Skip to content

Commit

Permalink
Revert "Added check for empty polydata topology"
Browse files Browse the repository at this point in the history
This reverts commit 7b5c294.
  • Loading branch information
Maik Simon Mikoszek authored and elrnv committed Aug 17, 2024
1 parent c399a6e commit e3e44a0
Showing 1 changed file with 36 additions and 68 deletions.
104 changes: 36 additions & 68 deletions src/xml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2574,74 +2574,42 @@ impl TryFrom<VTKFile> 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,
Expand Down

0 comments on commit e3e44a0

Please sign in to comment.