@huukhanhnguyen/geometry / dual
dual
BoundingBox
BoundingBox =
BoundingBox
BoundingBox2d
BoundingBox2d =
BoundingBox2d
BrepData
BrepData =
BrepData
MeshData
MeshData =
MeshData
Point
Point =
Point
Point2d
Point2d =
Point2d
Surface
Surface =
Surface
TriangleMesh
TriangleMesh<
A> =TriangleMesh<A>
Type Parameters
A
A extends Float64Array | number[] = number[]
Vector
Vector =
Vector
Vector2d
Vector2d =
Vector2d
BoundingBox
BoundingBox:
namespaces/BoundingBox
BoundingBox2d
BoundingBox2d:
namespaces/BoundingBox2d
BrepData
BrepData: {
analyticSection: (json,first_face,second_face,seed_region) =>Float64Array;analyzeTolerances: (json) =>Float64Array;boundingBox: (json) =>Float64Array;boundingSphere: (json) =>Float64Array;box: (dx,dy,dz) =>string;centerOfMass: (json) =>Float64Array;chamfer: (json,edge_indices,distance1,distance2) =>string;chamferReportJson: (json,edge_indices,distance1,distance2) =>string;checkBsplineRestrictions: (json,max_degree,max_segments,tolerance) =>number;circularPattern: (json,axis_x,axis_y,axis_z,center_x,center_y,center_z,count) =>string;classifyPoint: (json,x,y,z,tolerance) =>number;classifyShells: (documents) =>string[];clone: (json) =>string;collapseCollinearDefaultTolerance: () =>number;collapseCollinearVertices: (json,tolerance) =>string;cone: (bottom_radius,top_radius,height) =>string;containsPoint: (json,x,y,z,include_boundary) =>boolean;convertDefaultTolerance: () =>number;convertEdgesToElementary: (json,tolerance) =>string;convertToBspline: (json) =>string;convertToElementary: (json,tolerance) =>string;cornerChamfer: (json,vertex_index,distance) =>string;cornerFillet: (json,vertex_index,radius,sphere_center_mode) =>string;cornerFilletSetback: (json,vertex_index,radius,sphere_center_mode,setback) =>string;crossSection: (json,first_face,second_face,seed_region) =>Float64Array;crossSectionCurves: (json,first_face,second_face,seed_region) =>string;cylinder: (radius,height) =>string;distanceTo: (json,x,y,z) =>Float64Array;divideClosedFaces: (json) =>string;draftFaces: (json,face_indices,pull_x,pull_y,pull_z,angle,neutral_x,neutral_y,neutral_z) =>string;dump: (json) =>string;edgeForms: (json) =>string;edgeFormsJson: (json) =>string;edgeInteriorPointsJson: (document) =>string;edgeRange: (json,edge_index) =>Float64Array;edgeRangesJson: (document) =>string;edgeToFaceMap: (json) =>Uint32Array;edgeValue: (json,edge_index,t) =>Float64Array;entityCounts: (...args) =>Uint32Array;eulerCharacteristic: (json) =>number;extrude: (outer,holes_json,dx,dy,dz) =>string;extrudeProfile: (profile_json,holes_json,dx,dy,dz) =>string;faceArea: (json,face_index,eps) =>number;faceCentroid: (json,face_index) =>Float64Array;faceContainsPoint: (json,face_index,x,y,z,tolerance,include_boundary) =>boolean;faceDocument: (json,face_index) =>string;faceDomain: (json,face_index) =>Float64Array;faceForms: (json) =>string;faceFormsJson: (...args) =>string;faceFromLoop: (points,holes_json,tolerance) =>string;faceFromSurface: (surface_json,bounds,reversed,tolerance) =>string;faceFromSurfaceWithLoops: (surface_json,loops_json,reversed,tolerance) =>string;faceLoopPoints: (json) =>string;faceLoops: (json,tolerance) =>string;faceModifyShape: (json,face_index,constraints_json) =>string;faceOffset: (json,face_index,distance,tolerance) =>string;faceOutwardNormal: (...args) =>Float64Array;facePlanar: (points,tolerance) =>string;facePlanarWithHoles: (points,holes_json,tolerance) =>string;faceProject: (json,face_index,x,y,z) =>Float64Array;faceRectangle: (width,height,tolerance) =>string;faceSplitByLoops: (json,loops_json,tolerance) =>string;faceSummary: (json) =>Uint32Array;faceThicken: (json,face_index,thickness,symmetric) =>string;faceTrim: (json,face_index,tool_json,tool_face_index,side) =>string;faceTrimByLoop: (json,face_index,loop_points,side,tolerance) =>string;faceValue: (...args) =>Float64Array;fillet: (json,edge_indices,law_kind,law_params) =>string;filletReportJson: (json,edge_indices,law_kind,law_params) =>string;filterCircularEdges: (json) =>Uint32Array;filterConcaveEdges: (json) =>Uint32Array;filterConvexEdges: (json) =>Uint32Array;filterLinearEdges: (json) =>Uint32Array;fix: (json,config) =>Float64Array;fixSplitCommonVertex: (json) =>string;fixWireframe: (json,tolerance) =>string;freeEdgeCount: (json) =>number;fromFaces: (documents_json,tolerance) =>string;gridPattern: (json,x_axis,y_axis,spacing_x,spacing_y,count_x,count_y) =>string;helix: (outer,holes_json,radius,pitch,turns,clockwise,origin,axis,segments_per_turn) =>string;imprint: (json_a,json_b) =>string;intersect: (json_a,json_b) =>string;isClosed: (...args) =>boolean;isValidCheap: (json) =>boolean;linearPattern: (json,dx,dy,dz,spacing,count) =>string;loft: (profiles_json,ruled,closed) =>string;loopRegularPolygon: (radius,sides) =>Float64Array;massProperties: (json,eps) =>Float64Array;measurementDefaultEps: () =>number;measurementDeflection: (json) =>number;mirror: (...args) =>string;normalizeEdgeParameterFlags: (json) =>string;offset: (json,distance) =>string;outerShellDocument: (json) =>string;pipe: (outer,holes_json,path_json,guide_json) =>string;pullFace: (json,face_index,distance) =>string;recognizeHoles: (json) =>Float64Array;removeInternalLoops: (json) =>string;restrictionDefaultOptions: () =>Float64Array;reverse: (json) =>string;revolve: (outer,holes_json,axis_point,axis_direction,angle) =>string;section: (json,normal_x,normal_y,normal_z,point_x,point_y,point_z) =>string;sew: (json,tolerance) =>string;shell: (json,thickness,open_face_indices) =>string;signedVolume: (json,eps) =>number;solidEntityCounts: (json) =>Uint32Array;sphere: (radius) =>string;splitByLoops: (json,loops_json,tolerance) =>string;splitByPlane: (json,normal_x,normal_y,normal_z,point_x,point_y,point_z) =>string;splitC0BsplineEdges: (json) =>string;splitSelfIntersectingInnerLoops: (json) =>string;subtract: (json_a,json_b) =>string;surfaceArea: (json,eps) =>number;surfaceCross: (first_json,second_json,seed_region) =>string;surfaceCrossCurves: (first_json,second_json,seed_region) =>string;sweep: (outer,holes_json,path_json,ruled,segments) =>string;sweepProfile: (profile_json,holes_json,path_json,ruled,segments) =>string;tessellate: (document,deflection?) =>TriangleMesh;thicken: (json,thickness,symmetric,tolerance) =>string;thickOffset: (json,distance,excluded_face_indices) =>string;torus: (major_radius,minor_radius) =>string;transform: (...args) =>string;translate: (json,dx,dy,dz) =>string;unifyDefaultOptions: () =>Float64Array;unifySameDomain: (json,unify_faces,unify_edges,linear_tolerance,angular_tolerance) =>string;union: (json_a,json_b) =>string;validate: (document,toleranceScale,disabled) =>ValidationReport;validateOuterShell: (document,toleranceScale,disabled) =>ValidationReport;vertexPositions: (...args) =>Float64Array;voidShellDocuments: (json) =>string;volume: (json,eps) =>number; }
analyticSection
analyticSection: (
json,first_face,second_face,seed_region) =>Float64Array=wasm.brep_analytic_section
The plane x plane closed-form section between two faces of a solid, clipped to seed_region ([minX, minY, minZ, maxX, maxY, maxZ]).
Returns a flat packet: [lineCount, then per line: t0, t1, x0,y0,z0,
x1,y1,z1, u0,v0 on first, u1,v1 on first, u0,v0 on second, u1,v1 on second]. An empty result ([0]) means the planes are parallel or miss the box; the export ERRORS where the TypeScript returns null, since "not a plane pair" is a caller mistake here rather than a dispatch step.
Parameters
json
string
first_face
number
second_face
number
seed_region
Float64Array
Returns
Float64Array
analyzeTolerances
analyzeTolerances: (
json) =>Float64Array=wasm.brep_analyze_tolerances
[vertexCount, minTolerance, maxTolerance, averageTolerance] over the OUTER shell, which is the shell Solid.analyzeTolerances passes.
Parameters
json
string
Returns
Float64Array
boundingBox
boundingBox: (
json) =>Float64Array=wasm.brep_bounding_box
[minX, minY, minZ, maxX, maxY, maxZ]. An empty face set gives the empty box, which reads back +Infinity mins and -Infinity maxes exactly as BoundingBox.fromPoints([]) does.
Parameters
json
string
Returns
Float64Array
boundingSphere
boundingSphere: (
json) =>Float64Array=wasm.brep_bounding_sphere
[centerX, centerY, centerZ, radius].
Parameters
json
string
Returns
Float64Array
box
box: (
dx,dy,dz) =>string=wasm.brep_box
Parameters
dx
number
dy
number
dz
number
Returns
string
centerOfMass
centerOfMass: (
json) =>Float64Array=wasm.brep_center_of_mass
[x, y, z].
Parameters
json
string
Returns
Float64Array
chamfer
chamfer: (
json,edge_indices,distance1,distance2) =>string=wasm.brep_chamfer
Solid.chamfer(distance1, edges?, distance2?) — the chamfered solid, as a fresh handle.
An EMPTY edge_indices is the TypeScript's omitted edges, which selects every edge — and on an origin AABB box with equal distances that is the closed-form all-12-edge path (OCCT MakeChamfer topology: 26 faces, 48 edges, 24 vertices).
Same CONTRACT change as [brep_fillet]: an edge that does not cut is an error naming it, not a silently untouched solid.
Parameters
json
string
edge_indices
Uint32Array
distance1
number
distance2
number
Returns
string
chamferReportJson
chamferReportJson: (
json,edge_indices,distance1,distance2) =>string=wasm.brep_chamfer_report_json
Solid.chamferReport(...) — the counts and the per-edge outcome, as JSON.
Parameters
json
string
edge_indices
Uint32Array
distance1
number
distance2
number
Returns
string
checkBsplineRestrictions
checkBsplineRestrictions: (
json,max_degree,max_segments,tolerance) =>number=wasm.brep_check_bspline_restrictions
Count nurbs carriers exceeding the degree / segment limits.
Parameters
json
string
max_degree
number
max_segments
number
tolerance
number
Returns
number
circularPattern
circularPattern: (
json,axis_x,axis_y,axis_z,center_x,center_y,center_z,count) =>string=wasm.brep_circular_pattern
Parameters
json
string
axis_x
number
axis_y
number
axis_z
number
center_x
number
center_y
number
center_z
number
count
number
Returns
string
classifyPoint
classifyPoint: (
json,x,y,z,tolerance) =>number=wasm.brep_classify_point
0 = inside, 1 = outside, 2 = on-boundary — the ordering of the TypeScript union 'inside' | 'outside' | 'on-boundary'.
Parameters
json
string
x
number
y
number
z
number
tolerance
number
Returns
number
classifyShells
classifyShells: (
documents) =>string[] =wasm.brep_classify_shells
classifyShellsToBodies — N one-shell BrepJson documents in, one solid-root BrepJson document per body out.
Documents rather than handles, because containment is decided by point tests that cannot cross stores: every shell is read into ONE arena here.
Parameters
documents
string[]
Returns
string[]
clone
clone: (
json) =>string=wasm.brep_clone
Parameters
json
string
Returns
string
collapseCollinearDefaultTolerance
collapseCollinearDefaultTolerance: () =>
number=wasm.brep_collapse_collinear_default_tolerance
The default collapseCollinearVertices band.
Returns
number
collapseCollinearVertices
collapseCollinearVertices: (
json,tolerance) =>string=wasm.brep_collapse_collinear_vertices
Collapse runs of collinear boundary vertices. Returns the collapsed count.
Parameters
json
string
tolerance
number
Returns
string
cone
cone: (
bottom_radius,top_radius,height) =>string=wasm.brep_cone
Parameters
bottom_radius
number
top_radius
number
height
number
Returns
string
containsPoint
containsPoint: (
json,x,y,z,include_boundary) =>boolean=wasm.brep_contains_point
Parameters
json
string
x
number
y
number
z
number
include_boundary
boolean
Returns
boolean
convertDefaultTolerance
convertDefaultTolerance: () =>
number=wasm.brep_convert_default_tolerance
The default recognition band both elementary conversions take.
Returns
number
convertEdgesToElementary
convertEdgesToElementary: (
json,tolerance) =>string=wasm.brep_convert_edges_to_elementary
The same for nurbs EDGE carriers.
Parameters
json
string
tolerance
number
Returns
string
convertToBspline
convertToBspline: (
json) =>string=wasm.brep_convert_to_bspline
Convert every analytic face and edge carrier to an equivalent nurbs (B-spline) carrier. Returns the count of converted entities.
Parameters
json
string
Returns
string
convertToElementary
convertToElementary: (
json,tolerance) =>string=wasm.brep_convert_to_elementary
Recognize nurbs FACE carriers that are exactly an analytic primitive and convert them back within tolerance. Returns the count converted.
Parameters
json
string
tolerance
number
Returns
string
cornerChamfer
cornerChamfer: (
json,vertex_index,distance) =>string=wasm.brep_corner_chamfer
Solid.cornerChamfer(vertex, distance) — the corner-cut solid, as a fresh handle. The vertex index is the one [brep_corner_fillet] documents.
Parameters
json
string
vertex_index
number
distance
number
Returns
string
cornerFillet
cornerFillet: (
json,vertex_index,radius,sphere_center_mode) =>string=wasm.brep_corner_fillet
Solid.cornerFillet(vertex, radius, options?) — the corner-rounded solid, as a fresh handle.
The vertex is an INDEX into solid.vertices(), the order brep_vertex_positions flattens, so a caller reads the positions, picks the corner it wants, and hands the index back — the same convention [brep_fillet] uses for edges.
sphere_center_mode is the TypeScript's options.sphereCenter, whose two spellings are its whole domain: 0 = edge-tangent (the TS default), 1 = face-tangent. A string cannot cross the boundary as cheaply as the discriminant, and an unknown value is rejected rather than defaulted.
Parameters
json
string
vertex_index
number
radius
number
sphere_center_mode
number
Returns
string
cornerFilletSetback
cornerFilletSetback: (
json,vertex_index,radius,sphere_center_mode,setback) =>string=wasm.brep_corner_fillet_setback
Solid.cornerFillet with an explicit contact setback smaller than the default radius-derived distance. Same vertex index and sphere-centre mode as [brep_corner_fillet].
Parameters
json
string
vertex_index
number
radius
number
sphere_center_mode
number
setback
number
Returns
string
crossSection
crossSection: (
json,first_face,second_face,seed_region) =>Float64Array=wasm.brep_cross_section
The six-pair section dispatcher (cross::surface_cross) between two faces of one solid, so the parity suite can drive the whole intersection stack.
Returns a flat packet: [branchCount, contactCount, then per branch: kind,
closed, t0, t1, and eleven sampled 3D points at even fractions of the range,
then per contact: x, y, z]. kind is the CrossLineKind ordinal (0 line, 1 circle, 2 ellipse, 3 parabola, 4 hyperbola, 5 nurbs).
Parameters
json
string
first_face
number
second_face
number
seed_region
Float64Array
Returns
Float64Array
crossSectionCurves
crossSectionCurves: (
json,first_face,second_face,seed_region) =>string=wasm.brep_cross_section_curves
The three-path section between two faces of a registered solid, as CURVES.
Same dispatcher and same seed region as brep_cross_section; the difference is only what crosses. Returns a JSON array of {kind, closed, curveJson, t0, t1}, one entry per branch, in the intersector's own order. Isolated contact POINTS are not in this array — they are not curves — and brep_cross_section still reports them.
Parameters
json
string
first_face
number
second_face
number
seed_region
Float64Array
Returns
string
cylinder
cylinder: (
radius,height) =>string=wasm.brep_cylinder
Parameters
radius
number
height
number
Returns
string
distanceTo
distanceTo: (
json,x,y,z) =>Float64Array=wasm.brep_distance_to
[distance, queryX, queryY, queryZ, boundaryX, boundaryY, boundaryZ] — pointOnA is the query itself, pointOnB the closest boundary point.
Parameters
json
string
x
number
y
number
z
number
Returns
Float64Array
divideClosedFaces
divideClosedFaces: (
json) =>string=wasm.brep_divide_closed_faces
Cut U-periodic faces that belt the period (ShapeUpgrade_ClosedFaceDivide). Returns the divided-face count.
Parameters
json
string
Returns
string
draftFaces
draftFaces: (
json,face_indices,pull_x,pull_y,pull_z,angle,neutral_x,neutral_y,neutral_z) =>string=wasm.brep_draft_faces
Taper the selected PLANAR faces by angle radians about the neutral plane through neutral_* with normal pull_*. Returns a fresh handle.
Parameters
json
string
face_indices
Uint32Array
pull_x
number
pull_y
number
pull_z
number
angle
number
neutral_x
number
neutral_y
number
neutral_z
number
Returns
string
dump
readonlydump: (json) =>string=wasm.brep_shell_dump
Read a one-shell BrepJson document into a fresh handle. Write a shell handle back out as the same one-shell BrepJson document [brep_shell_load] reads.
The uv_curve rows go through the writer's CARRIER path, so what comes back is the uv_curve itself rather than an interpolation through samples of it, and a carrier that had to be fitted declares the deviation it measured on its own edge and face. That is what makes the round trip closed: dump → load → dump is byte-identical, because the second write has nothing left to widen.
Parameters
json
string
Returns
string
edgeForms
edgeForms: (
json) =>string=wasm.brep_edge_forms
The analytic form tag of each edge's carrier, in edge order.
Parameters
json
string
Returns
string
edgeFormsJson
edgeFormsJson: (
json) =>string=wasm.brep_edge_forms_json
The exact analytic descriptor of every EDGE carrier, as a JSON array in edge order — one CurveJson row per edge, null where the carrier holds no form (or holds a parabola/hyperbola, which the wire enum does not name).
Parameters
json
string
Returns
string
edgeInteriorPointsJson
edgeInteriorPointsJson: (
document) =>string
Parametric midpoint of every edge as JSON [[x, y, z], …].
Parameters
document
string
Returns
string
edgeRange
edgeRange: (
json,edge_index) =>Float64Array=wasm.brep_edge_range
curve.range() of one edge.
Parameters
json
string
edge_index
number
Returns
Float64Array
edgeRangesJson
edgeRangesJson: (
document) =>string
Every edge's curve.range() as JSON [[t0, t1], …] — published wasm has no brep_edge_ranges_json; this is the per-edge probe in document order (same contract as crates/geometry/src/brep/wasm/geometric_probes.rs).
Parameters
document
string
Returns
string
edgeToFaceMap
edgeToFaceMap: (
json) =>Uint32Array=wasm.brep_edge_to_face_map
Run-length packing of Map<Edge, Face[]>: [edgeIndex, faceCount,
faceIndex…] repeated, edges ascending. A two-manifold solid gives a faceCount of 2 for every edge.
Parameters
json
string
Returns
Uint32Array
edgeValue
edgeValue: (
json,edge_index,t) =>Float64Array=wasm.brep_edge_value
curve.value(t) of one edge, indexed in the solid's edge order. t is the carrier's OWN parameter — the knot domain for a form carrier, [0, 1] for a plain nurbs.
Parameters
json
string
edge_index
number
t
number
Returns
Float64Array
entityCounts
readonlyentityCounts: (...args) =>Uint32Array
Parameters
args
...[string]
Returns
Uint32Array
eulerCharacteristic
eulerCharacteristic: (
json) =>number=wasm.brep_euler_characteristic
Genus-correct Euler characteristic V − E + F − R.
Parameters
json
string
Returns
number
extrude
extrude: (
outer,holes_json,dx,dy,dz) =>string=wasm.brep_extrude
Extrude a planar profile polygon along a direction vector, whose LENGTH is the extrusion height. Holes in the profile become through-holes.
Parameters
outer
Float64Array
holes_json
string
dx
number
dy
number
dz
number
Returns
string
extrudeProfile
extrudeProfile: (
profile_json,holes_json,dx,dy,dz) =>string=wasm.brep_extrude_profile
Extrude a planar profile bounded by CURVES along a direction vector, whose LENGTH is the extrusion height. Holes in the profile become through-holes.
profile_json is the outer boundary ring — a JSON array of NurbsCurve documents in traversal order, one per boundary edge (a circle is a one-element ring). holes_json is a JSON array of such rings, or empty.
Parameters
profile_json
string
holes_json
string
dx
number
dy
number
dz
number
Returns
string
faceArea
faceArea: (
json,face_index,eps) =>number=wasm.brep_face_area
Area of ONE face, indexed in the solid's face order (solid.faces(), the order brep_face_value and brep_face_forms already use). Summing this over every face reproduces [brep_surface_area] exactly — it is the same term.
Parameters
json
string
face_index
number
eps
number
Returns
number
faceCentroid
faceCentroid: (
json,face_index) =>Float64Array=wasm.brep_face_centroid
[x, y, z] — the AREA centroid of one face, (1/A)·∫ x dA over its trimmed domain. Holes subtract, so an annular cap reports the centroid of the material it actually covers.
The tessellation deflection for the one rule that needs a mesh (a face whose uv boundary will not close) is the solid's own [brep_measurement_deflection], not a caller knob: the same face measured through brep_center_of_mass uses that value, and the two must not disagree.
Parameters
json
string
face_index
number
Returns
Float64Array
faceContainsPoint
faceContainsPoint: (
json,face_index,x,y,z,tolerance,include_boundary) =>boolean=wasm.brep_face_contains_point
True when the point lies on the trimmed face: within tolerance of the face's CARRIER and inside its trim. include_boundary decides the trim boundary itself; the carrier band is always tolerance, since a point off the surface is not on the face under any reading.
Parameters
json
string
face_index
number
x
number
y
number
z
number
tolerance
number
include_boundary
boolean
Returns
boolean
faceDocument
readonlyfaceDocument: (json,face_index) =>string=wasm.brep_shell_face_document
Hand ONE face of a registered shell out as its OWN one-shell version-2 document — the same BrepJson [brep_shell_load] reads, holding that face, its outer loop and holes, and only the edges and vertices those loops reference.
The rows are COPIES, re-indexed into a fresh table set because the face is copied into a private arena first ([copy_faces_into], which keeps edges a loop uses twice shared) and the writer emits only what is reachable from the shell it is given. So the document owns every row it names, and the source handle keeps its own geometry — this reads, it does not consume. It is what parashape's faceEntityOf emits as { brep: oneFaceShell.toJSON() } (packages/parametric/src/domains/brepFace.ts).
face_index is a POSITION in shell.faces, like [brep_shell_face_value], and arrives as f64 because that is the number the TypeScript hands over.
Parameters
json
string
face_index
number
Returns
string
faceDomain
faceDomain: (
json,face_index) =>Float64Array=wasm.brep_face_domain
[uMin, uMax, vMin, vMax] of one face's carrier — the domain its own value is defined over, which a probe has to stay inside.
Parameters
json
string
face_index
number
Returns
Float64Array
faceForms
faceForms: (
json) =>string=wasm.brep_face_forms
The analytic form tag of each face's carrier, as a JSON array of names ("plane" / "cylinder" / "cone" / "sphere" / "torus" / "none"), in face order. This is the recognition METADATA, not a dispatch key: evaluation stays generic NURBS eval on both sides.
Parameters
json
string
Returns
string
faceFormsJson
readonlyfaceFormsJson: (...args) =>string
Parameters
args
...[string]
Returns
string
faceFromLoop
faceFromLoop: (
points,holes_json,tolerance) =>string=wasm.brep_face_from_loop
Face.fromLoop with INNER LOOPS — the exact constructor, and the only path here that will take holes without touching them.
Face.fromLoop (topo/Face.ts) does two things and no more: it fits the supporting plane from the OUTER loop by Newell, and it hands surface and loop to the Face constructor (topo/Face.ts), which stores innerLoops verbatim. So this export does not clean the rings, does not re-wind them, does not check them coplanar and does not check that a hole nests inside the boundary — the caller's points ARE the loops, and a caller that wants those checks wants [brep_face_planar_with_holes] instead.
It also reproduces Face.fromLoop's FRAME, which is the other half of the difference from the holes path: the plane comes from Store::face_planar, so the uv origin sits at the core Plane's canonical origin (the plane point nearest the world origin) rather than at the first boundary point, and no uv_curves are recorded at all. See [brep_face_planar], which spells out what a caller sampling brep_shell_face_value sees when those two are confused.
holes_json is a JSON array of flat [x, y, z, ...] arrays, the same wire shape every other loop argument here takes.
Parameters
points
Float64Array
holes_json
string
tolerance
number
Returns
string
faceFromSurface
faceFromSurface: (
surface_json,bounds,reversed,tolerance) =>string=wasm.brep_face_from_surface
Face.fromSurface — a face on a general (nurbs or form-tagged) surface carrier, over its natural bounds.
This is the NATURAL-BOUNDS spelling — the whole of OCCT MakeFace(surface, UMin, UMax, VMin, VMax). For the TypeScript's caller-supplied boundary loops see [brep_face_from_surface_with_loops], which carries them as the points the rest of this boundary already spells a loop in.
bounds is [uMin, uMax, vMin, vMax], or empty for the surface's own domain.
Parameters
surface_json
string
bounds
Float64Array
reversed
boolean
tolerance
number
Returns
string
faceFromSurfaceWithLoops
faceFromSurfaceWithLoops: (
surface_json,loops_json,reversed,tolerance) =>string=wasm.brep_face_from_surface_with_loops
Face.fromSurface(surface, loops) — a face on a general surface carrier BOUNDED by caller-supplied loops, loops_json being [outer, ...holes] as a JSON array of flat [x, y, z, ...] rings.
That wire shape is the one every loop on this boundary already takes (brep_face_planar_with_holes, both split_by_loops): a loop gets no handle because both of Loop's factories build the same closed chain of straight edges through a point list, so the points ARE the loop. It also collapses the TypeScript's Loop[] | { outer, holes? } union, which is two spellings of one list whose first element is the outer loop.
Every loop vertex must lie on the surface within max(tolerance, 1e-6); make_face_from_surface refuses one that does not, rather than projecting it silently. An EMPTY list is refused here too — that is [brep_face_from_surface]'s construction, and answering it from this export would make one call mean two different faces.
Parameters
surface_json
string
loops_json
string
reversed
boolean
tolerance
number
Returns
string
faceLoopPoints
faceLoopPoints: (
json) =>string=wasm.brep_face_loop_points
The outer-loop boundary points of every face, as JSON [[[x, y, z], ...], ...] indexed the same way every export in this file selects faces.
Selection is geometric: a caller picks "the four walls" or "the pocket's floor" by measuring, and the existing boundary can only be read one vertex table at a time, which does not say which face a vertex belongs to. This is the smallest reader that makes an index selection derivable, and it is JSON for the reason the rest of the structural summaries are: the shape is ragged (a face has as many boundary points as it has edges) and small.
Parameters
json
string
Returns
string
faceLoops
readonlyfaceLoops: (json,tolerance) =>string=wasm.brep_shell_face_loops
Per-face boundary loops of a registered shell — outer first, then holes — each loop a flat [x, y, z, ...] point list, curved edges chord-subdivided until they sit within tolerance of their chord.
The JSON is Point[][][]: one array per face in the shell's own face order, one flat point list per loop. This is eachFaceLoops (brepFace.ts) over faceToLoops (brepFace.ts), including its filter — a loop that comes back with fewer than three points is not a polygon and is dropped, so a face's loop count here is not necessarily 1 + innerLoops.len().
Parameters
json
string
tolerance
number
Returns
string
faceModifyShape
faceModifyShape: (
json,face_index,constraints_json) =>string=wasm.brep_face_modify_shape
Face.modifyShape — Hu et al. shape modification on a FREEFORM face, under the geometric constraints in constraints_json. Answers a one-face shell handle; the source is not touched.
constraints_json is the ShapeModifyOptions record: { "method": "controlNet" | "energy",
"points": [{ "u": .., "v": .., "target": [x, y, z], "normal": [x, y, z] }],
"isoCurves": [{ "direction": "u" | "v", "parameter": .., "curve": { .. } }],
"energyRegularization": .. }.
DIVERGENCE (an argument that does nothing). The TypeScript option record also carries energySamplesPerSpan, and it is INERT there: assembleEnergyMatrix clamps it, slices the Gauss node and weight tables to that length, and then integrates with the full six-point rule anyway — its own comment says "use all 6 always for accuracy". It is therefore absent from this record rather than accepted and ignored.
Parameters
json
string
face_index
number
constraints_json
string
Returns
string
faceOffset
faceOffset: (
json,face_index,distance,tolerance) =>string=wasm.brep_face_offset
Face.offset — the face-level surface offset. Answers a one-face shell handle.
Parameters
json
string
face_index
number
distance
number
tolerance
number
Returns
string
faceOutwardNormal
readonlyfaceOutwardNormal: (...args) =>Float64Array
Parameters
args
...[string, number, number, number]
Returns
Float64Array
facePlanar
facePlanar: (
points,tolerance) =>string=wasm.brep_face_planar
A planar face on the plane its own boundary fits.
This one export is Face.planar AND Face.fromLoop(Loop.fromPolygon(...)), which the TypeScript defines as each other. The supporting plane is fitted from the boundary by Newell, so the outward normal follows the CALLER'S POINT ORDER — reverse the points and the face faces the other way. That is deliberate and is why brep_shell_from_faces re-orients what it sews.
It is Store::face_planar and NOT make_planar_face, which are two different functions on both sides and disagree about one thing a caller can see: where the carrier's uv ORIGIN sits. Face.planar pins it at the core Plane's own canonical origin (the plane point nearest the world origin), while makePlanarFace — the holes path below — pins it at the first boundary point. They also disagree about a SECOND, bigger thing: this path records NO uv_curves at all (faithful — TS Face.fromLoop adds none, topo/Face.ts), while the holes path records one linear uv_curve per boundary edge. So "self-consistent with the uv_curves they record" is true only vacuously here: a caller reading a uv boundary off a brep_face_planar face gets nothing. A caller sampling brep_shell_face_value also sees the origin difference — routing this export through the holes path once put Face.rectangle(4, 3)'s uv origin 2.5 units off the TypeScript's.
Parameters
points
Float64Array
tolerance
number
Returns
string
facePlanarWithHoles
facePlanarWithHoles: (
points,holes_json,tolerance) =>string=wasm.brep_face_planar_with_holes
A planar face with hole loops — the makePlanarFace path, whose extra work over [brep_face_planar] is exactly what holes need: the loops are cleaned, checked coplanar, re-wound (outer counter-clockwise about the outward normal, holes clockwise) and checked to nest. holes_json is a JSON array of flat [x, y, z, ...] arrays.
Parameters
points
Float64Array
holes_json
string
tolerance
number
Returns
string
faceProject
faceProject: (
json,face_index,x,y,z) =>Float64Array=wasm.brep_face_project
surface.project(point) of one face — the carrier's own inverse. Pairs with [brep_face_value] for the round-trip a form tag has to satisfy: a form whose axis points the wrong way describes the same point set with its parameters mirrored, so value and project disagree while every cross-side comparison still passes.
Parameters
json
string
face_index
number
x
number
y
number
z
number
Returns
Float64Array
faceRectangle
faceRectangle: (
width,height,tolerance) =>string=wasm.brep_face_rectangle
A rectangular planar face on the XY plane centred at the origin, width along x and height along y, outward normal +Z.
Parameters
width
number
height
number
tolerance
number
Returns
string
faceSplitByLoops
faceSplitByLoops: (
json,loops_json,tolerance) =>string=wasm.brep_face_split_by_loops
Split the ONE face of a shell handle by cutting loops that lie on its surface, returning the pieces as a new shell handle. Closed loops cut regions; open loops running boundary to boundary walk the face into pieces.
Parameters
json
string
loops_json
string
tolerance
number
Returns
string
faceSummary
faceSummary: (
json) =>Uint32Array=wasm.brep_face_summary
Per-face [reversed, loopCount, edgeCount], flattened in face order.
Parameters
json
string
Returns
Uint32Array
faceThicken
faceThicken: (
json,face_index,thickness,symmetric) =>string=wasm.brep_face_thicken
Face.thicken — extrude a face along its own outward normal into a slab. Answers a SOLID handle, since the result is a solid.
Parameters
json
string
face_index
number
thickness
number
symmetric
boolean
Returns
string
faceTrim
faceTrim: (
json,face_index,tool_json,tool_face_index,side) =>string=wasm.brep_face_trim
Face.trim — keep the part of a face inside a co-surface tool face (side == true) or cut the tool out of it (side == false). Both operands are one-face shell handles; the result is a shell of the surviving pieces.
Parameters
json
string
face_index
number
tool_json
string
tool_face_index
number
side
boolean
Returns
string
faceTrimByLoop
faceTrimByLoop: (
json,face_index,loop_points,side,tolerance) =>string=wasm.brep_face_trim_by_loop
Face.trim with a LOOP tool — the TypeScript's tool instanceof Face test taking its other alternative, where a closed loop lying on the face's own surface becomes the tool face.
DIVERGENCE (spelling). TS carries the two tools as one Face | Loop union argument; a boundary has no union, so each alternative is its own export. loop_points is one flat [x, y, z, ...] ring, the shape brep_face_planar takes, closed implicitly.
The loop is materialized at tolerance and then turned into a tool face at the SUBJECT's own tolerance, which is what trimFace does when it calls loopAsFaceOnSurface(tool, face.surface, face.tolerance).
Parameters
json
string
face_index
number
loop_points
Float64Array
side
boolean
tolerance
number
Returns
string
faceValue
readonlyfaceValue: (...args) =>Float64Array
Parameters
args
...[string, number, number, number]
Returns
Float64Array
fillet
fillet: (
json,edge_indices,law_kind,law_params) =>string=wasm.brep_fillet
Solid.fillet(edges, radius) — the filleted solid, as a fresh handle.
CONTRACT (changed): an edge that does not blend is an ERROR here, and the message names every such edge. It used to come back as the original solid with the reasons in a report this function dropped, so "the fillet did nothing" and "the shape needed no change" were the same answer. Use [brep_fillet_report_json] for the per-edge outcome of a partial run.
Parameters
json
string
edge_indices
Uint32Array
law_kind
number
law_params
Float64Array
Returns
string
filletReportJson
filletReportJson: (
json,edge_indices,law_kind,law_params) =>string=wasm.brep_fillet_report_json
Solid.filletReport(edges, radius) — the counts and the per-edge outcome, as JSON. The solid itself is NOT registered here; call [brep_fillet] for that.
Parameters
json
string
edge_indices
Uint32Array
law_kind
number
law_params
Float64Array
Returns
string
filterCircularEdges
filterCircularEdges: (
json) =>Uint32Array=wasm.brep_filter_circular_edges
Edge indices whose carrier is a full circle.
Parameters
json
string
Returns
Uint32Array
filterConcaveEdges
filterConcaveEdges: (
json) =>Uint32Array=wasm.brep_filter_concave_edges
Manifold edge indices whose oriented dihedral is a concave crease.
Parameters
json
string
Returns
Uint32Array
filterConvexEdges
filterConvexEdges: (
json) =>Uint32Array=wasm.brep_filter_convex_edges
Manifold edge indices whose oriented dihedral is a convex crease.
Parameters
json
string
Returns
Uint32Array
filterLinearEdges
filterLinearEdges: (
json) =>Uint32Array=wasm.brep_filter_linear_edges
Edge indices whose carrier is a straight line segment.
Parameters
json
string
Returns
Uint32Array
fix
fix: (
json,config) =>Float64Array=wasm.brep_fix
Run the shape-fix hierarchy in place. config is the JSON of a partial FixConfig ({} for the defaults, {"fixOrientation":"on"} to force one), which is what the TypeScript's Partial<FixConfig> argument is. Returns [status, actionsApplied].
Every advertised On/Auto flag runs the matching OCCT-named repair, or errors. Nine flags default to off. Degenerated / Reversed2d / AddCurve3d / Shifted run as OCCT FixEdgeCurves + FixDegenerated defaults (auto). LoopWire / SplitFace / PeriodicDegenerated default auto (Face::Perform).
Parameters
json
string
config
string
Returns
Float64Array
fixSplitCommonVertex
fixSplitCommonVertex: (
json) =>string=wasm.brep_fix_split_common_vertex
Split vertices shared by non-adjacent edge fans, returning the split count.
Parameters
json
string
Returns
string
fixWireframe
fixWireframe: (
json,tolerance) =>string=wasm.brep_fix_wireframe
Fix wireframe gaps below tolerance, returning the sewn pair count.
Parameters
json
string
tolerance
number
Returns
string
freeEdgeCount
freeEdgeCount: (
json) =>number=wasm.brep_free_edge_count
Free (singly-bordered) edges of the solid's OUTER shell — the edge-use census Solid.outerShell.manifoldReport().freeEdges reports, and 0 exactly when that shell sews watertight.
The TypeScript callers all read this count through .freeEdges.filter((edge) => !edge.degenerate), and the filter is not repeated here because [crate::brep::topo::arena::Store::shell_manifold_report] already exempts degenerate edges at the source: a pole row or a cone apex is a whole parameter range squeezed onto one point, appears once in its face's loop, and bounds nothing.
Parameters
json
string
Returns
number
fromFaces
readonlyfromFaces: (documents_json,tolerance) =>string=wasm.brep_shell_from_faces
Sew loose faces into one shell, ORIENTING it when the weld closes.
handles are shell handles whose faces are all taken; the operands stay valid, because each is transplanted through the version-2 round trip rather than moved — this crate's only store-to-store transfer, and the same one the boolean uses for its second operand.
tolerance of 0 or less means "the default sew band", matching the TS optional argument.
Parameters
documents_json
string
tolerance
number
Returns
string
gridPattern
gridPattern: (
json,x_axis,y_axis,spacing_x,spacing_y,count_x,count_y) =>string=wasm.brep_grid_pattern
Parameters
json
string
x_axis
Float64Array
y_axis
Float64Array
spacing_x
number
spacing_y
number
count_x
number
count_y
number
Returns
string
helix
helix: (
outer,holes_json,radius,pitch,turns,clockwise,origin,axis,segments_per_turn) =>string=wasm.brep_helix
Sweep a planar profile polygon along a helix.
Parameters
outer
Float64Array
holes_json
string
radius
number
pitch
number
turns
number
clockwise
boolean
origin
Float64Array
axis
Float64Array
segments_per_turn
number
Returns
string
imprint
imprint: (
json_a,json_b) =>string=wasm.brep_imprint
Imprint B's intersection trace onto A's faces, registering the result under a NEW handle and leaving both inputs valid.
The material is unchanged — same volume, same orientation — and only the face and edge structure is finer, so a caller can select or offset the sub-region B marks out. B is a stencil: it is never split and none of its faces survive. The operands are brought into one arena exactly as [boolean] does.
Parameters
json_a
string
json_b
string
Returns
string
intersect
intersect: (
json_a,json_b) =>string=wasm.brep_boolean_intersect
Intersection (A n B): only the material common to both solids.
Parameters
json_a
string
json_b
string
Returns
string
isClosed
readonlyisClosed: (...args) =>boolean
Parameters
args
...[string]
Returns
boolean
isValidCheap
isValidCheap: (
json) =>boolean=wasm.brep_is_valid_cheap
True when every shell of the solid is closed — the O(edges) validity screen Solid.isValidCheap runs before the geometric validate report.
Parameters
json
string
Returns
boolean
linearPattern
linearPattern: (
json,dx,dy,dz,spacing,count) =>string=wasm.brep_linear_pattern
Parameters
json
string
dx
number
dy
number
dz
number
spacing
number
count
number
Returns
string
loft
loft: (
profiles_json,ruled,closed) =>string=wasm.brep_loft
Loft a stack of planar profile polygons into a solid.
profiles_json is a JSON array of point rings ([[[x, y, z], ...], ...]) — the profiles cross as polygons for the same reason a swept profile does. The bands are typed analytically per pair, so coaxial circular sections come back carrying a cylinder or cone rather than a generic ruled patch.
Parameters
profiles_json
string
ruled
boolean
closed
boolean
Returns
string
loopRegularPolygon
loopRegularPolygon: (
radius,sides) =>Float64Array=wasm.brep_loop_regular_polygon
The points of a regular polygon on the XY plane centred at the origin, first at (radius, 0, 0) and winding counter-clockwise seen from +Z.
A LOOP does not get a handle, because at this boundary it has nothing a handle would carry: both of Loop's factories build the same thing — a closed chain of straight edges through a point list — so the points ARE the loop, and every consumer here (brep_face_planar, the two split_by_loops) takes them as points and materializes the chain in the store it is working in. Loop.fromPolygon is therefore the identity on this side.
Parameters
radius
number
sides
number
Returns
Float64Array
massProperties
massProperties: (
json,eps) =>Float64Array=wasm.brep_mass_properties
[volume, surfaceArea, comX, comY, comZ, i00, i01, i02, i10, i11, i12, i20,
i21, i22] — the tensor in ROW order, matching the TS [[Ixx, -Ixy, -Ixz], [-Ixy, Iyy, -Iyz], [-Ixz, -Iyz, Izz]] layout.
Parameters
json
string
eps
number
Returns
Float64Array
measurementDefaultEps
measurementDefaultEps: () =>
number=wasm.brep_measurement_default_eps
The relative stopping band Solid.volume / surfaceArea use when their caller passes no eps — DEFAULT_MEASUREMENT_EPS.
Returns
number
measurementDeflection
measurementDeflection: (
json) =>number=wasm.brep_measurement_deflection
Parameters
json
string
Returns
number
mirror
readonlymirror: (...args) =>string
Parameters
args
...[string, number, number, number, number, number, number]
Returns
string
normalizeEdgeParameterFlags
normalizeEdgeParameterFlags: (
json) =>string=wasm.brep_normalize_edge_parameter_flags
Recompute every edge's degenerate / sameParameter / sameRange flags from the geometry. Returns the number of edges whose flags changed.
Parameters
json
string
Returns
string
offset
offset: (
json,distance) =>string=wasm.brep_offset
Offset every face by distance — positive outward, negative inward.
Parameters
json
string
distance
number
Returns
string
outerShellDocument
outerShellDocument: (
json) =>string=wasm.brep_outer_shell_document
Hand a registered SOLID's OUTER shell out as its own one-shell version-2 document — the same BrepJson [brep_shell_load] reads.
The role is READ, not re-derived: Solid stores outer_shell separately from void_shells (topo/arena.rs), and classify_shells_to_bodies is what sorted them there by containment and winding.
This is what parashape's explode walk needs to reach a solid's boundary as a Shell handle without going through Shell.fromJSON on the TypeScript side (packages/parametric/src/domains/brepFace.ts).
Parameters
json
string
Returns
string
pipe
pipe: (
outer,holes_json,path_json,guide_json) =>string=wasm.brep_pipe
Pipe a planar profile polygon along a NURBS path, scaling the section by an optional guide rail (an empty guide_json means no guide).
Parameters
outer
Float64Array
holes_json
string
path_json
string
guide_json
string
Returns
string
pullFace
pullFace: (
json,face_index,distance) =>string=wasm.brep_pull_face
Slide the selected face along its own outward normal by distance, sliding each boundary vertex along a foreign incident edge so the neighbourhood stays valid. Returns a fresh handle.
DIVERGENCE (return). The TypeScript mutates the receiver and answers void. Across this boundary the caller's handle names an arena it still owns, so the pull runs on a working COPY and the result is registered — a handle the caller already holds is what "in place" means here, and mutating the registered arena would edit a solid another call may be mid-way through.
Parameters
json
string
face_index
number
distance
number
Returns
string
recognizeHoles
recognizeHoles: (
json) =>Float64Array=wasm.brep_recognize_holes
Eight doubles per recognized hole: [faceIndex, axisX, axisY, axisZ,
centerX, centerY, centerZ, radius, depth] — nine, and the face index is one because recognizeHoles emits exactly one face per hole.
Parameters
json
string
Returns
Float64Array
removeInternalLoops
removeInternalLoops: (
json) =>string=wasm.brep_remove_internal_loops
Strip every inner (hole) loop from every face. Returns the removed count.
Parameters
json
string
Returns
string
restrictionDefaultOptions
restrictionDefaultOptions: () =>
Float64Array=wasm.brep_restriction_default_options
[maxDegree, maxSegments, tolerance].
Returns
Float64Array
reverse
reverse: (
json) =>string=wasm.brep_reverse
Parameters
json
string
Returns
string
revolve
revolve: (
outer,holes_json,axis_point,axis_direction,angle) =>string=wasm.brep_revolve
Revolve a planar profile polygon about an axis. angle is in radians and must lie in (0, 2pi].
Parameters
outer
Float64Array
holes_json
string
axis_point
Float64Array
axis_direction
Float64Array
angle
number
Returns
string
section
section: (
json,normal_x,normal_y,normal_z,point_x,point_y,point_z) =>string=wasm.brep_section
The cross-section loops where a cutting plane meets a registered solid, as JSON: one object per loop with its edge count, the form-tag name of each edge's carrier, the loop's vertex positions, and — for a loop the analytic upgrade collapsed to ONE conic edge — that conic's radius or semi-axes.
The conic parameters are the point of reporting more than positions: a perpendicular cylinder cut must come back as an exact circle of the cylinder's own radius, and a chord polyline through the same vertices is indistinguishable from it by position alone.
Parameters
json
string
normal_x
number
normal_y
number
normal_z
number
point_x
number
point_y
number
point_z
number
Returns
string
sew
sew: (
json,tolerance) =>string=wasm.brep_sew_shells
Stitch coincident free-edge pairs of the outer shell. A non-finite tolerance means "not supplied", so the band defaults to the shell's own tolerance reach — which is what sewShells(undefined) does in TypeScript.
Parameters
json
string
tolerance
number
Returns
string
shell
readonlyshell: (json,thickness,open_face_indices) =>string=wasm.brep_shell
Hollow the solid to a wall of thickness, opening the selected faces.
Parameters
json
string
thickness
number
open_face_indices
Uint32Array
Returns
string
signedVolume
signedVolume: (
json,eps) =>number=wasm.brep_signed_volume
Parameters
json
string
eps
number
Returns
number
solidEntityCounts
solidEntityCounts: (
json) =>Uint32Array=wasm.brep_solid_entity_counts
[faces, edges, vertices].
Parameters
json
string
Returns
Uint32Array
sphere
sphere: (
radius) =>string=wasm.brep_sphere
Parameters
radius
number
Returns
string
splitByLoops
readonlysplitByLoops: (json,loops_json,tolerance) =>string=wasm.brep_shell_split_by_loops
Split every face of a shell by whichever cutting loops lie on ITS surface, returning a new shell. A face no loop applies to is carried through untouched.
Loops spanning several faces are NOT treated as one global arrangement — each face is split independently by its own subset, which is the TypeScript's stated behaviour and not an approximation of something better. The assignment band is max(face tolerance, 1e-5), the TS literal.
Parameters
json
string
loops_json
string
tolerance
number
Returns
string
splitByPlane
splitByPlane: (
json,normal_x,normal_y,normal_z,point_x,point_y,point_z) =>string=wasm.brep_split_by_plane
Split a registered solid by a cutting plane, returning [aboveHandle,
belowHandle] where a 0 means that half is empty — the plane missed the solid entirely and the whole solid is on the other side.
The TypeScript's splitByPlane wrapper additionally packages the cut boundaries into a Path2d in the plane's own frame. That is a repackaging of the section loops [brep_section] already returns, in a 2D type the registry has no handle for, so the boundary exposes the geometric operation and leaves the packaging to the caller.
Parameters
json
string
normal_x
number
normal_y
number
normal_z
number
point_x
number
point_y
number
point_z
number
Returns
string
splitC0BsplineEdges
splitC0BsplineEdges: (
json) =>string=wasm.brep_split_c0_bspline_edges
Split C0 NURBS edges at full-multiplicity interior knots (ShapeUpgrade::C0BSplineToSequenceOfC1BSplineCurve). Returns the split count.
Parameters
json
string
Returns
string
splitSelfIntersectingInnerLoops
splitSelfIntersectingInnerLoops: (
json) =>string=wasm.brep_split_self_intersecting_inner_loops
Partition figure-eight inner loops into simple sub-cycles. Returns the number of inner loops replaced.
Parameters
json
string
Returns
string
subtract
subtract: (
json_a,json_b) =>string=wasm.brep_boolean_subtract
Difference (A - B): the material of A with B's material carved away.
Parameters
json_a
string
json_b
string
Returns
string
surfaceArea
surfaceArea: (
json,eps) =>number=wasm.brep_surface_area
Parameters
json
string
eps
number
Returns
number
surfaceCross
surfaceCross: (
first_json,second_json,seed_region) =>string=wasm.brep_surface_cross
Intersect two surfaces, returning every section branch with its 3D carrier and its uv image on each operand.
This is the whole taxonomy in one call — plane x plane's closed form, the plane x anything scalar reduction, and the general SSI core — because the dispatch between them is the intersector's own and not a caller's choice.
unsupportedReasons is reported rather than thrown: a pair the core declines has an ANSWER (usually no branches, sometimes some), and turning that into an exception would hide the branches it did find.
Parameters
first_json
string
second_json
string
seed_region
Float64Array
Returns
string
surfaceCrossCurves
surfaceCrossCurves: (
first_json,second_json,seed_region) =>string=wasm.brep_surface_cross_curves
The standalone surface pair as CURVES — brep_surface_cross without a solid to hold, and without the uv_curves a caller building topology needs.
Parameters
first_json
string
second_json
string
seed_region
Float64Array
Returns
string
sweep
sweep: (
outer,holes_json,path_json,ruled,segments) =>string=wasm.brep_sweep
Sweep a planar profile polygon along a NURBS path.
ruled skins the walls with flat quads; clearing it gives one interpolated NURBS surface per profile edge. segments of 0 lets the path's own curvature pick the station count.
Parameters
outer
Float64Array
holes_json
string
path_json
string
ruled
boolean
segments
number
Returns
string
sweepProfile
sweepProfile: (
profile_json,holes_json,path_json,ruled,segments) =>string=wasm.brep_sweep_profile
Sweep a planar profile bounded by CURVES along a NURBS path.
Rings are described exactly as [brep_extrude_profile] takes them; ruled and segments mean what they do on .
Parameters
profile_json
string
holes_json
string
path_json
string
ruled
boolean
segments
number
Returns
string
tessellate
tessellate: (
document,deflection?) =>TriangleMesh
Display mesh of a solid-root B-Rep document at deflection.
Parameters
document
string
deflection?
number
Returns
thicken
readonlythicken: (json,thickness,symmetric,tolerance) =>string=wasm.brep_shell_thicken
Shell.thicken — thicken an open shell into a solid by offsetting every face and joining the two sides with ruled lateral walls on the free edges. Answers a SOLID handle.
Parameters
json
string
thickness
number
symmetric
boolean
tolerance
number
Returns
string
thickOffset
thickOffset: (
json,distance,excluded_face_indices) =>string=wasm.brep_thick_offset
Hollow the solid. Negative distance offsets inward (a cup); positive offsets outward (a jacket around the original). Selected faces stay where they are so the opening goes through them.
Parameters
json
string
distance
number
excluded_face_indices
Uint32Array
Returns
string
torus
torus: (
major_radius,minor_radius) =>string=wasm.brep_torus
Parameters
major_radius
number
minor_radius
number
Returns
string
transform
readonlytransform: (...args) =>string
Parameters
args
...[string, Float64Array<ArrayBufferLike>]
Returns
string
translate
translate: (
json,dx,dy,dz) =>string=wasm.brep_translate
Parameters
json
string
dx
number
dy
number
dz
number
Returns
string
unifyDefaultOptions
unifyDefaultOptions: () =>
Float64Array=wasm.brep_unify_default_options
The UnifyOptions defaults, as [unifyFaces, unifyEdges, linearTolerance,
angularTolerance] with the two flags as 0/1.
Returns
Float64Array
unifySameDomain
unifySameDomain: (
json,unify_faces,unify_edges,linear_tolerance,angular_tolerance) =>string=wasm.brep_unify_same_domain
Merge adjacent same-surface faces (and, when unify_edges, fuse the collinear runs the merge leaves). Returns the merged count.
Parameters
json
string
unify_faces
boolean
unify_edges
boolean
linear_tolerance
number
angular_tolerance
number
Returns
string
union
union: (
json_a,json_b) =>string=wasm.brep_boolean_union
Union/// Union (A u B): all material in either solid, with the overlap counted once.
Parameters
json_a
string
json_b
string
Returns
string
validate
validate: (
document,toleranceScale,disabled) =>ValidationReport
Validate a solid-root B-Rep document at toleranceScale, with disabled a comma-separated list of CheckId names — typed decode of the crate's report JSON.
Parameters
document
string
toleranceScale
number
disabled
string
Returns
validateOuterShell
validateOuterShell: (
document,toleranceScale,disabled) =>ValidationReport
Validate only a document's outer shell — typed decode, same report.
Parameters
document
string
toleranceScale
number
disabled
string
Returns
vertexPositions
readonlyvertexPositions: (...args) =>Float64Array
Parameters
args
...[string]
Returns
Float64Array
voidShellDocuments
voidShellDocuments: (
json) =>string=wasm.brep_void_shell_documents
Every VOID (cavity) shell of a registered solid, each as its own one-shell document, in the solid's own void_shells order. A solid with no cavity answers [] — an empty array, not an error, because "no voids" is an answer.
A void shell's faces are wound so their normals point INTO the cavity (topo/classify_shells.rs), and the copy carries that winding, so a reloaded void document probes exactly like the cavity it came from.
Parameters
json
string
Returns
string
volume
volume: (
json,eps) =>number=wasm.brep_volume
Parameters
json
string
eps
number
Returns
number
MeshData
MeshData: {
bevel: (id,edges,radius,segments,radius2?) =>void;bevelVertices: (id,vertices,radius,segments) =>void;boundingBox: (id) =>Float64Array;box: (width,depth,height) =>number;chamfer: (id,edges,distance1,distance2) =>void;clone: (id) =>number;cone: (radius_bottom,radius_top,height,sides) =>number;containsPoint: (id,x,y,z) =>boolean;cornerCount: (id) =>number;deleteVertices: (id,vertices) =>void;dissolveEdges: (id,edges) =>void;dump: (id) =>string;edgeCount: (id) =>number;edgesWithBothEndpointsInBox: (id,min,max) =>Uint32Array;edgeVertices: (id) =>Uint32Array;extrude: (id,faces,thickness) =>void;extrudeEdges: (id,edges,dx,dy,dz,distance) =>void;faceCount: (id) =>number;faceOffsets: (id) =>Uint32Array;faceVertices: (id) =>Uint32Array;free: (id) =>boolean;fromBrep: (document) =>number;fromTriangleMesh: (positions,indices,uvs) =>number;intersect: (id,positions,indices) =>number;isSolid: (id) =>boolean;lattice: (id,options_json) =>void;load: (json) =>number;positions: (id) =>Float64Array;reverse: (id) =>number;splitByPlane: (id,plane) =>string;subdivide: (id,options_json) =>void;subtract: (id,positions,indices) =>number;surfaceArea: (id) =>number;sweep: (path,profile,caps) =>number;tessellate: (mesh) =>TriangleMesh;tessellateJson: (id) =>string;thicken: (id,thickness,options_json) =>void;toBrep: (handle) =>unknown[];transform: (id,matrix) =>number;transformVertices: (id,vertices,matrix) =>void;union: (id,positions,indices) =>number;uvApply: (matrix,x,y,z) =>Float64Array;uvFromOrigin: (origin_x,origin_y,origin_z,u_axis_x,u_axis_y,u_axis_z,v_axis_x,v_axis_y,v_axis_z) =>Float64Array;uvPlanar: (u_axis_x,u_axis_y,u_axis_z,v_axis_x,v_axis_y,v_axis_z,u_offset,v_offset) =>Float64Array;vertexCount: (id) =>number;verticesInBox: (id,min,max) =>Uint32Array;volume: (id) =>number; }
bevel
bevel: (
id,edges,radius,segments,radius2?) =>void=wasm.mesh_bevel
mesh.bevel(edges, radius, segments, radius2?). edges are indices into mesh.edges.
Parameters
id
number
edges
Uint32Array
radius
number
segments
number
radius2?
number | null
Returns
void
bevelVertices
bevelVertices: (
id,vertices,radius,segments) =>void=wasm.mesh_bevel_vertices
mesh.bevelVertices(vertices, radius, segments). vertices are indices into mesh.vertices.
Parameters
id
number
vertices
Uint32Array
radius
number
segments
number
Returns
void
boundingBox
boundingBox: (
id) =>Float64Array=wasm.mesh_bounding_box
Mesh.boundingBox — [minX, minY, minZ, maxX, maxY, maxZ].
Parameters
id
number
Returns
Float64Array
box
box: (
width,depth,height) =>number=wasm.mesh_box
Mesh.box — axis-aligned box centered on the origin.
Parameters
width
number
depth
number
height
number
Returns
number
chamfer
chamfer: (
id,edges,distance1,distance2) =>void=wasm.mesh_chamfer
mesh.chamfer(edges, distance1, distance2). edges are indices into mesh.edges.
Parameters
id
number
edges
Uint32Array
distance1
number
distance2
number
Returns
void
clone
clone: (
id) =>number=wasm.mesh_clone
Mesh.clone — a topology rebuild, not a field copy.
Parameters
id
number
Returns
number
cone
cone: (
radius_bottom,radius_top,height,sides) =>number=wasm.mesh_cone
Mesh.cone — cone / frustum / cylinder by radii. sides is a f64 because the TS validates it with Number.isInteger and throws otherwise.
Parameters
radius_bottom
number
radius_top
number
height
number
sides
number
Returns
number
containsPoint
containsPoint: (
id,x,y,z) =>boolean=wasm.mesh_contains
Mesh.containsPoint.
Parameters
id
number
x
number
y
number
z
number
Returns
boolean
cornerCount
cornerCount: (
id) =>number=wasm.mesh_corner_count
mesh.corners.length.
Parameters
id
number
Returns
number
deleteVertices
deleteVertices: (
id,vertices) =>void=wasm.mesh_delete_vertices
deleteVertices(mesh, vertices). vertices are indices into mesh.vertices.
Parameters
id
number
vertices
Uint32Array
Returns
void
dissolveEdges
dissolveEdges: (
id,edges) =>void=wasm.mesh_dissolve_edges
dissolveEdges(mesh, edges). edges are indices into mesh.edges.
Parameters
id
number
edges
Uint32Array
Returns
void
dump
dump: (
id) =>string=wasm.mesh_dump
Mesh.toJSON — the MeshEntity payload of a live handle.
Parameters
id
number
Returns
string
edgeCount
edgeCount: (
id) =>number=wasm.mesh_edge_count
mesh.edges.length.
Parameters
id
number
Returns
number
edgesWithBothEndpointsInBox
edgesWithBothEndpointsInBox: (
id,min,max) =>Uint32Array=wasm.mesh_edges_with_both_endpoints_in_box
edgesWithBothEndpointsInBox(mesh, min, max) — the selected edges as indices into mesh.edges.
Parameters
id
number
min
Float64Array
max
Float64Array
Returns
Uint32Array
edgeVertices
edgeVertices: (
id) =>Uint32Array=wasm.mesh_edge_vertices
Every edge's two endpoint vertex INDICES (positions in mesh.vertices), concatenated in mesh.edges order: edge e is [2 * e, 2 * e + 1].
The pair is MeshEdge.vertex1, MeshEdge.vertex2 and those are UNORDERED — an edge records its endpoints, not a direction (the direction lives on the corners walking it). A caller mapping an (endpoint, endpoint) predicate onto edge indices for [mesh_bevel] or [mesh_dissolve_edges] must therefore accept either order.
Parameters
id
number
Returns
Uint32Array
extrude
extrude: (
id,faces,thickness) =>void=wasm.mesh_extrude
mesh.extrude(faces, thickness). faces are indices into mesh.faces.
Parameters
id
number
faces
Uint32Array
thickness
number
Returns
void
extrudeEdges
extrudeEdges: (
id,edges,dx,dy,dz,distance) =>void=wasm.mesh_extrude_edges
mesh.extrudeEdges(edges, direction, distance). edges are indices into mesh.edges.
Parameters
id
number
edges
Uint32Array
dx
number
dy
number
dz
number
distance
number
Returns
void
faceCount
faceCount: (
id) =>number=wasm.mesh_face_count
mesh.faces.length.
Parameters
id
number
Returns
number
faceOffsets
faceOffsets: (
id) =>Uint32Array=wasm.mesh_face_offsets
Start of each face inside [mesh_face_vertices], length faceCount + 1; face f spans [offsets[f], offsets[f + 1]).
Parameters
id
number
Returns
Uint32Array
faceVertices
faceVertices: (
id) =>Uint32Array=wasm.mesh_face_vertices
Every face's vertex INDICES (positions in mesh.vertices), concatenated in mesh.faces order and in each face's winding order. Slice face f with [mesh_face_offsets].
Parameters
id
number
Returns
Uint32Array
free
free: (
id) =>boolean=wasm.mesh_free
Drop a Mesh handle. False if the id was not live.
Parameters
id
number
Returns
boolean
fromBrep
fromBrep: (
document) =>number
B-Rep kernel document (one document or an array of them) → arena handle. Accepts a JSON string or a parsed value; objects are stringified. The typed door SHADOWS the generated mesh_from_brep (raw JSON string in).
Parameters
document
string | object
Returns
number
fromTriangleMesh
fromTriangleMesh: (
positions,indices,uvs) =>number=wasm.mesh_from_triangle_mesh
Mesh.fromTriangleMesh — rebuild half-edge topology from a triangle mesh. uvs is carried because the import FITS a per-face planar projection from the triangle's three (position, UV) samples; pass an empty array when the soup has none.
Parameters
positions
Float64Array
indices
Uint32Array
uvs
Float64Array
Returns
number
intersect
intersect: (
id,positions,indices) =>number=wasm.mesh_intersect
Mesh.intersect — the operand is a triangle mesh.
Parameters
id
number
positions
Float64Array
indices
Uint32Array
Returns
number
isSolid
isSolid: (
id) =>boolean=wasm.mesh_is_solid
Mesh.isSolid.
Parameters
id
number
Returns
boolean
lattice
lattice: (
id,options_json) =>void=wasm.mesh_lattice
mesh.lattice(options) — the wireframe modifier. options_json mirrors LatticeOptions; "" or "{}" means all defaults (and so an offset of 0, which lattice rejects, as the TS does).
Parameters
id
number
options_json
string
Returns
void
load
load: (
json) =>number=wasm.mesh_load
Mesh.fromJSON — parse a MeshEntity payload and return its handle.
Parameters
json
string
Returns
number
positions
positions: (
id) =>Float64Array=wasm.mesh_positions
Vertex positions of mesh.vertices, in order-array order: vertex index i is [3 * i, 3 * i + 2].
Parameters
id
number
Returns
Float64Array
reverse
reverse: (
id) =>number=wasm.mesh_reverse
Mesh.reverse — returns a NEW handle.
Parameters
id
number
Returns
number
splitByPlane
splitByPlane: (
id,plane) =>string=wasm.mesh_split_by_plane
Mesh.splitByPlane. above / below are registered Mesh handles the caller frees, or null; the boundary rings are the cut Path2d's plane-local 2D rings and boundaryTransformation its 16-number toWorld.
Parameters
id
number
plane
Float64Array
Returns
string
subdivide
subdivide: (
id,options_json) =>void=wasm.mesh_subdivide
mesh.subdivide(options) — Catmull-Clark. options_json mirrors SubdivideOptions; "" or "{}" means all defaults.
Parameters
id
number
options_json
string
Returns
void
subtract
subtract: (
id,positions,indices) =>number=wasm.mesh_subtract
Mesh.subtract — the operand is a triangle mesh.
Parameters
id
number
positions
Float64Array
indices
Uint32Array
Returns
number
surfaceArea
surfaceArea: (
id) =>number=wasm.mesh_surface_area
Mesh.surfaceArea.
Parameters
id
number
Returns
number
sweep
sweep: (
path,profile,caps) =>number=wasm.mesh_sweep
Mesh.sweep — sweep a 2D profile along a 2D path. Both are flat [x, y, ...] pairs.
Parameters
path
Float64Array
profile
Float64Array
caps
boolean
Returns
number
tessellate
tessellate: (
mesh) =>TriangleMesh
Tessellate an n-gon MeshData document into the canonical TriangleMesh — one-shot: the arena handle is loaded and freed inside the call.
The crate's wire format (MeshJson, what MeshData.load / .dump speak) keeps flat positions + faces with a parallel faceAttributes; MeshData stores vertices: MeshVertex[] and faces: MeshFace[]. This is the door, so packing vertices[i].position and the face reshape live here.
Parameters
mesh
Returns
tessellateJson
tessellateJson: (
id) =>string=wasm.mesh_tessellate_json
Mesh.tessellate as the FULL TriangleMeshJSON — groups / edges / faces / vertices included. The numeric channels agree with [mesh_tessellate] value for value; this is the same result, spelled in the wire format.
Parameters
id
number
Returns
string
thicken
thicken: (
id,thickness,options_json) =>void=wasm.mesh_thicken
mesh.thicken(thickness, options). options_json mirrors ThickenOptions; "" or "{}" means all defaults.
Parameters
id
number
thickness
number
options_json
string
Returns
void
toBrep
toBrep: (
handle) =>unknown[]
Arena handle → kernel documents (one per half-edge face). The typed door SHADOWS the generated mesh_to_brep (JSON string out).
Parameters
handle
number
Returns
unknown[]
transform
transform: (
id,matrix) =>number=wasm.mesh_transform
Mesh.transform — returns a NEW handle, as the TS returns a new Mesh.
Parameters
id
number
matrix
Float64Array
Returns
number
transformVertices
transformVertices: (
id,vertices,matrix) =>void=wasm.mesh_transform_vertices
transformVertices(mesh, vertices, matrix). vertices are indices into mesh.vertices.
Parameters
id
number
vertices
Uint32Array
matrix
Float64Array
Returns
void
union
union: (
id,positions,indices) =>number=wasm.mesh_union
Mesh.union — the operand is a triangle mesh, as in the TS (which tessellates whatever Shell it is handed). Only positions and indices are read: the cell-graph boolean emits input coordinates and segment interpolations, never a UV or a normal.
Parameters
id
number
positions
Float64Array
indices
Uint32Array
Returns
number
uvApply
uvApply: (
matrix,x,y,z) =>Float64Array=wasm.mesh_uv_apply
Mesh.uvApply(matrix, point) — apply a planar UV matrix to a 3D point.
matrix is [mesh_uv_planar]'s 16-element layout (uAxis rows 0–2, uOffset at 3, vAxis rows 4–6, vOffset at 7). Pure matrix×point for the planar affine encode — no multi-kind projector.
Parameters
matrix
Float64Array
x
number
y
number
z
number
Returns
Float64Array
uvFromOrigin
uvFromOrigin: (
origin_x,origin_y,origin_z,u_axis_x,u_axis_y,u_axis_z,v_axis_x,v_axis_y,v_axis_z) =>Float64Array=wasm.mesh_uv_from_origin
Mesh.uvFromOrigin(origin, uAxis, vAxis) — planar UV matrix whose origin maps to UV (0, 0). Offsets are the negated dots of each axis with the origin.
Parameters
origin_x
number
origin_y
number
origin_z
number
u_axis_x
number
u_axis_y
number
u_axis_z
number
v_axis_x
number
v_axis_y
number
v_axis_z
number
Returns
Float64Array
uvPlanar
uvPlanar: (
u_axis_x,u_axis_y,u_axis_z,v_axis_x,v_axis_y,v_axis_z,u_offset,v_offset) =>Float64Array=wasm.mesh_uv_planar
Mesh.uvPlanar(uAxis, vAxis, uOffset, vOffset) — public planar UV matrix. Layout: [ux, uy, uz, uOffset, vx, vy, vz, vOffset, 0,0,0,0, 0,0,0,1]. Apply as u = uAxis·p + uOffset, v = vAxis·p + vOffset (see [mesh_uv_apply]).
Parameters
u_axis_x
number
u_axis_y
number
u_axis_z
number
v_axis_x
number
v_axis_y
number
v_axis_z
number
u_offset
number
v_offset
number
Returns
Float64Array
vertexCount
vertexCount: (
id) =>number=wasm.mesh_vertex_count
mesh.vertices.length.
Parameters
id
number
Returns
number
verticesInBox
verticesInBox: (
id,min,max) =>Uint32Array=wasm.mesh_vertices_in_box
verticesInBox(mesh, min, max) — the selected vertices as indices into mesh.vertices.
Parameters
id
number
min
Float64Array
max
Float64Array
Returns
Uint32Array
volume
volume: (
id) =>number=wasm.mesh_volume
Mesh.volume.
Parameters
id
number
Returns
number
Point
Point:
namespaces/Point
Point2d
Point2d:
namespaces/Point2d
Surface
Surface:
namespaces/Surface
TriangleMesh
TriangleMesh:
namespaces/TriangleMesh
Vector
Vector: {
add: (left,right) =>Vector;angle: (from,to) =>number;between: (from,to) =>Vector;cross: (left,right) =>Vector;dot: (left,right) =>number;length: (vector) =>number;normalize: (vector) =>Vector;rotate: (vector,axis,angle) =>Vector;scale: (vector,factor) =>Vector;subtract: (left,right) =>Vector;transform: (vector,matrix) =>Vector; }
add
add: (
left,right) =>Vector
Parameters
left
right
Returns
angle
angle: (
from,to) =>number
Angle between two vectors, in DEGREES. Kernel angleTo is radians.
Parameters
from
to
Returns
number
between
between: (
from,to) =>Vector
Parameters
from
to
Returns
cross
cross: (
left,right) =>Vector
Parameters
left
right
Returns
dot
dot: (
left,right) =>number
Parameters
left
right
Returns
number
length
length: (
vector) =>number
Parameters
vector
Returns
number
normalize
normalize: (
vector) =>Vector
Parameters
vector
Returns
rotate
rotate: (
vector,axis,angle) =>Vector
Rotate vector around axis by angle radians.
Parameters
vector
axis
angle
number
Returns
scale
scale: (
vector,factor) =>Vector
Parameters
vector
factor
number
Returns
subtract
subtract: (
left,right) =>Vector
Parameters
left
right
Returns
transform
transform: (
vector,matrix) =>Vector
Parameters
vector
matrix
ArrayLike<number>
Returns
Vector2d
Vector2d:
namespaces/Vector2d