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

"Invalid triangles" when isosurface value is not 0.0 #5

Closed
Ickaser opened this issue Mar 9, 2022 · 0 comments · Fixed by #6
Closed

"Invalid triangles" when isosurface value is not 0.0 #5

Ickaser opened this issue Mar 9, 2022 · 0 comments · Fixed by #6
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Ickaser
Copy link
Contributor

Ickaser commented Mar 9, 2022

Something goes wrong with the algorithm when I use a nonzero isosurface value.

Here's my MWE:

using MarchingCubes
xi = [1.0, 2, 3, 4, 5]
dat = [(x-3)^2 + (y-3)^2 + (z-3)^2 for x in xi, y in xi, z in xi]
datsub = dat .- 5.0

m1 = MC(dat)
march(m1, 5.0)

m2 = MC(datsub)
march(m2)

march(m1, 5,0) gives me a lot of warnings about invalid triangles:

┌ Warning: Invalid triangle 6
└ @ MarchingCubes C:\Users\iwheeler\.julia\packages\MarchingCubes\V0hg7\src\MarchingCubes.jl:557
┌ Warning: Invalid triangle 12
└ @ MarchingCubes C:\Users\iwheeler\.julia\packages\MarchingCubes\V0hg7\src\MarchingCubes.jl:557

on up to triangle 128, with many repeats. On the other hand,
march(m2) runs just fine, and when I examine its output with PlyIO and Paraview, it gives me the sphere I expect.

@t-bltg t-bltg added the bug Something isn't working label Mar 10, 2022
@t-bltg t-bltg closed this as completed in #6 Mar 10, 2022
@t-bltg t-bltg added the good first issue Good for newcomers label Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants