From e3e44a0641a720955b11d04c5cc6d333839870f5 Mon Sep 17 00:00:00 2001 From: Maik Simon Mikoszek Date: Fri, 16 Aug 2024 09:39:36 +0200 Subject: [PATCH] Revert "Added check for empty polydata topology" This reverts commit 7b5c294b2ca4b7d24065a847aafb80852e468cbc. --- src/xml.rs | 104 +++++++++++++++++++---------------------------------- 1 file changed, 36 insertions(+), 68 deletions(-) diff --git a/src/xml.rs b/src/xml.rs index dda78e8..0152a62 100644 --- a/src/xml.rs +++ b/src/xml.rs @@ -2574,74 +2574,42 @@ impl TryFrom for model::Vtk { + number_of_strips + number_of_polys + number_of_verts; - let verts = match verts { - Some(Topo { - ref connectivity, - ref offsets, - }) if !connectivity.data.is_empty() && !offsets.data.is_empty() => { - verts - .map(|verts| { - verts.into_vertex_numbers( - number_of_verts, - appended_data, - encoding_info, - ) - }) - .transpose()? - } - _ => None, - }; - let lines = match lines { - Some(Topo { - ref connectivity, - ref offsets, - }) if !connectivity.data.is_empty() && !offsets.data.is_empty() => { - lines - .map(|lines| { - lines.into_vertex_numbers( - number_of_lines, - appended_data, - encoding_info, - ) - }) - .transpose()? - } - _ => None, - }; - let strips = match strips { - Some(Topo { - ref connectivity, - ref offsets, - }) if !connectivity.data.is_empty() && !offsets.data.is_empty() => { - strips - .map(|strips| { - strips.into_vertex_numbers( - number_of_strips, - appended_data, - encoding_info, - ) - }) - .transpose()? - } - _ => None, - }; - let polys = match polys { - Some(Topo { - ref connectivity, - ref offsets, - }) if !connectivity.data.is_empty() && !offsets.data.is_empty() => { - polys - .map(|polys| { - polys.into_vertex_numbers( - number_of_polys, - appended_data, - encoding_info, - ) - }) - .transpose()? - } - _ => None, - }; + let verts = verts + .map(|verts| { + verts.into_vertex_numbers( + number_of_verts, + appended_data, + encoding_info, + ) + }) + .transpose()?; + let lines = lines + .map(|lines| { + lines.into_vertex_numbers( + number_of_lines, + appended_data, + encoding_info, + ) + }) + .transpose()?; + let strips = strips + .map(|strips| { + strips.into_vertex_numbers( + number_of_strips, + appended_data, + encoding_info, + ) + }) + .transpose()?; + let polys = polys + .map(|polys| { + polys.into_vertex_numbers( + number_of_polys, + appended_data, + encoding_info, + ) + }) + .transpose()?; Ok(model::Piece::Inline(Box::new(model::PolyDataPiece { points: points.unwrap().data.into_io_buffer( number_of_points,