Skip to content

editorGlobalsBoxelUtils

Class: BoxelUtils

Hierarchy

  • BoxelUtils

Index

Methods

Methods

Static Private _debugOutlines

_debugOutlines(description: string, outlines: any, points: any[]): void

Defined in src/modules/kyub.core.boxel/src/BoxelUtils.ts:231

Parameters:

Name Type Default
description string -
outlines any -
points any[] []

Returns: void


Static Private _doPlatesTouch

_doPlatesTouch(firstPlate: Plate, secondPlate: Plate, requireSectionEquality: boolean): boolean

Defined in src/modules/kyub.core.boxel/src/BoxelUtils.ts:258

Checks if the plates have a (partially) shared edge

Parameters:

Name Type Default Description
firstPlate Plate - checked for shared edges with secondPlate
secondPlate Plate - checked for shared edges with firstPlate
requireSectionEquality boolean false optional. whether the shared edge has to be exactly equal (same length)

Returns: boolean

true if the plates contain a shared edge segment


Static Private _isPlateContained

_isPlateContained(plate: Plate, otherPlate: Plate): boolean

Defined in src/modules/kyub.core.boxel/src/BoxelUtils.ts:284

Parameters:

Name Type
plate Plate
otherPlate Plate

Returns: boolean


Static Private _shouldNegateOffsetForSection

_shouldNegateOffsetForSection(section: any, plateSide: PlateSide): boolean

Defined in src/modules/kyub.core.boxel/src/BoxelUtils.ts:220

Parameters:

Name Type
section any
plateSide PlateSide

Returns: boolean


Static alignBoxelAssembly

alignBoxelAssembly(baseMesh: Mesh, alignment: IMeshLocalAlignment): void

Defined in src/modules/kyub.core.boxel/src/BoxelUtils.ts:196

Aligns the boxel assembly with the base assembly so that the connectorPlate is at localPosition and localRotation in basePlate-local coordinates.

Parameters:

Name Type
baseMesh Mesh
alignment IMeshLocalAlignment

Returns: void


Static Private determineBoxelMeshAlignments

determineBoxelMeshAlignments(alignments: IMeshLocalAlignment[], baseSurfaceAnchor: MeshSurfaceAnchor): IBoxelMeshLocalAlignment[]

Defined in src/modules/kyub.core.boxel/src/BoxelUtils.ts:169

Predetermine alignments in boxel coordinate system for later use in CycleThroughGridInferrerResultsTool. Transforms the rotation and position determined by gridinferrer for the new boxel.

Parameters:

Name Type Description
alignments IMeshLocalAlignment[] -
baseSurfaceAnchor MeshSurfaceAnchor -

Returns: IBoxelMeshLocalAlignment[]


Static estimateAddedSurfaceArea

estimateAddedSurfaceArea(assembly: Assembly, addedAssembly: Assembly): number

Defined in src/modules/kyub.core.boxel/src/BoxelUtils.ts:128

Parameters:

Name Type
assembly Assembly
addedAssembly Assembly

Returns: number


Static estimateResultingPlatesCount

estimateResultingPlatesCount(assembly: Assembly, addedAssembly: Assembly): number

Defined in src/modules/kyub.core.boxel/src/BoxelUtils.ts:97

Parameters:

Name Type
assembly Assembly
addedAssembly Assembly

Returns: number


Static findMergeablePlates

findMergeablePlates(plate: Plate, candidatePlates: Plate[], requireSectionEquality: boolean): Plate‹›[]

Defined in src/modules/kyub.core.boxel/src/BoxelUtils.ts:29

Find coplanar plates to newPlate in the given neighborPlates

Parameters:

Name Type Default Description
plate Plate - the newly made plate that will be attached
candidatePlates Plate[] - list of plates that will be searched for coplanarity to newPlate
requireSectionEquality boolean false optional. whether plates should be considered touching only if the shared edge is exactly equal (same length)

Returns: Plate‹›[]

list of coplanar plates to newPlate in neighborPlates