editor › Globals › RasterizedOutline
Class: RasterizedOutline
Approximates the outline (that may contain round segments, e.g. with bends) using only linear paths, represented by their vertices / points.
Hierarchy
- RasterizedOutline
Index
Constructors
Properties
- actualLengths
- appliedJointDispositions
- cachedAABB
- cachedPointArray
- mirrorMatrix
- mirrored
- originalOutline
- points
Methods
- _mapJointDispositions
- _resetCache
- applyMatrix4
- clone
- getAABB
- getActualLength
- getAppliedJointDispositions
- getLength
- getMirrorMatrix
- getOriginalOutline
- getPoints
- getPointsFromOutlineSection
- hasOutlineSection
- isMirrored
- normalize
- reverse
- setActualLength
- setMirrorMatrix
- setMirrored
- setOriginalOutline
- setPoints
- toArray
- translate
Constructors
constructor
+ new RasterizedOutline(points: RasterizedOutlinePoint[], originalOutline?: Outline, appliedJointDispositions: Map‹Joint, number›, mirrored: boolean, mirrorMatrix: Matrix4‹›): RasterizedOutline
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:48
Parameters:
| Name | Type | Default |
|---|---|---|
points |
RasterizedOutlinePoint[] | - |
originalOutline? |
Outline | - |
appliedJointDispositions |
Map‹Joint, number› | new Map |
mirrored |
boolean | false |
mirrorMatrix |
Matrix4‹› | new Matrix4() |
Returns: RasterizedOutline
Properties
Private actualLengths
• actualLengths: Map‹OutlineSection‹›, number› = new Map
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:45
Private Readonly appliedJointDispositions
• appliedJointDispositions: Map‹Joint, number›
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:33
Keeps track of dispositions on a per joint basis.
Private cachedAABB
• cachedAABB: AABB
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:47
Private cachedPointArray
• cachedPointArray: ArrayPoint2[]
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:48
Private mirrorMatrix
• mirrorMatrix: Matrix4
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:43
Keeps track of the applied mirroring matrix.
Private mirrored
• mirrored: boolean
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:38
Whether this outline has been mirrored or not.
Private originalOutline
• originalOutline: Outline | null = null
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:28
The original outline this rasterized outline is based upon. Optional, may not be set.
Private points
• points: RasterizedOutlinePoint[] | null = null
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:23
Rasterized points as an array of Vector3 objects
Methods
Private _mapJointDispositions
▸ _mapJointDispositions(sectionJointMap: Map‹Joint, Joint›): Map‹Joint‹›, number›
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:240
Parameters:
| Name | Type |
|---|---|
sectionJointMap |
Map‹Joint, Joint› |
Returns: Map‹Joint‹›, number›
Private _resetCache
▸ _resetCache(): void
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:251
Returns: void
applyMatrix4
▸ applyMatrix4(matrix: Matrix4): void
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:170
Parameters:
| Name | Type |
|---|---|
matrix |
Matrix4 |
Returns: void
clone
▸ clone(mapping?: object): RasterizedOutline
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:222
Creates either a shallow copy of this rasterized outline or - when a mapping is given - a copy with replaced outline sections according to the given map.
Parameters:
▪Optional mapping: object
new outline and joint mapping. originalOutline: The original outline that should be set on the copy. joints: A map from old to new joint which is used to replace outline sections.
| Name | Type |
|---|---|
joints |
Map‹Joint, Joint› |
originalOutline |
Outline |
Returns: RasterizedOutline
getAABB
▸ getAABB(): AABB‹›
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:138
Returns: AABB‹›
getActualLength
▸ getActualLength(outlineSection: OutlineSection): number
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:201
Parameters:
| Name | Type |
|---|---|
outlineSection |
OutlineSection |
Returns: number
getAppliedJointDispositions
▸ getAppliedJointDispositions(): Map‹Joint, number›
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:74
Returns: Map‹Joint, number›
getLength
▸ getLength(outlineSection: OutlineSection): number
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:205
Parameters:
| Name | Type |
|---|---|
outlineSection |
OutlineSection |
Returns: number
getMirrorMatrix
▸ getMirrorMatrix(): Matrix4
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:90
Returns: Matrix4
getOriginalOutline
▸ getOriginalOutline(): Outline
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:70
Returns: Outline
getPoints
▸ getPoints(): RasterizedOutlinePoint[]
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:145
Returns: RasterizedOutlinePoint[]
getPointsFromOutlineSection
▸ getPointsFromOutlineSection(outlineSection: OutlineSection): Vector3[]
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:156
Returns the (cloned) points defining the given outline section including the next point in the outline.
Parameters:
| Name | Type |
|---|---|
outlineSection |
OutlineSection |
Returns: Vector3[]
hasOutlineSection
▸ hasOutlineSection(outlineSection: OutlineSection): boolean
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:210
Parameters:
| Name | Type |
|---|---|
outlineSection |
OutlineSection |
Returns: boolean
isMirrored
▸ isMirrored(): boolean
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:82
Returns: boolean
normalize
▸ normalize(): void
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:115
Moves the points in this outline so that the smallest coordinates are 0.
Returns: void
reverse
▸ reverse(): void
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:178
Returns: void
setActualLength
▸ setActualLength(outlineSection: OutlineSection, actualLength: number): void
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:197
Parameters:
| Name | Type |
|---|---|
outlineSection |
OutlineSection |
actualLength |
number |
Returns: void
setMirrorMatrix
▸ setMirrorMatrix(matrix: Matrix4): void
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:86
Parameters:
| Name | Type |
|---|---|
matrix |
Matrix4 |
Returns: void
setMirrored
▸ setMirrored(mirrored: boolean): void
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:78
Parameters:
| Name | Type |
|---|---|
mirrored |
boolean |
Returns: void
setOriginalOutline
▸ setOriginalOutline(outline: Outline): void
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:66
Parameters:
| Name | Type |
|---|---|
outline |
Outline |
Returns: void
setPoints
▸ setPoints(points: RasterizedOutlinePoint[]): void
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:94
Parameters:
| Name | Type |
|---|---|
points |
RasterizedOutlinePoint[] |
Returns: void
toArray
▸ toArray(copy: boolean): ArrayPoint2[]
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:131
Creates a new array from this outline in the form of [[x, y], …, [xn, yn]]
Parameters:
| Name | Type | Default |
|---|---|---|
copy |
boolean | false |
Returns: ArrayPoint2[]
translate
▸ translate(translation: Vector3): void
Defined in src/model/data/PhysicalObject/Outline/RasterizedOutline.ts:123
Translates the whole rasterized outline by the given translation vector
Parameters:
| Name | Type |
|---|---|
translation |
Vector3 |
Returns: void