Parses an SVG document and builds every drawable element into one compound shape on the ground plane, ready to draw, extrude or transform as a whole.
faceStrategy decides whether closed outlines become faces, scale and flipY map SVG
units and its downward Y axis, and alignment, direction and center place the result.
Invisible elements are skipped unless asked for.
The SVG text and the import and placement options
One compound holding every element
const drawing = await bitbybit.occt.svg.loadSVG({
svg: svgText,
faceStrategy: Bit.Inputs.OCCT.svgFaceStrategyEnum.auto,
makeRibbons: false,
includeInvisible: false,
joinSegments: true,
tolerance: 1e-7,
scale: 0.1,
flipY: true,
alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid,
direction: [0, 1, 0],
center: [0, 0, 0],
});
Parses an SVG document and builds one shape per drawable element, each bundled with its resolved fill, stroke and stroke width, plus the parse warnings and the SVG view box.
Use it when the elements need their own colors or separate handling; loadSVG gives the
whole drawing as one shape. Faces are built where the outline allows it.
The SVG text and the import and placement options
The shapes with their styles, the warnings and the view box
Importing SVG drawings as OpenCascade shapes. The importer parses the document (paths, basic shapes, transforms and the style cascade), reduces every element to the generic path vocabulary of
pathand builds wires, and faces where it can, laid on the ground plane and placed by the import options.loadSVGgives one compound for the whole drawing;loadSVGStructuredgives one shape per element with its fill and stroke.