pmneila / PyMCubes

Marching cubes (and related tools) for Python
BSD 3-Clause "New" or "Revised" License
692 stars 87 forks source link

number of mesh points #33

Closed ghost closed 3 years ago

ghost commented 3 years ago

Can I specify the number of mesh points? For example, vertices, triangles = mcubes.marching_cubes(cube, 0.5) and I hope to get a mesh with 6000 points.

pmneila commented 3 years ago

Hi, @faneggs,

No, you can't. The number of points depends on the contents of the input volume, and it's only known after running the marching cube algorithm. There might be two possible solutions for you: you can either resample the input volume in different sizes until you find a suitable one for your needs (a smaller input array will lead to a smaller number of vertices), or you can remesh/tessellate/decimate the resulting mesh as a post-processing step in an mesh editing software (e.g., Blender).

Hope that helps!

ghost commented 3 years ago

Hi, @faneggs,

No, you can't. The number of points depends on the contents of the input volume, and it's only known after running the marching cube algorithm. There might be two possible solutions for you: you can either resample the input volume in different sizes until you find a suitable one for your needs (a smaller input array will lead to a smaller number of vertices), or you can remesh/tessellate/decimate the resulting mesh as a post-processing step in an mesh editing software (e.g., Blender).

Hope that helps!

OK, thx!