Skip to content

nikitapn/cms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

CMS on a Uniform Grid

A Python visualisation of the Cubical Marching Squares (CMS) isosurface-extraction algorithm running on a uniform voxel grid.

What it does

  1. Evaluates a signed-distance field (SDF) on a regular 3-D grid.
  2. Runs Marching Squares independently on each cell face to find isosurface contour segments and Hermite data.
  3. Connects per-face feature points into closed 3-D loops (the mesh edges).
  4. Displays the result interactively with matplotlib (drag to rotate, scroll to zoom).

Visual legend

Symbol Meaning
Blue filled circles Inside corners (SDF < 0)
Orange open circles Outside corners (SDF ≥ 0)
Green arrows Surface normals near the isosurface
Grey wireframe Cell grid

Requirements

  • Python 3.10+
  • numpy
  • matplotlib
pip install numpy matplotlib

Usage

python cms_uniform_grid.py [--sdf <shape>]

--sdf choices: box (default), sphere, torus, combo, smooth_union

python cms_uniform_grid.py --sdf torus

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages