mesh.insetFaces

The mesh with chosen faces shrunk so each edge moves a set distance inward, framed by rings of new quads.

GeometricSince 0.3.0

Usage

TypeScript
mesh.insetFaces(faces: ElementSet, amount: number): Result<Mesh>

Parameters

  • facesElementSet

    A prim set of this mesh.

    Required

  • amountnumber

    How far each edge moves in from where it was, measured in the face’s plane. Required. In model.

Returns

Ok with the inset mesh: each inset face gains one quad per edge.

Errors

Guarantees

  • volume() is unchanged (the shape is not moved, only re-faced)
  • insetting one quad of a box gives 10 faces
  • The same result on every machine.

Example

TypeScript
const r = Mesh.box().value.insetFaces(ElementSet.prims([1]), 0.25) // → 10 faces once loadGeometryKernel() has run

See also