Skip to content

editor › Globals › VisualizationHelper

Class: VisualizationHelper

Hierarchy

  • VisualizationHelper

Index

Properties

Methods

Properties

Private placeholderDescriptors

• placeholderDescriptors: PlaceholderDescriptor[] = []

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:275


Static Private Readonly jointHighlightColor

▪ jointHighlightColor: Color‹› = new Color(0xff9800)

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:33

The color to use for highlighting joints


Static Private Readonly jointHighlightingMesh

▪ jointHighlightingMesh: Map‹string, Mesh‹›› = new Map()

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:28

for each joint id, cache the merged highlighting mesh


Static Private Readonly overrideMaterial

▪ overrideMaterial: Map‹SurfaceDisplayAnnotation‹›, string› = new Map()

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:39

All SurfaceDisplayAnnotation that currently have an override material type for visualization and their original material type.

Methods

Private _paintMeshUnderConstruction

▸ _paintMeshUnderConstruction(mesh: Mesh): void

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:304

Creates an under construction texture on a single mesh.

Parameters:

Name Type
mesh Mesh

Returns: void


paintUnderConstruction

▸ paintUnderConstruction(assembly: Assembly): void

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:280

Paints the meshes that are going to be assembled with the under construction texture.

Parameters:

Name Type
assembly Assembly

Returns: void


removeUnderConstruction

▸ removeUnderConstruction(): void

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:294

Removes all the under construction textures that were created with this VisualizationHelper.

Returns: void


Static Private _createPathForPoints

▸ _createPathForPoints(points: Vector3[]): Path

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:175

Parameters:

Name Type
points Vector3[]

Returns: Path


Static Private _getAllLines

▸ _getAllLines(joint: Joint‹AtomicPattern›, materialThickness: number): Array‹object›

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:224

This computes all the lines of a joint that should be rendered in svg coordinates including: 1. The joint outline on the top of the plate 2. The joint outline on the bottom of the plate 3. Vertical connections between 1. and 2.

Parameters:

Name Type
joint Joint‹AtomicPattern›
materialThickness number

Returns: Array‹object›


Static Private _highlightJoint

▸ _highlightJoint(joint: Joint‹AtomicPattern›, mesh: SvgSurfaceDescriptor, color: Color): ThreeMesh

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:192

This highlights an svg-import joint with a colored line that is following the outline of the joint

Parameters:

Name Type
joint Joint‹AtomicPattern›
mesh SvgSurfaceDescriptor
color Color

Returns: ThreeMesh


Static Private _otherSvgSurfaceDescriptorsInCompositeModel

▸ _otherSvgSurfaceDescriptorsInCompositeModel(svgSurfaceDescriptor: SvgSurfaceDescriptor, compositeModel: CompositeModel): any[]

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:261

Finds all the SvgSurfaceDescriptors in a CompositeModel that are not the same object as the parameter svgSurfaceDescriptor.

Parameters:

Name Type
svgSurfaceDescriptor SvgSurfaceDescriptor
compositeModel CompositeModel

Returns: any[]


Static createShapeForPolygon

▸ createShapeForPolygon(polygon: Polygon): Shape

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:142

Creates a THREE shape for a given polygon.

Parameters:

Name Type Description
polygon Polygon

Returns: Shape


Static createShapeForRasterizedOutline

▸ createShapeForRasterizedOutline(outline: RasterizedOutlineWithHoles): Shape

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:133

Creates a THREE shape for a given rasterized outline with holes.

Parameters:

Name Type Description
outline RasterizedOutlineWithHoles

Returns: Shape


Static getNonOverriddenMaterialType

▸ getNonOverriddenMaterialType(annotation: SurfaceDisplayAnnotation): string

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:122

Tools can override the current Material of a mesh for visualization. This should not get serialized, because the tool will not be able to remove the override material by itself after the deserialization. This method can be used to get the original material type of a SurfaceDisplayAnnotation.

Parameters:

Name Type Description
annotation SurfaceDisplayAnnotation

Returns: string


Static paintGhosted

▸ paintGhosted(mesh: Mesh): void

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:84

Paints this mesh ghosted. This means changing the material to PlywoodSemitransparent and remembering the old material.

Parameters:

Name Type
mesh Mesh

Returns: void


Static removeGhosting

▸ removeGhosting(): void

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:91

Removes all the ghosted materials and replaces them with the original materials.

Returns: void


Static removeJointHighlights

▸ removeJointHighlights(threemeshes: ThreeMesh[]): void

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:74

Parameters:

Name Type
threemeshes ThreeMesh[]

Returns: void


Static removePlaceholderDescriptor

▸ removePlaceholderDescriptor(descriptor: PlaceholderDescriptor): void

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:67

This method removes a PlaceholderDescriptor (under construction texture) from its assembly.

Parameters:

Name Type
descriptor PlaceholderDescriptor

Returns: void


Static setMaterial

▸ setMaterial(mesh: Mesh, type: string, rememberOriginalMaterial: boolean): void

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:105

Set the material of a mesh.

Parameters:

Name Type Default Description
mesh Mesh - the mesh to change the material of
type string - the identifier string of the material. See Materials.ts for the list of registered materials
rememberOriginalMaterial boolean false this is only a temporary material and we should remember the original one

Returns: void

the identifier string of the material that was previously used by the mesh.


Static visualizeMatchesWithOtherPlates

▸ visualizeMatchesWithOtherPlates(originPlates: SvgSurfaceDescriptor[], compositeModel: CompositeModel): ThreeMesh[]

Defined in src/modules/kyub.core.plateImport/src/VisualizationHelper.ts:46

This method finds the joints of other SvgSurfaceDescriptors in the given compositeModel which match with any joints of the given SvgSurfaceDescriptors. Then it highlights them with orange lines following the outline of the joints.

Parameters:

Name Type
originPlates SvgSurfaceDescriptor[]
compositeModel CompositeModel

Returns: ThreeMesh[]