Class: BoxelCSG
Hierarchy
- BoxelCSG
Index
Methods
- _inversePlacement
- _keepPointOnPlate
- _removeCandidateSubgraphs
- _runCsg
- boxelOperation
- getBoxelAlignments
- handleFailedOperation
- prepareForCsg
Methods
Static Private _inversePlacement
▸ _inversePlacement(placement: object, originalConnector: IConnector): void
Defined in src/modules/kyub.core.boxel/src/BoxelCSG.ts:363
Parameters:
▪ placement: object
| Name | Type |
|---|---|
alignment |
IMeshLocalAlignment |
connector |
IConnector |
score |
number |
▪ originalConnector: IConnector
Returns: void
Static Private _keepPointOnPlate
▸ _keepPointOnPlate(localPoint: Vector3, plate: Plate): Vector3
Defined in src/modules/kyub.core.boxel/src/BoxelCSG.ts:430
Parameters:
| Name | Type |
|---|---|
localPoint |
Vector3 |
plate |
Plate |
Returns: Vector3
Static Private _removeCandidateSubgraphs
▸ _removeCandidateSubgraphs(operation: CSGMeshOperation, deleteSubgraph: boolean): Array‹Map‹IModelElement, IModelElementRealizer‹IModelElement›››
Defined in src/modules/kyub.core.boxel/src/BoxelCSG.ts:379
Parameters:
| Name | Type | Default |
|---|---|---|
operation |
CSGMeshOperation | - |
deleteSubgraph |
boolean | false |
Returns: Array‹Map‹IModelElement, IModelElementRealizer‹IModelElement›››
Static Private _runCsg
▸ _runCsg(operation: CSGMeshOperation, notificationController: any): Promise‹IMeshOperationResult[]›
Defined in src/modules/kyub.core.boxel/src/BoxelCSG.ts:408
Wraps the execution of the BooleanMeshOperation in a BoxelCSGProgress for user feedback
Parameters:
| Name | Type | Description |
|---|---|---|
operation |
CSGMeshOperation | - |
notificationController |
any | - |
Returns: Promise‹IMeshOperationResult[]›
Static boxelOperation
▸ boxelOperation(operation: CSGMeshOperation, onFailure: OnFailureBehavior, notificationController: any): Promise‹IMeshOperationResult[]›
Defined in src/modules/kyub.core.boxel/src/BoxelCSG.ts:184
Performs a boxel operation and adjusts assemblies and composite models afterwards
Parameters:
| Name | Type | Description |
|---|---|---|
operation |
CSGMeshOperation | the operation to be performed |
onFailure |
OnFailureBehavior | how the CSG should behave if the operation fails |
notificationController |
any | - |
Returns: Promise‹IMeshOperationResult[]›
Static getBoxelAlignments
▸ getBoxelAlignments(operation: "add" | "remove", basePlate: Plate, baseSurface: MeshSurface, baseMesh: Mesh, assemblyBasePoint: Vector3, connectors: IConnector[], inferOnBigger?: boolean): Array‹object›
Defined in src/modules/kyub.core.boxel/src/BoxelCSG.ts:43
Parameters:
| Name | Type | Description |
|---|---|---|
operation |
"add" | "remove" | - |
basePlate |
Plate | - |
baseSurface |
MeshSurface | - |
baseMesh |
Mesh | - |
assemblyBasePoint |
Vector3 | - |
connectors |
IConnector[] | - |
inferOnBigger? |
boolean | infer on bigger plate instead of base plate This puts an emphasis on the click position on the larger surface instead of the second click which usually leads to more desirable results and also improves performance because fewer options have to be considered by the grid inferrer |
Returns: Array‹object›
all alignments, sorted by score with increasing score
Static handleFailedOperation
▸ handleFailedOperation(operation: CSGMeshOperation, onFailure: OnFailureBehavior, error: any): void
Defined in src/modules/kyub.core.boxel/src/BoxelCSG.ts:325
Parameters:
| Name | Type | Default |
|---|---|---|
operation |
CSGMeshOperation | - |
onFailure |
OnFailureBehavior | - |
error |
any | null |
Returns: void
Static prepareForCsg
▸ prepareForCsg(baseSurfaceAnchor: MeshSurfaceAnchor, candidateSurfaceAnchor: MeshSurfaceAnchor, allAlignments: IBoxelMeshLocalAlignment[], alignmentIndex: number): object
Defined in src/modules/kyub.core.boxel/src/BoxelCSG.ts:136
Ensures both assemblies have a mesh-concept assigned, then merges assemblies and makes the candidate mesh stick to the base mesh so that the boxel operation could also be done at a later stage.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
baseSurfaceAnchor |
MeshSurfaceAnchor | - | MeshSurfaceAnchor that points to the surface of the base mesh (used for aligning the candidate) |
candidateSurfaceAnchor |
MeshSurfaceAnchor | - | MeshSurfaceAnchor that points to the boxel's connector surface |
allAlignments |
IBoxelMeshLocalAlignment[] | - | the alignments determined by the gridinferrer |
alignmentIndex |
number | 0 | - |
Returns: object
base and candidate meshes ready to be CSG-ed
-
base: Mesh
-
candidate: Mesh
-
relativeTransformsAnchor: RelativeTransformsAnchor