Skip to content

Geometry Query

Geometry-kernel query namespace — read geometry, topology, and relationships as plain values or child handles (all-handle model). No query mutates its inputs. Accessed via snaptrude.core.geom.query.

Queries take opaque handles in and return either plain values (numbers, booleans, Vec3Components, BBoxComponents) or fresh child handles — see the Handles concept page. BREP topology handles (BrepHandle, FaceHandle, EdgeHandle, HalfEdgeHandle, VertexHandle) are session-ephemeral: obtain a BrepHandle via design.query.geometry.getBrep, walk it with the brep/face/edge/halfedge/vertex sub-namespaces, and note that these handles go stale on undo/redo/re-topologize.

Sub-namespaces

NamespaceDescription
curveShared line/arc queries and two-curve relationships — points, lengths, distances, parameters, predicates as plain values.
arcArc-specific reads — radius, centre, axis, sweep angle, validity.
circleCircle-specific reads — closed-circle properties as plain values (a circle is not part of the shared CurveHandle surface).
profileProfile reads — areas, perimeters, bounding boxes, child curves, and two-profile relationships.
contourContour reads (outer profile + holes) — child profiles, areas, and two-contour relationships.
brepBREP mesh topology + geometry — enumerate faces/edges/vertices/half-edges and read positions.
faceBREP face reads — boundary and hole loops, child topology handles.
edgeBREP edge reads — topology and geometry of a single edge.
halfedgeBREP half-edge walks — getNext/getPrev/getFlip traversals and reads.
vertexBREP vertex reads — topology and position of a single vertex.

Example

ts
// Walk a BREP from a scene component and read a vertex position
const brep = await snaptrude.design.query.geometry.getBrep(component);
const faces = await snaptrude.core.geom.query.brep.listFaces(brep);
const vertices = await snaptrude.core.geom.query.face.listVertices(faces[0]);
const position = await snaptrude.core.geom.query.vertex.getPosition(brep, vertices[0]);
// position is Vec3Components: { x, y, z } in Snaptrude units