Parses an SVG document into one compound on the ground, ready to draw, extrude or transform.
faceStrategy decides which closed outlines become faces; unit, scale and flipY map SVG
units and its downward Y; alignment, direction, center and keepOrigin place it. A very
large file is read up to its limits; loadSVGStructured lists what was left out.
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 warnings, the view box and the page size in millimetres.
Use it when the elements need their own colors or separate handling; loadSVG gives the
whole drawing as one shape.
The SVG text and the import and placement options
The shapes with their styles, the warnings, the view box and the page size
Importing SVG drawings as OpenCascade shapes. The importer parses the document (paths, basic shapes, transforms, reused elements, nested viewports, units and the style cascade with CSS), 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.