3Dpass/p3d

p3d_process_n crashes if an object has an empty slice

TacogentP3D opened this issue · 1 comments

The fix is to check if sect.len() != 0 in

p3d/src/lib.rs

Lines 133 to 141 in cfd70b0

let sect = if let AlgoType::Grid2dV3a = algo {
intersect_2(&mesh, z_sect, step * 0.01)
} else {
intersect(&mesh, z_sect)
};
let cntr = get_contour(sect);
if cntr.len() > 0 {
cntrs.push(cntr);
}

check exists in find_top_std_2、find_top_std_3、find_top_std_4。