Class: Plate
Hierarchy
↳ Plate
Implements
Index
Constructors
Properties
- boxelOperationId
- dimensionsConception
- highlightColor
- highlightStrength
- holes
- isValid
- lastShapeChangedRotation
- outline
- shapeChangeAngle
- textureOffsets
- textures
- toBeExtruded
- invalidColorizationColor
- invalidColorizationStrength
Methods
- _colorizeTexture
- _getAllowedEvents
- _getRotationParameters
- _getTextureMapKey
- _markMaterialChanged
- _onShapeChange
- _repositionInOutline
- addHole
- addJoint
- addMarker
- addOrnament
- clearAssembly
- clearBoxelOperationId
- clearCompositeModel
- clone
- determineSideOfLocalPoint
- determineSideOfPoint
- flipInPlace
- forceRepositionInOutline
- getAllConnectedPhysicalObjects
- getAllOutlinePoints
- getAllOutlinePoints3D
- getAllOutlineSections
- getArea
- getAssembly
- getAssemblyAABB
- getAssemblyLocalPoints
- getBoxelOperationId
- getCompositeModel
- getDimensionsConception
- getHalfMaterialThickness
- getHint
- getHoles
- getIsExternalPlate
- getIsValid
- getJointPossibilities
- getJoints
- getLocalAABB
- getLowQualityRendering
- getMarkers
- getMaterial
- getMaterialColor
- getMaterialThickness
- getMaterialType
- getNormal
- getObjectLocalPoints
- getOrnaments
- getOtherSide
- getOutline
- getParent
- getPhysEngineBody
- getPhysicsMaterial
- getPhysicsShapeDirty
- getPhysicsTransformsDirty
- getPosition
- getRealizer
- getRotation
- getSurfaceHeight
- getTexture
- getTextureOffset
- getTransforms
- getUid
- getVisualizationShapeDirty
- getVisualizationTransformsDirty
- getWorldAABB
- getWorldPoints
- getWorldPosition
- hasCutouts
- hasEngravings
- hasOrnament
- highlightIn
- initializeTextureOffset
- invertNormal
- isConnectedToPhysicalObject
- isHighlighted
- isVisible
- isolate
- mapAssemblyAxisToLocal
- mapAssemblyToLocal
- mapLocalAxisToAssembly
- mapLocalAxisToWorld
- mapLocalToAssembly
- mapLocalToWorld
- mapWorldAxisToLocal
- mapWorldToLocal
- markPhysicsTransformsDirty
- markPlateValid
- markShapeHasChanged
- markTransformsHaveChanged
- needsCustomMaterial
- prepareForTransforms
- removeHighlights
- removeHole
- removeJoint
- removeMarker
- removeOrnament
- resetPhysicsShapeDirty
- resetPhysicsTransformsDirty
- resetVisualizationShapeDirty
- resetVisualizationTransformsDirty
- rotate
- setAssembly
- setBoxelOperationId
- setCompositeModel
- setDimensionsConception
- setHint
- setHoles
- setInPlateRotation
- setLowQualityRendering
- setMaterial
- setMaterialColor
- setMaterialThickness
- setMaterialType
- setOutline
- setPosition
- setPositionWithoutChange
- setRealizer
- setRotation
- setToBeExtruded
- setVisible
- shouldBeExtruded
- toGeoJson
- toString
- translate
- unprepareFromTransforms
Object literals
Constructors
constructor
+ new Plate(options: IPlateOptions): Plate
Overrides PhysicalObject.constructor
Defined in src/model/data/PhysicalObject/Plate.ts:160
Creates a flat plate
Parameters:
| Name | Type | Default |
|---|---|---|
options |
IPlateOptions | {} |
Returns: Plate
Properties
Private boxelOperationId
• boxelOperationId: number = null
Defined in src/model/data/PhysicalObject/Plate.ts:140
This number distinguishes different sub-assemblies for the BoxelQueue
Private dimensionsConception
• dimensionsConception: DimensionConception = DimensionConception.MIDDLE
Defined in src/model/data/PhysicalObject/Plate.ts:135
Private highlightColor
• highlightColor: Color | null = null
Defined in src/model/data/PhysicalObject/Plate.ts:155
the color this plate is highlighted in, if any
Private highlightStrength
• highlightStrength: number = 0
Defined in src/model/data/PhysicalObject/Plate.ts:160
how strong to apply highlightColor, if it is not null
Private holes
• holes: Outline[] = []
Defined in src/model/data/PhysicalObject/Plate.ts:107
Array of Outline objects of the holes
Private isValid
• isValid: boolean = true
Defined in src/model/data/PhysicalObject/Plate.ts:145
If false, the plate will be rendered with a different color to indicate that it is invalid.
Private lastShapeChangedRotation
• lastShapeChangedRotation: any = null
Defined in src/model/data/PhysicalObject/Plate.ts:128
The last rotation for which 'shapeHasChanged' was called on all connected plates.
Private outline
• outline: Outline | null = null
Defined in src/model/data/PhysicalObject/Plate.ts:102
Outline of the plate shape
Private shapeChangeAngle
• shapeChangeAngle: number = 0.05
Defined in src/model/data/PhysicalObject/Plate.ts:133
Angle where a shape change will be called for the connected plates. In rad.
Private textureOffsets
• textureOffsets: object
Defined in src/model/data/PhysicalObject/Plate.ts:97
This object stores the texture offsets for each key. This is necessary, because the plate may loose its texture (e.g. when undoing). In this case the texture will be reinstantiated with the saved offset. NOTICE: Not to be confused with the outline's textureOffset: the outline's textureOffset defines the texture coordinate system based on the plate's 2D coordinate system (and needs to change if the plate changes), these texture offsets here are points in the texture coordinate system (thus should keep same values in order to prevent textures from flickering)
Type declaration:
Private textures
• textures: object
Defined in src/model/data/PhysicalObject/Plate.ts:87
Store a reference to the texture for each key. See _getTextureMapKey
Type declaration:
Private toBeExtruded
• toBeExtruded: boolean = false
Defined in src/model/data/PhysicalObject/Plate.ts:150
If this is set to true, the plate will be extruded in the see ExtrudeStep of the Visualization Pipeline
Static Private invalidColorizationColor
▪ invalidColorizationColor: Color‹› = new Color(Config.get("rendering.invalidPlateColorize"))
Defined in src/model/data/PhysicalObject/Plate.ts:72
Static Private invalidColorizationStrength
▪ invalidColorizationStrength: number = Config.get("rendering.invalidPlateColorizeStrength")
Defined in src/model/data/PhysicalObject/Plate.ts:73
Methods
Private _colorizeTexture
▸ _colorizeTexture(texture: KyubTexture): void
Defined in src/model/data/PhysicalObject/Plate.ts:1214
Parameters:
| Name | Type |
|---|---|
texture |
KyubTexture |
Returns: void
Protected _getAllowedEvents
▸ _getAllowedEvents(): string[]
Overrides PhysicalObject._getAllowedEvents
Defined in src/model/data/PhysicalObject/Plate.ts:1189
Returns: string[]
_getRotationParameters
▸ _getRotationParameters(oldNormal: Vector3, newNormal: Vector3, movedPoints: OutlinePoint[], staticPoints: OutlinePoint[]): object
Defined in src/model/data/PhysicalObject/Plate.ts:886
This method computes the most likely rotation that happened between oldNormal and newNormal. The reason why this is necessary is that using setFromUnitVectors alone leaves one degree of freedom for the rotation: Around the targetVector. Now, this method looks at the points that moved and tries to infer the rotation axis and a rotation point in order to minimize unwanted rotation of the plate within its coordinate system.
Parameters:
| Name | Type | Description |
|---|---|---|
oldNormal |
Vector3 | the previous plate normal |
newNormal |
Vector3 | the new plate normal |
movedPoints |
OutlinePoint[] | The points that moved |
staticPoints |
OutlinePoint[] | The points that did not move |
Returns: object
-
deltaRotation: Quaternion‹›
-
rotationPoint: Vector3‹›
Private _getTextureMapKey
▸ _getTextureMapKey(meshName: MeshName, renderCutouts: boolean): string
Defined in src/model/data/PhysicalObject/Plate.ts:1210
The key is created by concatenation of side ('side', 'front' or 'back') and the switch whether cutouts should be rendered on this material (false for plate margin geometry, true for the center plate geometry)
Parameters:
| Name | Type |
|---|---|
meshName |
MeshName |
renderCutouts |
boolean |
Returns: string
Private _markMaterialChanged
▸ _markMaterialChanged(): void
Defined in src/model/data/PhysicalObject/Plate.ts:1193
Returns: void
_onShapeChange
▸ _onShapeChange(...movedPoints: OutlinePoint[]): void
Defined in src/model/data/PhysicalObject/Plate.ts:749
Parameters:
| Name | Type |
|---|---|
...movedPoints |
OutlinePoint[] |
Returns: void
_repositionInOutline
▸ _repositionInOutline(force: boolean, keepHolesStable: boolean, keepOrnamentsStable: boolean, movedPoints: OutlinePoint[]): void
Defined in src/model/data/PhysicalObject/Plate.ts:766
Called by the outline when it changes
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
force |
boolean | false | force the recalculation of the rotation |
keepHolesStable |
boolean | true | if true, hole positions will be kept stable in the assembly coordinate system |
keepOrnamentsStable |
boolean | true | if true, ornament positions will be kept stable in assembly space, so the ornament is in the same position afterwards |
movedPoints |
OutlinePoint[] | [] | the points that changed their position. These are used to keep the rotation of the plate stable, if possible. |
Returns: void
addHole
▸ addHole(hole: Outline): void
Defined in src/model/data/PhysicalObject/Plate.ts:661
Parameters:
| Name | Type |
|---|---|
hole |
Outline |
Returns: void
addJoint
▸ addJoint(joint: Joint, ownJointPossibility: JointPossibility): void
Inherited from PhysicalObject.addJoint
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:289
Add a joint to the physical object. Only to be called from Joint constructor.
Parameters:
| Name | Type |
|---|---|
joint |
Joint |
ownJointPossibility |
JointPossibility |
Returns: void
addMarker
▸ addMarker(marker: Ornament, side: PlateSides): void
Defined in src/model/data/PhysicalObject/Plate.ts:354
Parameters:
| Name | Type |
|---|---|
marker |
Ornament |
side |
PlateSides |
Returns: void
addOrnament
▸ addOrnament(ornament: Ornament, side: PlateSides): void
Defined in src/model/data/PhysicalObject/Plate.ts:316
Parameters:
| Name | Type | Description |
|---|---|---|
ornament |
Ornament | The ornament to add to the plate. |
side |
PlateSides | Either 'front', 'back' or 'both'. This determines which side(s) the ornament is added to. |
Returns: void
clearAssembly
▸ clearAssembly(): void
Inherited from PhysicalObject.clearAssembly
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:491
Clears the assembly. Only to be called by the composite model upon removal
Returns: void
clearBoxelOperationId
▸ clearBoxelOperationId(): void
Defined in src/model/data/PhysicalObject/Plate.ts:240
Returns: void
clearCompositeModel
▸ clearCompositeModel(): void
Inherited from PhysicalObject.clearCompositeModel
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:325
Returns: void
clone
▸ clone(): Plate
Defined in src/model/data/PhysicalObject/Plate.ts:937
Clones this plate with its material, thickness, position and rotation. Position and rotation will be reset to world coordinate system Does NOT clone joints, compositeModel etc
Returns: Plate
determineSideOfLocalPoint
▸ determineSideOfLocalPoint(localPoint: Vector3): PlateSide
Defined in src/model/data/PhysicalObject/Plate.ts:1003
Parameters:
| Name | Type | Description |
|---|---|---|
localPoint |
Vector3 | The point that the user clicked on, local coordinates |
Returns: PlateSide
Either 'front' or 'back', depending on the relative position of intersectionPoint and plate.
determineSideOfPoint
▸ determineSideOfPoint(worldPoint: Vector3): PlateSide
Defined in src/model/data/PhysicalObject/Plate.ts:995
Parameters:
| Name | Type | Description |
|---|---|---|
worldPoint |
Vector3 | The point that the user clicked on, world coordinates |
Returns: PlateSide
Either 'front' or 'back', depending on the relative position of intersectionPoint and plate.
flipInPlace
▸ flipInPlace(): void
Defined in src/model/data/PhysicalObject/Plate.ts:1043
Flips the plate around (i.e. invert its normal by reversing the outline, which results in a 180°-y-rotation in repositionInOutline()), transfers ornaments to stay at the same world position, moves the plate if it is außenmaß to make the physical shape stay the same
Returns: void
forceRepositionInOutline
▸ forceRepositionInOutline(keepHolesStable: boolean, keepOrnamentsStable: boolean): void
Defined in src/model/data/PhysicalObject/Plate.ts:753
Parameters:
| Name | Type | Default |
|---|---|---|
keepHolesStable |
boolean | - |
keepOrnamentsStable |
boolean | true |
Returns: void
getAllConnectedPhysicalObjects
▸ getAllConnectedPhysicalObjects(onlySameAssembly: boolean): PhysicalObject[]
Inherited from PhysicalObject.getAllConnectedPhysicalObjects
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:280
Finds and returns all connected physical objects
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
onlySameAssembly |
boolean | true | If set to true, joints that span over multiple assemblies (and the associated physical object) will be ignored |
Returns: PhysicalObject[]
All connected physical objects
getAllOutlinePoints
▸ getAllOutlinePoints(): OutlinePoint[]
Defined in src/model/data/PhysicalObject/Plate.ts:625
Return all the outline points of this plate. This includes the outline's points as well as the holes'.
Returns: OutlinePoint[]
the outline sections
getAllOutlinePoints3D
▸ getAllOutlinePoints3D(): Vector3[]
Defined in src/model/data/PhysicalObject/Plate.ts:636
Return all outline points as assembly positions
Returns: Vector3[]
getAllOutlineSections
▸ getAllOutlineSections(): OutlineSection[]
Defined in src/model/data/PhysicalObject/Plate.ts:609
Return all the outline sections of this plate. This includes the outline as well as the holes.
Returns: OutlineSection[]
the outline sections
getArea
▸ getArea(): number
Defined in src/model/data/PhysicalObject/Plate.ts:678
calculate the area of this plate, taking holes into account
Returns: number
getAssembly
▸ getAssembly(): Assembly
Inherited from PhysicalObject.getAssembly
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:495
Returns: Assembly
getAssemblyAABB
▸ getAssemblyAABB(): AABB
Inherited from PhysicalObject.getAssemblyAABB
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:593
Returns: AABB
getAssemblyLocalPoints
▸ getAssemblyLocalPoints(exact: boolean): Vector3[]
Inherited from PhysicalObject.getAssemblyLocalPoints
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:589
Get points in assembly space roughly representing the shape of this object. This may not be an accurate rendering of all the points.
Parameters:
| Name | Type | Default |
|---|---|---|
exact |
boolean | true |
Returns: Vector3[]
The points in assembly space
getBoxelOperationId
▸ getBoxelOperationId(): number
Defined in src/model/data/PhysicalObject/Plate.ts:232
Returns: number
getCompositeModel
▸ getCompositeModel(): CompositeModel
Inherited from PhysicalObject.getCompositeModel
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:321
Returns: CompositeModel
The composite model this object belongs to
getDimensionsConception
▸ getDimensionsConception(): DimensionConception
Defined in src/model/data/PhysicalObject/Plate.ts:244
Returns: DimensionConception
getHalfMaterialThickness
▸ getHalfMaterialThickness(): number
Defined in src/model/data/PhysicalObject/Plate.ts:468
Returns: number
Half Material thickness in mm
getHint
▸ getHint(key: string, defaultValue: any): any
Inherited from PhysicalObject.getHint
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:535
Retrieve a hint for this object
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
key |
string | - | The name of the hint |
defaultValue |
any | null | Default value if hint is not defined Used hints: - (plate) passThroughPlate if true, the plate will not be attempted to be merged or joined with other plates upon export - (plate) importedJoints (An array of finger joints for use by the AssembleTool. Only set temporarily during the SVG import.) - (plate) physicsEngineThickness [Float] (Temporary thickness of the physical representation of the plate during push pull (collisionhandling).) - (externalObject) physicsEngineBodyType (One of: Body.DYNAMIC, Body.STATIC and Body.KINEMATIC see http://schteppe.github.io/cannon.js/docs/classes/Body.html) - (externalObject) ignoreWindSimulation [Boolean] (if true this object will be ignored in the wind simulation) - (externalObject) shading ('smooth' or 'flat' which equals with THREE.FlatShading or THREE.SmoothShading see https://threejs.org/docs/#Reference/Materials/MeshPhongMaterial.shading) - (externalObject) backgroundPartSpec the specs of the background part. Used for resetting background parts. - (any) lowQuality A hint for the renderer to render this physical object in lower quality. How this is achieved depends on the implementation of the renderer. - (externalObject) isSizeReferenceObject is used by the SizeReferenceTool. It flags Objects created by it to remove them, when a new SizeReferenceObject is created. - (physicalObject) notInteractable [Boolean] if true, tools cannot interact with this object |
Returns: any
getHoles
▸ getHoles(): Outline[]
Defined in src/model/data/PhysicalObject/Plate.ts:644
this should return the holes in the same order as they were set
Returns: Outline[]
array of 2d outlines of the holes
getIsExternalPlate
▸ getIsExternalPlate(): boolean
Defined in src/model/data/PhysicalObject/Plate.ts:400
Returns: boolean
getIsValid
▸ getIsValid(): boolean
Defined in src/model/data/PhysicalObject/Plate.ts:1157
Returns: boolean
getJointPossibilities
▸ getJointPossibilities(interactionPoint: Vector3): object[]
Overrides PhysicalObject.getJointPossibilities
Defined in src/model/data/PhysicalObject/Plate.ts:745
See {@link PhysicalObject#getJointPossibilities}
Parameters:
| Name | Type |
|---|---|
interactionPoint |
Vector3 |
Returns: object[]
getJoints
▸ getJoints(): Joint[]
Inherited from PhysicalObject.getJoints
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:270
Returns: Joint[]
Array of all joints to other objects
getLocalAABB
▸ getLocalAABB(): AABB
Inherited from PhysicalObject.getLocalAABB
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:621
This may not take into account all points, but only yields a rough representation.
Returns: AABB
This object's AABB in local space
getLowQualityRendering
▸ getLowQualityRendering(): boolean
Inherited from PhysicalObject.getLowQualityRendering
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:570
Returns: boolean
getMarkers
▸ getMarkers(side: PlateSides): Ornament[]
Defined in src/model/data/PhysicalObject/Plate.ts:295
Parameters:
| Name | Type | Description |
|---|---|---|
side |
PlateSides | Either 'front', 'back' or 'both'. This determines which side's markers you get. |
Returns: Ornament[]
The markers on the specified side(s).
getMaterial
▸ getMaterial(): IPlateMaterial
Defined in src/model/data/PhysicalObject/Plate.ts:419
Returns: IPlateMaterial
getMaterialColor
▸ getMaterialColor(): number | null
Defined in src/model/data/PhysicalObject/Plate.ts:454
Returns: number | null
the color of the material, as hex rgb
getMaterialThickness
▸ getMaterialThickness(): number
Defined in src/model/data/PhysicalObject/Plate.ts:461
Returns: number
Material thickness in mm
getMaterialType
▸ getMaterialType(): string
Defined in src/model/data/PhysicalObject/Plate.ts:437
Returns: string
the material type id of this plate
getNormal
▸ getNormal(space: "assembly" | "world", target: Vector3‹›): Vector3
Inherited from PhysicalObject.getNormal
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:452
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
space |
"assembly" | "world" | "assembly" | Defines the result coordinate system |
target |
Vector3‹› | new Vector3() | (optional) Vector that will receive the calculation result |
Returns: Vector3
The vector (0, 0, 1) transformed to assembly or world space
getObjectLocalPoints
▸ getObjectLocalPoints(exact: boolean): Vector3[]
Overrides PhysicalObject.getObjectLocalPoints
Defined in src/model/data/PhysicalObject/Plate.ts:954
Parameters:
| Name | Type | Default |
|---|---|---|
exact |
boolean | true |
Returns: Vector3[]
getOrnaments
▸ getOrnaments(side: PlateSides): Ornament[]
Defined in src/model/data/PhysicalObject/Plate.ts:260
Parameters:
| Name | Type | Description |
|---|---|---|
side |
PlateSides | Either 'front', 'back' or 'both'. This determines which side's ornaments you get. |
Returns: Ornament[]
The Ornaments on the specified side(s).
getOtherSide
▸ getOtherSide(side: PlateSide): PlateSide
Defined in src/model/data/PhysicalObject/Plate.ts:1016
Parameters:
| Name | Type | Description |
|---|---|---|
side |
PlateSide | either 'front' or 'back' |
Returns: PlateSide
'back' if side is front, 'front' if side is 'back'
getOutline
▸ getOutline(): Outline
Defined in src/model/data/PhysicalObject/Plate.ts:592
Returns: Outline
Outline the 2d outline of the plate
getParent
▸ getParent(): ITransformable
Implementation of ITransformable
Inherited from PhysicalObject.getParent
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:90
Returns: ITransformable
getPhysEngineBody
▸ getPhysEngineBody(): any
Inherited from PhysicalObject.getPhysEngineBody
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:179
Returns: any
The physics simulation body associated with this physical object
getPhysicsMaterial
▸ getPhysicsMaterial(): any
Defined in src/model/data/PhysicalObject/Plate.ts:585
Returns: any
getPhysicsShapeDirty
▸ getPhysicsShapeDirty(): boolean
Inherited from PhysicalObject.getPhysicsShapeDirty
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:250
Returns: boolean
Whether this object's shape should be considered dirty regarding its physics representation
getPhysicsTransformsDirty
▸ getPhysicsTransformsDirty(): boolean
Inherited from PhysicalObject.getPhysicsTransformsDirty
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:257
Returns: boolean
Whether this object's transforms should be considered dirty regarding its physics representation
getPosition
▸ getPosition(target: Vector3‹›): Vector3‹›
Inherited from PhysicalObject.getPosition
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:137
Parameters:
| Name | Type | Default |
|---|---|---|
target |
Vector3‹› | new Vector3() |
Returns: Vector3‹›
Position of the object, in assembly space. If the object does not have an assembly assigned the position is in world space.
getRealizer
▸ getRealizer(): IModelElementRealizer‹IModelElement› | IModelElementRealizer‹Mesh›
Inherited from PhysicalObject.getRealizer
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:82
Returns: IModelElementRealizer‹IModelElement› | IModelElementRealizer‹Mesh›
getRotation
▸ getRotation(target: Quaternion): Quaternion
Inherited from PhysicalObject.getRotation
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:158
Parameters:
| Name | Type | Default |
|---|---|---|
target |
Quaternion | new Quaternion() |
Returns: Quaternion
Rotation of the object, in assembly-local space
getSurfaceHeight
▸ getSurfaceHeight(plateSide: PlateSide): number
Defined in src/model/data/PhysicalObject/Plate.ts:1136
Returns the distance from plane to specified plate surface
Parameters:
| Name | Type | Description |
|---|---|---|
plateSide |
PlateSide | either 'front' or 'back' |
Returns: number
distance from plane to specified surface
getTexture
▸ getTexture(meshName: MeshName, shared: boolean, renderCutouts: boolean): KyubTexture
Defined in src/model/data/PhysicalObject/Plate.ts:506
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
meshName |
MeshName | - | Either 'front', 'back', 'outlineSide' or 'holeSide'. This determines which material you get. |
shared |
boolean | true | Whether - the backing Material instance may be shared with other plates. |
renderCutouts |
boolean | true | whether the material is supposed to render cutouts or not. Used to create the safe margins at the plate border |
Returns: KyubTexture
The material which should be used to render this plate as kyub texture.
getTextureOffset
▸ getTextureOffset(meshName: MeshName): Vector3
Defined in src/model/data/PhysicalObject/Plate.ts:558
Parameters:
| Name | Type |
|---|---|
meshName |
MeshName |
Returns: Vector3
KyubTexture offset of the specified texture
getTransforms
▸ getTransforms(): IReadOnlyTransforms
Implementation of ITransformable
Inherited from PhysicalObject.getTransforms
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:86
Returns: IReadOnlyTransforms
getUid
▸ getUid(): string
Inherited from PhysicalObject.getUid
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:74
Returns: string
getVisualizationShapeDirty
▸ getVisualizationShapeDirty(): boolean
Inherited from PhysicalObject.getVisualizationShapeDirty
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:236
Returns: boolean
Whether this object's shape should be considered dirty regarding its visualization
getVisualizationTransformsDirty
▸ getVisualizationTransformsDirty(): boolean
Inherited from PhysicalObject.getVisualizationTransformsDirty
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:243
Returns: boolean
Whether this object's transforms should be considered dirty regarding its visualization
getWorldAABB
▸ getWorldAABB(): AABB
Inherited from PhysicalObject.getWorldAABB
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:630
This may not take into account all points, but only yields a rough representation.
Returns: AABB
This object's AABB in world space
getWorldPoints
▸ getWorldPoints(exact: boolean): Vector3[]
Inherited from PhysicalObject.getWorldPoints
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:607
Get points in world space roughly representing the shape of this object. This may not be an accurate rendering of all the points. Note: This is currently used by: - WaterSimulationAddOn to determine the submerged volume - PositionHintFilterStrategy to determine overlap of hints with objects in the scene - CameraMotion to detect view frustum fitting
Parameters:
| Name | Type | Default |
|---|---|---|
exact |
boolean | true |
Returns: Vector3[]
The points in world space
getWorldPosition
▸ getWorldPosition(): Vector3
Inherited from PhysicalObject.getWorldPosition
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:502
Maps the value of #getPosition through the assembly back to world, if an assembly is present.
Returns: Vector3
hasCutouts
▸ hasCutouts(area: AABB, side: PlateSides): boolean
Defined in src/model/data/PhysicalObject/Plate.ts:396
Returns true if the plate has cutouts in the specified plate coordinates area
Parameters:
| Name | Type | Default |
|---|---|---|
area |
AABB | null |
side |
PlateSides | PlateSides.BOTH |
Returns: boolean
hasEngravings
▸ hasEngravings(area: AABB, side: PlateSides): boolean
Defined in src/model/data/PhysicalObject/Plate.ts:389
Returns true if the plate has engravings in the specified plate coordinate area
Parameters:
| Name | Type | Default |
|---|---|---|
area |
AABB | null |
side |
PlateSides | PlateSides.BOTH |
Returns: boolean
hasOrnament
▸ hasOrnament(ornament: Ornament, side: PlateSides): boolean
Defined in src/model/data/PhysicalObject/Plate.ts:278
Parameters:
| Name | Type | Description |
|---|---|---|
ornament |
Ornament | will be searched for (by identity) |
side |
PlateSides | Either 'front', 'back' or 'both'. This determines which side's ornaments you get. |
Returns: boolean
If the ornament instance is present at the specified side
highlightIn
▸ highlightIn(color: Color, strength: number): void
Defined in src/model/data/PhysicalObject/Plate.ts:211
Parameters:
| Name | Type | Default |
|---|---|---|
color |
Color | - |
strength |
number | 0.5 |
Returns: void
initializeTextureOffset
▸ initializeTextureOffset(meshName: MeshName, offset: Vector3): void
Defined in src/model/data/PhysicalObject/Plate.ts:575
Initializes the specified offset
Parameters:
| Name | Type |
|---|---|
meshName |
MeshName |
offset |
Vector3 |
Returns: void
invertNormal
▸ invertNormal(): void
Defined in src/model/data/PhysicalObject/Plate.ts:1027
Reverse all contained outlines to invert plate normal/ 'flip' the plate around
Returns: void
isConnectedToPhysicalObject
▸ isConnectedToPhysicalObject(physicalObject: PhysicalObject): boolean
Inherited from PhysicalObject.isConnectedToPhysicalObject
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:461
Parameters:
| Name | Type |
|---|---|
physicalObject |
PhysicalObject |
Returns: boolean
isHighlighted
▸ isHighlighted(): boolean
Defined in src/model/data/PhysicalObject/Plate.ts:228
Returns: boolean
isVisible
▸ isVisible(): boolean
Inherited from PhysicalObject.isVisible
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:639
Returns: boolean
isolate
▸ isolate(onlyDestroyJointsTo: any[], keepJointsTo: any[]): void
Overrides PhysicalObject.isolate
Defined in src/model/data/PhysicalObject/Plate.ts:489
see {@link PhysicalObject#isolate}
Parameters:
| Name | Type | Default |
|---|---|---|
onlyDestroyJointsTo |
any[] | [] |
keepJointsTo |
any[] | [] |
Returns: void
mapAssemblyAxisToLocal
▸ mapAssemblyAxisToLocal(assemblyAxis: ReadonlyVector3, target?: Vector3): Vector3
Inherited from PhysicalObject.mapAssemblyAxisToLocal
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:422
Deprecated: Use getTransforms().mapGlobalDirectionToLocal instead
deprecated
Parameters:
| Name | Type |
|---|---|
assemblyAxis |
ReadonlyVector3 |
target? |
Vector3 |
Returns: Vector3
mapAssemblyToLocal
▸ mapAssemblyToLocal(assemblyPointOrQuaternion: Quaternion, targetPointOrQuaternion?: Quaternion): Quaternion
Inherited from PhysicalObject.mapAssemblyToLocal
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:344
Deprecated: Use getTransforms().mapGlobalPositionToLocal or
getTransforms().mapGlobalRotationToLocal instead
Maps a point/quaternion from the assembly coordinate system into the object local coordinate system (undo rotation and translation)
deprecated
Parameters:
| Name | Type |
|---|---|
assemblyPointOrQuaternion |
Quaternion |
targetPointOrQuaternion? |
Quaternion |
Returns: Quaternion
▸ mapAssemblyToLocal(assemblyPointOrQuaternion: Vector3, targetPointOrQuaternion?: Vector3): Vector3
Inherited from PhysicalObject.mapAssemblyToLocal
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:346
deprecated
Parameters:
| Name | Type |
|---|---|
assemblyPointOrQuaternion |
Vector3 |
targetPointOrQuaternion? |
Vector3 |
Returns: Vector3
mapLocalAxisToAssembly
▸ mapLocalAxisToAssembly(localAxis: Vector3, target?: Vector3): Vector3
Inherited from PhysicalObject.mapLocalAxisToAssembly
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:430
Deprecated: Use getTransforms().mapLocalDirectionToGlobal instead
deprecated
Parameters:
| Name | Type |
|---|---|
localAxis |
Vector3 |
target? |
Vector3 |
Returns: Vector3
mapLocalAxisToWorld
▸ mapLocalAxisToWorld(localAxis: Vector3, target?: Vector3): Vector3
Inherited from PhysicalObject.mapLocalAxisToWorld
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:434
Parameters:
| Name | Type |
|---|---|
localAxis |
Vector3 |
target? |
Vector3 |
Returns: Vector3
mapLocalToAssembly
▸ mapLocalToAssembly(localPointOrQuaternion: Quaternion, targetPointOrQuaternion?: Quaternion): Quaternion
Inherited from PhysicalObject.mapLocalToAssembly
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:366
Deprecated: Use getTransforms().mapLocalPositionToGlobal or
getTransforms().mapLocalRotationToGlobal instead
Maps a point/quaternion from the local coordinate system into the assembly system (applies rotation and translation)
deprecated
Parameters:
| Name | Type | Description |
|---|---|---|
localPointOrQuaternion |
Quaternion | - |
targetPointOrQuaternion? |
Quaternion | - |
Returns: Quaternion
▸ mapLocalToAssembly(localPointOrQuaternion: Vector3, targetPointOrQuaternion?: Vector3): Vector3
Inherited from PhysicalObject.mapLocalToAssembly
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:368
deprecated
Parameters:
| Name | Type |
|---|---|
localPointOrQuaternion |
Vector3 |
targetPointOrQuaternion? |
Vector3 |
Returns: Vector3
mapLocalToWorld
▸ mapLocalToWorld(localPointOrQuaternion: Quaternion, targetPointOrQuaternion?: Quaternion): Quaternion
Inherited from PhysicalObject.mapLocalToWorld
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:397
Maps a point/quaternion from the object local coordinate system into the world system (using the assembly if set)
Parameters:
| Name | Type |
|---|---|
localPointOrQuaternion |
Quaternion |
targetPointOrQuaternion? |
Quaternion |
Returns: Quaternion
▸ mapLocalToWorld(localPointOrQuaternion: Vector3, targetPointOrQuaternion?: Vector3): Vector3
Inherited from PhysicalObject.mapLocalToWorld
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:398
Parameters:
| Name | Type |
|---|---|
localPointOrQuaternion |
Vector3 |
targetPointOrQuaternion? |
Vector3 |
Returns: Vector3
mapWorldAxisToLocal
▸ mapWorldAxisToLocal(worldAxis: ReadonlyVector3, target?: Vector3): Vector3
Inherited from PhysicalObject.mapWorldAxisToLocal
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:412
Parameters:
| Name | Type |
|---|---|
worldAxis |
ReadonlyVector3 |
target? |
Vector3 |
Returns: Vector3
mapWorldToLocal
▸ mapWorldToLocal(worldPointOrQuaternion: ReadonlyQuaternion, targetPointOrQuaternion?: Quaternion): Quaternion
Inherited from PhysicalObject.mapWorldToLocal
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:381
Maps a point/quaternion from the world coordinate system into the object local system (using the assembly if set)
Parameters:
| Name | Type |
|---|---|
worldPointOrQuaternion |
ReadonlyQuaternion |
targetPointOrQuaternion? |
Quaternion |
Returns: Quaternion
▸ mapWorldToLocal(worldPointOrQuaternion: ReadonlyVector3, targetPointOrQuaternion?: Vector3): Vector3
Inherited from PhysicalObject.mapWorldToLocal
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:382
Parameters:
| Name | Type |
|---|---|
worldPointOrQuaternion |
ReadonlyVector3 |
targetPointOrQuaternion? |
Vector3 |
Returns: Vector3
markPhysicsTransformsDirty
▸ markPhysicsTransformsDirty(): void
Inherited from PhysicalObject.markPhysicsTransformsDirty
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:189
Returns: void
markPlateValid
▸ markPlateValid(newValue: boolean): void
Defined in src/model/data/PhysicalObject/Plate.ts:1149
Parameters:
| Name | Type |
|---|---|
newValue |
boolean |
Returns: void
markShapeHasChanged
▸ markShapeHasChanged(): void
Inherited from PhysicalObject.markShapeHasChanged
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:261
Returns: void
markTransformsHaveChanged
▸ markTransformsHaveChanged(): void
Inherited from PhysicalObject.markTransformsHaveChanged
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:183
Returns: void
needsCustomMaterial
▸ needsCustomMaterial(): boolean
Defined in src/model/data/PhysicalObject/Plate.ts:551
Returns: boolean
prepareForTransforms
▸ prepareForTransforms(): Vertex[][]
Overrides PhysicalObject.prepareForTransforms
Defined in src/model/data/PhysicalObject/Plate.ts:1103
Returns: Vertex[][]
removeHighlights
▸ removeHighlights(): void
Defined in src/model/data/PhysicalObject/Plate.ts:220
Returns: void
removeHole
▸ removeHole(hole: Outline): void
Defined in src/model/data/PhysicalObject/Plate.ts:668
Parameters:
| Name | Type |
|---|---|
hole |
Outline |
Returns: void
removeJoint
▸ removeJoint(joint: Joint): void
Inherited from PhysicalObject.removeJoint
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:302
Removes a joint from the physical object. Only to be called from Joint.destroy()
Parameters:
| Name | Type |
|---|---|
joint |
Joint |
Returns: void
removeMarker
▸ removeMarker(marker: Ornament): void
Defined in src/model/data/PhysicalObject/Plate.ts:378
Parameters:
| Name | Type |
|---|---|
marker |
Ornament |
Returns: void
removeOrnament
▸ removeOrnament(ornament: Ornament): void
Defined in src/model/data/PhysicalObject/Plate.ts:344
Parameters:
| Name | Type |
|---|---|
ornament |
Ornament |
Returns: void
resetPhysicsShapeDirty
▸ resetPhysicsShapeDirty(): boolean
Inherited from PhysicalObject.resetPhysicsShapeDirty
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:227
Resets the physicsTransformsDirty flag.
Returns: boolean
The state of the flag before reset
resetPhysicsTransformsDirty
▸ resetPhysicsTransformsDirty(): boolean
Inherited from PhysicalObject.resetPhysicsTransformsDirty
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:217
Resets the physicsShapeDirty flag.
Returns: boolean
The state of the flag before reset
resetVisualizationShapeDirty
▸ resetVisualizationShapeDirty(): boolean
Inherited from PhysicalObject.resetVisualizationShapeDirty
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:207
Resets the visualizationTransformsDirty flag.
Returns: boolean
The state of the flag before reset
resetVisualizationTransformsDirty
▸ resetVisualizationTransformsDirty(): boolean
Inherited from PhysicalObject.resetVisualizationTransformsDirty
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:197
Resets the visualizationShapeDirty flag.
Returns: boolean
The state of the flag before reset
rotate
▸ rotate(rotation: Quaternion): void
Overrides PhysicalObject.rotate
Defined in src/model/data/PhysicalObject/Plate.ts:704
Parameters:
| Name | Type |
|---|---|
rotation |
Quaternion |
Returns: void
setAssembly
▸ setAssembly(newAssembly: Assembly, dueToMerge: boolean): void
Inherited from PhysicalObject.setAssembly
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:475
Sets the assembly the object belongs to
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
newAssembly |
Assembly | - | _ the new assembly the object belongs to |
dueToMerge |
boolean | false | Indicates if this object is being re-assigned due to merging two assemblies |
Returns: void
setBoxelOperationId
▸ setBoxelOperationId(id: number): void
Defined in src/model/data/PhysicalObject/Plate.ts:236
Parameters:
| Name | Type |
|---|---|
id |
number |
Returns: void
setCompositeModel
▸ setCompositeModel(compositeModel: CompositeModel): void
Inherited from PhysicalObject.setCompositeModel
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:332
Parameters:
| Name | Type | Description |
|---|---|---|
compositeModel |
CompositeModel | The composite model this object belongs to |
Returns: void
setDimensionsConception
▸ setDimensionsConception(newConception: DimensionConception): void
Defined in src/model/data/PhysicalObject/Plate.ts:248
Parameters:
| Name | Type |
|---|---|
newConception |
DimensionConception |
Returns: void
setHint
▸ setHint(key: string, value: any): void
Inherited from PhysicalObject.setHint
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:547
Sets a hint for this object
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | The name of the hint |
value |
any | The value for this hint |
Returns: void
setHoles
▸ setHoles(holes: Outline[]): void
Defined in src/model/data/PhysicalObject/Plate.ts:651
Parameters:
| Name | Type | Description |
|---|---|---|
holes |
Outline[] | The array of holes in the plate |
Returns: void
setInPlateRotation
▸ setInPlateRotation(rotation: Quaternion): void
Defined in src/model/data/PhysicalObject/Plate.ts:715
Updates the rotation of the plate by keeping the 3D position of the points the same, but changing the 2D coordinates. The new rotation thus must not change the current normal.
Parameters:
| Name | Type | Description |
|---|---|---|
rotation |
Quaternion | the new rotation of the plate, in assembly space |
Returns: void
setLowQualityRendering
▸ setLowQualityRendering(newValue: boolean): void
Inherited from PhysicalObject.setLowQualityRendering
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:556
Sets a hint for low res rendering. If this value differs from the previous value, markShapeHasChanged will be called automatically for you.
Parameters:
| Name | Type | Description |
|---|---|---|
newValue |
boolean | The value to set for the lowQuality hint |
Returns: void
setMaterial
▸ setMaterial(material: IPlateMaterial): void
Defined in src/model/data/PhysicalObject/Plate.ts:413
Parameters:
| Name | Type |
|---|---|
material |
IPlateMaterial |
Returns: void
setMaterialColor
▸ setMaterialColor(materialColor: number | null): void
Defined in src/model/data/PhysicalObject/Plate.ts:444
Parameters:
| Name | Type | Description |
|---|---|---|
materialColor |
number | null | the color the material should have, as hex rgb |
Returns: void
setMaterialThickness
▸ setMaterialThickness(materialThickness: number): void
Defined in src/model/data/PhysicalObject/Plate.ts:475
Parameters:
| Name | Type | Description |
|---|---|---|
materialThickness |
number | Material thickness in mm. Must be between 0.1 and 100 mm |
Returns: void
setMaterialType
▸ setMaterialType(materialType: string): void
Defined in src/model/data/PhysicalObject/Plate.ts:427
Parameters:
| Name | Type | Description |
|---|---|---|
materialType |
string | The material to be set |
Returns: void
setOutline
▸ setOutline(outline: Outline, emitUpdate: boolean): void
Defined in src/model/data/PhysicalObject/Plate.ts:599
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
outline |
Outline | - | outline of the plate |
emitUpdate |
boolean | true | - |
Returns: void
setPosition
▸ setPosition(position: Vector3): void
Overrides PhysicalObject.setPosition
Defined in src/model/data/PhysicalObject/Plate.ts:682
Parameters:
| Name | Type |
|---|---|
position |
Vector3 |
Returns: void
setPositionWithoutChange
▸ setPositionWithoutChange(position: Vector3): void
Defined in src/model/data/PhysicalObject/Plate.ts:690
updates the position of a plate without affecting dependent objects like connected plates
Parameters:
| Name | Type |
|---|---|
position |
Vector3 |
Returns: void
setRealizer
▸ setRealizer(realizer: IModelElementRealizer‹IModelElement›): void
Inherited from PhysicalObject.setRealizer
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:78
Parameters:
| Name | Type |
|---|---|
realizer |
IModelElementRealizer‹IModelElement› |
Returns: void
setRotation
▸ setRotation(rotation: Quaternion): void
Overrides PhysicalObject.setRotation
Defined in src/model/data/PhysicalObject/Plate.ts:699
Parameters:
| Name | Type |
|---|---|
rotation |
Quaternion |
Returns: void
setToBeExtruded
▸ setToBeExtruded(toBeExtruded: boolean): void
Defined in src/model/data/PhysicalObject/Plate.ts:404
Parameters:
| Name | Type |
|---|---|
toBeExtruded |
boolean |
Returns: void
setVisible
▸ setVisible(visibility: boolean): void
Inherited from PhysicalObject.setVisible
Defined in src/model/data/PhysicalObject/PhysicalObject.ts:635
Parameters:
| Name | Type |
|---|---|
visibility |
boolean |
Returns: void
shouldBeExtruded
▸ shouldBeExtruded(): boolean
Defined in src/model/data/PhysicalObject/Plate.ts:408
Returns: boolean
toGeoJson
▸ toGeoJson(simpleOutline: boolean): any[][]
Defined in src/model/data/PhysicalObject/Plate.ts:1166
Generates a GeoJson representation of this plate
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
simpleOutline |
boolean | true | the amount of points per outlineSection is limited when true Outline.getSimpleRasterizedOutline |
Returns: any[][]
toString
▸ toString(): string
Overrides PhysicalObject.toString
Defined in src/model/data/PhysicalObject/Plate.ts:1113
Returns: string
translate
▸ translate(translation: Vector3): void
Overrides PhysicalObject.translate
Defined in src/model/data/PhysicalObject/Plate.ts:694
Parameters:
| Name | Type |
|---|---|
translation |
Vector3 |
Returns: void
unprepareFromTransforms
▸ unprepareFromTransforms(groups: Vertex[][]): void
Overrides PhysicalObject.unprepareFromTransforms
Defined in src/model/data/PhysicalObject/Plate.ts:1107
Parameters:
| Name | Type |
|---|---|
groups |
Vertex[][] |
Returns: void
Object literals
Private markers
▪ markers: object
Defined in src/model/data/PhysicalObject/Plate.ts:120
Markers that do not influence the data structure, but may alter rendering. They will not be seen in the svg export.
backFacing
• backFacing: undefined[] = []
Defined in src/model/data/PhysicalObject/Plate.ts:121
frontFacing
• frontFacing: undefined[] = []
Defined in src/model/data/PhysicalObject/Plate.ts:122
Private material
▪ material: object
Defined in src/model/data/PhysicalObject/Plate.ts:78
The material to be rendered for this shape
color
• color: any = Config.get("plates.defaultMaterialColor", null)
Defined in src/model/data/PhysicalObject/Plate.ts:81
thickness
• thickness: any = Config.get("plates.defaultMaterialThickness", 4)
Defined in src/model/data/PhysicalObject/Plate.ts:80
type
• type: any = Config.get("plates.defaultMaterialType", "poplar")
Defined in src/model/data/PhysicalObject/Plate.ts:79
Private ornaments
▪ ornaments: object
Defined in src/model/data/PhysicalObject/Plate.ts:112
Ornaments that do not influence the data structure, but may alter rendering.
backFacing
• backFacing: undefined[] = []
Defined in src/model/data/PhysicalObject/Plate.ts:113
frontFacing
• frontFacing: undefined[] = []
Defined in src/model/data/PhysicalObject/Plate.ts:114