Skip to content
Shapemetry

@huukhanhnguyen/types / geometry/brep

geometry/brep

AnalyticSurface

AnalyticSurface = { d: number; normal: Vector; type: "plane"; uvMax: [number, number]; uvMin: [number, number]; } | { axis: Vector; origin: Point; radius: number; type: "cylinder"; vRange: [number, number]; xAxis: Vector; yAxis: Vector; } | { apex: Point; axis: Vector; halfAngle: number; type: "cone"; vRange: [number, number]; xAxis: Vector; yAxis: Vector; } | { center: Point; radius: number; type: "sphere"; xAxis: Vector; yAxis: Vector; zAxis: Vector; } | { center: Point; majorRadius: number; minorRadius: number; type: "torus"; xAxis: Vector; yAxis: Vector; zAxis: Vector; }

The named analytic form of a document surface: a plane is already one, a revolve is RECOGNISED from its profile, a nurbs has none (null).

It exists because a document that stores a profile has to be recognised by anything that wants named parameters, and an exact-B-rep exchange format wants exactly that: STEP spells a cylinder CYLINDRICAL_SURFACE with an axis and a radius, not a swept profile. The recogniser itself (surfaceForm / analyticFromRevolve) is RUNTIME and lives in @huukhanhnguyen/geometry; this is the shape it — and the kernel's own BrepData.faceFormsJson — hand back, so a consumer can take its form from either source and switch once.


OrderableBrepDocument

OrderableBrepDocument = { edges: unknown[]; faces: { innerLoops: number[]; outerLoop: number; }[]; loops: { orientedEdges: { edge: number; }[]; }[]; shells: { faces: number[]; }[]; }

The tables a face/edge reorder walks: the BrepData slice it reads plus the DERIVED shell partition (classifyShells) handed alongside — BrepData itself stores no shells.

edges

edges: unknown[]

faces

faces: { innerLoops: number[]; outerLoop: number; }[]

innerLoops

innerLoops: number[]

outerLoop

outerLoop: number

loops

loops: { orientedEdges: { edge: number; }[]; }[]

orientedEdges

orientedEdges: { edge: number; }[]

shells

shells: { faces: number[]; }[]

faces

faces: number[]

Last updated: 📖 2 min readEdit on GitHub