editor › Globals › OutlineSection
Class: OutlineSection
Abstract base class representing the connection of two OutlinePoints.
Hierarchy
- OutlineSection
Index
Properties
Methods
- clearEdgeJoint
- clearOutline
- clearTeeJoint
- clone
- distanceToPoint
- distanceToPoint2D
- equalsSection
- getAdjacentSectionAt
- getCenterPosition
- getCenterPosition2D
- getDirection
- getDirection2D
- getEdgeJoint
- getEnd
- getInterpolatedPosition
- getInterpolatedPosition2D
- getJoinedSection
- getJoint
- getJointPossibility
- getJoints
- getLength
- getNextSection
- getNormal
- getNormal2D
- getOtherPoint
- getOutline
- getOutlinePoint
- getPlate
- getPrevSection
- getStart
- getTangent2DAt
- getTangentAt
- getTeeJoint
- hasSameDirectionAsJoinedSection
- intersectLine
- intersectLineSegment
- intersectPlane
- nearestOwnPointTo
- nearestOwnPointTo2D
- overlapsSection
- rasterize
- reverse
- setEdgeJoint
- setEnd
- setOutline
- setStart
- setTeeJoint
- toArray
- toArrayOfPositions
- translate
Properties
Protected edgeJoint
• edgeJoint: EdgeJoint | null = null
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:30
EdgeJoint connection to some other OutlineSection
Protected end
• end: OutlinePoint | null = null
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:27
End OutlinePoint
Protected outline
• outline: Outline | null = null
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:21
Outline this section belongs to
Protected start
• start: OutlinePoint | null = null
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:24
Start OutlinePoint
Protected teeJoint
• teeJoint: TeeJoint | null = null
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:33
TeeJoint connection to some other plate
Methods
clearEdgeJoint
▸ clearEdgeJoint(): void
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:329
Clears the assigned Edge joint. Should only be called by the associated EdgeJoint itself.
Returns: void
clearOutline
▸ clearOutline(): void
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:151
Clears the reference to the outline. This method should only be used by the Outline
Returns: void
clearTeeJoint
▸ clearTeeJoint(): void
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:336
Clears the assigned TeeJoint. Should only be called by the associated TeeJoint itself.
Returns: void
Abstract clone
▸ clone(): any
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:92
Returns: any
Abstract distanceToPoint
▸ distanceToPoint(point: Vector3, clampToLine?: boolean): number
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:41
Computes the distance of this OutlineSection to the given point.
Parameters:
| Name | Type | Description |
|---|---|---|
point |
Vector3 | Point to compute distance to (assembly-coordinates) |
clampToLine? |
boolean | (optional) Whether to clamp the returned value to the line segment, defaults to true |
Returns: number
Distance between point and this OutlineSection
Abstract distanceToPoint2D
▸ distanceToPoint2D(point: Vector3): number
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:48
Computes the distance of this OutlineSection to the given point (in local coordinates).
Parameters:
| Name | Type | Description |
|---|---|---|
point |
Vector3 | Point to compute distance to (local coordinates) |
Returns: number
Distance between point and this OutlineSection
equalsSection
▸ equalsSection(otherSection: OutlineSection, sameAssembly: boolean): boolean
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:452
Determine if this section is equal to otherSection in positions of start and end point in 3D.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
otherSection |
OutlineSection | - | - |
sameAssembly |
boolean | true | If true, the two sections will be considered to be in the same assembly coordinate system. Defaults to true. |
Returns: boolean
Whether the sections are equal in positions
getAdjacentSectionAt
▸ getAdjacentSectionAt(point: OutlinePoint): OutlineSection | null
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:398
Gets the next or prev section, depending on the outlinePoint provided to "jump over". The provided point doesn't need to be one of my endpoints, just having the same coordinates is also ok.
Parameters:
| Name | Type | Description |
|---|---|---|
point |
OutlinePoint | should be at the 3D position of either this.start or this.end |
Returns: OutlineSection | null
an adjacent OutlineSection of me, or null if
getCenterPosition
▸ getCenterPosition(): Vector3‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:187
Returns: Vector3‹›
getCenterPosition2D
▸ getCenterPosition2D(): Vector3‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:195
Returns: Vector3‹›
getDirection
▸ getDirection(targetVector: Vector3‹›): Vector3‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:229
Returns the direction of this OutlineSection in 3D assembly coordinates.
Parameters:
| Name | Type | Default |
|---|---|---|
targetVector |
Vector3‹› | new Vector3() |
Returns: Vector3‹›
Direction
getDirection2D
▸ getDirection2D(targetVector: Vector3‹›): Vector3‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:238
Returns the direction of this OutlineSection in 2D outline coordinates.
Parameters:
| Name | Type | Default |
|---|---|---|
targetVector |
Vector3‹› | new Vector3() |
Returns: Vector3‹›
getEdgeJoint
▸ getEdgeJoint(): EdgeJoint‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:281
Returns: EdgeJoint‹›
getEnd
▸ getEnd(): OutlinePoint‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:175
Returns: OutlinePoint‹›
getInterpolatedPosition
▸ getInterpolatedPosition(alpha: number): Vector3
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:191
Parameters:
| Name | Type |
|---|---|
alpha |
number |
Returns: Vector3
getInterpolatedPosition2D
▸ getInterpolatedPosition2D(alpha: number): Vector3
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:199
Parameters:
| Name | Type |
|---|---|
alpha |
number |
Returns: Vector3
getJoinedSection
▸ getJoinedSection(): OutlineSection | null
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:344
Gets the OutlineSection this section is joint to via its EdgeJoint (or null).
Returns: OutlineSection | null
Other section connected by EdgeJoint
getJoint
▸ getJoint(jointClass: any): EdgeJoint‹› | TeeJoint‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:293
Parameters:
| Name | Type |
|---|---|
jointClass |
any |
Returns: EdgeJoint‹› | TeeJoint‹›
getJointPossibility
▸ getJointPossibility(point: Vector3): object | null
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:356
Parameters:
| Name | Type | Description |
|---|---|---|
point |
Vector3 | 3D interaction point in assembly space |
Returns: object | null
Joint possibility for this OutlineLine, or null, if no plate is assigned or this section is already joined to some other plate
getJoints
▸ getJoints(): (EdgeJoint‹› | TeeJoint‹›)[]
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:289
Returns: (EdgeJoint‹› | TeeJoint‹›)[]
Abstract getLength
▸ getLength(): number
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:83
Returns: number
the length of this outline section
getNextSection
▸ getNextSection(): OutlineSection‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:384
Returns: OutlineSection‹›
getNormal
▸ getNormal(target: Vector3‹›): Vector3‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:261
Returns the normal (outward facing, orthogonal on side of Plate) of this OutlineSection in 3D assembly coordinates.
Parameters:
| Name | Type | Default |
|---|---|---|
target |
Vector3‹› | new Vector3() |
Returns: Vector3‹›
getNormal2D
▸ getNormal2D(target: Vector3‹›): Vector3‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:276
Returns the normal (outward facing) of this OutlineSection in 2D plate-local coordinates Warning: Outlines that are CW will have their normals point inwards (for cutouts in plates).
Parameters:
| Name | Type | Default |
|---|---|---|
target |
Vector3‹› | new Vector3() |
Returns: Vector3‹›
getOtherPoint
▸ getOtherPoint(point: OutlinePoint): OutlinePoint‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:215
Parameters:
| Name | Type |
|---|---|
point |
OutlinePoint |
Returns: OutlinePoint‹›
getOutline
▸ getOutline(): Outline‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:135
Returns: Outline‹›
getOutlinePoint
▸ getOutlinePoint(startOrEnd: "start" | "end"): OutlinePoint‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:179
Parameters:
| Name | Type |
|---|---|
startOrEnd |
"start" | "end" |
Returns: OutlinePoint‹›
getPlate
▸ getPlate(): Plate‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:127
Returns: Plate‹›
getPrevSection
▸ getPrevSection(): OutlineSection‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:388
Returns: OutlineSection‹›
getStart
▸ getStart(): OutlinePoint‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:159
Returns: OutlinePoint‹›
getTangent2DAt
▸ getTangent2DAt(x: number, targetVector?: Vector3): Vector3‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:254
Returns the 2D tangent (local space) at the parameter x on the outline section.
Parameters:
| Name | Type |
|---|---|
x |
number |
targetVector? |
Vector3 |
Returns: Vector3‹›
getTangentAt
▸ getTangentAt(x: number, targetVector?: Vector3): Vector3‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:247
Returns the 3D tangent (assembly space) at the parameter x on the outline section.
Parameters:
| Name | Type |
|---|---|
x |
number |
targetVector? |
Vector3 |
Returns: Vector3‹›
getTeeJoint
▸ getTeeJoint(): TeeJoint‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:285
Returns: TeeJoint‹›
hasSameDirectionAsJoinedSection
▸ hasSameDirectionAsJoinedSection(): boolean
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:376
Returns: boolean
True, if this section and its joined section point in the same (assembly) direction - start and end point are at the same assembly coordinates, false if not.
Abstract intersectLine
▸ intersectLine(line: Line3): Vector3
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:90
Intersects this section with the line and returns the intersections
Parameters:
| Name | Type | Description |
|---|---|---|
line |
Line3 | Line (assembly space) to intersect OutlineSection with |
Returns: Vector3
Intersection or null if there was none
intersectLineSegment
▸ intersectLineSegment(lineSegment: Line3): Vector3‹›
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:99
Intersects this section with the line segment and returns the intersections.
Parameters:
| Name | Type | Description |
|---|---|---|
lineSegment |
Line3 | Line segment (assembly space) to intersect OutlineSection with |
Returns: Vector3‹›
Intersection or null if there was none
Abstract intersectPlane
▸ intersectPlane(plane: Plane, epsilon?: number): Vector3
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:78
Intersects this section with the plane and returns the intersection point
Parameters:
| Name | Type | Description |
|---|---|---|
plane |
Plane | Plane (assembly space) to intersect OutlineSection with |
epsilon? |
number | - |
Returns: Vector3
Intersection point between this section and the plane. In assembly space
Abstract nearestOwnPointTo
▸ nearestOwnPointTo(point: Vector3): Vector3
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:55
Computes the point on this OutlineSection that has the minimal distance to the specified point
Parameters:
| Name | Type | Description |
|---|---|---|
point |
Vector3 | Reference point, in assembly coordinates |
Returns: Vector3
Nearest point on outline, in assembly coordinates
Abstract nearestOwnPointTo2D
▸ nearestOwnPointTo2D(point: Vector3, target?: Vector3): Vector3
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:63
Computes the point on this OutlineSection that has the minimal distance to the specified point
Parameters:
| Name | Type | Description |
|---|---|---|
point |
Vector3 | Reference point, in local coordinates |
target? |
Vector3 | (optional) Will be used to store the result |
Returns: Vector3
Nearest point on outline, in local coordinates
overlapsSection
▸ overlapsSection(otherSection: OutlineSection, sameAssembly: boolean): boolean
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:428
Determine if this section is parallel to otherSection and they touch in more than one point
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
otherSection |
OutlineSection | - | Other section, has to be in the same assembly as this section |
sameAssembly |
boolean | true | (optional) If true, the two sections will be considered to be in the same assembly coordinate system. Defaults to true. |
Returns: boolean
Whether the sections have a shared segment or not
Abstract rasterize
▸ rasterize(includeEnd?: boolean): Vector3[]
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:71
Rasterizes this OutlineSection and returns it as an array of Vector3 objects. The start position must be part of the result. The end point is included depending on includeEnd.
Parameters:
| Name | Type | Description |
|---|---|---|
includeEnd? |
boolean | (optional) If true, the end of this section will be included in the return value |
Returns: Vector3[]
Rasterized points
reverse
▸ reverse(): void
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:414
Swaps start and end of this section This needs to handled with care as usually all sections in an Outline need to be reversed at the same time. Otherwise, there might be OutlinePoints, that have an invalid start/end.
Returns: void
setEdgeJoint
▸ setEdgeJoint(edgeJoint: EdgeJoint): void
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:302
Set the EdgeJoint this section is connected with. This setter should only be used by the future EdgeJoint.
Parameters:
| Name | Type | Description |
|---|---|---|
edgeJoint |
EdgeJoint | New EdgeJoint |
Returns: void
setEnd
▸ setEnd(end: OutlinePoint): this
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:209
Sets the ending OutlinePoint of this OutlineSection and also sets the ending OutlineSection of that point for consistency.
Parameters:
| Name | Type | Description |
|---|---|---|
end |
OutlinePoint | Ending point |
Returns: this
Returns this to allow chaining
setOutline
▸ setOutline(outline: Outline): void
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:143
Sets the outline this section belongs to. This setter should only be used by the future Outline.
Parameters:
| Name | Type | Description |
|---|---|---|
outline |
Outline | New Outline |
Returns: void
setStart
▸ setStart(start: OutlinePoint): this
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:169
Sets the starting OutlinePoint of this OutlineSection and also sets the starting OutlineSection of that point for consistency.
Parameters:
| Name | Type | Description |
|---|---|---|
start |
OutlinePoint | Starting point |
Returns: this
Returns this to allow chaining
setTeeJoint
▸ setTeeJoint(teeJoint: TeeJoint): void
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:316
Set the TeeJoint this section is connected with. This setter should only be used by the TeeJoint.
Parameters:
| Name | Type | Description |
|---|---|---|
teeJoint |
TeeJoint | New TeeJoint |
Returns: void
toArray
▸ toArray(): [OutlinePoint, OutlinePoint]
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:481
Returns: [OutlinePoint, OutlinePoint]
toArrayOfPositions
▸ toArrayOfPositions(): [Vector3, Vector3]
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:485
Returns: [Vector3, Vector3]
translate
▸ translate(translation: Vector3): void
Defined in src/model/data/PhysicalObject/Outline/OutlineSection.ts:119
Translates this OutlineSection by applying the translation to both end points' 3D positions.
Parameters:
| Name | Type | Description |
|---|---|---|
translation |
Vector3 | Translation to apply |
Returns: void