Anim8or Community

General Category => ASL Scripts => Topic started by: NickE on January 02, 2017, 04:32:25 pm

Title: Marching Cubes - Mesh of the Surface from a Collection of Points
Post by: NickE on January 02, 2017, 04:32:25 pm
Have you ever had a collection of points and wanted a mesh that corresponded to the surface of those points?

In my never ending quest to bring physics (or to effects that look mostly like physics) to Anim8or through scripting, I was working with smoothed particle hydrodynamics (SPH) to simulate fluids.  Using Anim8or points as particles, I was able to write scripts to simulate the fluid action, but had no real way of rendering just points.  The actual SPH script is still in development.

One popular way to extract a surface mesh from a point cloud is to use a technique called Marching Cubes.

Below is an implementation of the the Marching Cubes Algorithm in ASL.  The documentation for usage is within the script itself.
Title: Re: Marching Cubes - Mesh of the Surface from a Collection of Points
Post by: neirao on January 04, 2017, 07:01:25 pm
i will try... nice if post a "image preview" for help us, hehehehe
Thanks NIcke! :)
Title: Re: Marching Cubes - Mesh of the Surface from a Collection of Points
Post by: Unobtainium on March 20, 2017, 01:47:16 pm
Haven't tried this yet but I like what you're doing here. Thanks, NickE. Perhaps somewhere down the road you could have a look at noise removal or smoothing of the point clouds as well (I'm confident there exists numerous techniques for these things). (: