editor › Globals › PlateMergingComponent
Class: PlateMergingComponent
Takes care of merging coplanar Plates and fixing intersecting resulting Intersections
Hierarchy
↳ PlateMergingComponent
Index
Properties
Methods
- _alignCrossJoints
- _createCrossJoint
- _createFingerJoint
- _createMissingJoints
- _createPairOfAlternatingTeeJoints
- _createTeeJoint
- _fixPlateCollisions
- _getIntersectingPlates
- _groupPlatesByNormal
- _insertOutlinePointsIfRequired
- _mergePlates
- _placeJoint
- _removeMergedPlates
- _setAssembly
- _splitAndJoinOutlines
- _splitPlateAt
- afterRealization
- beforeExport
- beforeInteractionStart
- beforeUpdateVisualizedModel
- getAssembly
Properties
Protected assembly
• assembly: Assembly | null = null
Inherited from AssemblyComponent.assembly
Defined in src/model/data/Component/AssemblyComponent.ts:8
Private mergedPlates
• mergedPlates: Plate[] = []
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:39
Private plateSplittingStrategy
• plateSplittingStrategy: IPlateSplittingStrategy = new SplitShorterSidesStrategy()
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:37
IPlateSplittingStrategy that determines how to split plates if needed
Methods
Private _alignCrossJoints
▸ _alignCrossJoints(): void
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:369
Aligns cross joints to make them easier to assemble, i.e. makes that all plates going along one side have the slit on the top, and all plates going the along the other side have the slit on the bottom
Returns: void
Private _createCrossJoint
▸ _createCrossJoint(plateA: Plate, plateB: Plate, start: Vector3, end: Vector3): void
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:106
Parameters:
| Name | Type |
|---|---|
plateA |
Plate |
plateB |
Plate |
start |
Vector3 |
end |
Vector3 |
Returns: void
Private _createFingerJoint
▸ _createFingerJoint(jointPosition: IJointPosition): void
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:134
Parameters:
| Name | Type |
|---|---|
jointPosition |
IJointPosition |
Returns: void
Private _createMissingJoints
▸ _createMissingJoints(): void
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:72
Returns: void
Private _createPairOfAlternatingTeeJoints
▸ _createPairOfAlternatingTeeJoints(plateA: Plate, plateB: Plate, continuousPlate: Plate): void
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:515
Create a pair of TeeJoints for two colliding reinforcement plates. The TeeJoints need to be created synchronously because a flag (isStartingAtCollision) needs to be set here. Depending on the value of isStartingAtCollision the TeeJointRenderer creates alternating TeeJoints.
Parameters:
| Name | Type | Description |
|---|---|---|
plateA |
Plate | One part of the split plate |
plateB |
Plate | The other part of the split plate |
continuousPlate |
Plate | The continuous plate |
Returns: void
Private _createTeeJoint
▸ _createTeeJoint(section: OutlineSection, plate: Plate): void
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:122
Parameters:
| Name | Type |
|---|---|
section |
OutlineSection |
plate |
Plate |
Returns: void
Private _fixPlateCollisions
▸ _fixPlateCollisions(preferredMethod: any): void
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:277
Merging plates may create plates that overlap, but are not joined. This method inspects the assembly, splits plates and creates joints in order to make the assembly physically buildable.
Parameters:
| Name | Type | Description |
|---|---|---|
preferredMethod |
any | preferred method how to resolve collisions, either 'TeeJoint' or 'CrossJoint' |
Returns: void
Private _getIntersectingPlates
▸ _getIntersectingPlates(assembly: Assembly): Array‹[Plate, Plate]›
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:566
an list of two physically intersecting plates each. Plates joined with each other are ignored. Plates where one plate touches the other
Parameters:
| Name | Type |
|---|---|
assembly |
Assembly |
Returns: Array‹[Plate, Plate]›
Private _groupPlatesByNormal
▸ _groupPlatesByNormal(plates: Plate[]): Map‹Vector3, Plate[]›
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:412
Parameters:
| Name | Type | Description |
|---|---|---|
plates |
Plate[] | that need to be grouped |
Returns: Map‹Vector3, Plate[]›
map of normal vector to the plates having this or the negated equivalent normal
Private _insertOutlinePointsIfRequired
▸ _insertOutlinePointsIfRequired(): void
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:164
This function makes sure that for every start and end of a joint under creation there is a point in the outline. After that, the outline is subdivided such that joint creation becomes as simple as linking the right sections.
|← sectionA →|
outline of plateA -----●-------------------●----------
|← desired joint →|
outline of plateB ---●--------------●-----------------
|← sectionB →|
↓
outline of plateA -----●-○-----------------●----------
|← desired joint →|
outline of plateB ---●---○----------●------○----------
↖ inserted point
Returns: void
Private _mergePlates
▸ _mergePlates(): Promise‹Plate[]›
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:259
Merge mergeable plates in the assembly using PlateMerger. Copies FingerJoints and TeeJoints. Transforms FingerJoints into IntersectionAvoidanceTeeJoints.
Private _placeJoint
▸ _placeJoint(jointPosition: IJointPosition, plateB: Plate, plateA: Plate): void
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:84
Parameters:
| Name | Type |
|---|---|
jointPosition |
IJointPosition |
plateB |
Plate |
plateA |
Plate |
Returns: void
Private _removeMergedPlates
▸ _removeMergedPlates(): void
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:247
Returns: void
_setAssembly
▸ _setAssembly(assembly: Assembly): void
Inherited from AssemblyComponent._setAssembly
Defined in src/model/data/Component/AssemblyComponent.ts:22
Only to be called by the assembly when adding the component to it
Parameters:
| Name | Type | Description |
|---|---|---|
assembly |
Assembly | - |
Returns: void
Private _splitAndJoinOutlines
▸ _splitAndJoinOutlines(): void
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:63
The Joint Model can only handle Joints between either a pair of OutlineSections (FingerJoint) or an OutlineSection and a Plate (TeeJoint) or a pair of Plates (CrossJoint). For the first two cases we might need to split existing OutlineSections. After we ensured that all necessary OutlinePoints are created, we create the Joints between them.
Returns: void
Private _splitPlateAt
▸ _splitPlateAt(plateToSplit: Plate, intersectionPositions: Vector3[]): Plate
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:443
Split given plate at given intersection points by adding outline points first and split plate by newly created outline points later on.
Parameters:
| Name | Type | Description |
|---|---|---|
plateToSplit |
Plate | The plate to be split |
intersectionPositions |
Vector3[] | The intersections positions |
Returns: Plate
The new plate
afterRealization
▸ afterRealization(): Promise‹void›
Overrides AssemblyComponent.afterRealization
Defined in src/model/data/Component/plateMerging/PlateMergingComponent.ts:41
Returns: Promise‹void›
beforeExport
▸ beforeExport(): Promise‹void›
Inherited from Component.beforeExport
Defined in src/model/data/Component/Component.ts:12
Entrypoint for subclasses to modify the assembly before all plates in compositeModel are exported to SVG.
Returns: Promise‹void›
promise that should resolve when the component has done all its work
beforeInteractionStart
▸ beforeInteractionStart(tool: any, visualizationManager: any): Promise‹Assembly[]› | void
Inherited from Component.beforeInteractionStart
Defined in src/model/data/Component/Component.ts:29
is called on the Assembly's components of the interacted physical object before the tool interaction is started.
Parameters:
| Name | Type | Description |
|---|---|---|
tool |
any | the tool the user has currently selected |
visualizationManager |
any | to wake up the editor after creating new objects |
Returns: Promise‹Assembly[]› | void
promise that resolves to the newly created assemblies
beforeUpdateVisualizedModel
▸ beforeUpdateVisualizedModel(): void
Inherited from Component.beforeUpdateVisualizedModel
Defined in src/model/data/Component/Component.ts:19
Entrypoint for subclasses to modify the assembly before rendering a frame.
Returns: void
getAssembly
▸ getAssembly(): Assembly
Inherited from AssemblyComponent.getAssembly
Defined in src/model/data/Component/AssemblyComponent.ts:14
Returns: Assembly