Skip to content

editorGlobalsTexturizer

Class: Texturizer

This class provides THREE.Materials

Hierarchy

  • Texturizer

Index

Methods

Methods

Static Private _generateMaterialForSide

_generateMaterialForSide(plate: Plate, side: PlateSide, minMaxPlateCoordinates: AABB, polygon: MultiPolygon, mirrorX: boolean, renderCutouts: boolean, renderBackfaces: boolean): IPlateSideMaterialInformation

Defined in src/model/visualization/Texturizer.ts:156

Parameters:

Name Type Default Description
plate Plate - the Plate object
side PlateSide - The side you want to get the material from.
minMaxPlateCoordinates AABB - the minimum and maximum plate coordinates that need to be texturized
polygon MultiPolygon - -
mirrorX boolean false mirrors the image in x direction, used when engraving/cutting on the back side because the texture is applied mirrored itself
renderCutouts boolean true boolean flag to indicate whether cutouts should be rendered (-> shaded / drawn to texture) used to disable cutouts on the margin geometry of plates with shaded ornaments.
renderBackfaces boolean false whether the back sides of each surface should be rendered. Used for fake burnt edges.

Returns: IPlateSideMaterialInformation


Static Private _generateMiddleMaterials

_generateMiddleMaterials(plate: Plate, polygon: MultiPolygon, layerCount: number, renderCutouts: boolean): Material[]

Defined in src/model/visualization/Texturizer.ts:256

Like _generateMaterialForSide, but generates a matching FakeBurntEdgesMaterial. These are used to paint additional geometry between the front and back side of the plate to create the impression of burnt edges at the border of cut- outs.

Parameters:

Name Type
plate Plate
polygon MultiPolygon
layerCount number
renderCutouts boolean

Returns: Material[]


Static Private _getMaterial

_getMaterial(plate: Plate, textureKey: MeshName, shared: boolean, renderCutouts: boolean): MixMapEngravingMaterial

Defined in src/model/visualization/Texturizer.ts:305

Gets the THREE.Material for the given plate

Parameters:

Name Type Default Description
plate Plate - the Plate object
textureKey MeshName - the material to get {@see Materials.getTexture}
shared boolean - whether this material may be shared with other plates {@see Materials.getTexture}
renderCutouts boolean true whether a material should be returned that renders cutouts or not. Used to create safe margins at the plate border where no cutouts are rendered.

Returns: MixMapEngravingMaterial


Static getMaterials

getMaterials(plate: Plate, minMaxPlateCoordinates: AABB, polygon: MultiPolygon, middleGeometryCount: number, renderCutouts: boolean, generateMarginMaterial: boolean): IPlateMaterialInformation

Defined in src/model/visualization/Texturizer.ts:57

Gets the materials that can be applied to the mesh of a plate An ornament texture will be created for the aabb described in minMaxPlateCoordinates

Parameters:

Name Type Default Description
plate Plate - the Plate object
minMaxPlateCoordinates AABB - the minimum and maximum plate coordinates that need to be texturized
polygon MultiPolygon - -
middleGeometryCount number - how many middle layers will be rendered between the front and back geometry.
renderCutouts boolean true -
generateMarginMaterial boolean true -

Returns: IPlateMaterialInformation