Michael Fogleman

Projects AboutResumeMoreShop!

Projects tagged "meshing"

This page highlights several of my personal software projects.

Table of Contents

SDF Modeling January 2021

700 Python 3D Meshing

Generate 3D meshes based on signed distance functions with a dirt simple Python API.

The goal of this library is to provide a simple, fun, and easy-to-use API for generating 3D models in our favorite language Python. The code simply uses the Marching Cubes algorithm to generate a mesh from a signed distance function (SDF). This would normally be abysmally slow in Python. However, numpy is used to evaluate the SDF on entire batches of points simultaneously. Furthermore, multiple threads are used to process batches in parallel. The result is surprisingly fast (for marching cubes). Supports text, 2D extrusion & revolution, image masks, various file formats, and more!

The code below is a complete example which generates the model shown in the image. This is the canonical Constructive Solid Geometry example. Note the use of operators for intersection, union, and difference.

from sdf import *

f = sphere(1) & box(1.5)

c = cylinder(0.5)
f -= c.orient(X) | c.orient(Y) | c.orient(Z)


Heightmap Meshing August 2019

405 C++ 3D Meshing

Convert any grayscale heightmap into a 3D triangle mesh.

This is a modern implementation of a nice algorithm from the 1995 paper Fast Polygonal Approximation of Terrains and Height Fields by Garland and Heckbert. The meshes produced by hmm satisfy the Delaunay condition and can satisfy a specified maximal error or maximal number of triangles or vertices. It's also very fast!


Mesh Simplification May 2016

198 Go 3D Meshing

Simple command line tool for simplifying meshes in STL format.

This is a straight-forward implementation of Surface Simplification Using Quadric Error Metrics, SIGGRAPH 97, written in Go. Some problematic meshes don't simplify very well, but overall it works nicely. Watch the animation - the mesh is repeatedly simplified, starting with 86632 triangles and ending with just 64 triangles. The bunny remains recognizable for an impressive duration.