Shape primitives
Ten 3D primitives and six 2D ones, bezier paths that extrude, revolve and sweep, booleans in both dimensions, a cloner, and text as geometry. Every one of them is a mesh.
-
The primitives are torus, pyramid, prism, tube and rounded cuboid, with ellipse, star and ngon in 2D.
segments,rings,sidesandcorner_radiuswork on all of them.
-
path2dandpath3dassets extrude with a bevel, lathe, sweep along a rail, or stroke with ajoin, acapand ataper.
-
boolean3dandboolean2drun over a node's children: union, difference, intersection. Operands stay editable, moving one recomputes, and booleans nest.
-
shape2dgainedellipse,starandngon, andboolean2djoins, cuts and intersects filled outlines. The 2D booleans run oni_overlay, in fixed-point integers, so every platform gets the same vertices. -
A cloner is linear, radial or grid, and
seedandrandomscatter the copies. A thousand copies are one draw call, custom materials included.
-
kind = "text"on ameshasset turns a word into geometry, counters kept as holes, sized in world units, sitting on its baseline. -
Vertex colours and morph targets both survive a glTF import. A morph weight is a property, so a clip drives it as
mesh/morph.<name>, and vertex colours reach a material withfeatures = { vertex_color = true }.
One mesher
- A collider fitted to a torus is a torus.
- A ray picks the shape that is drawn.
- Headless tests check every mesh is closed and outward-facing, with the exact volume a boolean should have.
- Deterministic:
libmfor the curves, and a BSP of dot products and lerps. - The meshers are the engine's own: core builds the triangles, physics fits its colliders to them.
[[assets]]
id = "ring"
type = "mesh"
kind = "torus"
radius = 1.1
tube_radius = 0.28
[nodes.mesh]
source = "#ring"
[nodes.collider3d]
kind = "trimesh"
mesh = "#ring"
examples/objects has five rows, one per category, then the 2D layer. It
runs in the browser. The
manual and the generated
asset and component
references have the keys.
