Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Author Topic: Marching Cubes - Mesh of the Surface from a Collection of Points  (Read 15089 times)

NickE

  • Full Member
  • ***
  • Posts: 167
    • View Profile

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.
Logged

neirao

  • Sr. Member
  • ****
  • Posts: 624
  • Neirao
    • View Profile
Re: Marching Cubes - Mesh of the Surface from a Collection of Points
« Reply #1 on: January 04, 2017, 02:01:25 pm »

i will try... nice if post a "image preview" for help us, hehehehe
Thanks NIcke! :)
Logged

Unobtainium

  • Newbie
  • *
  • Posts: 22
  • Engineer dabbling in various technical arts
    • View Profile
Re: Marching Cubes - Mesh of the Surface from a Collection of Points
« Reply #2 on: March 20, 2017, 09:47:16 am »

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). (:
Logged

polyGon_tError

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Marching Cubes - Mesh of the Surface from a Collection of Points
« Reply #3 on: April 03, 2020, 06:15:02 am »

why you put hexa value in edgeTable array? :|
Logged

NickE

  • Full Member
  • ***
  • Posts: 167
    • View Profile
Re: Marching Cubes - Mesh of the Surface from a Collection of Points
« Reply #4 on: April 04, 2020, 09:59:41 am »

The edgeTable array represents the possible intersections of the marching cube with the point cloud.  The values of the EdgeTable array tell which edges of the marching cube intersect the isosurface with bits 0 to 11 each representing one edge of a cube.  It is way easier to represent binary in hex than decimal.
Logged