/** * Generic 2D-path -> OCCT geometry builder. SVG-agnostic: it consumes the * Inputs.OCCT path vocabulary (line / quadratic / cubic / arc) and builds wires * and (optionally) faces, placed into 3D CAD space. * * The whole group set is encoded into a single flat command buffer and built in * one native call (BuildShapesFromSegments): each segment becomes exact geometry * (low-degree bezier / rational-conic arc), each subpath is optionally * concatenated into one BSpline, and closed groups optionally become faces with * holes. The native call returns a compound with one child per group, in order. */ import { BitbybitOcctModule, TopoDS_Shape } from "../../bitbybit-dev-occt/bitbybit-dev-occt"; import { OccHelper } from "../occ-helper"; import * as Inputs from "../api/inputs"; export interface BuiltElement { shape: TopoDS_Shape; isFace: boolean; } /** A group of subpaths that becomes one output shape (e.g. one SVG element). */ export interface PathGroup { subpaths: Inputs.OCCT.PathSubpath[]; makeFaces: boolean; } export declare class PathBuilder { private readonly occ; private readonly och; constructor(occ: BitbybitOcctModule, och: OccHelper); /** Map a 2D path-space point into 3D CAD space per placement options. */ private toCad; /** Apply uniform-scale + optional Y-flip + translate to an arc (analytic, exact). */ private placeArc; /** * Build one output shape per group in a single native call. Returns one entry * per input group, in order (undefined for a group that produced nothing). */ buildGroups(groups: PathGroup[], o: Inputs.OCCT.PathPlacementDto, opts: { joinSegments: boolean; tolerance: number; warnings: string[]; }): (BuiltElement | undefined)[]; /** Public generic entry: build a single shape from a ShapeFromPathDto. */ shapeFromPath(inputs: Inputs.OCCT.ShapeFromPathDto): TopoDS_Shape | undefined; }