editor › Globals › OutlinePoint
Class: OutlinePoint
Represents a point in a Plate's Outline. Each OutlinePoint has a 2D (Plate-local) and 3D (Assembly-local) position. Those positions are identical until the OutlinePoint is assigned a Plate (via its Outline). Then, the Plate's transformations are used to convert and sync the two positions.
Hierarchy
↳ OutlinePoint
Index
Constructors
Properties
Methods
- _getIndex
- _update2DFrom3D
- _update3DFrom2D
- clearOutline
- clone
- closeTo
- destroy
- distanceTo
- distanceToPoint
- emitPositionChange
- emitPositionUpdate
- getEnding
- getMergedVertices
- getNext
- getOtherAdjacentSection
- getOutline
- getPlate
- getPosition
- getPosition2D
- getPosition3D
- getPositionChangeEventEmitter
- getPrev
- getStarting
- getVertexPosition
- isolate
- mergedTo
- setEnding
- setOutline
- setPosition
- setPosition2D
- setPosition3D
- setStarting
- split
- translate
- group
- merge
- unique
Constructors
constructor
+ new OutlinePoint(position2D: Vector3): OutlinePoint
Overrides Vertex.constructor
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:22
Parameters:
| Name | Type |
|---|---|
position2D |
Vector3 |
Returns: OutlinePoint
Properties
Private ending
• ending: OutlineSection | null
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:20
Private outline
• outline: Outline | null
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:16
Private position2D
• position2D: Vector3
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:22
Private starting
• starting: OutlineSection | null
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:18
Methods
_getIndex
▸ _getIndex(): number
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:157
Returns: number
_update2DFrom3D
▸ _update2DFrom3D(): void
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:164
Updates the 2D position of this OutlinePoint to match the 3D position.
Returns: void
_update3DFrom2D
▸ _update3DFrom2D(emitUpdate: boolean): void
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:176
Updates the 3D position of this OutlinePoint to match the 2D position.
Parameters:
| Name | Type | Default |
|---|---|---|
emitUpdate |
boolean | true |
Returns: void
clearOutline
▸ clearOutline(): void
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:90
Called when the point is removed from the outline (only to be called by the outline during removal)
Returns: void
clone
▸ clone(): OutlinePoint
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:48
Returns: OutlinePoint
closeTo
▸ closeTo(other: Vertex): boolean
Inherited from OutlinePoint.closeTo
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:220
Determines whether two vertices are close enough together to share their position.
Parameters:
| Name | Type |
|---|---|
other |
Vertex |
Returns: boolean
whether the two vertices are close together
destroy
▸ destroy(): void
Inherited from OutlinePoint.destroy
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:188
Returns: void
distanceTo
▸ distanceTo(otherVertex: Vertex): number
Inherited from OutlinePoint.distanceTo
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:280
Parameters:
| Name | Type |
|---|---|
otherVertex |
Vertex |
Returns: number
distanceToPoint
▸ distanceToPoint(point: Vector3): number
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:55
Parameters:
| Name | Type |
|---|---|
point |
Vector3 |
Returns: number
emitPositionChange
▸ emitPositionChange(): void
Inherited from OutlinePoint.emitPositionChange
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:180
Returns: void
emitPositionUpdate
▸ emitPositionUpdate(): void
Inherited from OutlinePoint.emitPositionUpdate
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:276
This will emit a forced position update
Returns: void
getEnding
▸ getEnding(): OutlineSection
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:108
Returns: OutlineSection
getMergedVertices
▸ getMergedVertices(this: OutlinePoint): readonly OutlinePoint[]
Inherited from OutlinePoint.getMergedVertices
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:260
Gets all vertices merged with this Vertex (including this Vertex).
Parameters:
| Name | Type |
|---|---|
this |
OutlinePoint |
Returns: readonly OutlinePoint[]
▸ getMergedVertices(this: Vertex): readonly Vertex[]
Inherited from OutlinePoint.getMergedVertices
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:261
Parameters:
| Name | Type |
|---|---|
this |
Vertex |
Returns: readonly Vertex[]
getNext
▸ getNext(): OutlinePoint‹›
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:149
Returns: OutlinePoint‹›
getOtherAdjacentSection
▸ getOtherAdjacentSection(section: OutlineSection): OutlineSection‹›
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:126
Parameters:
| Name | Type | Description |
|---|---|---|
section |
OutlineSection | one of the sections that are adjacent to this OutlinePoint |
Returns: OutlineSection‹›
the other section that is adjacent to this OutlinePoint
getOutline
▸ getOutline(): Outline
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:67
Returns: Outline
getPlate
▸ getPlate(): Plate | null
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:63
Gets the Plate of the outline this point belongs to (or null).
Returns: Plate | null
the Plate
getPosition
▸ getPosition(targetVector?: Vector3): Vector3‹›
Inherited from OutlinePoint.getPosition
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:245
Gets the position of this Vertex.
Parameters:
| Name | Type | Description |
|---|---|---|
targetVector? |
Vector3 | Optional target object |
Returns: Vector3‹›
the vertex position
getPosition2D
▸ getPosition2D(targetVector: Vector3‹›): Vector3‹›
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:136
Parameters:
| Name | Type | Default |
|---|---|---|
targetVector |
Vector3‹› | new Vector3() |
Returns: Vector3‹›
getPosition3D
▸ getPosition3D(target?: Vector3): Vector3‹›
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:32
Parameters:
| Name | Type |
|---|---|
target? |
Vector3 |
Returns: Vector3‹›
getPositionChangeEventEmitter
▸ getPositionChangeEventEmitter(): IPublicEventEmitterInterface‹Vertex‹›[]›
Inherited from OutlinePoint.getPositionChangeEventEmitter
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:184
Returns: IPublicEventEmitterInterface‹Vertex‹›[]›
getPrev
▸ getPrev(): OutlinePoint‹›
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:153
Returns: OutlinePoint‹›
getStarting
▸ getStarting(): OutlineSection
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:94
Returns: OutlineSection
getVertexPosition
▸ getVertexPosition(): VertexPosition‹›
Inherited from OutlinePoint.getVertexPosition
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:269
Returns: VertexPosition‹›
isolate
▸ isolate(): void
Inherited from OutlinePoint.isolate
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:212
Removed this Vertex from its merged group and isolates it.
Returns: void
mergedTo
▸ mergedTo(other: Vertex): boolean
Inherited from OutlinePoint.mergedTo
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:236
Determines whether two vertices are merged.
Parameters:
| Name | Type |
|---|---|
other |
Vertex |
Returns: boolean
whether the two vertices are merged
setEnding
▸ setEnding(ending: OutlineSection): void
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:117
Sets the ending OutlineSection. This setter should only be called from the future ending OutlineSection of this OutlinePoint.
Parameters:
| Name | Type | Description |
|---|---|---|
ending |
OutlineSection | the new ending OutlineSection |
Returns: void
setOutline
▸ setOutline(outline: Outline, emitEvent: boolean): void
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:76
Sets the outline and updates the 3D position such that the 2D position remains unchanged.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
outline |
Outline | - | the new Outline this point belongs to |
emitEvent |
boolean | true | Whether to emit an event for this change |
Returns: void
setPosition
▸ setPosition(position: Vector3, emitUpdate: boolean): void
Inherited from OutlinePoint.setPosition
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:253
Set the position of this Vertex (and all merged vertices).
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
position |
Vector3 | - | - |
emitUpdate |
boolean | true | Whether to emit an position change event |
Returns: void
setPosition2D
▸ setPosition2D(position: Vector3): void
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:144
Sets the 3D position of the underlying Vertex such that the 2D position will be the given position.
Parameters:
| Name | Type |
|---|---|
position |
Vector3 |
Returns: void
setPosition3D
▸ setPosition3D(position: Vector3, emitUpdate?: boolean): void
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:42
Update the 3D position of the underlying Vertex. If no update is emitted, no 2D position gets updated (neither from this nor from any merged outline point)
Parameters:
| Name | Type | Description |
|---|---|---|
position |
Vector3 | - |
emitUpdate? |
boolean | - |
Returns: void
setStarting
▸ setStarting(starting: OutlineSection): void
Defined in src/model/data/PhysicalObject/Outline/OutlinePoint.ts:103
Sets the starting OutlineSection. This setter should only be called from the future starting OutlineSection of this OutlinePoint.
Parameters:
| Name | Type | Description |
|---|---|---|
starting |
OutlineSection | the new starting OutlineSection |
Returns: void
split
▸ split(): Vertex‹›[]
Inherited from OutlinePoint.split
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:205
Splits the group of merged vertices this Vertex belongs to into individual vertices.
Returns: Vertex‹›[]
list of split vertices
translate
▸ translate(translation: Vector3): void
Inherited from OutlinePoint.translate
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:227
Translates this Vertex by modifying its position.
Parameters:
| Name | Type |
|---|---|
translation |
Vector3 |
Returns: void
Static group
▸ group(vertices: readonly Vertex[]): Vertex‹›[][]
Inherited from OutlinePoint.group
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:112
Groups an array of vertices by their position.
Parameters:
| Name | Type | Description |
|---|---|---|
vertices |
readonly Vertex[] | the vertices to group |
Returns: Vertex‹›[][]
the vertices grouped by position
Static merge
▸ merge(vertices: Vertex[]): VertexPosition[]
Inherited from OutlinePoint.merge
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:133
Groups an array of vertices by their position and merges Vertices with the same position.
Parameters:
| Name | Type | Description |
|---|---|---|
vertices |
Vertex[] | the vertices to group and merge |
Returns: VertexPosition[]
the resulting VertexPositions
Static unique
▸ unique(vertices: Vertex[]): Vertex‹›[]
Inherited from OutlinePoint.unique
Defined in src/model/data/PhysicalObject/Outline/Vertex.ts:160
Selects and returns one representative Vertex per group of merged vertices.
Parameters:
| Name | Type | Description |
|---|---|---|
vertices |
Vertex[] | the vertices to group and select representatives for |
Returns: Vertex‹›[]
list of selected vertices (one per group)