editor › Globals › SvgImporter
Class: SvgImporter
Hierarchy
- SvgImporter
Index
Methods
- _importSvgContextToModelElements
- _putPlatesInStacks
- importSvgToModelElements
- importSvgToPlateStacks
- segmentize
Methods
Static Private _importSvgContextToModelElements
▸ _importSvgContextToModelElements(svgContext: SvgContext, editor: Editor): Promise‹SvgSurfaceDescriptor[]›
Defined in src/workflow/SvgImporter.ts:90
Parameters:
| Name | Type |
|---|---|
svgContext |
SvgContext |
editor |
Editor |
Returns: Promise‹SvgSurfaceDescriptor[]›
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): Promise‹SvgSurfaceDescriptor[]›
Defined in src/workflow/SvgImporter.ts:35
Parameters:
| Name | Type |
|---|---|
svgString |
string |
editor |
Editor |
Returns: Promise‹SvgSurfaceDescriptor[]›
Static importSvgToPlateStacks
▸ importSvgToPlateStacks(svgString: string, editor: Editor): Promise‹PlateStack[]›
Defined in src/workflow/SvgImporter.ts:26
Parameters:
| Name | Type |
|---|---|
svgString |
string |
editor |
Editor |
Returns: Promise‹PlateStack[]›
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›