Class: Outline
Defines a closed 3D shape consisting of OutlinePoints and OutlineSections.
Hierarchy
- any
↳ Outline
Index
Constructors
Properties
- cachedRasterizedOutline
- cachedSimpleRasterizedOutline
- createFrom3D
- plane
- plate
- points
- sections
- textureOrigin
Methods
- _addPoint
- _addSection
- _createEnlargedRasterizedOutline
- _ensureCCW
- _ensureCW
- _ensureWindingOrder
- _getAllowedEvents
- _getCornerAngle
- _getDirection
- _getNextPoint
- _getNextSection
- _getPoint
- _getPointIndex
- _getPrevPoint
- _getPrevSection
- _getSection
- _getVectorKey
- _isPlaneValid
- _removePoint
- _removeSection
- _resetCache
- _set
- _updatePlaneNormal
- _updatePointsFrom3D
- clearPlate
- clone
- closestOutlinePointTo
- contains
- contains2D
- emitShapeChange
- extendEnlargedRasterizedOutlineBy
- getAABB2D
- getArea
- getCenter
- getCenter2D
- getEnlargedRasterizedOutline
- getJointPossibilities
- getJointPossibility
- getOutline
- getPlane
- getPlate
- getPoints
- getPoints2D
- getPoints3D
- getRasterizedOutline
- getSectionIndex
- getSections
- getSimpleRasterizedOutline
- getTextureOffset
- insertPoint
- insertPointAfterPoint
- intersectLine
- intersectPlane
- isolate
- map2DToTexture
- mapTextureTo2D
- nearestOwnPointTo
- nearestOwnPointTo2D
- nearestOwnPointsTo
- removePoint
- removeZeroLengthSection
- replaceOutlinePointWithSection
- replaceSection
- replaceSections
- reverse
- rotate
- rotate2D
- rotateTextureOriginAroundPoint3D
- setCreateFrom3D
- setPlate
- setTextureOffset
- shiftIndices
- toSvg
- translate
- translate2D
- updatePointsFrom2D
- updatePointsFrom3D
- _mirrorRasterizedOutline
- mirrorRasterizedOutlineWithHoles
Constructors
constructor
+ new Outline(points: OutlinePoint[], sections: OutlineSection[], createFrom3D: boolean): Outline
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:85
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
points |
OutlinePoint[] | - | the points, that define this outline |
sections |
OutlineSection[] | - | the sections, that - based on the supplied points - define this outline |
createFrom3D |
boolean | false | whether points are in 3D assembly space (true) or in 2D local space (false). |
Returns: Outline
Properties
Private cachedRasterizedOutline
• cachedRasterizedOutline: RasterizedOutline | null = null
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:84
Private cachedSimpleRasterizedOutline
• cachedSimpleRasterizedOutline: RasterizedOutline | null = null
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:85
Private createFrom3D
• createFrom3D: boolean
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:82
Private plane
• plane: object | null = null
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:77
The plane to use for caching
Private plate
• plate: Plate | null = null
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:81
Plate that this Outline belongs to
Private points
• points: OutlinePoint[] = []
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:65
Array of OutlinePoints
Private sections
• sections: OutlineSection[] = []
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:69
Array of OutlineSections
Private textureOrigin
• textureOrigin: OutlinePoint‹› = new OutlinePoint(new Vector3())
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:73
Special point that keeps track of the initial origin of the Outline
Methods
Private _addPoint
▸ _addPoint(point: OutlinePoint, afterIndex: number, emitEvent: boolean): OutlinePoint
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1104
Adds an OutlinePoint, binds to the point's events
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
point |
OutlinePoint | - | the point to be added |
afterIndex |
number | this.points.length - 1 | after which index the point is being added (defaults to last position) |
emitEvent |
boolean | true | - |
Returns: OutlinePoint
Private _addSection
▸ _addSection(section: OutlineSection, afterIndex: number): OutlineSection
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1146
Adds an OutlineSection
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
section |
OutlineSection | - | Section to be added |
afterIndex |
number | this.sections.length - 1 | After which index the section is being added (defaults to last position) |
Returns: OutlineSection
Private _createEnlargedRasterizedOutline
▸ _createEnlargedRasterizedOutline(jointExtensionMap: Map‹Joint, number›, defaultExtension: number, cut: boolean): RasterizedOutline
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:982
Offset rasterized sections according to jointExtensionMap and intersect them/insert points to build an enlarged rasterized outline.
Parameters:
| Name | Type | Description |
|---|---|---|
jointExtensionMap |
Map‹Joint, number› | - |
defaultExtension |
number | Sections without joints will be extended by this value (eg used for parametric hole) |
cut |
boolean | How to handle gaps: use intersection point (false, default) or insert a segment (true) |
Returns: RasterizedOutline
Private _ensureCCW
▸ _ensureCCW(): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1295
Returns: void
Private _ensureCW
▸ _ensureCW(): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1289
Returns: void
Private _ensureWindingOrder
▸ _ensureWindingOrder(isCutout: boolean): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1281
Parameters:
| Name | Type |
|---|---|
isCutout |
boolean |
Returns: void
Private _getAllowedEvents
▸ _getAllowedEvents(): string[]
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1277
Used by EventMixin
Returns: string[]
Private _getCornerAngle
▸ _getCornerAngle(vec1: Vector3, vec2: Vector3): number
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1055
Parameters:
| Name | Type |
|---|---|
vec1 |
Vector3 |
vec2 |
Vector3 |
Returns: number
Private _getDirection
▸ _getDirection(): "CW" | "CCW" | null
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1301
Returns: "CW" | "CCW" | null
Private _getNextPoint
▸ _getNextPoint(point: OutlinePoint): OutlinePoint
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1221
Private getter for requesting the next OutlinePoint given some OutlinePoint.
Parameters:
| Name | Type | Description |
|---|---|---|
point |
OutlinePoint | Current point |
Returns: OutlinePoint
Next point
Private _getNextSection
▸ _getNextSection(section: OutlineSection): OutlineSection
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1249
Parameters:
| Name | Type |
|---|---|
section |
OutlineSection |
Returns: OutlineSection
Private _getPoint
▸ _getPoint(index: number, wrap: boolean): OutlinePoint
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1209
Private getter for requesting outline points by index. Invalid indices can optionally be mapped the range of valid indices.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
index |
number | - | the index of the OutlinePoint |
wrap |
boolean | true | map invalid indices to valid range |
Returns: OutlinePoint
the OutlinePoint at the given index (or null)
_getPointIndex
▸ _getPointIndex(point: OutlinePoint): number
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:962
Returns the internal index of the point within the Outline.
Parameters:
| Name | Type | Description |
|---|---|---|
point |
OutlinePoint | the point |
Returns: number
index of the point
Private _getPrevPoint
▸ _getPrevPoint(point: OutlinePoint): OutlinePoint
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1231
Private getter for requesting the previous OutlinePoint given some OutlinePoint.
Parameters:
| Name | Type | Description |
|---|---|---|
point |
OutlinePoint | Current point |
Returns: OutlinePoint
Previous point
Private _getPrevSection
▸ _getPrevSection(section: OutlineSection): OutlineSection
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1254
Parameters:
| Name | Type |
|---|---|
section |
OutlineSection |
Returns: OutlineSection
Private _getSection
▸ _getSection(index: number, wrap: boolean): OutlineSection
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1242
Private getter for requesting outline sections by index. Invalid indices can optionally be mapped the range of valid indices.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
index |
number | - | - |
wrap |
boolean | true | map invalid indices to valid range |
Returns: OutlineSection
the OutlineSection at the given index (or null)
Private _getVectorKey
▸ _getVectorKey(vector: Vector3): string
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1061
Parameters:
| Name | Type |
|---|---|
vector |
Vector3 |
Returns: string
Private _isPlaneValid
▸ _isPlaneValid(): boolean
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1173
This method checks whether all the outline points are in @plane with a very small tolerance. The tolerance is chosen deliberately small in order to leave a small margin for error. Rotations around the z axis will not be detected. Rotations by 180deg around x or y will not be detected. Movements of points within the plane will not be detected.
Returns: boolean
true, if the the plane is still valid, false otherwise
Private _removePoint
▸ _removePoint(point: OutlinePoint): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1130
Removes a point from the outline, unbinds from events and clears the outline reference
Parameters:
| Name | Type |
|---|---|
point |
OutlinePoint |
Returns: void
Private _removeSection
▸ _removeSection(section: OutlineSection): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1154
Parameters:
| Name | Type |
|---|---|
section |
OutlineSection |
Returns: void
Private _resetCache
▸ _resetCache(): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1323
Returns: void
Private _set
▸ _set(points: OutlinePoint[], sections: OutlineSection[]): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1068
Sets the points and sections of this outline.
Parameters:
| Name | Type |
|---|---|
points |
OutlinePoint[] |
sections |
OutlineSection[] |
Returns: void
Private _updatePlaneNormal
▸ _updatePlaneNormal(): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1194
Negates @plane normal if necessary to maintain outline rotation
Returns: void
Private _updatePointsFrom3D
▸ _updatePointsFrom3D(): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:1262
Updates all outline points' 2D positions from their respective 3D positions.
Returns: void
clearPlate
▸ clearPlate(): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:468
Returns: void
clone
▸ clone(): Outline
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:879
Returns: Outline
closestOutlinePointTo
▸ closestOutlinePointTo(referencePoint: Vector3): OutlinePoint
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:857
Parameters:
| Name | Type |
|---|---|
referencePoint |
Vector3 |
Returns: OutlinePoint
contains
▸ contains(point: Vector3, tolerance2D: number, toleranceZ: any): boolean
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:724
Determines whether a point in assembly coordinates is on or inside the outline
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
point |
Vector3 | - | point in assembly coordinates |
tolerance2D |
number | 0 | optional, determines how far away from outline the point can be |
toleranceZ |
any | null | optional, determines how far above or below the outline the point can be |
Returns: boolean
true if the point is contained inside the outline
contains2D
▸ contains2D(localPoint: Vector3, tolerance2D: number, toleranceZ: any): boolean
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:736
Determines whether a point in local coordinates is on or inside the outline
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
localPoint |
Vector3 | - | point in assembly coordinates |
tolerance2D |
number | 0 | optional, determines how far away from outline the point can be tolerance2D > 0 scales the outline up, tolerance2D < 0 scales the outline down |
toleranceZ |
any | null | optional, overwrites how far above or below the outline the point can be |
Returns: boolean
Whether the point is contained inside the outline
emitShapeChange
▸ emitShapeChange(movedPoints: OutlinePoint[]): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:933
Parameters:
| Name | Type | Default |
|---|---|---|
movedPoints |
OutlinePoint[] | [] |
Returns: void
extendEnlargedRasterizedOutlineBy
▸ extendEnlargedRasterizedOutlineBy(rasterizedOutlineWithHoles: RasterizedOutlineWithHoles, jointExtensionMap: Map‹Joint, number›, defaultExtension: number, cut: boolean): RasterizedOutlineWithHoles
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:320
Returns a copy of the passed RasterizedOutlineWithHoles that is extended/shortened as specified by the joint extension map and takes any already applied joint dispositions or mirror operations into account.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
rasterizedOutlineWithHoles |
RasterizedOutlineWithHoles | - | RasterizedOutlineWithHoles that will be extended/shortened |
jointExtensionMap |
Map‹Joint, number› | - | defines dispositions per joint, positive will extend, negative will shrink |
defaultExtension |
number | 0 | - |
cut |
boolean | false | - |
Returns: RasterizedOutlineWithHoles
getAABB2D
▸ getAABB2D(): AABB
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:783
Get an axis-aligned bounding box of the outline point's 2D coordinates
Returns: AABB
getArea
▸ getArea(): number
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:869
Returns: number
getCenter
▸ getCenter(): Vector3
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:861
Returns: Vector3
getCenter2D
▸ getCenter2D(): Vector3
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:865
Returns: Vector3
getEnlargedRasterizedOutline
▸ getEnlargedRasterizedOutline(jointExtensions: Map‹Joint, number›, extendAllBy: number, fabricationConfig: FabricationConfig‹›, ignoreNegativeOffset: boolean, addOutlineDisposition: boolean, cut: boolean): RasterizedOutline
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:262
A Description would be cool!
ToDo: Handle failed shape changes
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
jointExtensions |
Map‹Joint, number› | new Map |
- |
extendAllBy |
number | 0 | - |
fabricationConfig |
FabricationConfig‹› | new FabricationConfig() | - |
ignoreNegativeOffset |
boolean | false | - |
addOutlineDisposition |
boolean | true | Whether reference (0) is at the finger end (true, default) or the original section position (false) |
cut |
boolean | false | - |
Returns: RasterizedOutline
getJointPossibilities
▸ getJointPossibilities(interactionPoint: Vector3): Array‹object›
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:516
Aggregates JointPossibilities from the various outline elements.
see PhysicalObject#getJointPossibilities
Parameters:
| Name | Type |
|---|---|
interactionPoint |
Vector3 |
Returns: Array‹object›
getJointPossibility
▸ getJointPossibility(interactionPoint: Vector3): object
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:485
Returns the SurfaceJointPossibility for this Outline.
Parameters:
| Name | Type | Description |
|---|---|---|
interactionPoint |
Vector3 | the 3D interaction point, in assembly coordinates |
Returns: object
the interaction possibility for this Outline plus the distance to the interaction point
-
distance: number
-
jointPossibility: typeof SurfaceJointPossibility
getOutline
▸ getOutline(): Outline
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:475
Returns: Outline
getPlane
▸ getPlane(forceUpdate: boolean): object
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:384
Fits a plane through all outline points.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
forceUpdate |
boolean | false | ignore any cached value |
Returns: object
the center of points, plane (normal and constant) and the sum of squared distances
-
center: Vector3
-
constant: number
-
normal: Vector3
-
squaredDistances: number
getPlate
▸ getPlate(): Plate
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:435
Returns: Plate
getPoints
▸ getPoints(): OutlinePoint[]
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:531
Returns a set of OutlinePoints
Returns: OutlinePoint[]
Points of this Outline (warning: original array instance, no clone)
getPoints2D
▸ getPoints2D(): Vector3[]
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:538
Returns the OutlinePoints mapped to their local positions
Returns: Vector3[]
getPoints3D
▸ getPoints3D(): Vector3[]
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:545
Returns the OutlinePoints mapped to their Assembly positions
Returns: Vector3[]
getRasterizedOutline
▸ getRasterizedOutline(): RasterizedOutline
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:240
Rasterizes each OutlineSection and creates a RasterizedOutline from the results.
Returns: RasterizedOutline
the rasterized 2D outline
getSectionIndex
▸ getSectionIndex(section: OutlineSection): number
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:971
Returns the internal index of the section within the Outline.
Parameters:
| Name | Type | Description |
|---|---|---|
section |
OutlineSection | the section |
Returns: number
index of the section
getSections
▸ getSections(): OutlineSection[]
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:552
Returns: OutlineSection[]
The sections of this Outline (warning: original array instance, no clone)
getSimpleRasterizedOutline
▸ getSimpleRasterizedOutline(): RasterizedOutline
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:362
Creates a RasterizedOutline with max 5 points per section from the results.
Returns: RasterizedOutline
the rasterized 2D outline
getTextureOffset
▸ getTextureOffset(target: Vector3): Vector3
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:790
Parameters:
| Name | Type | Default |
|---|---|---|
target |
Vector3 | new Vector3() |
Returns: Vector3
the texture offset between 2D coordinates and the texture coordinates
insertPoint
▸ insertPoint(point: OutlinePoint, afterIndex: number, SectionType: object, emitChange: boolean): OutlineSection
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:110
Inserts an OutlinePoint and a new section and changes the original sections end
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
point |
OutlinePoint | - | that will be inserted into the outline |
afterIndex |
number | this.points.length - 1 | after which the point and new section will be inserted |
SectionType |
object | OutlineLine | kind of section that will be created |
emitChange |
boolean | true | - |
Returns: OutlineSection
newly inserted section
insertPointAfterPoint
▸ insertPointAfterPoint‹T›(point: OutlinePoint, afterPoint: OutlinePoint, SectionType: Constructor‹OutlineSection›): T
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:139
Inserts an OutlinePoint and a new section after another point
Type parameters:
▪ T: OutlineSection
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
point |
OutlinePoint | - | that will be inserted into the outline |
afterPoint |
OutlinePoint | - | part of this Outline, new point will be inserted after it |
SectionType |
Constructor‹OutlineSection› | OutlineLine | kind of section that will be created |
Returns: T
newly inserted section
intersectLine
▸ intersectLine(line: Line3): Vector3[]
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:597
Intersects line with all OutlineSections
Parameters:
| Name | Type | Description |
|---|---|---|
line |
Line3 | - |
Returns: Vector3[]
intersections
intersectPlane
▸ intersectPlane(plane: Plane, params: object): Array‹object›
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:561
Intersects a plane with all OutlineSections.
Parameters:
▪ plane: Plane
▪Default value params: object= {}
| Name | Type |
|---|---|
ignoreSegmentsInPlane? |
boolean |
tolerance? |
number |
Returns: Array‹object›
an array that, for each intersection, contains the section and the intersection point
isolate
▸ isolate(): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:232
Isolates all points of this Outline to allow the Outline to move freely.
Returns: void
map2DToTexture
▸ map2DToTexture(point: Vector3, target: Vector3): Vector3
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:808
Maps a point from outline 2D coordinates to texture coordinates
Parameters:
| Name | Type | Default |
|---|---|---|
point |
Vector3 | - |
target |
Vector3 | new Vector3() |
Returns: Vector3
mapTextureTo2D
▸ mapTextureTo2D(point: Vector3, target: Vector3): Vector3
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:816
Maps a point from texture coordinates to outline 2D coordinates
Parameters:
| Name | Type | Default |
|---|---|---|
point |
Vector3 | - |
target |
Vector3 | new Vector3() |
Returns: Vector3
nearestOwnPointTo
▸ nearestOwnPointTo(referencePoint: Vector3): object
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:825
Parameters:
| Name | Type | Description |
|---|---|---|
referencePoint |
Vector3 | the reference point in assembly coordinates |
Returns: object
point and section with the minimum distance
-
point: Vector3
-
section: OutlineSection
nearestOwnPointTo2D
▸ nearestOwnPointTo2D(referencePoint: Vector3): object
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:849
Parameters:
| Name | Type | Description |
|---|---|---|
referencePoint |
Vector3 | the reference point in local coordinates |
Returns: object
point and section with the minimum distance
-
point: Vector3
-
section: OutlineSection
nearestOwnPointsTo
▸ nearestOwnPointsTo(referencePoint: Vector3): Array‹object›
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:837
Parameters:
| Name | Type | Description |
|---|---|---|
referencePoint |
Vector3 | the reference point in assembly coordinates |
Returns: Array‹object›
points with the minimum distance on all sections
removePoint
▸ removePoint(point: OutlinePoint): OutlineLine
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:407
Removes the point and its two adjacent sections from the outline. Adds a new OutlineLine to close the gap.
Parameters:
| Name | Type | Description |
|---|---|---|
point |
OutlinePoint | to be removed |
Returns: OutlineLine
the line that was created to close the gap
removeZeroLengthSection
▸ removeZeroLengthSection(section: OutlineSection): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:423
Removes the section and closes the gap by reconnecting the two neighboring sections.
Parameters:
| Name | Type | Description |
|---|---|---|
section |
OutlineSection | to be removed. Must have length 0 |
Returns: void
replaceOutlinePointWithSection
▸ replaceOutlinePointWithSection(outlinePoint: OutlinePoint, replacementSection: OutlineSection): OutlinePoint
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:613
Inserts replacementSection at outlinePoint. It will end at outlinePoint and start at a newly created point.
Parameters:
| Name | Type |
|---|---|
outlinePoint |
OutlinePoint |
replacementSection |
OutlineSection |
Returns: OutlinePoint
the newly created outline point, the start of replacementSection
replaceSection
▸ replaceSection(originalSection: OutlineSection, replacementSections: OutlineSection[], silenceUpdate: boolean): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:640
Replaces an outlineSection with an array of new sections
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
originalSection |
OutlineSection | - | section to be replaced |
replacementSections |
OutlineSection[] | - | sections that will replace the original section |
silenceUpdate |
boolean | false | - If true, no shapeChange event will be emitted. Use this if you want to replace multiple sections in one go without re-adjusting coordinates (since the plate centers itself) |
Returns: void
replaceSections
▸ replaceSections(originalSections: OutlineSection[], replacementSections: OutlineSection[], silenceUpdate: boolean): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:648
Parameters:
| Name | Type | Default |
|---|---|---|
originalSections |
OutlineSection[] | - |
replacementSections |
OutlineSection[] | - |
silenceUpdate |
boolean | false |
Returns: void
reverse
▸ reverse(): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:917
Reverses the outline: changes order of points and sections and switches start/end of each section Notice: Sections will be shifted by one, as the last section will stay the last section and just change direction - to ensure that the pattern "section X connects point X and X+1" will be kept - so sections A B C D will be reversed to C B A D
Returns: void
rotate
▸ rotate(rotation: Quaternion): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:181
Rotates this Outline by applying the rotation to the 3D position of each points.
Parameters:
| Name | Type | Description |
|---|---|---|
rotation |
Quaternion | the rotation to apply |
Returns: void
rotate2D
▸ rotate2D(rotation: Quaternion): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:196
Rotates this Outline by applying the rotation to the 2D position of each points.
Parameters:
| Name | Type | Description |
|---|---|---|
rotation |
Quaternion | the rotation to apply |
Returns: void
rotateTextureOriginAroundPoint3D
▸ rotateTextureOriginAroundPoint3D(rotationPoint: Vector3, deltaRotation: Quaternion): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:207
Parameters:
| Name | Type |
|---|---|
rotationPoint |
Vector3 |
deltaRotation |
Quaternion |
Returns: void
setCreateFrom3D
▸ setCreateFrom3D(value: boolean): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:929
Parameters:
| Name | Type |
|---|---|
value |
boolean |
Returns: void
setPlate
▸ setPlate(plate: Plate, isCutout: boolean, emit3DPointUpdate: boolean): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:447
Sets the Plate of this Outline. This setter should only be used by the future Plate of this Outline.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
plate |
Plate | - | - |
isCutout |
boolean | false | - |
emit3DPointUpdate |
boolean | true | If true and plate is created with 2D positions, will stop sending position update to the vertices changed in updatePointsFrom2D |
Returns: void
setTextureOffset
▸ setTextureOffset(__namedParameters: object): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:799
Updates the offset between 2D coordinates and the texture coordinates.
Parameters:
▪ __namedParameters: object
| Name | Type |
|---|---|
x |
any |
y |
any |
Returns: void
shiftIndices
▸ shiftIndices(startIndex: number): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:219
Shift outline points and sections around so that the point at startIndex is the first point, conserving the order
Parameters:
| Name | Type | Description |
|---|---|---|
startIndex |
number | point index that should be made the first |
Returns: void
toSvg
▸ toSvg(additionalPoints: Vector3[]): string
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:888
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
additionalPoints |
Vector3[] | [] | will be rendered as red circles |
Returns: string
translate
▸ translate(translation: Vector3): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:152
Translates this Outline by applying the translation to the 3D position of each points.
Parameters:
| Name | Type | Description |
|---|---|---|
translation |
Vector3 | translation to apply |
Returns: void
translate2D
▸ translate2D(translation: Vector3): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:165
Translates this Outline by applying the translation to the 2D position of each points.
Parameters:
| Name | Type | Description |
|---|---|---|
translation |
Vector3 | translation to apply |
Returns: void
updatePointsFrom2D
▸ updatePointsFrom2D(emitUpdate: boolean): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:941
Updates all outline points' 3D positions from their respective 2D positions.
Parameters:
| Name | Type | Default |
|---|---|---|
emitUpdate |
boolean | true |
Returns: void
updatePointsFrom3D
▸ updatePointsFrom3D(): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:953
Expose _updatePointsFrom3D for Plate._repositionInOutline only
Returns: void
Static Private _mirrorRasterizedOutline
▸ _mirrorRasterizedOutline(rasterizedOutline: RasterizedOutline, matrix: Matrix4): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:55
Parameters:
| Name | Type |
|---|---|
rasterizedOutline |
RasterizedOutline |
matrix |
Matrix4 |
Returns: void
Static mirrorRasterizedOutlineWithHoles
▸ mirrorRasterizedOutlineWithHoles(rasterizedOutlineWithHoles: RasterizedOutlineWithHoles, matrix: Matrix4): void
Defined in src/model/data/PhysicalObject/Outline/Outline.ts:47
Mirrors the passed RasterizedOutlineWithHoles according to the passed matrix.
Parameters:
| Name | Type | Description |
|---|---|---|
rasterizedOutlineWithHoles |
RasterizedOutlineWithHoles | RasterizedOutlineWithHoles that should be mirrored |
matrix |
Matrix4 | mirror matrix |
Returns: void