editor › Globals › SvgSurfaceDescriptor
Class: SvgSurfaceDescriptor
This represents a single surface that originates from an SvgContext.
Hierarchy
↳ SvgSurfaceDescriptor
Implements
Index
Constructors
Properties
Methods
- _getAnnotations
- _getImplementation
- addAnnotation
- applyJointsAndTransformToOriginal
- canBeModifiedSynchronously
- cleanupInvalidAnnotations
- destroy
- getAllJoints
- getAnalyzer
- getAnnotationsFor
- getAssembly
- getCache
- getChangeEventEmitter
- getDimensionConception
- getEdges
- getElementsThisDependsOn
- getGlobalTransforms
- getIsTwoManifold
- getIsValid
- getJointManager
- getNumberOfNotDisabledSurfaces
- getOriginalMesh
- getOriginalSvgMaterialThickness
- getParent
- getPoints
- getSegment
- getSurface
- getSurfaces
- getSvgCutouts
- getSvgOutline
- getSymmetryManager
- getTransforms
- getTransformsChangeEventEmitter
- getTransformsDefiner
- hasBrokenCutouts
- hasEdge
- hasSurface
- isSurfaceDisabled
- mapLocalDirectionToWorld
- mapLocalPositionToWorld
- mapLocalRotationToWorld
- mapWorldDirectionToLocal
- mapWorldPositionToLocal
- mapWorldRotationToLocal
- modify
- modifySync
- removeAnnotation
- setAllJoints
- setAssembly
- setDimensionConception
- setImplementation
- setJointManager
- setOriginalSvgMaterialThickness
- setSegment
- setShapeFromGlobalCoords
- setShapeFromLocalCoords
- setSymmetryManager
- setTransformsDefiner
- transferToAssembly
- _lineStripToVectors
- setFromSvgContext
Constructors
constructor
+ new SvgSurfaceDescriptor(): SvgSurfaceDescriptor
Overrides Mesh.constructor
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:52
Returns: SvgSurfaceDescriptor
Properties
Private allJoints
• allJoints: Array‹Joint‹AtomicPattern››
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:50
Protected implementation
• implementation: IMeshImplementation
Inherited from Mesh.implementation
Defined in src/model/data/Concepts/Mesh/Mesh.ts:60
Private jointManager
• jointManager: SvgJointManager
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:48
Private originalSvgMaterialThickness
• originalSvgMaterialThickness: number
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:52
Private segment
• segment: Segment
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:47
Private symmetryManager
• symmetryManager: SvgSymmetryManager
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:49
Methods
_getAnnotations
▸ _getAnnotations(reason: string): Set‹MeshAnnotation‹››
Inherited from Mesh._getAnnotations
Defined in src/model/data/Concepts/Mesh/Mesh.ts:536
WARNING: This method is for serialization only. Do not use this to modify the Mesh.
Parameters:
| Name | Type |
|---|---|
reason |
string |
Returns: Set‹MeshAnnotation‹››
_getImplementation
▸ _getImplementation(): IMeshImplementation
Inherited from Mesh._getImplementation
Defined in src/model/data/Concepts/Mesh/Mesh.ts:529
WARNING: This method is for serialization only. Do not use this to modify the Mesh.
Returns: IMeshImplementation
addAnnotation
▸ addAnnotation(meshAnnotation: MeshAnnotation): void
Inherited from Mesh.addAnnotation
Defined in src/model/data/Concepts/Mesh/Mesh.ts:182
Adds an annotation to the mesh.
Parameters:
| Name | Type | Description |
|---|---|---|
meshAnnotation |
MeshAnnotation | - |
Returns: void
applyJointsAndTransformToOriginal
▸ applyJointsAndTransformToOriginal(): void
Implementation of IAssemblingSvgSurface
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:97
Returns: void
canBeModifiedSynchronously
▸ canBeModifiedSynchronously(): boolean
Inherited from Mesh.canBeModifiedSynchronously
Defined in src/model/data/Concepts/Mesh/Mesh.ts:335
Returns: boolean
cleanupInvalidAnnotations
▸ cleanupInvalidAnnotations(): void
Inherited from Mesh.cleanupInvalidAnnotations
Defined in src/model/data/Concepts/Mesh/Mesh.ts:200
Removes all annotations that have an invalid anchor and thus do not point to anything useful anymore
Returns: void
destroy
▸ destroy(): void
Implementation of IPositionableElement
Defined in src/model/data/Concepts/Mesh/Mesh.ts:250
Returns: void
getAllJoints
▸ getAllJoints(): Array‹Joint‹AtomicPattern››
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:137
Returns: Array‹Joint‹AtomicPattern››
getAnalyzer
▸ getAnalyzer(type: VOLUME_ANALYZER): MeshVolumeAnalyzer
Inherited from Mesh.getAnalyzer
Defined in src/model/data/Concepts/Mesh/Mesh.ts:422
Get an analyzer of the given type. This analyzer will remain valid until the next MeshChangeEvent.
Parameters:
| Name | Type | Description |
|---|---|---|
type |
VOLUME_ANALYZER | - |
Returns: MeshVolumeAnalyzer
▸ getAnalyzer(type: SURFACE_ANALYZER): MeshSurfaceAnalyzer
Inherited from Mesh.getAnalyzer
Defined in src/model/data/Concepts/Mesh/Mesh.ts:423
Parameters:
| Name | Type |
|---|---|
type |
SURFACE_ANALYZER |
Returns: MeshSurfaceAnalyzer
▸ getAnalyzer(type: POINTS_ANALYZER): MeshPointsAnalyzer
Inherited from Mesh.getAnalyzer
Defined in src/model/data/Concepts/Mesh/Mesh.ts:424
Parameters:
| Name | Type |
|---|---|
type |
POINTS_ANALYZER |
Returns: MeshPointsAnalyzer
▸ getAnalyzer(type: EDGE_ANALYZER): MeshEdgeAnalyzer
Inherited from Mesh.getAnalyzer
Defined in src/model/data/Concepts/Mesh/Mesh.ts:425
Parameters:
| Name | Type |
|---|---|
type |
EDGE_ANALYZER |
Returns: MeshEdgeAnalyzer
getAnnotationsFor
▸ getAnnotationsFor(target: MeshElement): MeshAnnotation[]
Inherited from Mesh.getAnnotationsFor
Defined in src/model/data/Concepts/Mesh/Mesh.ts:187
Parameters:
| Name | Type |
|---|---|
target |
MeshElement |
Returns: MeshAnnotation[]
getAssembly
▸ getAssembly(): Assembly
Implementation of IPositionableElement
Inherited from Mesh.getAssembly
Defined in src/model/data/Concepts/Mesh/Mesh.ts:139
Returns: Assembly
getCache
▸ getCache(type: SURFACE_NORMALS): SurfaceNormalCache
Defined in src/model/data/Concepts/Mesh/Mesh.ts:386
Get a cache of the given type. This cache will remain valid until the next MeshChangeEvent.
Parameters:
| Name | Type | Description |
|---|---|---|
type |
SURFACE_NORMALS | - |
Returns: SurfaceNormalCache
▸ getCache(type: SURFACE_POINTS): SurfacePointsCache
Defined in src/model/data/Concepts/Mesh/Mesh.ts:387
Parameters:
| Name | Type |
|---|---|
type |
SURFACE_POINTS |
Returns: SurfacePointsCache
▸ getCache(type: SURFACE_PLANE): SurfacePlaneCache
Defined in src/model/data/Concepts/Mesh/Mesh.ts:388
Parameters:
| Name | Type |
|---|---|
type |
SURFACE_PLANE |
Returns: SurfacePlaneCache
getChangeEventEmitter
▸ getChangeEventEmitter(): IPublicEventEmitterInterface‹MeshChangeEvent‹››
Implementation of IPositionableElement
Inherited from Mesh.getChangeEventEmitter
Defined in src/model/data/Concepts/Mesh/Mesh.ts:147
Returns: IPublicEventEmitterInterface‹MeshChangeEvent‹››
getDimensionConception
▸ getDimensionConception(): DimensionConception
Inherited from Mesh.getDimensionConception
Defined in src/model/data/Concepts/Mesh/Mesh.ts:170
Returns: DimensionConception
getEdges
▸ getEdges(): MeshHalfEdge[]
Defined in src/model/data/Concepts/Mesh/Mesh.ts:123
Returns: MeshHalfEdge[]
getElementsThisDependsOn
▸ getElementsThisDependsOn(): IModelElement[]
Implementation of IPositionableElement
Inherited from Mesh.getElementsThisDependsOn
Defined in src/model/data/Concepts/Mesh/Mesh.ts:369
Returns: IModelElement[]
getGlobalTransforms
▸ getGlobalTransforms(): Transforms
Inherited from Mesh.getGlobalTransforms
Defined in src/model/data/Concepts/Mesh/Mesh.ts:159
Returns: Transforms
getIsTwoManifold
▸ getIsTwoManifold(): boolean
Inherited from Mesh.getIsTwoManifold
Defined in src/model/data/Concepts/Mesh/Mesh.ts:119
Returns: boolean
getIsValid
▸ getIsValid(): boolean
Implementation of IPositionableElement
Inherited from Mesh.getIsValid
Defined in src/model/data/Concepts/Mesh/Mesh.ts:241
Returns: boolean
getJointManager
▸ getJointManager(): SvgJointManager
Implementation of IAssemblingSvgSurface
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:69
Returns: SvgJointManager
getNumberOfNotDisabledSurfaces
▸ getNumberOfNotDisabledSurfaces(): number
Inherited from Mesh.getNumberOfNotDisabledSurfaces
Defined in src/model/data/Concepts/Mesh/Mesh.ts:215
Returns: number
getOriginalMesh
▸ getOriginalMesh(): SvgSurfaceDescriptor
Implementation of IAssemblingSvgSurface
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:141
Returns: SvgSurfaceDescriptor
getOriginalSvgMaterialThickness
▸ getOriginalSvgMaterialThickness(): number
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:77
Returns: number
getParent
▸ getParent(): ITransformable
Implementation of IPositionableElement
Defined in src/model/data/Concepts/Mesh/Mesh.ts:163
Returns: ITransformable
getPoints
▸ getPoints(): MeshPoint[]
Defined in src/model/data/Concepts/Mesh/Mesh.ts:131
Returns: MeshPoint[]
getSegment
▸ getSegment(): Segment
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:129
Returns: Segment
getSurface
▸ getSurface(): MeshSurface
Inherited from SingleSurfaceDescriptor.getSurface
Defined in src/model/data/Concepts/SingleSurfaceDescriptor.ts:42
Returns: MeshSurface
the single surface of this mesh
getSurfaces
▸ getSurfaces(): readonly MeshSurface[]
Inherited from Mesh.getSurfaces
Defined in src/model/data/Concepts/Mesh/Mesh.ts:111
Returns: readonly MeshSurface[]
the surfaces that define this mesh. Note that the transforms defined by the transforms-defining anchor are NOT applied (== surfaces are in "local coordinates"), this is the responsibility of whoever uses theses surfaces.
getSvgCutouts
▸ getSvgCutouts(): Vector3[][]
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:149
Returns: Vector3[][]
getSvgOutline
▸ getSvgOutline(): Vector3[]
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:145
Returns: Vector3[]
getSymmetryManager
▸ getSymmetryManager(): SvgSymmetryManager
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:85
Returns: SvgSymmetryManager
getTransforms
▸ getTransforms(): IReadOnlyTransforms | null
Implementation of IAssemblingSvgSurface
Inherited from Mesh.getTransforms
Defined in src/model/data/Concepts/Mesh/Mesh.ts:155
Returns: IReadOnlyTransforms | null
getTransformsChangeEventEmitter
▸ getTransformsChangeEventEmitter(): IPublicEventEmitterInterface‹ITransformsChangeEvent›
Implementation of IPositionableElement
Inherited from Mesh.getTransformsChangeEventEmitter
Defined in src/model/data/Concepts/Mesh/Mesh.ts:378
Returns: IPublicEventEmitterInterface‹ITransformsChangeEvent›
getTransformsDefiner
▸ getTransformsDefiner(): IPositioningAnchor | null
Implementation of IAssemblingSvgSurface
Inherited from Mesh.getTransformsDefiner
Defined in src/model/data/Concepts/Mesh/Mesh.ts:151
Returns: IPositioningAnchor | null
hasBrokenCutouts
▸ hasBrokenCutouts(): boolean
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:112
Returns: boolean
hasEdge
▸ hasEdge(edge: MeshHalfEdge): boolean
Defined in src/model/data/Concepts/Mesh/Mesh.ts:135
Parameters:
| Name | Type |
|---|---|
edge |
MeshHalfEdge |
Returns: boolean
hasSurface
▸ hasSurface(surface: MeshSurface): boolean
Inherited from Mesh.hasSurface
Defined in src/model/data/Concepts/Mesh/Mesh.ts:115
Parameters:
| Name | Type |
|---|---|
surface |
MeshSurface |
Returns: boolean
isSurfaceDisabled
▸ isSurfaceDisabled(surface: MeshSurface): boolean
Inherited from Mesh.isSurfaceDisabled
Defined in src/model/data/Concepts/Mesh/Mesh.ts:225
Parameters:
| Name | Type |
|---|---|
surface |
MeshSurface |
Returns: boolean
mapLocalDirectionToWorld
▸ mapLocalDirectionToWorld(localDirection: ReadonlyVector3, target: Vector3): Vector3
Inherited from Mesh.mapLocalDirectionToWorld
Defined in src/model/data/Concepts/Mesh/Mesh.ts:475
Maps a Vector3 direction from the mesh-local coordinate system to the world coordinate system Pretends identity transform if there is no assembly
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
localDirection |
ReadonlyVector3 | - | - |
target |
Vector3 | new Vector3() | - |
Returns: Vector3
mapLocalPositionToWorld
▸ mapLocalPositionToWorld(localPosition: ReadonlyVector3, target: Vector3): Vector3
Inherited from Mesh.mapLocalPositionToWorld
Defined in src/model/data/Concepts/Mesh/Mesh.ts:464
Maps a Vector3 position from the mesh-local coordinate system to the world coordinate system Pretends identity transform if there is no assembly
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
localPosition |
ReadonlyVector3 | - | - |
target |
Vector3 | new Vector3() | - |
Returns: Vector3
mapLocalRotationToWorld
▸ mapLocalRotationToWorld(localRotation: ReadonlyQuaternion, target: Quaternion): Quaternion
Inherited from Mesh.mapLocalRotationToWorld
Defined in src/model/data/Concepts/Mesh/Mesh.ts:486
Maps a Quaternion rotation from the mesh-local coordinate system to the world coordinate system Pretends identity transform if there is no assembly
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
localRotation |
ReadonlyQuaternion | - | - |
target |
Quaternion | new Quaternion() | - |
Returns: Quaternion
mapWorldDirectionToLocal
▸ mapWorldDirectionToLocal(worldDirection: Vector3, target: Vector3): Vector3
Inherited from Mesh.mapWorldDirectionToLocal
Defined in src/model/data/Concepts/Mesh/Mesh.ts:509
Maps a Vector3 direction from the world coordinate system to the mesh-local coordinate system Pretends identity transform if there is no assembly
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
worldDirection |
Vector3 | - | - |
target |
Vector3 | new Vector3() | - |
Returns: Vector3
mapWorldPositionToLocal
▸ mapWorldPositionToLocal(worldPosition: Vector3, target: Vector3): Vector3
Inherited from Mesh.mapWorldPositionToLocal
Defined in src/model/data/Concepts/Mesh/Mesh.ts:498
Maps a Vector3 position from the world coordinate system to the mesh-local coordinate system Pretends identity transform if there is no assembly
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
worldPosition |
Vector3 | - | - |
target |
Vector3 | new Vector3() | - |
Returns: Vector3
mapWorldRotationToLocal
▸ mapWorldRotationToLocal(worldRotation: Quaternion, target: Quaternion): Quaternion
Inherited from Mesh.mapWorldRotationToLocal
Defined in src/model/data/Concepts/Mesh/Mesh.ts:520
Maps a Quaternion rotation from the world coordinate system to the mesh-local coordinate system Pretends identity transform if there is no assembly
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
worldRotation |
Quaternion | - | - |
target |
Quaternion | new Quaternion() | - |
Returns: Quaternion
modify
▸ modify(callback: function): Promise‹void›
Inherited from SingleSurfaceDescriptor.modify
Defined in src/model/data/Concepts/SingleSurfaceDescriptor.ts:18
Parameters:
▪ callback: function
▸ (mesh: Mesh, meshImplementation: IMeshImplementation): Promise‹IMeshOperationResult›
Parameters:
| Name | Type |
|---|---|
mesh |
Mesh |
meshImplementation |
IMeshImplementation |
Returns: Promise‹void›
modifySync
▸ modifySync(callback: function): void
Inherited from SingleSurfaceDescriptor.modifySync
Overrides Mesh.modifySync
Defined in src/model/data/Concepts/SingleSurfaceDescriptor.ts:31
Parameters:
▪ callback: function
▸ (mesh: Mesh, meshImplementation: IMeshImplementation): IMeshOperationResult
Parameters:
| Name | Type |
|---|---|
mesh |
Mesh |
meshImplementation |
IMeshImplementation |
Returns: void
removeAnnotation
▸ removeAnnotation(meshAnnotation: MeshAnnotation): void
Inherited from Mesh.removeAnnotation
Defined in src/model/data/Concepts/Mesh/Mesh.ts:233
Removes an annotation from the set of mesh annotations
Parameters:
| Name | Type | Description |
|---|---|---|
meshAnnotation |
MeshAnnotation | - |
Returns: void
setAllJoints
▸ setAllJoints(value: Array‹Joint‹AtomicPattern››): void
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:133
Parameters:
| Name | Type |
|---|---|
value |
Array‹Joint‹AtomicPattern›› |
Returns: void
setAssembly
▸ setAssembly(assembly: Assembly): void
Implementation of IPositionableElement
Overrides Mesh.setAssembly
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:61
Parameters:
| Name | Type |
|---|---|
assembly |
Assembly |
Returns: void
setDimensionConception
▸ setDimensionConception(dimensionConception: DimensionConception): void
Inherited from Mesh.setDimensionConception
Defined in src/model/data/Concepts/Mesh/Mesh.ts:174
Parameters:
| Name | Type |
|---|---|
dimensionConception |
DimensionConception |
Returns: void
setImplementation
▸ setImplementation(implementation: IMeshImplementation): Mesh‹›
Inherited from SingleSurfaceDescriptor.setImplementation
Overrides Mesh.setImplementation
Defined in src/model/data/Concepts/SingleSurfaceDescriptor.ts:13
Parameters:
| Name | Type |
|---|---|
implementation |
IMeshImplementation |
Returns: Mesh‹›
setJointManager
▸ setJointManager(manager: SvgJointManager): void
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:73
Parameters:
| Name | Type |
|---|---|
manager |
SvgJointManager |
Returns: void
setOriginalSvgMaterialThickness
▸ setOriginalSvgMaterialThickness(originalSvgMaterialThickness: number): void
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:81
Parameters:
| Name | Type |
|---|---|
originalSvgMaterialThickness |
number |
Returns: void
setSegment
▸ setSegment(segment: Segment): void
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:102
Parameters:
| Name | Type |
|---|---|
segment |
Segment |
Returns: void
setShapeFromGlobalCoords
▸ setShapeFromGlobalCoords(outline: Vector3[], cutouts?: Vector3[][]): void
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:116
Parameters:
| Name | Type |
|---|---|
outline |
Vector3[] |
cutouts? |
Vector3[][] |
Returns: void
setShapeFromLocalCoords
▸ setShapeFromLocalCoords(outline: Vector3[], cutouts?: Vector3[][]): void
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:124
Parameters:
| Name | Type |
|---|---|
outline |
Vector3[] |
cutouts? |
Vector3[][] |
Returns: void
setSymmetryManager
▸ setSymmetryManager(manager: SvgSymmetryManager): void
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:89
Parameters:
| Name | Type |
|---|---|
manager |
SvgSymmetryManager |
Returns: void
setTransformsDefiner
▸ setTransformsDefiner(transformsAnchor: IPositioningAnchor | null): this
Implementation of IAssemblingSvgSurface
Inherited from Mesh.setTransformsDefiner
Defined in src/model/data/Concepts/Mesh/Mesh.ts:259
Replaces the transformsDefiningAnchor. Emits a transformsChange event with the new anchor.
Parameters:
| Name | Type | Description |
|---|---|---|
transformsAnchor |
IPositioningAnchor | null | - |
Returns: this
transferToAssembly
▸ transferToAssembly(destinationMesh: IAssemblingSvgSurface): void
Implementation of IAssemblingSvgSurface
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:93
Parameters:
| Name | Type |
|---|---|
destinationMesh |
IAssemblingSvgSurface |
Returns: void
Static Private _lineStripToVectors
▸ _lineStripToVectors(lineStrip: LineStrip): Vector3[]
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:156
Parameters:
| Name | Type |
|---|---|
lineStrip |
LineStrip |
Returns: Vector3[]
Static setFromSvgContext
▸ setFromSvgContext(svgContext: SvgContext, segment: Segment): Promise‹SvgSurfaceDescriptor›
Defined in src/model/data/Concepts/SvgSurfaceDescriptor.ts:26
Parameters:
| Name | Type |
|---|---|
svgContext |
SvgContext |
segment |
Segment |
Returns: Promise‹SvgSurfaceDescriptor›