editor › Globals › KyubTexture
Class: KyubTexture
This class defines a Texture that represents the visuals of a physical material such as poplar. It provides a method to set a random offset in order to make all objects look different.
Hierarchy
↳ KyubTexture
Index
Constructors
Properties
Methods
- _applyPropertiesToClone
- _updateToPseudoPlateUv
- clone
- distanceToPoint
- getAABB
- getChangeEventEmitter
- getIsShared
- getMaterial
- getMirroredToPseudoPlateUvTransformationMatrix
- getOBB
- getOffset
- getRenderCutouts
- getRotation
- getScale
- getScaledSize
- getSize
- getTextureKey
- getToPseudoPlateUvTransformationMatrix
- isPointWithin
- mapGlobal
- mapLocal
- setOffset
- setRandomOffset
- setRotation
- setScale
- setSize
Constructors
constructor
+ new KyubTexture(size: object, material: MixMapEngravingMaterial, textureKey: TextureKey, isShared: boolean, renderCutouts: boolean): KyubTexture
Defined in src/model/visualization/textures/KyubTexture.ts:17
Parameters:
▪ size: object
| Name | Type |
|---|---|
height |
number |
width |
number |
▪ material: MixMapEngravingMaterial
▪ textureKey: TextureKey
▪ isShared: boolean
▪ renderCutouts: boolean
Returns: KyubTexture
Properties
Private Readonly isShared
• isShared: boolean
Defined in src/model/visualization/textures/KyubTexture.ts:15
Private Readonly material
• material: MixMapEngravingMaterial
Defined in src/model/visualization/textures/KyubTexture.ts:14
Private Readonly renderCutouts
• renderCutouts: boolean
Defined in src/model/visualization/textures/KyubTexture.ts:17
Private Readonly textureKey
• textureKey: TextureKey
Defined in src/model/visualization/textures/KyubTexture.ts:16
Methods
Protected _applyPropertiesToClone
▸ _applyPropertiesToClone(clone: UvPositionable): void
Inherited from UvPositionable._applyPropertiesToClone
Defined in src/model/visualization/textures/UvPositionable.ts:240
Parameters:
| Name | Type |
|---|---|
clone |
UvPositionable |
Returns: void
Protected _updateToPseudoPlateUv
▸ _updateToPseudoPlateUv(): void
Inherited from UvPositionable._updateToPseudoPlateUv
Defined in src/model/visualization/textures/UvPositionable.ts:251
Calculate a Matrix3 that transforms scaled texture uv coordinate (0,0 to 1,1) to pseudo plate uv coordinates (mm from plate origin)
Returns: void
clone
▸ clone(): UvPositionable
Inherited from UvPositionable.clone
Defined in src/model/visualization/textures/UvPositionable.ts:217
Generates a clone with identical values
Returns: UvPositionable
distanceToPoint
▸ distanceToPoint(point: ReadonlyVector3): number
Inherited from UvPositionable.distanceToPoint
Defined in src/model/visualization/textures/UvPositionable.ts:112
Uses the AABB to determine the distance to a point
Parameters:
| Name | Type | Description |
|---|---|---|
point |
ReadonlyVector3 | test point in texture coordinates |
Returns: number
the distance from the point to the aabb)
getAABB
▸ getAABB(): AABB
Inherited from UvPositionable.getAABB
Defined in src/model/visualization/textures/UvPositionable.ts:66
Calculates the AABB for this UVPositionable in texture coordinates (rotation, offset and scaling are already applied, for more detailed results use getOBB)
If properties have not change from the last call, the cached aabb will be returned
Returns: AABB
getChangeEventEmitter
▸ getChangeEventEmitter(): IPublicEventEmitterInterface‹UvPositionable›
Inherited from UvPositionable.getChangeEventEmitter
Defined in src/model/visualization/textures/UvPositionable.ts:56
Returns: IPublicEventEmitterInterface‹UvPositionable›
getIsShared
▸ getIsShared(): boolean
Defined in src/model/visualization/textures/KyubTexture.ts:73
Returns: boolean
whether the Material instance used by this Texture may also be used by others. If true, the object returned by getMaterial should be considered immutable.
getMaterial
▸ getMaterial(): MixMapEngravingMaterial
Defined in src/model/visualization/textures/KyubTexture.ts:43
Returns: MixMapEngravingMaterial
the visual material of this Texture.
getMirroredToPseudoPlateUvTransformationMatrix
▸ getMirroredToPseudoPlateUvTransformationMatrix(): Matrix3
Inherited from UvPositionable.getMirroredToPseudoPlateUvTransformationMatrix
Defined in src/model/visualization/textures/UvPositionable.ts:210
Same as getToPseudoPlateUvTransformationMatrix, but mirror the positionable around the x axis at the beginning. Required for rendering cutouts in the shader that need to be mirrored because they are placed on the back of a plate
Returns: Matrix3
getOBB
▸ getOBB(): OBB
Inherited from UvPositionable.getOBB
Defined in src/model/visualization/textures/UvPositionable.ts:51
Calculates the OBB for this UvPositionable in texture coordinates (rotation, offset and scaling already applied)
Returns: OBB
getOffset
▸ getOffset(): Vector3
Inherited from UvPositionable.getOffset
Defined in src/model/visualization/textures/UvPositionable.ts:119
Returns the UvPositionable offset (= center position of the UvPositionable) in texture coordinates
Returns: Vector3
getRenderCutouts
▸ getRenderCutouts(): boolean
Defined in src/model/visualization/textures/KyubTexture.ts:57
Returns: boolean
information whether this material should render cutouts or not - set to false for plate margin material
getRotation
▸ getRotation(): number
Inherited from UvPositionable.getRotation
Defined in src/model/visualization/textures/UvPositionable.ts:155
Get the rotation
Returns: number
CW rotation in degrees around the center of the UvPositionable
getScale
▸ getScale(): Vector3
Inherited from UvPositionable.getScale
Defined in src/model/visualization/textures/UvPositionable.ts:137
Get the scale
Returns: Vector3
the scale of the UvPositionable that is applied to its size
getScaledSize
▸ getScaledSize(target?: Vector3): Vector3
Inherited from UvPositionable.getScaledSize
Defined in src/model/visualization/textures/UvPositionable.ts:187
Get the actual size, which is the native size with the scale vector applied
Parameters:
| Name | Type |
|---|---|
target? |
Vector3 |
Returns: Vector3
getSize
▸ getSize(): Vector3
Inherited from UvPositionable.getSize
Defined in src/model/visualization/textures/UvPositionable.ts:172
Get the native size of the UvPositionable, without scale being applied, in mm. Null-vector by default, as there usually needs to be some external knowledge to determine the native size.
Returns: Vector3
getTextureKey
▸ getTextureKey(): TextureKey
Defined in src/model/visualization/textures/KyubTexture.ts:50
Returns: TextureKey
what kind of texture this is
getToPseudoPlateUvTransformationMatrix
▸ getToPseudoPlateUvTransformationMatrix(): Matrix3
Inherited from UvPositionable.getToPseudoPlateUvTransformationMatrix
Defined in src/model/visualization/textures/UvPositionable.ts:201
Return a matrix that transforms scaled texture coordinates to pseudo plate uv coordinates (the ones described by position, scale and rotation)
Returns: Matrix3
isPointWithin
▸ isPointWithin(point: Vector3): boolean
Inherited from UvPositionable.isPointWithin
Defined in src/model/visualization/textures/UvPositionable.ts:102
Uses the AABB to determine whether a point is within the UvPositionable
Parameters:
| Name | Type | Description |
|---|---|---|
point |
Vector3 | test point in texture coordinates |
Returns: boolean
Whether the point is within the ornament's AABB
mapGlobal
▸ mapGlobal(uvCoord: ReadonlyVector3, target: Vector3): Vector3
Inherited from UvPositionable.mapGlobal
Defined in src/model/visualization/textures/UvPositionable.ts:231
Parameters:
| Name | Type | Default |
|---|---|---|
uvCoord |
ReadonlyVector3 | - |
target |
Vector3 | new Vector3() |
Returns: Vector3
mapLocal
▸ mapLocal(uvCoord: ReadonlyVector3, target: Vector3): Vector3
Inherited from UvPositionable.mapLocal
Defined in src/model/visualization/textures/UvPositionable.ts:223
Parameters:
| Name | Type | Default |
|---|---|---|
uvCoord |
ReadonlyVector3 | - |
target |
Vector3 | new Vector3() |
Returns: Vector3
setOffset
▸ setOffset(newOffset: Vector3): void
Inherited from UvPositionable.setOffset
Defined in src/model/visualization/textures/UvPositionable.ts:127
Set the offset
Parameters:
| Name | Type | Description |
|---|---|---|
newOffset |
Vector3 | new offset (= center position of the UvPositionable) in texture coordinates |
Returns: void
setRandomOffset
▸ setRandomOffset(): void
Defined in src/model/visualization/textures/KyubTexture.ts:63
Returns: void
setRotation
▸ setRotation(newRotation: number): void
Inherited from UvPositionable.setRotation
Defined in src/model/visualization/textures/UvPositionable.ts:163
Set the rotation
Parameters:
| Name | Type | Description |
|---|---|---|
newRotation |
number | new rotation in radians |
Returns: void
setScale
▸ setScale(): void
Overrides UvPositionable.setScale
Defined in src/model/visualization/textures/KyubTexture.ts:36
Returns: void
setSize
▸ setSize(size: Vector3): void
Inherited from UvPositionable.setSize
Defined in src/model/visualization/textures/UvPositionable.ts:179
Set the size
Parameters:
| Name | Type |
|---|---|
size |
Vector3 |
Returns: void