Shapemetry API / Solid
Class: Solid
Defined in: nurbsBrep/topo/Solid.ts:169
A solid region of space: one outer boundary shell plus any number of void shells (interior cavities whose normals point into their void). The outer shell's face normals point outward, away from the solid material.
Constructors
Constructor
new Solid(
outerShell,voidShells?):Solid
Defined in: nurbsBrep/topo/Solid.ts:174
Parameters
outerShell
voidShells?
Shell[] = []
Returns
Solid
Properties
index
readonlyindex:number
Defined in: nurbsBrep/topo/Solid.ts:170
outerShell
outerShell:
Shell
Defined in: nurbsBrep/topo/Solid.ts:171
voidShells
voidShells:
Shell[]
Defined in: nurbsBrep/topo/Solid.ts:172
Accessors
isSolid
Get Signature
get isSolid():
boolean
Defined in: nurbsBrep/topo/Solid.ts:190
A Solid always denotes a solid body (part of the uniform Shell interface shared across the mesh / brep kernels). Present so the public API is call-compatible with the other Shell-like classes.
Returns
boolean
Methods
equals()
equals(
other):boolean
Defined in: nurbsBrep/topo/Solid.ts:181
Identity comparison: two references denote the same solid.
Parameters
other
Solid
Returns
boolean
shells()
shells():
Shell[]
Defined in: nurbsBrep/topo/Solid.ts:195
Outer shell faces followed by every void shell's faces.
Returns
Shell[]
faces()
faces():
Face[]
Defined in: nurbsBrep/topo/Solid.ts:200
Distinct faces across every shell.
Returns
Face[]
edges()
edges():
Edge[]
Defined in: nurbsBrep/topo/Solid.ts:207
Distinct edges across every shell.
Returns
Edge[]
vertices()
vertices():
Vertex[]
Defined in: nurbsBrep/topo/Solid.ts:222
Distinct vertices across every shell.
Returns
Vertex[]
cellCounts()
cellCounts():
CellCounts
Defined in: nurbsBrep/topo/Solid.ts:237
Vertex / edge / face counts of the boundary.
Returns
CellCounts
eulerCharacteristic()
eulerCharacteristic():
number
Defined in: nurbsBrep/topo/Solid.ts:263
Genus-correct Euler characteristic of the boundary: V − E + F − R, where R is the number of inner (hole / ring) loops summed over every face. This is the Euler-Poincaré quantity 2·(shells − genus) for a B-rep whose faces may be multiply connected — a face with a hole (an annular cap) is NOT a disk cell, so the plain V − E + F would over-count it; subtracting one per inner loop restores the topological invariant. For a single closed genus-g shell this is 2 − 2g (so 2 for a box / finite cylinder, 0 for a through-hole prism).
A face with no holes contributes R = 0, so a box (and every primitive / planar boolean result with single-loop faces) gives the familiar V − E + F.
DEGENERATE edges (a sphere's two pole rings, a pointed cone's apex ring — whose 3D carrier collapses to a single point) are NOT real 1-cells of the surface CW-complex, so they must be excluded from E. This mirrors OCCT's treatment of BRep_Tool::Degenerated edges, and makes χ(sphere) = χ(cone) = 2 (genus 0) instead of the spurious 0 / 1 a raw edge count would give.
Returns
number
boundingBox()
boundingBox():
BoundingBox
Defined in: nurbsBrep/topo/Solid.ts:352
Axis-aligned bounding box of the solid, sampled from the FACE SURFACES (over their natural parameter box where set) and boundary EDGE CURVES — not from the topological vertex set. A sphere/cylinder/torus collapses its seam + poles to ≤2 vertices, so a vertex-only box would be degenerate (x/y spans 0); a curved face also bulges beyond its boundary edges, so the surface itself must be sampled. This mirrors OCCT BRepBndLib::Add, which bounds each face by BndLib_AddSurface over the face's UV range plus the boundary curves. The u-grid uses a multiple of four so the cardinal directions of a full-period analytic surface (±r at u = 0, π/2, π, 3π/2) and the poles (v endpoints) are hit exactly, giving the exact [−r, r]³ cube for a full sphere.
Returns
surfaceArea()
surfaceArea():
number
Defined in: nurbsBrep/topo/Solid.ts:361
Total boundary area, summed over faces. Each face contributes the area of its outer loop minus the area of every hole loop. Planar loops are measured exactly by the Newell vector-area formula.
Returns
number
measurementDeflection()
measurementDeflection():
number
Defined in: nurbsBrep/topo/Solid.ts:395
Internal linear deflection for the curved volume/area measurement: a small fraction of the solid's longest extent, so the chord error of the tessellation is far below the 0.5%/1% acceptance tolerances. The extent is sampled from the FACE SURFACES (over their natural parameter box where set, otherwise their boundary vertices) rather than from the topological vertex set — a torus or sphere collapses its seam to a single vertex, which would make a vertex-only bounding box degenerate and force a runaway grid.
Returns
number
meshPoint()
meshPoint(
positions,index):Point
Defined in: nurbsBrep/topo/Solid.ts:526
Read the (index)-th packed vertex of a flat position array as a Point.
Parameters
positions
number[]
index
number
Returns
volume()
volume():
number
Defined in: nurbsBrep/topo/Solid.ts:548
Enclosed volume via the divergence theorem: with the field F = (x, y, z)/3, div F = 1, so the volume equals (1/3) of the flux of position through the boundary. Each oriented boundary loop is fan-triangulated about its first vertex, and every triangle (a, b, c) contributes a·(b×c)/6 — the signed volume of the tetrahedron it spans with the origin.
For a planar face with holes the surface flux is the integral over the annular region (outer loop minus inner loops), mirroring OCCT BRepGProp / GProp_GProps which walks every face boundary edge with its orientation IN THE FACE so a hole contour subtracts. The independent per-wire fans here cannot rely on the stored inner-wire winding (a boolean-produced hole may be wound the SAME way as its outer loop about the face's outward normal), so each fan triangle is explicitly oriented to the face's OUTWARD normal and every inner (hole) wire's contribution is negated: outer loop adds material, holes remove it. This makes the accumulated flux uniformly signed, so the trailing magnitude only guards against a globally inward-oriented solid.
Returns
number
union()
union(
other,options?):Solid
Defined in: nurbsBrep/topo/Solid.ts:601
Boolean union with another solid (A ∪ B): all material in either solid, the overlap counted once. Delegates to the boolean runner.
Parameters
other
Solid
options?
BooleanOptions
Returns
Solid
subtract()
subtract(
other,options?):Solid
Defined in: nurbsBrep/topo/Solid.ts:610
Boolean difference with another solid (A − B): this solid's material with other's material carved away. Delegates to the boolean runner.
Parameters
other
Solid
options?
BooleanOptions
Returns
Solid
intersect()
intersect(
other,options?):Solid
Defined in: nurbsBrep/topo/Solid.ts:619
Boolean intersection with another solid (A ∩ B): only the material common to both. Delegates to the boolean runner.
Parameters
other
Solid
options?
BooleanOptions
Returns
Solid
translate()
translate(
dx,dy,dz):Solid
Defined in: nurbsBrep/topo/Solid.ts:631
Rigid translation by (dx, dy, dz): a fresh solid on translated geometry with the same topology and the same edge/vertex sharing this solid had. Used to place a primitive relative to another for a boolean (the cylinder/box milestone), keeping the placement out of the build modules so they stay canonical-origin only.
Parameters
dx
number
dy
number
dz
number
Returns
Solid
transform()
transform(
matrix):this
Defined in: nurbsBrep/topo/Solid.ts:643
Apply a general affine transformation, rebuilding this solid's geometry in place from the transformed object graph. The topology counts and the edge/vertex sharing are preserved; planar surfaces are carried by the plane transform, the quadric bases are rebuilt from their transformed centre/axes, and freeform carriers delegate to the wrapped NURBS transform. Returns this. Delegates the rebuild to the free function transformSolid.
Parameters
matrix
Returns
this
clone()
clone():
Solid
Defined in: nurbsBrep/topo/Solid.ts:656
Structural deep copy: a fresh object graph (every entity a new instance) on value-copied geometry, keeping the same topology counts and the same edge/vertex sharing this solid had. Mutating the clone leaves this solid untouched. Delegates to the free function cloneSolid.
Returns
Solid
reverse()
reverse():
this
Defined in: nurbsBrep/topo/Solid.ts:667
Invert this solid's orientation in place: every face normal flips and each boundary wire is walked backwards, so the boundary still bounds the same region but with all outward normals reversed (the signed-volume sense negates while the unsigned volume and area are unchanged). Returns this. Delegates the rebuild to the free function reverseSolid.
Returns
this
mirror()
mirror(
planeNormal,planePoint):Solid
Defined in: nurbsBrep/topo/Solid.ts:679
Mirror this solid across the plane through planePoint with the given planeNormal, returning a fresh reflected solid. Delegates to the free function mirrorSolid.
Parameters
planeNormal
planePoint
Returns
Solid
tessellate()
tessellate(
deflection?):TriangleMesh
Defined in: nurbsBrep/topo/Solid.ts:691
Tessellate the boundary into a triangle soup as GPU-friendly flat arrays (positions / indices / normals). When no deflection is given the linear chord tolerance defaults to a size-aware multiple of this solid's own Solid.measurementDeflection (span/1000) so the mesh scales with the model rather than a fixed absolute value. Delegates to the free function tessellateSolid.
Parameters
deflection?
number
Returns
TriangleMesh
toTriangleMesh()
toTriangleMesh(
deflection?):TriangleMesh
Defined in: nurbsBrep/topo/Solid.ts:701
Tessellate the boundary into the public TriangleMeshClass (the uniform Shell mesh class). When no deflection is given the chord tolerance defaults to the same size-aware span/1000 as Solid.tessellate. Delegates to the free function tessellateSolidToMesh.
Parameters
deflection?
number
Returns
toJSON()
toJSON():
BrepJson
Defined in: nurbsBrep/topo/Solid.ts:711
Serialize this solid's full topology + geometry to a plain JSON object (shared vertices/edges collapse to one entity each; pcurves are emitted as sampled polylines per face-edge). Delegates to the free function solidToJson.
Returns
toStl()
toStl():
Uint8Array
Defined in: nurbsBrep/topo/Solid.ts:723
Export the boundary as a binary STL triangle soup. Tessellates the solid and writes one 50-byte facet record per triangle with the standard 80-byte header and a 4-byte little-endian facet count. Delegates to the free function writeStl.
Returns
Uint8Array
toStlAscii()
toStlAscii():
string
Defined in: nurbsBrep/topo/Solid.ts:728
Export the boundary as ASCII STL text. Delegates to writeStlAscii.
Returns
string
toObj()
toObj():
string
Defined in: nurbsBrep/topo/Solid.ts:736
Export the boundary as a Wavefront OBJ string (v / vn / f lines from the tessellation). Delegates to the free function writeObj.
Returns
string
toPly()
toPly(
format?):string|Uint8Array<ArrayBufferLike>
Defined in: nurbsBrep/topo/Solid.ts:744
Export the boundary as a Stanford PLY mesh, binary by default or ASCII when format is 'ascii'. Delegates to the free function writePly.
Parameters
format?
"ascii" | "binary"
Returns
string | Uint8Array<ArrayBufferLike>
toStep()
toStep():
string
Defined in: nurbsBrep/topo/Solid.ts:753
Export the solid as an ISO 10303-21 (STEP AP203) text file preserving the analytic B-rep (elementary surfaces / curves and B-spline carriers, voids). Delegates to the free function writeStep.
Returns
string
toIges()
toIges():
string
Defined in: nurbsBrep/topo/Solid.ts:761
Export the solid as an IGES text file (S/G/D/P/T sections). Delegates to the free function writeIges.
Returns
string
toGlb()
toGlb():
Uint8Array
Defined in: nurbsBrep/topo/Solid.ts:769
Export the boundary as a binary glTF (GLB) container with one mesh primitive (POSITION + NORMAL + indices). Delegates to the free function writeGlb.
Returns
Uint8Array
toThreemf()
toThreemf():
Uint8Array
Defined in: nurbsBrep/topo/Solid.ts:777
Export the boundary as a 3MF package (OPC ZIP with a mesh-mode 3D model part). Delegates to the free function writeThreemf.
Returns
Uint8Array
centerOfMass()
centerOfMass():
Point
Defined in: nurbsBrep/topo/Solid.ts:785
Centroid of the enclosed volume (uniform density), via the divergence theorem over the boundary. Delegates to the free function centerOfMass.
Returns
massProperties()
massProperties():
MassProperties
Defined in: nurbsBrep/topo/Solid.ts:794
Full mass properties (volume, surface area, centroid, inertia tensor about the centroid) at uniform density 1. Delegates to the free function massProperties.
Returns
boundingSphere()
boundingSphere():
object
Defined in: nurbsBrep/topo/Solid.ts:799
Smallest enclosing sphere centre + radius. Delegates to boundingSphere.
Returns
object
center
center:
Point
radius
radius:
number
distanceTo()
distanceTo(
point):DistanceResult
Defined in: nurbsBrep/topo/Solid.ts:807
Minimum distance from point to this solid's surface, with the nearest point on each side. Delegates to the free function distanceTo.
Parameters
point
Returns
entityCounts()
entityCounts():
object
Defined in: nurbsBrep/topo/Solid.ts:812
Face / edge / vertex counts of the boundary. Delegates to entityCounts.
Returns
object
faces
faces:
number
edges
edges:
number
vertices
vertices:
number
classify()
classify(
point,tolerance?):PointClassification
Defined in: nurbsBrep/topo/Solid.ts:820
Classify point as inside, outside, or on the boundary of this solid. Delegates to the free function classify.
Parameters
point
tolerance?
number
Returns
contains()
contains(
point,includeBoundary?):boolean
Defined in: nurbsBrep/topo/Solid.ts:828
Whether point lies in this solid; includeBoundary (default true) counts on-boundary points as contained. Delegates to the free function contains.
Parameters
point
includeBoundary?
boolean = true
Returns
boolean
edgeToFaceMap()
Defined in: nurbsBrep/topo/Solid.ts:836
Map from each distinct boundary edge to the faces that reference it (every manifold edge maps to exactly two faces). Delegates to edgeToFaceMap.
Returns
filterLinearEdges()
filterLinearEdges():
Edge[]
Defined in: nurbsBrep/topo/Solid.ts:843
Distinct boundary edges whose carrier curve is a straight line segment.
Returns
Edge[]
filterCircularEdges()
filterCircularEdges():
Edge[]
Defined in: nurbsBrep/topo/Solid.ts:848
Distinct boundary edges whose carrier curve is a full circle.
Returns
Edge[]
filterConvexEdges()
filterConvexEdges():
Edge[]
Defined in: nurbsBrep/topo/Solid.ts:856
Manifold edges whose dihedral marks a convex crease. Delegates to the free function filterConvexEdges (brep's published convexity convention).
Returns
Edge[]
filterConcaveEdges()
filterConcaveEdges():
Edge[]
Defined in: nurbsBrep/topo/Solid.ts:864
Manifold edges whose dihedral marks a concave crease. Delegates to the free function filterConcaveEdges (brep's published concavity convention).
Returns
Edge[]
recognizeHoles()
recognizeHoles():
RecognizedHole[]
Defined in: nurbsBrep/topo/Solid.ts:871
Recognize cylindrical holes from the boundary faces. Delegates to recognizeHoles.
Returns
section()
section(
planeNormal,planePoint):Wire[]
Defined in: nurbsBrep/topo/Solid.ts:882
Cross-section loops where a cutting plane meets this solid's boundary, one closed Wire per connected loop (outer loop before any nested holes). Delegates to the free function sectionSolid.
Parameters
planeNormal
planePoint
Returns
Wire[]
splitByPlane()
splitByPlane(
plane):SplitByPlaneResult<Solid>
Defined in: nurbsBrep/topo/Solid.ts:891
Split this solid into its above-plane and below-plane halves, plus the cut boundaries as a SplitByPlaneResult. Watertight for planar (polyhedral) solids. Delegates to the free function splitByPlane.
Parameters
plane
Returns
SplitByPlaneResult<Solid>
shell()
shell(
thickness,openFaces?):Solid
Defined in: nurbsBrep/topo/Solid.ts:902
Hollow this solid into a thin wall of the given thickness, offsetting every face inward; faces in openFaces are removed and bridged with a rim. Returns a fresh watertight solid. Delegates to the free function shellSolid.
Parameters
thickness
number
openFaces?
Face[]
Returns
Solid
offset()
offset(
distance,options?):Solid
Defined in: nurbsBrep/topo/Solid.ts:912
Offset every boundary face by the signed distance (positive grows, negative shrinks), re-intersecting adjacent faces (or bridging convex corners with a rolling-ball arc joint when options.jointStrategy is 'arc') into a fresh solid. Delegates to the free function offsetSolid.
Parameters
distance
number
options?
Partial<OffsetOptions>
Returns
Solid
thickOffset()
thickOffset(
distance,excludedFaces?,options?):Solid
Defined in: nurbsBrep/topo/Solid.ts:921
Thick (hollowed) offset: offset every face by distance while leaving any excludedFaces at their original position, walled to the offset faces, into a fresh solid. Delegates to the free function thickSolid.
Parameters
distance
number
excludedFaces?
Face[]
options?
Partial<OffsetOptions>
Returns
Solid
linearPattern()
linearPattern(
direction,spacing,count):Compound
Defined in: nurbsBrep/topo/Solid.ts:932
Linear array: count copies of this solid each offset by spacing along direction, gathered into a Compound (this solid is element 0). Delegates to the free function linearPattern.
Parameters
direction
spacing
number
count
number
Returns
circularPattern()
circularPattern(
axis,center,count):Compound
Defined in: nurbsBrep/topo/Solid.ts:941
Circular array: count copies of this solid evenly spaced about axis through center, gathered into a Compound (this solid is element 0). Delegates to the free function circularPattern.
Parameters
axis
center
count
number
Returns
gridPattern()
gridPattern(
directionX,directionY,spacingX,spacingY,countX,countY):Compound
Defined in: nurbsBrep/topo/Solid.ts:950
Grid array: countX×countY copies stepped by spacingX/spacingY along directionX/directionY, gathered into a Compound. Delegates to the free function gridPattern.
Parameters
directionX
directionY
spacingX
number
spacingY
number
countX
number
countY
number
Returns
xor()
xor(
other):Solid
Defined in: nurbsBrep/topo/Solid.ts:967
Symmetric difference (A △ B): the material in exactly one of the two solids, (A ∪ B) − (A ∩ B). Delegates to the free function xorSolids.
Parameters
other
Solid
Returns
Solid
draftFaces()
draftFaces(
faces,pullDirection,angle,neutralPlanePoint):Solid
Defined in: nurbsBrep/topo/Solid.ts:978
Taper the given faces about a neutral plane, giving each a draft angle relative to the pullDirection. Returns a fresh watertight solid. Delegates to the free function draftFaces.
Parameters
faces
Face[]
pullDirection
angle
number
neutralPlanePoint
Returns
Solid
pullFace()
pullFace(
face,distance):void
Defined in: nurbsBrep/topo/Solid.ts:986
Slide a planar face along its normal by distance, mutating this solid in place (returns void). Delegates to the free function pullFace.
Parameters
face
distance
number
Returns
void
defeatureByFace()
defeatureByFace(
faces):Solid
Defined in: nurbsBrep/topo/Solid.ts:997
Remove the given faces (e.g. the walls + floor of a pocket) and re-sew the remaining boundary shut, returning a fresh healed solid. Delegates to the free function defeatureByFace.
Parameters
faces
Face[]
Returns
Solid
defeatureByEdge()
defeatureByEdge(
edges):Solid
Defined in: nurbsBrep/topo/Solid.ts:1005
Remove the faces reachable from the given edges and heal the boundary, returning a fresh solid. Delegates to the free function defeatureByEdge.
Parameters
edges
Edge[]
Returns
Solid
defeatureByVertex()
defeatureByVertex(
vertex):Promise<Solid>
Defined in: nurbsBrep/topo/Solid.ts:1014
Defeature the neighbourhood of vertex by cutting back along the plane through its neighbours, returning a fresh solid. Delegates to the free function defeatureByVertex.
Parameters
vertex
Returns
Promise<Solid>
defeatureByEdgePlane()
defeatureByEdgePlane(
edge):Promise<Solid>
Defined in: nurbsBrep/topo/Solid.ts:1023
Defeature the neighbourhood of edge by cutting back along the plane through its neighbours, returning a fresh solid. Delegates to the free function defeatureByEdgePlane.
Parameters
edge
Returns
Promise<Solid>
unifySameDomain()
unifySameDomain(
options?): [Solid,number]
Defined in: nurbsBrep/topo/Solid.ts:1034
Merge adjacent same-surface faces (and optionally fuse collinear edges), returning [solid, mergedCount]. Delegates to the free function unifySameDomain.
Parameters
options?
Partial<UnifyOptions>
Returns
[Solid, number]
sewShells()
sewShells(
tolerance?): [Solid,number]
Defined in: nurbsBrep/topo/Solid.ts:1039
Sew coincident boundary edges across shells, returning [solid, sewnCount]. Delegates to sewShells.
Parameters
tolerance?
number
Returns
[Solid, number]
normalizeEdgeParameterFlags()
normalizeEdgeParameterFlags():
number
Defined in: nurbsBrep/topo/Solid.ts:1050
Measure each edge's pcurves against its 3D carrier and SET the degenerate / sameParameter / sameRange flags to match — the role of OCCT BRepLib::SameParameter. Returns the number of edges whose flags changed. Run on a solid of unknown provenance (an import, a hand-edited graph) before downstream code or validate reads the flags.
Returns
number
removeInternalWires()
removeInternalWires():
number
Defined in: nurbsBrep/topo/Solid.ts:1055
Remove redundant inner (hole) wires, returning the removed count. Delegates to removeInternalWires.
Returns
number
splitSelfIntersectingInnerWires()
splitSelfIntersectingInnerWires():
number
Defined in: nurbsBrep/topo/Solid.ts:1060
Split self-intersecting (figure-eight) inner wires, returning the split count. Delegates to splitSelfIntersectingInnerWires.
Returns
number
collapseCollinearVertices()
collapseCollinearVertices(
tolerance?):number
Defined in: nurbsBrep/topo/Solid.ts:1065
Collapse runs of collinear boundary vertices, returning the collapsed count. Delegates to collapseCollinearVertices.
Parameters
tolerance?
number
Returns
number
fix()
fix(
config?): [Solid,FixResult]
Defined in: nurbsBrep/topo/Solid.ts:1073
Run the shape-fix hierarchy, returning [solid, FixResult]. Delegates to the free function fix (imported as fixShape to avoid the method-name clash).
Parameters
config?
Partial<FixConfig>
Returns
[Solid, FixResult]
fixWireframe()
fixWireframe(
tolerance?):number
Defined in: nurbsBrep/topo/Solid.ts:1078
Fix wireframe gaps below tolerance, returning the fix count. Delegates to fixWireframe.
Parameters
tolerance?
number
Returns
number
fixSplitCommonVertex()
fixSplitCommonVertex():
number
Defined in: nurbsBrep/topo/Solid.ts:1083
Split vertices shared by non-adjacent edges, returning the split count. Delegates to fixSplitCommonVertex.
Returns
number
validate()
validate(
options?):ValidationReport
Defined in: nurbsBrep/topo/Solid.ts:1090
Validate this solid's topology + geometry. Delegates to the free function validateSolid.
Parameters
options?
Returns
analyzeTolerances()
analyzeTolerances():
ToleranceAnalysis
Defined in: nurbsBrep/topo/Solid.ts:1095
Per-entity tolerance analysis over the outer shell. Delegates to the free function analyzeTolerances.
Returns
checkBsplineRestrictions()
checkBsplineRestrictions(
options?):number
Defined in: nurbsBrep/topo/Solid.ts:1100
Count freeform carriers exceeding the degree / segment limits. Delegates to checkBsplineRestrictions.
Parameters
options?
Returns
number
convertToBspline()
convertToBspline():
number
Defined in: nurbsBrep/topo/Solid.ts:1109
Convert every analytic face and edge carrier to an equivalent freeform (B-spline) carrier, returning the count of converted entities. Delegates to the free function convertSolidToBspline.
Returns
number
convertToElementary()
convertToElementary(
tolerance?):number
Defined in: nurbsBrep/topo/Solid.ts:1118
Recognize freeform face carriers that are exactly an analytic primitive and convert them back to the elementary surface within tolerance, returning the count converted. Delegates to the free function convertSolidToElementary.
Parameters
tolerance?
number
Returns
number
convertEdgesToElementary()
convertEdgesToElementary(
tolerance?):number
Defined in: nurbsBrep/topo/Solid.ts:1127
Recognize freeform edge carriers that are exactly an analytic curve and convert them back to the elementary curve within tolerance, returning the count converted. Delegates to the free function convertEdgesToElementary.
Parameters
tolerance?
number
Returns
number
box()
staticbox(dx,dy,dz):Solid
Defined in: nurbsBrep/topo/Solid.ts:1136
Build an axis-aligned box of the given extents with its near-bottom corner at the origin: 8 shared vertices, 12 shared edges (each bordered by exactly two of the 6 faces), and outward-oriented planar faces.
Parameters
dx
number
dy
number
dz
number
Returns
Solid
cylinder()
staticcylinder(radius,height):Solid
Defined in: nurbsBrep/topo/Solid.ts:1146
Right circular cylinder: axis along +Z, base circle centred at the origin with the given radius, body spanning z in [0, height]. One periodic lateral face plus two planar caps sharing the rim circle edges. Matches OCCT's BRepPrimAPI_MakeCylinder placement.
Parameters
radius
number
height
number
Returns
Solid
sphere()
staticsphere(radius,_segments?):Solid
Defined in: nurbsBrep/topo/Solid.ts:1157
Sphere centred at the origin with the given radius, pole axis +Z. One doubly-parameterized periodic face over the full domain. Matches OCCT's BRepPrimAPI_MakeSphere placement. segments matches the brep public signature; nurbsBrep carries the exact periodic surface, so it is purely a tessellation hint and does not change the topology.
Parameters
radius
number
_segments?
number = 16
Returns
Solid
cone()
staticcone(bottomRadius,topRadius,height):Solid
Defined in: nurbsBrep/topo/Solid.ts:1166
(Possibly truncated) cone: axis along +Z, bottom radius at z = 0, top radius at z = height. A pointed top (topRadius ~ 0) yields a single apex vertex and no top cap. Matches OCCT's BRepPrimAPI_MakeCone placement.
Parameters
bottomRadius
number
topRadius
number
height
number
Returns
Solid
torus()
statictorus(majorRadius,minorRadius,_segments?):Solid
Defined in: nurbsBrep/topo/Solid.ts:1178
Torus centred at the origin, axis +Z, the tube of radius minorRadius swept around +Z at majorRadius. One doubly-periodic face with a degenerate four-edge seam wire and no caps. Matches OCCT's BRepPrimAPI_MakeTorus placement. segments matches the brep public signature; nurbsBrep carries the exact periodic surface, so it is purely a tessellation hint and does not change the topology.
Parameters
majorRadius
number
minorRadius
number
_segments?
number = 16
Returns
Solid
fromJSON()
staticfromJSON(data):Solid
Defined in: nurbsBrep/topo/Solid.ts:1186
Rebuild a solid from its serialized JSON form (the inverse of Solid.toJSON). Delegates to the free function solidFromJson.
Parameters
data
Returns
Solid
fromStl()
staticfromStl(data):Solid
Defined in: nurbsBrep/topo/Solid.ts:1197
Rebuild a solid from STL data (binary Uint8Array or ASCII string), welding the triangle soup into a shared-edge two-manifold. Delegates to the free function readStl.
Parameters
data
string | Uint8Array<ArrayBufferLike>
Returns
Solid
fromObj()
staticfromObj(content):Solid
Defined in: nurbsBrep/topo/Solid.ts:1205
Rebuild a solid from a Wavefront OBJ string, welding the parsed mesh into a shared-edge two-manifold. Delegates to the free function readObj.
Parameters
content
string
Returns
Solid
fromPly()
staticfromPly(data):Solid
Defined in: nurbsBrep/topo/Solid.ts:1214
Rebuild a solid from PLY data (binary Uint8Array or ASCII string), welding the parsed mesh into a shared-edge two-manifold. Delegates to the free function readPly.
Parameters
data
string | Uint8Array<ArrayBufferLike>
Returns
Solid
fromStep()
staticfromStep(content):Solid
Defined in: nurbsBrep/topo/Solid.ts:1222
Rebuild a solid from STEP (ISO 10303-21) text, reconstructing the analytic B-rep topology and geometry. Delegates to the free function readStep.
Parameters
content
string
Returns
Solid
fromIges()
staticfromIges(content):Solid
Defined in: nurbsBrep/topo/Solid.ts:1230
Rebuild a solid from IGES text, reconstructing the per-face B-rep. Delegates to the free function readIges.
Parameters
content
string
Returns
Solid
fromGlb()
staticfromGlb(data):Solid
Defined in: nurbsBrep/topo/Solid.ts:1239
Rebuild a solid from a binary glTF (GLB) container, welding every mesh primitive into a shared-edge two-manifold. Delegates to the free function readGlb.
Parameters
data
Uint8Array
Returns
Solid
fromThreemf()
staticfromThreemf(data):Solid
Defined in: nurbsBrep/topo/Solid.ts:1248
Rebuild a solid from a 3MF package (Uint8Array OPC ZIP or raw model-XML string), welding the mesh into a shared-edge two-manifold. Delegates to the free function readThreemf.
Parameters
data
string | Uint8Array<ArrayBufferLike>
Returns
Solid
extrude()
staticextrude(face,direction):Solid
Defined in: nurbsBrep/topo/Solid.ts:1259
Extrude a planar profile face linearly along direction, capping both ends and walling the profile boundary, into a fresh prism solid. Delegates to the free function extrude.
Parameters
face
direction
Returns
Solid
revolve()
staticrevolve(face,axisPoint,axisDirection,angle):Solid
Defined in: nurbsBrep/topo/Solid.ts:1268
Revolve a profile face about the axis through axisPoint along axisDirection by angle radians (full or partial), into a fresh solid of revolution. Delegates to the free function revolve.
Parameters
face
axisPoint
axisDirection
angle
number
Returns
Solid
loft()
staticloft(faces,options?):Solid
Defined in: nurbsBrep/topo/Solid.ts:1279
Loft a sequence of profile faces into a fresh solid. By default the lateral walls are smooth NURBS surfaces skinned through all profiles (the CAD-standard loft); options.ruled switches to planar bands between adjacent profiles. options.closed wraps the last profile back to the first (no end caps). Delegates to the free function loft.
Parameters
faces
Face[]
options?
ruled?
boolean
closed?
boolean
Returns
Solid
sweep()
staticsweep(profile,path,options?):Solid
Defined in: nurbsBrep/topo/Solid.ts:1290
Sweep a profile face along a NURBS path (rotation-minimizing frames) into a fresh swept solid. By default each profile edge becomes a smooth interpolated NURBS surface (the CAD-standard sweep); options.ruled facets the lateral walls into flat quads. options.segments overrides the auto sample count. Delegates to the free function sweep.
Parameters
profile
path
options?
ruled?
boolean
segments?
number
Returns
Solid
pipe()
staticpipe(profile,path,guide?):Solid
Defined in: nurbsBrep/topo/Solid.ts:1298
Pipe a profile face along a NURBS path, optionally scaling the section to follow a guide rail. Delegates to the free function pipe.
Parameters
profile
path
guide?
Returns
Solid
helix()
statichelix(profile,radius,pitch,turns,options?):Solid
Defined in: nurbsBrep/topo/Solid.ts:1308
Sweep a profile face along a helix of the given radius, pitch, and number of turns (with optional clockwise / origin / axis / segmentsPerTurn overrides), into a fresh coil solid. Delegates to the free function makeHelix.
Parameters
profile
radius
number
pitch
number
turns
number
options?
clockwise?
boolean
origin?
axis?
segmentsPerTurn?
number
Returns
Solid