editor › Globals › CrossJointRenderer
Class: CrossJointRenderer
Renders CrossJoints on Plates
Hierarchy
↳ CrossJointRenderer
Index
Constructors
Properties
Methods
- _cutoutCornerPointsIfBothOverlap
- _cutoutCornerPointsIfIAmInside
- _cutoutCornerPointsIfTheOtherIsInside
- _getCutoutOuterPoints
- _getOuterPointsOfOutlineIntersection
- _getPointsInTheMiddle
- _getRect
- _isBetween
- _returnEmpty
- _whoIsInsideTheOther
- calculateFlexShapeChanges
- calculateShapeChanges
- canRender
Constructors
constructor
+ new CrossJointRenderer(jointInstance: CrossJoint): CrossJointRenderer
Inherited from JointRenderer.constructor
Defined in src/model/visualization/Joints/Renderer/JointRenderer.ts:33
Parameters:
| Name | Type |
|---|---|
jointInstance |
CrossJoint |
Returns: CrossJointRenderer
Properties
Protected Readonly jointInstance
• jointInstance: CrossJoint
Inherited from JointRenderer.jointInstance
Defined in src/model/visualization/Joints/Renderer/JointRenderer.ts:35
Methods
Private _cutoutCornerPointsIfBothOverlap
▸ _cutoutCornerPointsIfBothOverlap(physicalObject: PhysicalObject, left: Vector3, right: Vector3, otherLeft: Vector3, otherRight: Vector3, epsilon: number): [Vector3, Vector3]
Defined in src/model/visualization/Joints/Renderer/CrossJointRenderer.ts:238
Parameters:
| Name | Type |
|---|---|
physicalObject |
PhysicalObject |
left |
Vector3 |
right |
Vector3 |
otherLeft |
Vector3 |
otherRight |
Vector3 |
epsilon |
number |
Returns: [Vector3, Vector3]
Private _cutoutCornerPointsIfIAmInside
▸ _cutoutCornerPointsIfIAmInside(): [null, null]
Defined in src/model/visualization/Joints/Renderer/CrossJointRenderer.ts:224
Returns: [null, null]
Private _cutoutCornerPointsIfTheOtherIsInside
▸ _cutoutCornerPointsIfTheOtherIsInside(physicalObject: PhysicalObject, left: Vector3, right: Vector3): [Vector3, Vector3]
Defined in src/model/visualization/Joints/Renderer/CrossJointRenderer.ts:228
Parameters:
| Name | Type |
|---|---|
physicalObject |
PhysicalObject |
left |
Vector3 |
right |
Vector3 |
Returns: [Vector3, Vector3]
Private _getCutoutOuterPoints
▸ _getCutoutOuterPoints(amIInside: boolean, isTheOtherInside: boolean, selectedPhysicalObject: PhysicalObject, left: Vector3, right: Vector3, otherLeft: Vector3, otherRight: Vector3, epsilon: number): [Vector3, Vector3]
Defined in src/model/visualization/Joints/Renderer/CrossJointRenderer.ts:205
calculates corner points of the cutout
Parameters:
| Name | Type |
|---|---|
amIInside |
boolean |
isTheOtherInside |
boolean |
selectedPhysicalObject |
PhysicalObject |
left |
Vector3 |
right |
Vector3 |
otherLeft |
Vector3 |
otherRight |
Vector3 |
epsilon |
number |
Returns: [Vector3, Vector3]
localLeft is the inner point and localRight the outer point of the cutout both lie inside if they describe a hole.
Private _getOuterPointsOfOutlineIntersection
▸ _getOuterPointsOfOutlineIntersection(planeA: Plate, planeB: Plate): Vector3[]
Defined in src/model/visualization/Joints/Renderer/CrossJointRenderer.ts:132
calculates the intersection line of the two planes returns the outer intersection points of the line and the outlines of the two planes
Parameters:
| Name | Type |
|---|---|
planeA |
Plate |
planeB |
Plate |
Returns: Vector3[]
Private _getPointsInTheMiddle
▸ _getPointsInTheMiddle(array: [Vector3, Vector3, Vector3, Vector3]): [Vector3, Vector3]
Defined in src/model/visualization/Joints/Renderer/CrossJointRenderer.ts:71
The given four points form a line, this function returns the two in the middle
Parameters:
| Name | Type | Description |
|---|---|---|
array |
[Vector3, Vector3, Vector3, Vector3] | array has 4 elements |
Returns: [Vector3, Vector3]
the two elements in the middle of array
Private _getRect
▸ _getRect(localLeft: Vector3, localRight: Vector3, cutoutHeight: number, epsilon: number): Polygon
Defined in src/model/visualization/Joints/Renderer/CrossJointRenderer.ts:167
calculates a rectangle based on height and two corner points the right corner point has to be the outer point if they do not specify a hole
Parameters:
| Name | Type |
|---|---|
localLeft |
Vector3 |
localRight |
Vector3 |
cutoutHeight |
number |
epsilon |
number |
Returns: Polygon
[[x, y], [x, y], …]
Private _isBetween
▸ _isBetween(point: Vector3, cornerA: Vector3, cornerB: Vector3, epsilon: number): boolean
Defined in src/model/visualization/Joints/Renderer/CrossJointRenderer.ts:116
Parameters:
| Name | Type |
|---|---|
point |
Vector3 |
cornerA |
Vector3 |
cornerB |
Vector3 |
epsilon |
number |
Returns: boolean
Private _returnEmpty
▸ _returnEmpty(): object
Defined in src/model/visualization/Joints/Renderer/CrossJointRenderer.ts:277
Returns: object
-
additions: undefined[] = []
-
cutouts: undefined[] = []
Private _whoIsInsideTheOther
▸ _whoIsInsideTheOther(leftA: Vector3, rightA: Vector3, leftB: Vector3, rightB: Vector3, epsilon: number): [boolean, boolean]
Defined in src/model/visualization/Joints/Renderer/CrossJointRenderer.ts:83
calculates whether a lies in b or b in a
Parameters:
| Name | Type | Description |
|---|---|---|
leftA |
Vector3 | - |
rightA |
Vector3 | - |
leftB |
Vector3 | - |
rightB |
Vector3 | - |
epsilon |
number | accuracy to say whether a and b are congruent or not |
Returns: [boolean, boolean]
calculateFlexShapeChanges
▸ calculateFlexShapeChanges(plate: Plate, config: PlatePipelineConfig, rasterizedOutlines: RasterizedOutline[], plateMatrix: Matrix4): IFlexShapeChanges
Inherited from JointRenderer.calculateFlexShapeChanges
Defined in src/model/visualization/Joints/Renderer/JointRenderer.ts:46
Parameters:
| Name | Type |
|---|---|
plate |
Plate |
config |
PlatePipelineConfig |
rasterizedOutlines |
RasterizedOutline[] |
plateMatrix |
Matrix4 |
Returns: IFlexShapeChanges
calculateShapeChanges
▸ calculateShapeChanges(selectedPhysicalObject: Plate, options: any, rasterizedOutlines: RasterizedOutline[]): object
Overrides JointRenderer.calculateShapeChanges
Defined in src/model/visualization/Joints/Renderer/CrossJointRenderer.ts:21
Parameters:
| Name | Type |
|---|---|
selectedPhysicalObject |
Plate |
options |
any |
rasterizedOutlines |
RasterizedOutline[] |
Returns: object
-
additions: undefined[] = []
-
cutouts: undefined[] = []
Static canRender
▸ canRender(joint: any): boolean
Overrides JointRenderer.canRender
Defined in src/model/visualization/Joints/Renderer/CrossJointRenderer.ts:17
Parameters:
| Name | Type |
|---|---|
joint |
any |
Returns: boolean