Skip to content

editorGlobalsSvgImporter

Class: SvgImporter

Hierarchy

  • SvgImporter

Index

Methods

Methods

Static Private _importSvgContextToModelElements

_importSvgContextToModelElements(svgContext: SvgContext, editor: Editor): PromiseSvgSurfaceDescriptor[]›

Defined in src/workflow/SvgImporter.ts:90

Parameters:

Name Type
svgContext SvgContext
editor Editor

Returns: PromiseSvgSurfaceDescriptor[]›


Static Private _putPlatesInStacks

_putPlatesInStacks(plates: SvgSurfaceDescriptor[], groups: Segment[][]): PlateStack[]

Defined in src/workflow/SvgImporter.ts:134

Parameters:

Name Type
plates SvgSurfaceDescriptor[]
groups Segment[][]

Returns: PlateStack[]


Static importSvgToModelElements

importSvgToModelElements(svgString: string, editor: Editor): PromiseSvgSurfaceDescriptor[]›

Defined in src/workflow/SvgImporter.ts:35

Parameters:

Name Type
svgString string
editor Editor

Returns: PromiseSvgSurfaceDescriptor[]›


Static importSvgToPlateStacks

importSvgToPlateStacks(svgString: string, editor: Editor): PromisePlateStack[]›

Defined in src/workflow/SvgImporter.ts:26

Parameters:

Name Type
svgString string
editor Editor

Returns: PromisePlateStack[]›


Static segmentize

segmentize(svgContext: SvgContext, centerPosition?: Vector2 | "middle"): Promise‹object›

Defined in src/workflow/SvgImporter.ts:49

Find segments in the given svg string and transforms them into kyub coordinates.

Parameters:

Name Type Description
svgContext SvgContext -
centerPosition? Vector2 | "middle" - If provided, will take this point (in SVG coordinates) as origin and transform the segment's coordinates accordingly. If not provided, a plateCenter object is taken as origin if it exists in the SVG. Else, the segment's AABB's center will be the coordinate origin. If 'center' is provided, it will take the SVG's center and will not try to guess it.

Returns: Promise‹object›