Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

contour_solve

The vertex of each straddling cell, written to pos. With PLACEMENT qef the vertex is the point nearest the planes the surface normals at the cell's crossings describe (least squares, pulled back toward the mean of the crossings by lambda per crossing, default 0.02), which puts the vertices on a box's edges and close to its corners; with centroid it is the mean of the crossings. A qef vertex is held just inside its own cell (a thousandth of the cell size in from each wall), so two cells sharing a wall never land two vertices on one point.

It reads the grid params as contour_cells does, cells and domain_count (the list of straddling cells and the live count compact made; a slot at or past the count takes the origin), cross_p and cross_w from contour_crossings, and cross_n, the unit surface normal at each crossing, read when PLACEMENT is qef (a crossing with a zero normal adds no plane and still counts toward the mean). The sdf.mesh node runs it with the normals of the shape's gradient and takes pos as the mesh's points.

Dispatch over the straddling cells, or the capacity of their list. Exact: each vertex has one writer.