Skip to main content

geometry3d

Mesh operations that stand outside the simulation: hulls, convex decomposition, voxelisation, cutting and boolean intersection. A mesh is an asset's name or a table of points and indices.

6 functions, 0 constants. Scripts reach it as geometry3d::.

Functions

Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.

functionacts onwhat it does
convex_decomposition(any, any?) -> anyThe mesh cut into convex pieces, each one a mesh: the only way to collide a concave shape dynamically.
convex_hull(any) -> anyThe tightest convex shape containing every point: what a dynamic collider wants when the model is concave.
intersect(any, any) -> anyThe mesh both meshes have in common, or nothing when they do not overlap.
pieces(any) -> anyThe mesh's separate parts, one mesh each: what a model that was already broken is made of.
split(any, any) -> anyCut the mesh with a plane, returning the two halves: #{ point = [..], normal = [..] }.
voxelize(any, any?) -> anyThe mesh as a voxel grid — #{ size, cells }, ready to be a voxels asset — so a model can become destructible terrain.