editor › Globals › PreTransformHelper
Class: PreTransformHelper
Hierarchy
- PreTransformHelper
Index
Methods
- alignAssemblyDirections
- alignAssemblyPositions
- alignEdge
- alignPlanarOnSections
- applyRotationAroundEdge
- determinePointToPointMapping
- ensurePlanarObjects
Methods
Static alignAssemblyDirections
▸ alignAssemblyDirections(sourceAssembly: Assembly, targetAssembly: Assembly, assemblyDirectionSource: Vector3, assemblyDirectionTarget: Vector3): void
Defined in src/model/data/Joints/Joints/PreTransformHelper.ts:184
Moves sourceAssembly so that the assembly-space direction vectors assemblyDirectionSource and assemblyDirectionTarget align in world space
Parameters:
| Name | Type |
|---|---|
sourceAssembly |
Assembly |
targetAssembly |
Assembly |
assemblyDirectionSource |
Vector3 |
assemblyDirectionTarget |
Vector3 |
Returns: void
Static alignAssemblyPositions
▸ alignAssemblyPositions(sourceAssembly: Assembly, targetAssembly: Assembly, assemblyPositionSource: Vector3, assemblyPositionTarget: Vector3): void
Defined in src/model/data/Joints/Joints/PreTransformHelper.ts:168
Moves sourceAssembly so that the assembly-space points assemblyPositionSource and assemblyPositionTarget align in world space
Parameters:
| Name | Type |
|---|---|
sourceAssembly |
Assembly |
targetAssembly |
Assembly |
assemblyPositionSource |
Vector3 |
assemblyPositionTarget |
Vector3 |
Returns: void
Static alignEdge
▸ alignEdge(mapping: any, sourceAssembly: Assembly): object
Defined in src/model/data/Joints/Joints/PreTransformHelper.ts:98
Based on a source (start->end) to target (start->end) edge mapping, aligns the source assembly to match the target.
Parameters:
| Name | Type |
|---|---|
mapping |
any |
sourceAssembly |
Assembly |
Returns: object
edge that the object is being aligned on
-
direction: Vector3
-
start: Vector3
Static alignPlanarOnSections
▸ alignPlanarOnSections(sectionA: OutlineSection, sectionB: OutlineSection, assemblyA: Assembly, assemblyB: Assembly): object
Defined in src/model/data/Joints/Joints/PreTransformHelper.ts:15
Composite method to align two plates to be planar and touch each other at the two specified OutlineSections
Parameters:
| Name | Type |
|---|---|
sectionA |
OutlineSection |
sectionB |
OutlineSection |
assemblyA |
Assembly |
assemblyB |
Assembly |
Returns: object
-
edge(): object
-
direction: Vector3
-
start: Vector3
-
mapping(): object
-
source: object
-
end: object
-
worldPosition: Vector3‹› = osAEnd
-
start: object
-
worldPosition: Vector3‹› = osAStart
-
-
target: object
-
end: object
-
point: OutlinePoint‹› = aEndMappingTarget
-
worldPosition: Vector3‹› = aEndMappingTargetPos
-
start: object
-
point: OutlinePoint‹› = aStartMappingTarget
-
worldPosition: Vector3‹› = aStartMappingTargetPos
-
Static applyRotationAroundEdge
▸ applyRotationAroundEdge(assembly: Assembly, edge: any, angle: number): void
Defined in src/model/data/Joints/Joints/PreTransformHelper.ts:158
Parameters:
| Name | Type | Default |
|---|---|---|
assembly |
Assembly | - |
edge |
any | - |
angle |
number | Math.PI / 2 |
Returns: void
Static determinePointToPointMapping
▸ determinePointToPointMapping(sectionA: OutlineSection, sectionB: OutlineSection, assemblyA: Assembly, assemblyB: Assembly): object
Defined in src/model/data/Joints/Joints/PreTransformHelper.ts:37
Determines which point (start/end) of section A will be mapped onto which point (start/end) of section B. Chooses the combination with shortest distance
Parameters:
| Name | Type |
|---|---|
sectionA |
OutlineSection |
sectionB |
OutlineSection |
assemblyA |
Assembly |
assemblyB |
Assembly |
Returns: object
-
source: object
-
end: object
- worldPosition: Vector3‹› = osAEnd
-
start: object
- worldPosition: Vector3‹› = osAStart
-
target: object
-
end: object
-
point: OutlinePoint‹› = aEndMappingTarget
-
worldPosition: Vector3‹› = aEndMappingTargetPos
-
-
start: object
-
point: OutlinePoint‹› = aStartMappingTarget
-
worldPosition: Vector3‹› = aStartMappingTargetPos
-
Static ensurePlanarObjects
▸ ensurePlanarObjects(objectA: PhysicalObject, objectB: PhysicalObject, edge: object): void
Defined in src/model/data/Joints/Joints/PreTransformHelper.ts:127
Ensures both plates are planar, i.e the normal vectors point in the same direction, by rotating objectA's assembly around rotationCenter Since resulting quaternions may have too many degrees of freedom, the rotation is constrained to a rotation around the edge's direction vector
Parameters:
▪ objectA: PhysicalObject
▪ objectB: PhysicalObject
▪ edge: object
| Name | Type |
|---|---|
direction |
Vector3 |
start |
Vector3 |
Returns: void