Skip to content

editorGlobalsMeshEdgeAnchor

Class: MeshEdgeAnchor

A mesh edge anchor always points to the (conceptually) same edge in a mesh.

Hierarchy

MeshElementAnchorMeshHalfEdge, IEdgeSignature, MeshEdgeAnchor

MeshEdgeAnchor

PointOnEdgeAnchor

Implements

Index

Properties

Methods

Object literals

Properties

Protected additionalElementContext

additionalElementContext: any

Inherited from MeshElementAnchor.additionalElementContext

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:36

Additional information about the elements current context (not belonging to the elementSignature). Used to keep the anchor's context consistent after a mesh change. Eg a POSA tries to find it's orientation by looking at the direction of edges with the same surface at their twin.


Protected Readonly changeEventEmitter

changeEventEmitter: EventEmitterIMeshAnchorChangeEvent = new EventEmitter()

Inherited from AbstractMeshAnchor.changeEventEmitter

Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:33


Protected element

element: MeshHalfEdge = null

Inherited from MeshElementAnchor.element

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:42

Last known identity of the element. Only null if the anchor has never been valid in its lifetime yet or is already destroyed.


Protected isDestroyed

isDestroyed: boolean = false

Inherited from AbstractMeshAnchor.isDestroyed

Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:24


Protected lastMeshAdaptionWasSuccessful

lastMeshAdaptionWasSuccessful: boolean = false

Inherited from AbstractMeshAnchor.lastMeshAdaptionWasSuccessful

Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:31

During initialization, subclasses need to take care of setting this value to true, if the anchor became valid before the first meshChangeEvent was fired. Else, the anchor will stay invalid until the first meshChangeEvent is fired.


Protected mesh

mesh: Mesh | null

Inherited from AbstractMeshAnchor.mesh

Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:23

Methods

Protected _adaptToChangedMesh

_adaptToChangedMesh(event: MeshChangeEvent, requiresExactMatch: boolean): object

Inherited from MeshElementAnchor._adaptToChangedMesh

Overrides AbstractMeshAnchor._adaptToChangedMesh

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:263

see AbstractMeshAnchor._adaptToChangedMesh

Parameters:

Name Type Description
event MeshChangeEvent -
requiresExactMatch boolean if true, will only adapt to elements in the mesh that match the signature perfectly

Returns: object


Protected _applyChangedScale

_applyChangedScale(scale: number): void

Overrides MeshElementAnchor._applyChangedScale

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:107

Parameters:

Name Type
scale number

Returns: void


Protected _changeSelfToChosenCandidate

_changeSelfToChosenCandidate(chosenCandidate: IAbstractElementCandidateMeshHalfEdge›, mirror?: IMirrorMapping): boolean

Inherited from MeshElementAnchor._changeSelfToChosenCandidate

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:208

Now that it is decided which candidate this anchor will be pointing to, it should adjust it references to it.

Parameters:

Name Type Description
chosenCandidate IAbstractElementCandidateMeshHalfEdge the candidate the anchor should now point to
mirror? IMirrorMapping -

Returns: boolean

whether the anchor is still valid (...or became invalidated)


Protected _checkIfAnchorCanBeValid

_checkIfAnchorCanBeValid(): boolean

Inherited from MeshElementAnchor._checkIfAnchorCanBeValid

Overrides AbstractMeshAnchor._checkIfAnchorCanBeValid

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:194

Returns: boolean


Protected _createEvent

_createEvent(splitAnchors: MeshEdgeAnchor[], previousTarget: Mesh, __namedParameters: object): IMeshAnchorChangeEvent

Inherited from MeshElementAnchor._createEvent

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:224

Creates an appropriate MeshAnchorChangeEvent depending on how many additional anchors have been created

Parameters:

splitAnchors: MeshEdgeAnchor[]

if there are multiple equally good candidates, the rest of them should be split off using an anchor each. In this case, the event will be a MeshAnchorChange.SPLIT.

previousTarget: Mesh

-

__namedParameters: object

Name Type Description
mirror IMirrorMapping -
scale number -

Returns: IMeshAnchorChangeEvent


Protected _createSplitOffInstance

_createSplitOffInstance(mesh: Mesh, edge: MeshHalfEdge): MeshEdgeAnchor

Overrides MeshElementAnchor._createSplitOffInstance

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:101

Parameters:

Name Type
mesh Mesh
edge MeshHalfEdge

Returns: MeshEdgeAnchor


Protected _extractAdditionalElementContextFromCurrentElement

_extractAdditionalElementContextFromCurrentElement(): any

Overrides MeshElementAnchor._extractAdditionalElementContextFromCurrentElement

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:93

Returns: any


Protected _extractSignatureFromCurrentElement

_extractSignatureFromCurrentElement(): IEdgeSignature

Overrides MeshElementAnchor._extractSignatureFromCurrentElement

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:85

Returns: IEdgeSignature


Protected _findByMirror

_findByMirror(successor: Mesh, mirror: IMirrorMapping): Array‹IAbstractElementCandidateMeshHalfEdge››

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:216

Finds the new mirrored surface candidates.

Parameters:

Name Type Description
successor Mesh new mirrored mesh
mirror IMirrorMapping map of old to mirrored mesh points

Returns: Array‹IAbstractElementCandidateMeshHalfEdge››


Protected _findBySameIdentity

_findBySameIdentity(candidateMesh: Mesh): object[]

Overrides MeshElementAnchor._findBySameIdentity

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:112

Parameters:

Name Type
candidateMesh Mesh

Returns: object[]


Protected _findBySameSignature

_findBySameSignature(candidateMesh: Mesh): Array‹IAbstractElementCandidateMeshHalfEdge››

Overrides MeshElementAnchor._findBySameSignature

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:131

Parameters:

Name Type
candidateMesh Mesh

Returns: Array‹IAbstractElementCandidateMeshHalfEdge››


Protected _findBySameUID

_findBySameUID(candidateMesh: Mesh): Array‹IAbstractElementCandidateMeshHalfEdge››

Overrides MeshElementAnchor._findBySameUID

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:120

Parameters:

Name Type
candidateMesh Mesh

Returns: Array‹IAbstractElementCandidateMeshHalfEdge››


Private _findBySimilarSignature

_findBySimilarSignature(candidateMesh: Mesh): Array‹IAbstractElementCandidateMeshHalfEdge››

Overrides MeshElementAnchor._findBySimilarSignature

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:160

todo: find cases where this happens and adapt to them

Parameters:

Name Type Description
candidateMesh Mesh -

Returns: Array‹IAbstractElementCandidateMeshHalfEdge››


Private _getAssemblySpaceSignature

_getAssemblySpaceSignature(signature: IEdgeSignature): IEdgeSignature

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:241

Transforms the surface signature into assembly space so that it can be compared with other meshes

Parameters:

Name Type
signature IEdgeSignature

Returns: IEdgeSignature


Protected _getInstance

_getInstance(): MeshEdgeAnchor‹›

Overrides MeshElementAnchor._getInstance

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:81

Returns: MeshEdgeAnchor‹›


Protected _isElementValid

_isElementValid(): boolean

Overrides MeshElementAnchor._isElementValid

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:97

Returns: boolean


Protected _onMeshChange

_onMeshChange(meshEvent: MeshChangeEvent): void

Inherited from AbstractMeshAnchor._onMeshChange

Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:127

Parameters:

Name Type
meshEvent MeshChangeEvent

Returns: void


Protected _performInitialLookup

_performInitialLookup(): void

Inherited from MeshElementAnchor._performInitialLookup

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:173

When creating the anchor, there is the time span between setting signature/mesh and the first mesh change event where the anchor can already be valid (if the mesh is already filled with the correct data). To not falsely stay invalid, when either the element is set or the mesh is set, this initial lookup function needs to be called.

Afterwards, the anchor will simply evaluate it's validity after each meshChange event.

Returns: void


Protected _reFindElementOnMesh

_reFindElementOnMesh(candidateMesh: Mesh, requiresExactMatch: boolean, mirror?: IMirrorMapping): Array‹IAbstractElementCandidateMeshHalfEdge››

Overrides MeshElementAnchor._reFindElementOnMesh

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:201

Parameters:

Name Type
candidateMesh Mesh
requiresExactMatch boolean
mirror? IMirrorMapping

Returns: Array‹IAbstractElementCandidateMeshHalfEdge››


Protected _refindSelfAndEmit

_refindSelfAndEmit(meshEvent: MeshChangeEvent, requiresExactMatch: boolean): void

Inherited from AbstractMeshAnchor._refindSelfAndEmit

Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:134

Parameters:

Name Type Default
meshEvent MeshChangeEvent -
requiresExactMatch boolean false

Returns: void


Protected _setElement

_setElement(element: MeshHalfEdge): void

Inherited from MeshElementAnchor._setElement

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:363

Sets the (new) element this points to. For data consistency, also extracts the element's signature

Parameters:

Name Type
element MeshHalfEdge

Returns: void


Protected _setMesh

_setMesh(newMesh: Mesh | null): void

Inherited from AbstractMeshAnchor._setMesh

Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:115

Updates the mesh reference and event bindings.

This is protected as you should only change the mesh during initialization or updates handled in child classes - users should not be able to arbitrarily change the mesh and thus corrupt state.

Parameters:

Name Type
newMesh Mesh | null

Returns: void


Protected _setMeshAndElement

_setMeshAndElement(mesh: Mesh, element: MeshHalfEdge): void

Inherited from MeshElementAnchor._setMeshAndElement

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:185

Parameters:

Name Type
mesh Mesh
element MeshHalfEdge

Returns: void


Private _signaturesEqual

_signaturesEqual(signature: IEdgeSignature, currentSignature: IEdgeSignature): boolean

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:230

Parameters:

Name Type
signature IEdgeSignature
currentSignature IEdgeSignature

Returns: boolean


clone

clone(): MeshElementAnchorMeshHalfEdge, IEdgeSignature, MeshEdgeAnchor

Implementation of IMeshAnchor

Inherited from MeshElementAnchor.clone

Overrides AbstractMeshAnchor.clone

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:66

Returns: MeshElementAnchorMeshHalfEdge, IEdgeSignature, MeshEdgeAnchor


destroy

destroy(): void

Implementation of IMeshAnchor

Inherited from MeshElementAnchor.destroy

Overrides AbstractMeshAnchor.destroy

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:94

Returns: void


getChangeEventEmitter

getChangeEventEmitter(): IPublicEventEmitterInterfaceIMeshAnchorChangeEvent

Implementation of IMeshAnchor

Inherited from AbstractMeshAnchor.getChangeEventEmitter

Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:81

Returns: IPublicEventEmitterInterfaceIMeshAnchorChangeEvent


getEdge

getEdge(): MeshHalfEdge | null

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:73

Returns: MeshHalfEdge | null


getInMeshTarget

getInMeshTarget(): MeshHalfEdge

Implementation of IMeshAnchor

Overrides AbstractMeshAnchor.getInMeshTarget

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:69

Returns: MeshHalfEdge


getIsValid

getIsValid(): boolean

Implementation of IMeshAnchor

Inherited from AbstractMeshAnchor.getIsValid

Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:62

Returns: boolean


getMesh

getMesh(): Mesh‹›

Implementation of IMeshAnchor

Inherited from AbstractMeshAnchor.getMesh

Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:47

This should initialize the anchor with the necessary positionable arguments.

Returns: Mesh‹›


getSignature

getSignature(): IEdgeSignature

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:77

Returns: IEdgeSignature


getSurface

getSurface(): MeshSurface

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:65

Returns: MeshSurface


getTargets

getTargets(): [Mesh] | []

Implementation of IMeshAnchor

Inherited from AbstractMeshAnchor.getTargets

Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:54

Returns: [Mesh] | []

the target mesh this anchor points to or an empty list if the mesh is not set


initializeFromElement

initializeFromElement(mesh: Mesh, element: MeshHalfEdge): this

Inherited from MeshElementAnchor.initializeFromElement

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:50

If you have a valid mesh and element combination, you can initialize the anchor here. If the mesh may be invalid and become valid later, use initializeFromSignature()

Parameters:

Name Type Description
mesh Mesh -
element MeshHalfEdge -

Returns: this


initializeFromSignature

initializeFromSignature(mesh: Mesh, signature: IEdgeSignature): void

Inherited from MeshElementAnchor.initializeFromSignature

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:81

The preferred way to initialize an anchor: set the mesh and the signature. The mesh does NOT need to be valid yet, it may also become valid later (but is expected to emit change events so that the anchor can react accordingly)

Parameters:

Name Type
mesh Mesh
signature IEdgeSignature

Returns: void


reFindElementOnMesh

reFindElementOnMesh(candidateMesh: Mesh, requiresExactMatch: boolean, mirror?: IMirrorMapping): Array‹IAbstractElementCandidateMeshHalfEdge››

Inherited from MeshElementAnchor.reFindElementOnMesh

Defined in src/model/data/Concepts/Anchors/MeshElementAnchor.ts:99

Parameters:

Name Type
candidateMesh Mesh
requiresExactMatch boolean
mirror? IMirrorMapping

Returns: Array‹IAbstractElementCandidateMeshHalfEdge››


setFromEdgePoints

setFromEdgePoints(mesh: Mesh, startPoint: ReadonlyVector3, endPoint: ReadonlyVector3): void

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:55

Parameters:

Name Type
mesh Mesh
startPoint ReadonlyVector3
endPoint ReadonlyVector3

Returns: void


Static fromEdge

fromEdge(mesh: Mesh, edge: MeshHalfEdge): MeshEdgeAnchor

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:43

Parameters:

Name Type Description
mesh Mesh -
edge MeshHalfEdge -

Returns: MeshEdgeAnchor


Static fromEdgePoints

fromEdgePoints(mesh: Mesh, startPoint: ReadonlyVector3, endPoint: ReadonlyVector3): MeshEdgeAnchor

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:32

Parameters:

Name Type Description
mesh Mesh -
startPoint ReadonlyVector3 -
endPoint ReadonlyVector3 -

Returns: MeshEdgeAnchor

Object literals

Protected elementSignature

elementSignature: object

Overrides MeshElementAnchor.elementSignature

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:49

endPoint

endPoint: null = null

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:50

id

id: null = null

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:51

startPoint

startPoint: null = null

Defined in src/model/data/Concepts/Anchors/MeshEdgeAnchor.ts:52