editor › Globals › OutlineFactory
Class: OutlineFactory
Hierarchy
- OutlineFactory
Index
Methods
- _fromVector3Array
- fromExistingOutline2D
- fromExistingOutlineWorld3D
- fromNestedArray
- fromPoint3DArray
- fromPointArray
- fromSvgData
- fromUnsortedLineSegmentsArray
- fromUnsortedOutlineSectionsArray
- gum
- rectangle
- roundedRectangle
- square
Methods
Static _fromVector3Array
▸ _fromVector3Array(vectors: Vector3[], from3D: boolean, sectionBuilders: Array‹typeof OutlineSection›): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineFactory.ts:136
Creates an outline from the array of Vector3 instances.
Parameters:
| Name | Type | Default |
|---|---|---|
vectors |
Vector3[] | - |
from3D |
boolean | false |
sectionBuilders |
Array‹typeof OutlineSection› | [OutlineLine] |
Returns: Outline‹›
Static fromExistingOutline2D
▸ fromExistingOutline2D(outline: Outline): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineFactory.ts:114
Returns a new outline with duplicate OutlinePoints and Sections, but not shared vertex positions. Positions are taken from 2D.
Parameters:
| Name | Type |
|---|---|
outline |
Outline |
Returns: Outline‹›
Static fromExistingOutlineWorld3D
▸ fromExistingOutlineWorld3D(outline: Outline): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineFactory.ts:126
Use this to duplicate a plate to be at the same position as the specified outline. When creating a plate with the returned outline, it will perfectly overlap with the specified outline, however, its rotation may differ from the reference plate (see general-issues#115)
Parameters:
| Name | Type | Description |
|---|---|---|
outline |
Outline | - |
Returns: Outline‹›
Static fromNestedArray
▸ fromNestedArray(points: ArrayPoint2[]): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineFactory.ts:33
Creates a new outline from the given array in the form of [[x, y], …, [xn, yn]]
Parameters:
| Name | Type |
|---|---|
points |
ArrayPoint2[] |
Returns: Outline‹›
Static fromPoint3DArray
▸ fromPoint3DArray(points: readonly IPoint3[]): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineFactory.ts:25
Creates an outline from the array of (3D world coordinates) points (will cause the plate to be at the same position of these points)
Parameters:
| Name | Type |
|---|---|
points |
readonly IPoint3[] |
Returns: Outline‹›
Static fromPointArray
▸ fromPointArray(points: IPoint2[]): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineFactory.ts:16
Creates an outline from the array of points.
Parameters:
| Name | Type |
|---|---|
points |
IPoint2[] |
Returns: Outline‹›
Static fromSvgData
▸ fromSvgData(unitLength: number, center: IPoint2, outlineString: string): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineFactory.ts:58
Parameters:
| Name | Type | Description |
|---|---|---|
unitLength |
number | How many units is a 10mm line/cube wide? |
center |
IPoint2 | Point describing the {x, y} center of the outline |
outlineString |
string | Points string of a svg polygon describing the outline |
Returns: Outline‹›
Static fromUnsortedLineSegmentsArray
▸ fromUnsortedLineSegmentsArray(unsortedLineSegments: Array‹[Vector3, Vector3]›): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineFactory.ts:38
Parameters:
| Name | Type |
|---|---|
unsortedLineSegments |
Array‹[Vector3, Vector3]› |
Returns: Outline‹›
Static fromUnsortedOutlineSectionsArray
▸ fromUnsortedOutlineSectionsArray(outlineSections: OutlineSection[]): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineFactory.ts:46
Creates a new outline from the given array of unsorted and unconnected OutlineSections.
Parameters:
| Name | Type |
|---|---|
outlineSections |
OutlineSection[] |
Returns: Outline‹›
Static gum
▸ gum(width: number, height: number): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineFactory.ts:89
Parameters:
| Name | Type |
|---|---|
width |
number |
height |
number |
Returns: Outline‹›
Static rectangle
▸ rectangle(width: number, height: number): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineFactory.ts:77
Returns a rectangle-shaped outline centered around the origin
Parameters:
| Name | Type | Description |
|---|---|---|
width |
number | Width (x-length) of the rectangle, positive |
height |
number | Height (y-length) of the rectangle, positive |
Returns: Outline‹›
the rectangular outline
Static roundedRectangle
▸ roundedRectangle(width: number, height: number, radius: number): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineFactory.ts:158
Parameters:
| Name | Type |
|---|---|
width |
number |
height |
number |
radius |
number |
Returns: Outline‹›
Static square
▸ square(length: number): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineFactory.ts:106
Returns a square-shaped axis-aligned outline centered around the origin
Parameters:
| Name | Type | Description |
|---|---|---|
length |
number | Length of the square, positive |
Returns: Outline‹›
the squared outline