Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p3d_process_n crashes if an object has an empty slice #2

Open
TacogentP3D opened this issue Jan 10, 2024 · 1 comment
Open

p3d_process_n crashes if an object has an empty slice #2

TacogentP3D opened this issue Jan 10, 2024 · 1 comment

Comments

@TacogentP3D
Copy link

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);
}

@ghost
Copy link

ghost commented Feb 24, 2024

check exists in find_top_std_2、find_top_std_3、find_top_std_4。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant