Skip to content

editorGlobalsTessellationDescriptor

Class: TessellationDescriptor

A TessellationDescriptor is the blueprint for tessellation on a mesh: It defines where the different tessellation- cuts will happen on the surface, and coordinates what happens when the mesh is changed.

Hierarchy

  • TessellationDescriptor

Implements

Index

Properties

Methods

Properties

Private assembly

assembly: Assembly

Defined in src/model/data/Concepts/TessellationDescriptor.ts:53


Private changeEmitter

changeEmitter: EventEmitterIModelElementEvent = new EventEmitter()

Defined in src/model/data/Concepts/TessellationDescriptor.ts:56


Private displayNotificationCallback

displayNotificationCallback: function

Defined in src/model/data/Concepts/TessellationDescriptor.ts:57

Type declaration:

▸ (type: TessellationNotificationType): any

Parameters:

Name Type
type TessellationNotificationType

Private meshAnchor

meshAnchor: MeshAnchor | null

Defined in src/model/data/Concepts/TessellationDescriptor.ts:54


Private Readonly minimumAngleForTessellationJump

minimumAngleForTessellationJump: number = Math.PI / 5

Defined in src/model/data/Concepts/TessellationDescriptor.ts:64


Private savedSurfaceTessellations

savedSurfaceTessellations: Array‹object› = []

Defined in src/model/data/Concepts/TessellationDescriptor.ts:58


Private surfaceTessellations

surfaceTessellations: SurfaceTessellation[] = []

Defined in src/model/data/Concepts/TessellationDescriptor.ts:55


Static Private tessellationPresetSizes

tessellationPresetSizes: object[] = [ { value: [210, 297], name: "A4" }, { value: [297, 420], name: "A3" }, { value: [420, 594], name: "A2" }, { value: [594, 841], name: "A1" }, ]

Defined in src/model/data/Concepts/TessellationDescriptor.ts:30

Methods

Private _clearSavedSurfaceTessellations

_clearSavedSurfaceTessellations(): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:404

Returns: void


Private _getJumpWidth

_getJumpWidth(): number

Defined in src/model/data/Concepts/TessellationDescriptor.ts:380

Returns: number


Private _improveTessellationPositions

_improveTessellationPositions(): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:434

Returns: void


Private _jumpAwayFromDoubleIntersectionPoints

_jumpAwayFromDoubleIntersectionPoints(): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:460

Returns: void


Private _jumpAwayFromOutlineSections

_jumpAwayFromOutlineSections(): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:502

Returns: void


Private _moveIfCutlinesInOnlyOneDirectionPossible

_moveIfCutlinesInOnlyOneDirectionPossible(): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:445

This checks if it is possible for some surfaceTessellations to only have cutLines in one direction. If this is possible, we try to move the tessellation that way

Returns: void


Private _notifyUser

_notifyUser(type: TessellationNotificationType): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:413

Parameters:

Name Type
type TessellationNotificationType

Returns: void


Private _onAnchorTransformsChange

_onAnchorTransformsChange(changeEvent: IAnchorChangeEvent): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:546

This will be called, when either the mesh anchor, or one of the Anchors of the surface tessellation changes. The TessellationDescriptor should then be realized again.

Parameters:

Name Type
changeEvent IAnchorChangeEvent

Returns: void


Private _onMeshAnchorChange

_onMeshAnchorChange(event: IMeshAnchorChangeEvent): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:421

Parameters:

Name Type
event IMeshAnchorChangeEvent

Returns: void


Private _removeUnnecessaryTessellations

_removeUnnecessaryTessellations(): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:554

Returns: void


Private _saveTessellation

_saveTessellation(): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:384

Returns: void


addSurfaceTessellation

addSurfaceTessellation(surfaceTessellation: SurfaceTessellation, checkForValidSurface: boolean): boolean

Defined in src/model/data/Concepts/TessellationDescriptor.ts:71

Parameters:

Name Type Default Description
surfaceTessellation SurfaceTessellation - The surfaceTessellation to add
checkForValidSurface boolean true whether to check for surfaceTessellations with the same surface and replace them. This can be useful on deserialization, when we can't be sure the anchor is already returning a valid surface.

Returns: boolean


applyAutoTessellation

applyAutoTessellation(): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:263

Apply a tessellation in the size stored in the compositeModel to the current assembly. When we have a saved tessellation, we first apply it and keep it if it is valid. Otherwise we use the AutoTessellationGenerator to generate a tessellation.

Returns: void


clearSurfaceTessellations

clearSurfaceTessellations(emitEvent: boolean, savePreviousTessellation: boolean): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:153

Clears all surfaceTessellations from the object.

Parameters:

Name Type Default Description
emitEvent boolean true If an event should be emitted
savePreviousTessellation boolean false If we want to save the tessellation on the object for later use.

Returns: void


clone

clone(anchor: MeshAnchor): TessellationDescriptor

Defined in src/model/data/Concepts/TessellationDescriptor.ts:249

Parameters:

Name Type
anchor MeshAnchor

Returns: TessellationDescriptor


destroy

destroy(): void

Implementation of IModelElement

Defined in src/model/data/Concepts/TessellationDescriptor.ts:241

Returns: void


getAnchor

getAnchor(): MeshAnchor

Defined in src/model/data/Concepts/TessellationDescriptor.ts:211

Returns: MeshAnchor


getAssembly

getAssembly(): Assembly

Implementation of IModelElement

Defined in src/model/data/Concepts/TessellationDescriptor.ts:203

Returns: Assembly


getChangeEventEmitter

getChangeEventEmitter(): IPublicEventEmitterInterfaceIModelElementEvent

Implementation of IModelElement

Defined in src/model/data/Concepts/TessellationDescriptor.ts:199

Returns: IPublicEventEmitterInterfaceIModelElementEvent


getCompositeModelTessellationSize

getCompositeModelTessellationSize(): Vector2

Defined in src/model/data/Concepts/TessellationDescriptor.ts:371

Return the saved compositeModelTessellationSize in a Vector2, that is sorted ascending, so x will be the smaller value, and y the bigger value

Returns: Vector2


getElementsThisDependsOn

getElementsThisDependsOn(): IModelElement[]

Implementation of IModelElement

Defined in src/model/data/Concepts/TessellationDescriptor.ts:185

Returns: IModelElement[]


getIsValid

getIsValid(): boolean

Implementation of IModelElement

Defined in src/model/data/Concepts/TessellationDescriptor.ts:237

Returns: boolean


getNumberOfCutLines

getNumberOfCutLines(): number

Defined in src/model/data/Concepts/TessellationDescriptor.ts:215

Returns: number


getSavedTessellationSizes

getSavedTessellationSizes(): Array‹object›

Defined in src/model/data/Concepts/TessellationDescriptor.ts:170

This generates the information on the stored tessellations, so in the export dialog they can be displayed as saved tessellations.

Returns: Array‹object›


getSurfaceTessellations

getSurfaceTessellations(): SurfaceTessellation‹›[]

Defined in src/model/data/Concepts/TessellationDescriptor.ts:127

Returns: SurfaceTessellation‹›[]


hasSurfaceTessellation

hasSurfaceTessellation(surfaceTessellation: SurfaceTessellation): boolean

Defined in src/model/data/Concepts/TessellationDescriptor.ts:131

Parameters:

Name Type
surfaceTessellation SurfaceTessellation

Returns: boolean


hasValidTessellation

hasValidTessellation(): boolean

Defined in src/model/data/Concepts/TessellationDescriptor.ts:301

Returns: boolean


isSurfaceTessellatable

isSurfaceTessellatable(surface: MeshSurface): boolean

Defined in src/model/data/Concepts/TessellationDescriptor.ts:106

Parameters:

Name Type
surface MeshSurface

Returns: boolean


reevaluateSurfaceTessellations

reevaluateSurfaceTessellations(): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:342

When valid, this checks if the current tessellation is okay, and otherwise does a new tessellation

Returns: void


removeSurfaceTessellation

removeSurfaceTessellation(surfaceTessellation: SurfaceTessellation, emitEvent: boolean): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:135

Parameters:

Name Type Default
surfaceTessellation SurfaceTessellation -
emitEvent boolean true

Returns: void


setAnchor

setAnchor(newAnchor: MeshAnchor): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:222

Parameters:

Name Type Description
newAnchor MeshAnchor the anchor that defines the assembly the mesh the tessellation is applied to

Returns: void


setAssembly

setAssembly(assembly: Assembly): void

Implementation of IModelElement

Defined in src/model/data/Concepts/TessellationDescriptor.ts:207

Parameters:

Name Type
assembly Assembly

Returns: void


setDisplayNotificationCallback

setDisplayNotificationCallback(displayFunction: function): void

Defined in src/model/data/Concepts/TessellationDescriptor.ts:102

This can be set on the TessellationDescriptor (by the TessellationModule for example) to allow it to show notifications to the user

Parameters:

displayFunction: function

function to call when a user message should be generated

▸ (type: TessellationNotificationType): any

Parameters:

Name Type
type TessellationNotificationType

Returns: void


Static findOrCreateTessellationDescriptor

findOrCreateTessellationDescriptor(mesh: Mesh, assembly: Assembly): TessellationDescriptor

Defined in src/model/data/Concepts/TessellationDescriptor.ts:37

Parameters:

Name Type
mesh Mesh
assembly Assembly

Returns: TessellationDescriptor