@itwin/core-common 5.1.0-dev.66 → 5.1.0-dev.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/MaterialProps.d.ts +5 -2
- package/lib/cjs/MaterialProps.d.ts.map +1 -1
- package/lib/cjs/MaterialProps.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.d.ts +4 -0
- package/lib/cjs/geometry/AdditionalTransform.d.ts.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js +9 -0
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/internal/RenderMesh.d.ts +19 -5
- package/lib/cjs/internal/RenderMesh.d.ts.map +1 -1
- package/lib/cjs/internal/RenderMesh.js +11 -8
- package/lib/cjs/internal/RenderMesh.js.map +1 -1
- package/lib/cjs/internal/cross-package.d.ts +1 -1
- package/lib/cjs/internal/cross-package.d.ts.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/esm/MaterialProps.d.ts +5 -2
- package/lib/esm/MaterialProps.d.ts.map +1 -1
- package/lib/esm/MaterialProps.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.d.ts +4 -0
- package/lib/esm/geometry/AdditionalTransform.d.ts.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js +10 -1
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/internal/RenderMesh.d.ts +19 -5
- package/lib/esm/internal/RenderMesh.d.ts.map +1 -1
- package/lib/esm/internal/RenderMesh.js +11 -8
- package/lib/esm/internal/RenderMesh.js.map +1 -1
- package/lib/esm/internal/cross-package.d.ts +1 -1
- package/lib/esm/internal/cross-package.d.ts.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/package.json +6 -6
|
@@ -140,9 +140,12 @@ export interface RenderMaterialAssetProps {
|
|
|
140
140
|
HasFinish?: boolean;
|
|
141
141
|
/** Specular exponent (surface shininess); range is 0 to 128; if undefined, defaults to 13.5 */
|
|
142
142
|
finish?: number;
|
|
143
|
-
/** If true, this material
|
|
143
|
+
/** If true, then this material overrides the surface transparency to be the value of [[transmit]].
|
|
144
|
+
* If false, then this material overrides the surface to be fully opaque.
|
|
145
|
+
* If undefined, then this material does not override the surface transparency at all.
|
|
146
|
+
*/
|
|
144
147
|
HasTransmit?: boolean;
|
|
145
|
-
/** Surface transparency; if undefined, defaults to 0.0 */
|
|
148
|
+
/** Surface transparency; if undefined, defaults to 0.0. Has no effect unless [[HasTransmit]] is true. */
|
|
146
149
|
transmit?: number;
|
|
147
150
|
/** If true, this material has a value for diffuse reflectivity; if undefined, defaults to false */
|
|
148
151
|
HasDiffuse?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialProps.d.ts","sourceRoot":"","sources":["../../src/MaterialProps.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,EAAE,CAAC;AAEtC;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC;AAEpC;;;GAGG;AACH,oBAAY,eAAe;IACzB,wCAAwC;IACxC,QAAQ,IAAI;IACZ,MAAM,IAAI;IACV,WAAW,IAAI;IACf,IAAI,IAAI;IACR,MAAM,IAAI;CACX;AAID;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,qFAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6GAA6G;IAC7G,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B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B,qEAAqE;IACrE,GAAG,CAAC,EAAE,4BAA4B,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB;IACjE,+EAA+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE;QACf,2EAA2E;QAC3E,cAAc,CAAC,EAAE;YACf,iEAAiE;YACjE,cAAc,CAAC,EAAE,wBAAwB,CAAC;SAC3C,CAAC;KACH,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialProps.js","sourceRoot":"","sources":["../../src/MaterialProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAqBH;;;GAGG;AACH,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,wCAAwC;IACxC,6DAAY,CAAA;IACZ,yDAAU,CAAA;IACV,mEAAe,CAAA;IACf,qDAAQ,CAAA;IACR,yDAAU,CAAA;AACZ,CAAC,EAPW,eAAe,+BAAf,eAAe,QAO1B;AA4CD;;GAEG;AACH,IAAY,cASX;AATD,WAAY,cAAc;IACxB,wBAAwB;IACxB,mDAAQ,CAAA;IACR;;OAEG;IACH,yDAAgB,CAAA;IAChB,uFAAuF;IACvF,uEAAuB,CAAA;AACzB,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { DefinitionElementProps } from \"./ElementProps\";\nimport { TextureMapping } from \"./TextureMapping\";\n\n/** Describes a color as an array of three numbers ranging from 0 to 1 where the first entry corresponds to the color's red component,\n * the second to green, and the third to blue.\n * @see usage in [[RenderMaterialAssetProps]].\n * @public\n * @extensions\n */\nexport type RgbFactorProps = number[];\n\n/** A 2d point specified as an array of 2 numbers [x, y].\n * @see usage in [[TextureMapProps]].\n * @public\n * @extensions\n */\nexport type Point2dProps = number[];\n\n/** Describes the units in which a [[TextureMapProps]]' scale is expressed.\n * @public\n * @extensions\n */\nexport enum TextureMapUnits {\n /** Indicates the scale has no units. */\n Relative = 0,\n Meters = 3,\n Millimeters = 4,\n Feet = 5,\n Inches = 6,\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/** As part of a [[RenderMaterialAssetProps]], describes how to map a [[RenderTexture]]'s image to the triangles of a mesh to which the material is applied.\n * @see [[RenderMaterialAssetMapsProps]] for the supported types of texture mappings.\n * @public\n * @extensions\n */\nexport interface TextureMapProps {\n /** Angle in degrees to rotate texture when applying; defaults to 0.0 if undefined */\n pattern_angle?: number;\n /** If true, flip the pattern map in U; if undefined, defaults to false */\n pattern_u_flip?: boolean;\n /** If true, flip the pattern map in V; if undefined, defaults to false */\n pattern_flip?: boolean;\n /** X, Y scale to apply to the pattern map; if undefined, defaults to {0,0}, which is almost never useful. */\n pattern_scale?: Point2dProps;\n /** X, Y offset to apply to the pattern map; if undefined, defaults to {0,0} */\n pattern_offset?: Point2dProps;\n /** Units to use when applying the scaling; if undefined, defaults to [[TextureMapUnits.Relative]] */\n pattern_scalemode?: TextureMapUnits;\n /** Mapping mode to use for the texture application; if undefined, defaults to [[TextureMapping.Mode.Parametric]] */\n pattern_mapping?: TextureMapping.Mode;\n /** Weight at which to combine diffuse image and color; if undefined, defaults to 1.0 */\n pattern_weight?: number;\n /** If true, override the mapping mode with constant LOD mapping for the normal map, defaults to false.\n * @deprecated in 4.4 - will not be removed until after 2026-06-13. It never functioned properly - use [[pattern_useconstantlod]] instead.\n */\n pattern_useConstantLod?: boolean;\n /** If true, override the mapping mode with constant LOD mapping for the normal map, defaults to false. */\n pattern_useconstantlod?: boolean;\n /** The number of times the texture is repeated if pattern_useconstantlod is true. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. Defaults to 1.*/\n pattern_constantlod_repetitions?: number;\n /** An offset in world units used to shift the texture when pattern_useconstantlod is true. Defaults to (0, 0). */\n pattern_constantlod_offset?: Point2dProps;\n /** The minimum distance (from the eye to the surface) at which to clamp the texture size when pattern_useconstantlod is true. Defaults to 1. */\n pattern_constantlod_mindistanceclamp?: number;\n /** The maximum distance (from the eye to the surface) at which to clamp the texture size when pattern_useconstantlod is true. Defaults to 2^32. */\n pattern_constantlod_maxdistanceclamp?: number;\n /** The Id of the persistent [Texture]($backend) element defining the texture image. */\n TextureId: Id64String;\n}\n\n/** Flags applied to a [[NormalMapProps]]. The enum values can be combined using bitwise operators.\n * @public\n */\nexport enum NormalMapFlags {\n /** No special flags. */\n None = 0,\n /** Indicates that the Y component of each vector - stored in the texture's green channel - points upward along the positive Y axis and should\n * be negated. By default it points downward.\n */\n GreenUp = 1 << 0,\n /** If true, override the mapping mode with constant LOD mapping for the normal map. */\n UseConstantLod = 1 << 1,\n}\n\n/** Describes how to apply [normal mapping](https://en.wikipedia.org/wiki/Normal_mapping) to a surface material.\n * @see [[RenderMaterialAssetMapsProps.Normal]] to define a normal map for a [[RenderMaterialAssetProps]].\n * @public\n */\nexport interface NormalMapProps extends TextureMapProps {\n /** Flags controlling how the normal map is applied. Default: [[NormalMapFlags.None]]. */\n NormalFlags?: NormalMapFlags;\n}\n\n/** Describes different types of textures to be applied to a surface material to alter its appearance.\n * @note While technically both [[Pattern]] and [[Normal]] can define their own mapping parameters (`pattern_angle`, `pattern_mapping`, etc), in practice\n * if both maps are present they are expected to have identical mapping parameters, with the exception of `TextureId`.\n * @see [[RenderMaterialAssetProps.Map]] to define the texture maps for a material asset.\n * @public\n */\nexport interface RenderMaterialAssetMapsProps {\n /** Maps an image describing the diffuse color of the surface, replacing or mixing with the surface's own color. */\n Pattern?: TextureMapProps;\n /** Maps a [normal map](https://en.wikipedia.org/wiki/Normal_mapping) to the surface, simulating more complex surface details than are\n * present in the surface's geometry.\n */\n Normal?: NormalMapProps;\n /** Maps an image describing detailed minor height variation of the surface geometry. */\n Bump?: TextureMapProps;\n /** Maps an image describing the diffuse color of the surface, replacing or mixing with the surface's own color. */\n Diffuse?: TextureMapProps;\n /** Maps an image describing the glossiness of the surface's finish */\n Finish?: TextureMapProps;\n /** Maps an image describing glowing parts of the surface */\n GlowColor?: TextureMapProps;\n /** Maps an image describing the reflectiveness of the surface */\n Reflect?: TextureMapProps;\n /** Maps an image describing the specular component of the surface */\n Specular?: TextureMapProps;\n /** Maps an image describing the translucency of the surface, how much light comes out the back of the surface */\n TranslucencyColor?: TextureMapProps;\n /** Maps an image describing the transparency of the surface, how visible objects behind this object are */\n TransparentColor?: TextureMapProps;\n /** Maps an image describing the displacement of the surface geometry */\n Displacement?: TextureMapProps;\n}\n\n/** Describes the graphical properties of a [RenderMaterialElement]($backend) as part of a [[RenderMaterialProps]].\n * This representation is used to persist the material properties into the [IModelDb]($backend), but is unwieldy and verbose.\n * @see [RenderMaterialElementParams]($backend) for a somewhat more ergonomic representation.\n * @public\n * @extensions\n */\nexport interface RenderMaterialAssetProps {\n /** If true, this material has a fill/diffuse color; if undefined, defaults to false */\n HasBaseColor?: boolean;\n /** Surface color used for fill or diffuse illumination; if undefined, defaults to black */\n color?: RgbFactorProps;\n /** If true, this material has a specular color; if undefined, defaults to false */\n HasSpecularColor?: boolean;\n /** Surface color used for specular illumination; if undefined, defaults to black */\n specular_color?: RgbFactorProps;\n /** If true, this material has a specular exponent; if undefined, defaults to false */\n HasFinish?: boolean;\n /** Specular exponent (surface shininess); range is 0 to 128; if undefined, defaults to 13.5 */\n finish?: number;\n /** If true, this material has surface transparency; if undefined, defaults to false */\n HasTransmit?: boolean;\n /** Surface transparency; if undefined, defaults to 0.0 */\n transmit?: number;\n /** If true, this material has a value for diffuse reflectivity; if undefined, defaults to false */\n HasDiffuse?: boolean;\n /** Surface diffuse reflectivity; if undefined, defaults to 0.6 */\n diffuse?: number;\n /** If true, this material has a value for specular reflectivity; if undefined, defaults to false. If false, specular value is actually set to 0.0 */\n HasSpecular?: boolean;\n /** Surface specular reflectivity; if undefined, defaults to 0.4 */\n specular?: number;\n /** If true, this material has a value for environmental reflectivity; if undefined, defaults to false */\n HasReflect?: boolean;\n /** Surface environmental reflectivity; stored as fraction of specular in V8 material settings; if undefined defaults to 0.0 */\n reflect?: number;\n /** If true, this material has a surface reflectance color; if undefined, defaults to false. If false, reflectance color is actually set to specular color */\n HasReflectColor?: boolean;\n /** Surface reflectance color; if undefined, defaults to black */\n reflect_color?: RgbFactorProps;\n /** A scale by which to multiply the components of the normals read from [[Map.Normal]], if a normal map is defined.\n * Default: 1.0\n */\n pbr_normal?: number;\n /** An optional set of texture maps associated with this material. */\n Map?: RenderMaterialAssetMapsProps;\n}\n\n/** Properties that define a [RenderMaterialElement]($backend).\n * @see [[RenderMaterial]] for the representation used by the display system.\n * @public\n * @extensions\n */\nexport interface RenderMaterialProps extends DefinitionElementProps {\n /** The name of a palette that can be used to categorize multiple materials. */\n paletteName: string;\n /** An optional description of the material. */\n description?: string;\n jsonProperties?: {\n /** A container for various \"assets\" describing aspects of the material. */\n materialAssets?: {\n /** Properties of the material describing how it is displayed. */\n renderMaterial?: RenderMaterialAssetProps;\n };\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MaterialProps.js","sourceRoot":"","sources":["../../src/MaterialProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAqBH;;;GAGG;AACH,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,wCAAwC;IACxC,6DAAY,CAAA;IACZ,yDAAU,CAAA;IACV,mEAAe,CAAA;IACf,qDAAQ,CAAA;IACR,yDAAU,CAAA;AACZ,CAAC,EAPW,eAAe,+BAAf,eAAe,QAO1B;AA4CD;;GAEG;AACH,IAAY,cASX;AATD,WAAY,cAAc;IACxB,wBAAwB;IACxB,mDAAQ,CAAA;IACR;;OAEG;IACH,yDAAgB,CAAA;IAChB,uFAAuF;IACvF,uEAAuB,CAAA;AACzB,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { DefinitionElementProps } from \"./ElementProps\";\nimport { TextureMapping } from \"./TextureMapping\";\n\n/** Describes a color as an array of three numbers ranging from 0 to 1 where the first entry corresponds to the color's red component,\n * the second to green, and the third to blue.\n * @see usage in [[RenderMaterialAssetProps]].\n * @public\n * @extensions\n */\nexport type RgbFactorProps = number[];\n\n/** A 2d point specified as an array of 2 numbers [x, y].\n * @see usage in [[TextureMapProps]].\n * @public\n * @extensions\n */\nexport type Point2dProps = number[];\n\n/** Describes the units in which a [[TextureMapProps]]' scale is expressed.\n * @public\n * @extensions\n */\nexport enum TextureMapUnits {\n /** Indicates the scale has no units. */\n Relative = 0,\n Meters = 3,\n Millimeters = 4,\n Feet = 5,\n Inches = 6,\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/** As part of a [[RenderMaterialAssetProps]], describes how to map a [[RenderTexture]]'s image to the triangles of a mesh to which the material is applied.\n * @see [[RenderMaterialAssetMapsProps]] for the supported types of texture mappings.\n * @public\n * @extensions\n */\nexport interface TextureMapProps {\n /** Angle in degrees to rotate texture when applying; defaults to 0.0 if undefined */\n pattern_angle?: number;\n /** If true, flip the pattern map in U; if undefined, defaults to false */\n pattern_u_flip?: boolean;\n /** If true, flip the pattern map in V; if undefined, defaults to false */\n pattern_flip?: boolean;\n /** X, Y scale to apply to the pattern map; if undefined, defaults to {0,0}, which is almost never useful. */\n pattern_scale?: Point2dProps;\n /** X, Y offset to apply to the pattern map; if undefined, defaults to {0,0} */\n pattern_offset?: Point2dProps;\n /** Units to use when applying the scaling; if undefined, defaults to [[TextureMapUnits.Relative]] */\n pattern_scalemode?: TextureMapUnits;\n /** Mapping mode to use for the texture application; if undefined, defaults to [[TextureMapping.Mode.Parametric]] */\n pattern_mapping?: TextureMapping.Mode;\n /** Weight at which to combine diffuse image and color; if undefined, defaults to 1.0 */\n pattern_weight?: number;\n /** If true, override the mapping mode with constant LOD mapping for the normal map, defaults to false.\n * @deprecated in 4.4 - will not be removed until after 2026-06-13. It never functioned properly - use [[pattern_useconstantlod]] instead.\n */\n pattern_useConstantLod?: boolean;\n /** If true, override the mapping mode with constant LOD mapping for the normal map, defaults to false. */\n pattern_useconstantlod?: boolean;\n /** The number of times the texture is repeated if pattern_useconstantlod is true. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. Defaults to 1.*/\n pattern_constantlod_repetitions?: number;\n /** An offset in world units used to shift the texture when pattern_useconstantlod is true. Defaults to (0, 0). */\n pattern_constantlod_offset?: Point2dProps;\n /** The minimum distance (from the eye to the surface) at which to clamp the texture size when pattern_useconstantlod is true. Defaults to 1. */\n pattern_constantlod_mindistanceclamp?: number;\n /** The maximum distance (from the eye to the surface) at which to clamp the texture size when pattern_useconstantlod is true. Defaults to 2^32. */\n pattern_constantlod_maxdistanceclamp?: number;\n /** The Id of the persistent [Texture]($backend) element defining the texture image. */\n TextureId: Id64String;\n}\n\n/** Flags applied to a [[NormalMapProps]]. The enum values can be combined using bitwise operators.\n * @public\n */\nexport enum NormalMapFlags {\n /** No special flags. */\n None = 0,\n /** Indicates that the Y component of each vector - stored in the texture's green channel - points upward along the positive Y axis and should\n * be negated. By default it points downward.\n */\n GreenUp = 1 << 0,\n /** If true, override the mapping mode with constant LOD mapping for the normal map. */\n UseConstantLod = 1 << 1,\n}\n\n/** Describes how to apply [normal mapping](https://en.wikipedia.org/wiki/Normal_mapping) to a surface material.\n * @see [[RenderMaterialAssetMapsProps.Normal]] to define a normal map for a [[RenderMaterialAssetProps]].\n * @public\n */\nexport interface NormalMapProps extends TextureMapProps {\n /** Flags controlling how the normal map is applied. Default: [[NormalMapFlags.None]]. */\n NormalFlags?: NormalMapFlags;\n}\n\n/** Describes different types of textures to be applied to a surface material to alter its appearance.\n * @note While technically both [[Pattern]] and [[Normal]] can define their own mapping parameters (`pattern_angle`, `pattern_mapping`, etc), in practice\n * if both maps are present they are expected to have identical mapping parameters, with the exception of `TextureId`.\n * @see [[RenderMaterialAssetProps.Map]] to define the texture maps for a material asset.\n * @public\n */\nexport interface RenderMaterialAssetMapsProps {\n /** Maps an image describing the diffuse color of the surface, replacing or mixing with the surface's own color. */\n Pattern?: TextureMapProps;\n /** Maps a [normal map](https://en.wikipedia.org/wiki/Normal_mapping) to the surface, simulating more complex surface details than are\n * present in the surface's geometry.\n */\n Normal?: NormalMapProps;\n /** Maps an image describing detailed minor height variation of the surface geometry. */\n Bump?: TextureMapProps;\n /** Maps an image describing the diffuse color of the surface, replacing or mixing with the surface's own color. */\n Diffuse?: TextureMapProps;\n /** Maps an image describing the glossiness of the surface's finish */\n Finish?: TextureMapProps;\n /** Maps an image describing glowing parts of the surface */\n GlowColor?: TextureMapProps;\n /** Maps an image describing the reflectiveness of the surface */\n Reflect?: TextureMapProps;\n /** Maps an image describing the specular component of the surface */\n Specular?: TextureMapProps;\n /** Maps an image describing the translucency of the surface, how much light comes out the back of the surface */\n TranslucencyColor?: TextureMapProps;\n /** Maps an image describing the transparency of the surface, how visible objects behind this object are */\n TransparentColor?: TextureMapProps;\n /** Maps an image describing the displacement of the surface geometry */\n Displacement?: TextureMapProps;\n}\n\n/** Describes the graphical properties of a [RenderMaterialElement]($backend) as part of a [[RenderMaterialProps]].\n * This representation is used to persist the material properties into the [IModelDb]($backend), but is unwieldy and verbose.\n * @see [RenderMaterialElementParams]($backend) for a somewhat more ergonomic representation.\n * @public\n * @extensions\n */\nexport interface RenderMaterialAssetProps {\n /** If true, this material has a fill/diffuse color; if undefined, defaults to false */\n HasBaseColor?: boolean;\n /** Surface color used for fill or diffuse illumination; if undefined, defaults to black */\n color?: RgbFactorProps;\n /** If true, this material has a specular color; if undefined, defaults to false */\n HasSpecularColor?: boolean;\n /** Surface color used for specular illumination; if undefined, defaults to black */\n specular_color?: RgbFactorProps;\n /** If true, this material has a specular exponent; if undefined, defaults to false */\n HasFinish?: boolean;\n /** Specular exponent (surface shininess); range is 0 to 128; if undefined, defaults to 13.5 */\n finish?: number;\n /** If true, then this material overrides the surface transparency to be the value of [[transmit]].\n * If false, then this material overrides the surface to be fully opaque.\n * If undefined, then this material does not override the surface transparency at all.\n */\n HasTransmit?: boolean;\n /** Surface transparency; if undefined, defaults to 0.0. Has no effect unless [[HasTransmit]] is true. */\n transmit?: number;\n /** If true, this material has a value for diffuse reflectivity; if undefined, defaults to false */\n HasDiffuse?: boolean;\n /** Surface diffuse reflectivity; if undefined, defaults to 0.6 */\n diffuse?: number;\n /** If true, this material has a value for specular reflectivity; if undefined, defaults to false. If false, specular value is actually set to 0.0 */\n HasSpecular?: boolean;\n /** Surface specular reflectivity; if undefined, defaults to 0.4 */\n specular?: number;\n /** If true, this material has a value for environmental reflectivity; if undefined, defaults to false */\n HasReflect?: boolean;\n /** Surface environmental reflectivity; stored as fraction of specular in V8 material settings; if undefined defaults to 0.0 */\n reflect?: number;\n /** If true, this material has a surface reflectance color; if undefined, defaults to false. If false, reflectance color is actually set to specular color */\n HasReflectColor?: boolean;\n /** Surface reflectance color; if undefined, defaults to black */\n reflect_color?: RgbFactorProps;\n /** A scale by which to multiply the components of the normals read from [[Map.Normal]], if a normal map is defined.\n * Default: 1.0\n */\n pbr_normal?: number;\n /** An optional set of texture maps associated with this material. */\n Map?: RenderMaterialAssetMapsProps;\n}\n\n/** Properties that define a [RenderMaterialElement]($backend).\n * @see [[RenderMaterial]] for the representation used by the display system.\n * @public\n * @extensions\n */\nexport interface RenderMaterialProps extends DefinitionElementProps {\n /** The name of a palette that can be used to categorize multiple materials. */\n paletteName: string;\n /** An optional description of the material. */\n description?: string;\n jsonProperties?: {\n /** A container for various \"assets\" describing aspects of the material. */\n materialAssets?: {\n /** Properties of the material describing how it is displayed. */\n renderMaterial?: RenderMaterialAssetProps;\n };\n };\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Geometry
|
|
3
3
|
*/
|
|
4
|
+
import { Transform } from "@itwin/core-geometry";
|
|
4
5
|
/** An affine transformation with an additional Z Offset.
|
|
5
6
|
* The equations are:
|
|
6
7
|
* given a = scale * cos(rotation) and b = scale * sin(rotation)
|
|
@@ -53,6 +54,9 @@ export declare class Helmert2DWithZOffset implements Helmert2DWithZOffsetProps {
|
|
|
53
54
|
/** Compares two Helmert2DWithZOffset objects applying a minuscule tolerance.
|
|
54
55
|
* @public */
|
|
55
56
|
equals(other: Helmert2DWithZOffset): boolean;
|
|
57
|
+
/** Convert Helmert2DWithZOffset object into Transfrom object
|
|
58
|
+
* @public */
|
|
59
|
+
convertHelmertToTransform(): Transform;
|
|
56
60
|
}
|
|
57
61
|
/** Additional Transform definition
|
|
58
62
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdditionalTransform.d.ts","sourceRoot":"","sources":["../../../src/geometry/AdditionalTransform.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"AdditionalTransform.d.ts","sourceRoot":"","sources":["../../../src/geometry/AdditionalTransform.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAwC,SAAS,EAAY,MAAM,sBAAsB,CAAC;AAEjG;;;;;;;;GAQG;AACH,MAAM,WAAW,yBAAyB;IACxC,6BAA6B;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,qBAAa,oBAAqB,YAAW,yBAAyB;IACpE,6BAA6B;IACtB,YAAY,EAAG,MAAM,CAAC;IAC7B,6BAA6B;IACtB,YAAY,EAAG,MAAM,CAAC;IAC7B,wCAAwC;IACjC,YAAY,EAAG,MAAM,CAAC;IAC7B,oEAAoE;IAC7D,MAAM,EAAG,MAAM,CAAC;IACvB,iFAAiF;IAC1E,KAAK,EAAG,MAAM,CAAC;gBAEV,IAAI,CAAC,EAAE,yBAAyB;IAU5C;iBACa;WACC,QAAQ,CAAC,IAAI,EAAE,yBAAyB,GAAG,oBAAoB;IAI7E;iBACa;IACN,MAAM,IAAI,yBAAyB;IAI1C;kBACc;IACP,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO;IAQnD;iBACa;IACN,yBAAyB,IAAI,SAAS;CAe9C;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,gFAAgF;IAChF,oBAAoB,CAAC,EAAE,yBAAyB,CAAC;CAClD;AAED;;;;;EAKE;AACF,qBAAa,mBAAoB,YAAW,wBAAwB;IAElE,gFAAgF;IAChF,SAAgB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;gBAEzC,IAAI,CAAC,EAAE,wBAAwB;IAKlD;iBACa;WACC,QAAQ,CAAC,IAAI,EAAE,wBAAwB,GAAG,mBAAmB;IAI3E;iBACa;IACN,MAAM,IAAI,wBAAwB;IAIzC;kBACc;IACP,MAAM,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO;CASnD"}
|
|
@@ -59,6 +59,15 @@ class Helmert2DWithZOffset {
|
|
|
59
59
|
Math.abs(this.rotDeg - other.rotDeg) < core_geometry_1.Geometry.smallAngleDegrees &&
|
|
60
60
|
Math.abs(this.scale - other.scale) < core_geometry_1.Geometry.smallFraction);
|
|
61
61
|
}
|
|
62
|
+
/** Convert Helmert2DWithZOffset object into Transfrom object
|
|
63
|
+
* @public */
|
|
64
|
+
convertHelmertToTransform() {
|
|
65
|
+
const rotationXY = core_geometry_1.Matrix3d.createRotationAroundAxisIndex(core_geometry_1.AxisIndex.Z, core_geometry_1.Angle.createDegrees(this?.rotDeg));
|
|
66
|
+
rotationXY.scaleColumnsInPlace(this.scale, this.scale, 1.0);
|
|
67
|
+
const translation = core_geometry_1.Vector3d.create(this.translationX, this.translationY, this.translationZ);
|
|
68
|
+
const helmertTransform = core_geometry_1.Transform.createRefs(translation, rotationXY);
|
|
69
|
+
return helmertTransform;
|
|
70
|
+
}
|
|
62
71
|
}
|
|
63
72
|
exports.Helmert2DWithZOffset = Helmert2DWithZOffset;
|
|
64
73
|
/** Additional Transform implementation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdditionalTransform.js","sourceRoot":"","sources":["../../../src/geometry/AdditionalTransform.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,wBAAwB;;;AAExB,
|
|
1
|
+
{"version":3,"file":"AdditionalTransform.js","sourceRoot":"","sources":["../../../src/geometry/AdditionalTransform.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,wBAAwB;;;AAExB,wDAAiG;AAwBjG;;;;;;;;;GASG;AACH,MAAa,oBAAoB;IAC/B,6BAA6B;IACtB,YAAY,CAAU;IAC7B,6BAA6B;IACtB,YAAY,CAAU;IAC7B,wCAAwC;IACjC,YAAY,CAAU;IAC7B,oEAAoE;IAC7D,MAAM,CAAU;IACvB,iFAAiF;IAC1E,KAAK,CAAU;IAEtB,YAAY,IAAgC;QAC1C,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC;IA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,GAAG,wBAAQ,CAAC,MAAM,CACjC,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,YAAY,CAClB,CAAC;QACF,MAAM,gBAAgB,GAAG,yBAAS,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvE,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF;AA7DD,oDA6DC;AAWD;;;;;EAKE;AACF,MAAa,mBAAmB;IAE9B,gFAAgF;IAChE,oBAAoB,CAAwB;IAE5D,YAAmB,IAA+B;QAChD,IAAI,IAAI;YACN,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjI,CAAC;IAED;iBACa;IACN,MAAM,CAAC,QAAQ,CAAC,IAA8B;QACnD,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED;iBACa;IACN,MAAM;QACX,OAAO,EAAE,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC7D,CAAC;IAED;kBACc;IACP,MAAM,CAAC,KAA0B;QACtC,IAAI,CAAC,IAAI,CAAC,oBAAoB,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,oBAAoB,KAAK,SAAS,CAAC;YAC1F,OAAO,KAAK,CAAC;QAEf,IAAI,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAqB,CAAC;YAC7F,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAjCD,kDAiCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Geometry\n */\n// cspell:ignore Helmert\n\nimport { Angle, AxisIndex, Geometry, Matrix3d, Transform, Vector3d } from \"@itwin/core-geometry\";\n\n/** An affine transformation with an additional Z Offset.\n * The equations are:\n * given a = scale * cos(rotation) and b = scale * sin(rotation)\n * X = a * x - b * y + translationX\n * Y = b * x + a * y + translationY\n * Z = z + translationZ\n * @public\n * @extensions\n */\nexport interface Helmert2DWithZOffsetProps {\n /** The X post translation */\n translationX: number;\n /** The Y post-translation */\n translationY: number;\n /** The Z post-translation or Z offset*/\n translationZ: number;\n /** The rotation in the trigonometric (CCW) direction in degrees. */\n rotDeg: number;\n /** The scale. This scale applies to both X and Y axises. Does not apply to Z. */\n scale: number;\n}\n\n/** An affine transformation with an additional Z Offset.\n * The equations are:\n * given a = scale * cos(rotation) and b = scale * sin(rotation)\n * X = a * x - b * y + translationX\n * Y = b * x + a * y + translationY\n * Z = z + translationZ\n *\n * Note that the class only implements the definition and not the operation.\n * @public\n */\nexport class Helmert2DWithZOffset implements Helmert2DWithZOffsetProps {\n /** The X post translation */\n public translationX!: number;\n /** The Y post-translation */\n public translationY!: number;\n /** The Z post-translation or Z offset*/\n public translationZ!: number;\n /** The rotation in the trigonometric (CCW) direction in degrees. */\n public rotDeg!: number;\n /** The scale. This scale applies to both X and Y axises. Does not apply to Z. */\n public scale!: number;\n\n constructor(data?: Helmert2DWithZOffsetProps) {\n if (data) {\n this.translationX = data.translationX;\n this.translationY = data.translationY;\n this.translationZ = data.translationZ;\n this.rotDeg = data.rotDeg;\n this.scale = data.scale;\n }\n }\n\n /** Creates an Helmert Transform from JSON representation.\n * @public */\n public static fromJSON(data: Helmert2DWithZOffsetProps): Helmert2DWithZOffset {\n return new Helmert2DWithZOffset(data);\n }\n\n /** Creates a JSON from the Helmert Transform definition\n * @public */\n public toJSON(): Helmert2DWithZOffsetProps {\n return { translationX: this.translationX, translationY: this.translationY, translationZ: this.translationZ, rotDeg: this.rotDeg, scale: this.scale };\n }\n\n /** Compares two Helmert2DWithZOffset objects applying a minuscule tolerance.\n * @public */\n public equals(other: Helmert2DWithZOffset): boolean {\n return (Math.abs(this.translationX - other.translationX) < Geometry.smallMetricDistance &&\n Math.abs(this.translationY - other.translationY) < Geometry.smallMetricDistance &&\n Math.abs(this.translationZ - other.translationZ) < Geometry.smallMetricDistance &&\n Math.abs(this.rotDeg - other.rotDeg) < Geometry.smallAngleDegrees &&\n Math.abs(this.scale - other.scale) < Geometry.smallFraction);\n }\n\n /** Convert Helmert2DWithZOffset object into Transfrom object\n * @public */\n public convertHelmertToTransform(): Transform {\n const rotationXY = Matrix3d.createRotationAroundAxisIndex(\n AxisIndex.Z,\n Angle.createDegrees(this?.rotDeg)\n );\n rotationXY.scaleColumnsInPlace(this.scale, this.scale, 1.0);\n const translation = Vector3d.create(\n this.translationX,\n this.translationY,\n this.translationZ\n );\n const helmertTransform = Transform.createRefs(translation, rotationXY);\n\n return helmertTransform;\n }\n}\n\n/** Additional Transform definition\n * @public\n * @extensions\n */\nexport interface AdditionalTransformProps {\n /** The properties of a 2D Helmert transform with Z offset if one is defined. */\n helmert2DWithZOffset?: Helmert2DWithZOffsetProps;\n}\n\n/** Additional Transform implementation.\n * An additional transform is a transformation that can apply to either the horizontal or vertical coordinates of a\n * geographic CRS. The transformation is applied after the latitude/longitude have been projected thus the process\n * is applied to the result Cartesian coordinates of the projection process.\n * @public\n*/\nexport class AdditionalTransform implements AdditionalTransformProps {\n\n /** The properties of a 2D Helmert transform with Z offset if one is defined. */\n public readonly helmert2DWithZOffset?: Helmert2DWithZOffset;\n\n public constructor(data?: AdditionalTransformProps) {\n if (data)\n this.helmert2DWithZOffset = data.helmert2DWithZOffset ? Helmert2DWithZOffset.fromJSON(data.helmert2DWithZOffset) : undefined;\n }\n\n /** Creates an Additional Transform from JSON representation.\n * @public */\n public static fromJSON(data: AdditionalTransformProps): AdditionalTransform {\n return new AdditionalTransform(data);\n }\n\n /** Creates a JSON from the Additional Transform definition\n * @public */\n public toJSON(): AdditionalTransformProps {\n return { helmert2DWithZOffset: this.helmert2DWithZOffset };\n }\n\n /** Compares two additional transforms applying a minuscule tolerance to comparing numbers.\n * @public */\n public equals(other: AdditionalTransform): boolean {\n if ((this.helmert2DWithZOffset === undefined) !== (other.helmert2DWithZOffset === undefined))\n return false;\n\n if (this.helmert2DWithZOffset && !this.helmert2DWithZOffset.equals(other.helmert2DWithZOffset!))\n return false;\n\n return true;\n }\n}\n\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Rendering
|
|
3
3
|
*/
|
|
4
|
+
import { ColorDef } from "../ColorDef";
|
|
5
|
+
import { LinePixels } from "../LinePixels";
|
|
4
6
|
import { OctEncodedNormalPair } from "../OctEncodedNormal";
|
|
5
7
|
import { PolylineIndices } from "../RenderPolyline";
|
|
6
8
|
/** @internal */
|
|
@@ -19,10 +21,22 @@ export declare class MeshEdge {
|
|
|
19
21
|
compareTo(other: MeshEdge): number;
|
|
20
22
|
}
|
|
21
23
|
/** @internal */
|
|
24
|
+
export interface EdgeAppearanceOverrides {
|
|
25
|
+
color?: ColorDef;
|
|
26
|
+
linePixels?: LinePixels;
|
|
27
|
+
width?: number;
|
|
28
|
+
}
|
|
29
|
+
/** @internal */
|
|
30
|
+
export interface MeshPolylineGroup {
|
|
31
|
+
polylines: MeshPolyline[];
|
|
32
|
+
appearance?: EdgeAppearanceOverrides;
|
|
33
|
+
}
|
|
34
|
+
/** @internal */
|
|
22
35
|
export declare class MeshEdges {
|
|
23
36
|
visible: MeshEdge[];
|
|
24
37
|
silhouette: MeshEdge[];
|
|
25
|
-
|
|
38
|
+
appearance?: EdgeAppearanceOverrides;
|
|
39
|
+
polylineGroups: MeshPolylineGroup[];
|
|
26
40
|
silhouetteNormals: OctEncodedNormalPair[];
|
|
27
41
|
constructor();
|
|
28
42
|
}
|
|
@@ -42,10 +56,10 @@ export declare class SilhouetteEdgeArgs extends EdgeArgs {
|
|
|
42
56
|
}
|
|
43
57
|
/** @internal */
|
|
44
58
|
export declare class PolylineEdgeArgs {
|
|
45
|
-
|
|
46
|
-
constructor(
|
|
47
|
-
init(
|
|
48
|
-
get
|
|
59
|
+
groups?: MeshPolylineGroup[];
|
|
60
|
+
constructor(groups?: MeshPolylineGroup[]);
|
|
61
|
+
init(groups?: MeshPolylineGroup[]): boolean;
|
|
62
|
+
get numGroups(): number;
|
|
49
63
|
get isValid(): boolean;
|
|
50
64
|
clear(): void;
|
|
51
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMesh.d.ts","sourceRoot":"","sources":["../../../src/internal/RenderMesh.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,gBAAgB;AAChB,qBAAa,YAAY;IACvB,SAAgB,OAAO,EAAE,eAAe,CAAC;gBAEtB,OAAO,GAAE,eAAoB;IAIzC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAMtB,KAAK;CACb;AAED,gBAAgB;AAChB,MAAM,MAAM,gBAAgB,GAAG,YAAY,EAAE,CAAC;AAE9C,gBAAgB;AAChB,qBAAa,QAAQ;IACZ,OAAO,WAAU;gBAEL,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAY5C,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM;CAO1C;AAED,gBAAgB;AAChB,qBAAa,SAAS;IACb,OAAO,EAAE,QAAQ,EAAE,CAAM;IACzB,UAAU,EAAE,QAAQ,EAAE,CAAM;IAC5B,
|
|
1
|
+
{"version":3,"file":"RenderMesh.d.ts","sourceRoot":"","sources":["../../../src/internal/RenderMesh.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE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AAW,QAAQ,WAA+D;CACnF;AAED,gBAAgB;AAChB,qBAAa,kBAAmB,SAAQ,QAAQ;IACvC,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAExB,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS;IAU1B,KAAK;CAItB;AAED,gBAAgB;AAChB,qBAAa,gBAAgB;IACpB,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;gBAEjB,MAAM,CAAC,EAAE,iBAAiB,EAAE;IAIxC,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,GAAG,OAAO;IAKlD,IAAW,SAAS,WAAuC;IAC3D,IAAW,OAAO,YAAiC;IAC5C,KAAK;CACb"}
|
|
@@ -49,7 +49,8 @@ exports.MeshEdge = MeshEdge;
|
|
|
49
49
|
class MeshEdges {
|
|
50
50
|
visible = [];
|
|
51
51
|
silhouette = [];
|
|
52
|
-
|
|
52
|
+
appearance;
|
|
53
|
+
polylineGroups = [];
|
|
53
54
|
silhouetteNormals = [];
|
|
54
55
|
constructor() { }
|
|
55
56
|
}
|
|
@@ -87,15 +88,17 @@ class SilhouetteEdgeArgs extends EdgeArgs {
|
|
|
87
88
|
exports.SilhouetteEdgeArgs = SilhouetteEdgeArgs;
|
|
88
89
|
/** @internal */
|
|
89
90
|
class PolylineEdgeArgs {
|
|
90
|
-
|
|
91
|
-
constructor(
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
groups;
|
|
92
|
+
constructor(groups) {
|
|
93
|
+
this.init(groups);
|
|
94
|
+
}
|
|
95
|
+
init(groups) {
|
|
96
|
+
this.groups = groups?.filter((group) => group.polylines.length > 0);
|
|
94
97
|
return this.isValid;
|
|
95
98
|
}
|
|
96
|
-
get
|
|
97
|
-
get isValid() { return this.
|
|
98
|
-
clear() { this.
|
|
99
|
+
get numGroups() { return this.groups?.length ?? 0; }
|
|
100
|
+
get isValid() { return this.numGroups > 0; }
|
|
101
|
+
clear() { this.groups = undefined; }
|
|
99
102
|
}
|
|
100
103
|
exports.PolylineEdgeArgs = PolylineEdgeArgs;
|
|
101
104
|
//# sourceMappingURL=RenderMesh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMesh.js","sourceRoot":"","sources":["../../../src/internal/RenderMesh.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"RenderMesh.js","sourceRoot":"","sources":["../../../src/internal/RenderMesh.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAOH,gBAAgB;AAChB,MAAa,YAAY;IACP,OAAO,CAAkB;IAEzC,YAAmB,UAA2B,EAAE;QAC9C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAEM,QAAQ,CAAC,KAAa;QAC3B,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QACzB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,KAAK;YAC/D,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAEM,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;CAC5C;AAdD,oCAcC;AAKD,gBAAgB;AAChB,MAAa,QAAQ;IACZ,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAExB,YAAmB,MAAe,EAAE,MAAe;QACjD,IAAI,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,MAAM;YAC9C,OAAO;QACT,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC;YACpB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;YACzB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,O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C,CAAC,CAAC,CAAC,CAAC;CACnF;AAdD,4BAcC;AAED,gBAAgB;AAChB,MAAa,kBAAmB,SAAQ,QAAQ;IACvC,OAAO,CAA0B;IAExB,IAAI,CAAC,SAAqB;QACxC,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YAC/D,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC;YAClC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,iBAAiB,CAAC;QAC7C,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEe,KAAK;QACnB,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC;CACF;AAjBD,gDAiBC;AAED,gBAAgB;AAChB,MAAa,gBAAgB;IACpB,MAAM,CAAuB;IAEpC,YAAmB,MAA4B;QAC7C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IAEM,IAAI,CAAC,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3D,IAAW,OAAO,KAAK,OAAO,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5C,KAAK,KAAK,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CAC5C;AAfD,4CAeC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { ColorDef } from \"../ColorDef\";\nimport { LinePixels } from \"../LinePixels\";\nimport { OctEncodedNormalPair } from \"../OctEncodedNormal\";\nimport { PolylineIndices } from \"../RenderPolyline\";\n\n/** @internal */\nexport class MeshPolyline {\n public readonly indices: PolylineIndices;\n\n public constructor(indices: PolylineIndices = []) {\n this.indices = indices.slice();\n }\n\n public addIndex(index: number) {\n const { indices } = this;\n if (indices.length === 0 || indices[indices.length - 1] !== index)\n indices.push(index);\n }\n\n public clear() { this.indices.length = 0; }\n}\n\n/** @internal */\nexport type MeshPolylineList = MeshPolyline[];\n\n/** @internal */\nexport class MeshEdge {\n public indices = [0, 0];\n\n public constructor(index0?: number, index1?: number) {\n if (undefined === index0 || undefined === index1)\n return;\n if (index0 < index1) {\n this.indices[0] = index0;\n this.indices[1] = index1;\n } else {\n this.indices[0] = index1;\n this.indices[1] = index0;\n }\n }\n\n public compareTo(other: MeshEdge): number {\n let diff = this.indices[0] - other.indices[0];\n if (0 === diff)\n diff = this.indices[1] - other.indices[1];\n\n return diff;\n }\n}\n\n/** @internal */\nexport interface EdgeAppearanceOverrides {\n color?: ColorDef;\n linePixels?: LinePixels;\n width?: number;\n}\n\n/** @internal */\nexport interface MeshPolylineGroup {\n polylines: MeshPolyline[];\n appearance?: EdgeAppearanceOverrides;\n}\n\n/** @internal */\nexport class MeshEdges {\n public visible: MeshEdge[] = [];\n public silhouette: MeshEdge[] = [];\n public appearance?: EdgeAppearanceOverrides;\n public polylineGroups: MeshPolylineGroup[] = [];\n public silhouetteNormals: OctEncodedNormalPair[] = [];\n public constructor() { }\n}\n\n/** @internal */\nexport class EdgeArgs {\n public edges?: MeshEdge[];\n\n public init(meshEdges?: MeshEdges): boolean {\n this.clear();\n if (undefined !== meshEdges && 0 < meshEdges.visible.length)\n this.edges = meshEdges.visible;\n\n return this.isValid;\n }\n\n public clear(): void { this.edges = undefined; }\n public get isValid(): boolean { return 0 < this.numEdges; }\n public get numEdges() { return undefined !== this.edges ? this.edges.length : 0; }\n}\n\n/** @internal */\nexport class SilhouetteEdgeArgs extends EdgeArgs {\n public normals?: OctEncodedNormalPair[];\n\n public override init(meshEdges?: MeshEdges) {\n this.clear();\n if (undefined !== meshEdges && 0 < meshEdges.silhouette.length) {\n this.edges = meshEdges.silhouette;\n this.normals = meshEdges.silhouetteNormals;\n }\n\n return this.isValid;\n }\n\n public override clear() {\n this.normals = undefined;\n super.clear();\n }\n}\n\n/** @internal */\nexport class PolylineEdgeArgs {\n public groups?: MeshPolylineGroup[];\n\n public constructor(groups?: MeshPolylineGroup[]) {\n this.init(groups);\n }\n\n public init(groups?: MeshPolylineGroup[]): boolean {\n this.groups = groups?.filter((group) => group.polylines.length > 0);\n return this.isValid;\n }\n\n public get numGroups() { return this.groups?.length ?? 0; }\n public get isValid() { return this.numGroups > 0; }\n public clear() { this.groups = undefined; }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { DecorationGeometryProps, SnapRequestProps, SnapResponseProps } from "./Snapping";
|
|
2
|
-
export { EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs } from "./RenderMesh";
|
|
2
|
+
export { type EdgeAppearanceOverrides, EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs } from "./RenderMesh";
|
|
3
3
|
export { MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTable } from "./PackedFeatureTable";
|
|
4
4
|
export type { BackendReadable, BackendWritable, BackendBuffer } from "./BackendTypes";
|
|
5
5
|
export { RenderMaterialParams } from "./RenderMaterialParams";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-package.d.ts","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EACL,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"cross-package.d.ts","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EACL,KAAK,uBAAuB,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EACvI,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAAE,uBAAuB,EAAE,kBAAkB,EAC1E,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAG/F,2CAEsB;
|
|
1
|
+
{"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAG/F,2CAEsB;AADU,sGAAA,QAAQ,OAAA;AAAE,sGAAA,QAAQ,OAAA;AAAE,uGAAA,SAAS,OAAA;AAAE,0GAAA,YAAY,OAAA;AAAyB,8GAAA,gBAAgB,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AAExI,2DAE8B;AAD5B,kIAAA,4BAA4B,OAAA;AAAE,6HAAA,uBAAuB,OAAA;AAAE,wHAAA,kBAAkB,OAAA;AAG3E,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nexport type { DecorationGeometryProps, SnapRequestProps, SnapResponseProps } from \"./Snapping\";\nexport {\n type EdgeAppearanceOverrides, EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs\n} from \"./RenderMesh\";\nexport {\n MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTable\n} from \"./PackedFeatureTable\";\nexport type { BackendReadable, BackendWritable, BackendBuffer } from \"./BackendTypes\";\nexport { RenderMaterialParams } from \"./RenderMaterialParams\";\nexport { RenderTextureParams } from \"./RenderTextureParams\";\n"]}
|
|
@@ -140,9 +140,12 @@ export interface RenderMaterialAssetProps {
|
|
|
140
140
|
HasFinish?: boolean;
|
|
141
141
|
/** Specular exponent (surface shininess); range is 0 to 128; if undefined, defaults to 13.5 */
|
|
142
142
|
finish?: number;
|
|
143
|
-
/** If true, this material
|
|
143
|
+
/** If true, then this material overrides the surface transparency to be the value of [[transmit]].
|
|
144
|
+
* If false, then this material overrides the surface to be fully opaque.
|
|
145
|
+
* If undefined, then this material does not override the surface transparency at all.
|
|
146
|
+
*/
|
|
144
147
|
HasTransmit?: boolean;
|
|
145
|
-
/** Surface transparency; if undefined, defaults to 0.0 */
|
|
148
|
+
/** Surface transparency; if undefined, defaults to 0.0. Has no effect unless [[HasTransmit]] is true. */
|
|
146
149
|
transmit?: number;
|
|
147
150
|
/** If true, this material has a value for diffuse reflectivity; if undefined, defaults to false */
|
|
148
151
|
HasDiffuse?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
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AG+F;AAC/F;;GAEG;AAqBH;;;GAGG;AACH,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,wCAAwC;IACxC,6DAAY,CAAA;IACZ,yDAAU,CAAA;IACV,mEAAe,CAAA;IACf,qDAAQ,CAAA;IACR,yDAAU,CAAA;AACZ,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AA4CD;;GAEG;AACH,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,wBAAwB;IACxB,mDAAQ,CAAA;IACR;;OAEG;IACH,yDAAgB,CAAA;IAChB,uFAAuF;IACvF,uEAAuB,CAAA;AACzB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { DefinitionElementProps } from \"./ElementProps\";\nimport { TextureMapping } from \"./TextureMapping\";\n\n/** Describes a color as an array of three numbers ranging from 0 to 1 where the first entry corresponds to the color's red component,\n * the second to green, and the third to blue.\n * @see usage in [[RenderMaterialAssetProps]].\n * @public\n * @extensions\n */\nexport type RgbFactorProps = number[];\n\n/** A 2d point specified as an array of 2 numbers [x, y].\n * @see usage in [[TextureMapProps]].\n * @public\n * @extensions\n */\nexport type Point2dProps = number[];\n\n/** Describes the units in which a [[TextureMapProps]]' scale is expressed.\n * @public\n * @extensions\n */\nexport enum TextureMapUnits {\n /** Indicates the scale has no units. */\n Relative = 0,\n Meters = 3,\n Millimeters = 4,\n Feet = 5,\n Inches = 6,\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/** As part of a [[RenderMaterialAssetProps]], describes how to map a [[RenderTexture]]'s image to the triangles of a mesh to which the material is applied.\n * @see [[RenderMaterialAssetMapsProps]] for the supported types of texture mappings.\n * @public\n * @extensions\n */\nexport interface TextureMapProps {\n /** Angle in degrees to rotate texture when applying; defaults to 0.0 if undefined */\n pattern_angle?: number;\n /** If true, flip the pattern map in U; if undefined, defaults to false */\n pattern_u_flip?: boolean;\n /** If true, flip the pattern map in V; if undefined, defaults to false */\n pattern_flip?: boolean;\n /** X, Y scale to apply to the pattern map; if undefined, defaults to {0,0}, which is almost never useful. */\n pattern_scale?: Point2dProps;\n /** X, Y offset to apply to the pattern map; if undefined, defaults to {0,0} */\n pattern_offset?: Point2dProps;\n /** Units to use when applying the scaling; if undefined, defaults to [[TextureMapUnits.Relative]] */\n pattern_scalemode?: TextureMapUnits;\n /** Mapping mode to use for the texture application; if undefined, defaults to [[TextureMapping.Mode.Parametric]] */\n pattern_mapping?: TextureMapping.Mode;\n /** Weight at which to combine diffuse image and color; if undefined, defaults to 1.0 */\n pattern_weight?: number;\n /** If true, override the mapping mode with constant LOD mapping for the normal map, defaults to false.\n * @deprecated in 4.4 - will not be removed until after 2026-06-13. It never functioned properly - use [[pattern_useconstantlod]] instead.\n */\n pattern_useConstantLod?: boolean;\n /** If true, override the mapping mode with constant LOD mapping for the normal map, defaults to false. */\n pattern_useconstantlod?: boolean;\n /** The number of times the texture is repeated if pattern_useconstantlod is true. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. Defaults to 1.*/\n pattern_constantlod_repetitions?: number;\n /** An offset in world units used to shift the texture when pattern_useconstantlod is true. Defaults to (0, 0). */\n pattern_constantlod_offset?: Point2dProps;\n /** The minimum distance (from the eye to the surface) at which to clamp the texture size when pattern_useconstantlod is true. Defaults to 1. */\n pattern_constantlod_mindistanceclamp?: number;\n /** The maximum distance (from the eye to the surface) at which to clamp the texture size when pattern_useconstantlod is true. Defaults to 2^32. */\n pattern_constantlod_maxdistanceclamp?: number;\n /** The Id of the persistent [Texture]($backend) element defining the texture image. */\n TextureId: Id64String;\n}\n\n/** Flags applied to a [[NormalMapProps]]. The enum values can be combined using bitwise operators.\n * @public\n */\nexport enum NormalMapFlags {\n /** No special flags. */\n None = 0,\n /** Indicates that the Y component of each vector - stored in the texture's green channel - points upward along the positive Y axis and should\n * be negated. By default it points downward.\n */\n GreenUp = 1 << 0,\n /** If true, override the mapping mode with constant LOD mapping for the normal map. */\n UseConstantLod = 1 << 1,\n}\n\n/** Describes how to apply [normal mapping](https://en.wikipedia.org/wiki/Normal_mapping) to a surface material.\n * @see [[RenderMaterialAssetMapsProps.Normal]] to define a normal map for a [[RenderMaterialAssetProps]].\n * @public\n */\nexport interface NormalMapProps extends TextureMapProps {\n /** Flags controlling how the normal map is applied. Default: [[NormalMapFlags.None]]. */\n NormalFlags?: NormalMapFlags;\n}\n\n/** Describes different types of textures to be applied to a surface material to alter its appearance.\n * @note While technically both [[Pattern]] and [[Normal]] can define their own mapping parameters (`pattern_angle`, `pattern_mapping`, etc), in practice\n * if both maps are present they are expected to have identical mapping parameters, with the exception of `TextureId`.\n * @see [[RenderMaterialAssetProps.Map]] to define the texture maps for a material asset.\n * @public\n */\nexport interface RenderMaterialAssetMapsProps {\n /** Maps an image describing the diffuse color of the surface, replacing or mixing with the surface's own color. */\n Pattern?: TextureMapProps;\n /** Maps a [normal map](https://en.wikipedia.org/wiki/Normal_mapping) to the surface, simulating more complex surface details than are\n * present in the surface's geometry.\n */\n Normal?: NormalMapProps;\n /** Maps an image describing detailed minor height variation of the surface geometry. */\n Bump?: TextureMapProps;\n /** Maps an image describing the diffuse color of the surface, replacing or mixing with the surface's own color. */\n Diffuse?: TextureMapProps;\n /** Maps an image describing the glossiness of the surface's finish */\n Finish?: TextureMapProps;\n /** Maps an image describing glowing parts of the surface */\n GlowColor?: TextureMapProps;\n /** Maps an image describing the reflectiveness of the surface */\n Reflect?: TextureMapProps;\n /** Maps an image describing the specular component of the surface */\n Specular?: TextureMapProps;\n /** Maps an image describing the translucency of the surface, how much light comes out the back of the surface */\n TranslucencyColor?: TextureMapProps;\n /** Maps an image describing the transparency of the surface, how visible objects behind this object are */\n TransparentColor?: TextureMapProps;\n /** Maps an image describing the displacement of the surface geometry */\n Displacement?: TextureMapProps;\n}\n\n/** Describes the graphical properties of a [RenderMaterialElement]($backend) as part of a [[RenderMaterialProps]].\n * This representation is used to persist the material properties into the [IModelDb]($backend), but is unwieldy and verbose.\n * @see [RenderMaterialElementParams]($backend) for a somewhat more ergonomic representation.\n * @public\n * @extensions\n */\nexport interface RenderMaterialAssetProps {\n /** If true, this material has a fill/diffuse color; if undefined, defaults to false */\n HasBaseColor?: boolean;\n /** Surface color used for fill or diffuse illumination; if undefined, defaults to black */\n color?: RgbFactorProps;\n /** If true, this material has a specular color; if undefined, defaults to false */\n HasSpecularColor?: boolean;\n /** Surface color used for specular illumination; if undefined, defaults to black */\n specular_color?: RgbFactorProps;\n /** If true, this material has a specular exponent; if undefined, defaults to false */\n HasFinish?: boolean;\n /** Specular exponent (surface shininess); range is 0 to 128; if undefined, defaults to 13.5 */\n finish?: number;\n /** If true, this material has surface transparency; if undefined, defaults to false */\n HasTransmit?: boolean;\n /** Surface transparency; if undefined, defaults to 0.0 */\n transmit?: number;\n /** If true, this material has a value for diffuse reflectivity; if undefined, defaults to false */\n HasDiffuse?: boolean;\n /** Surface diffuse reflectivity; if undefined, defaults to 0.6 */\n diffuse?: number;\n /** If true, this material has a value for specular reflectivity; if undefined, defaults to false. If false, specular value is actually set to 0.0 */\n HasSpecular?: boolean;\n /** Surface specular reflectivity; if undefined, defaults to 0.4 */\n specular?: number;\n /** If true, this material has a value for environmental reflectivity; if undefined, defaults to false */\n HasReflect?: boolean;\n /** Surface environmental reflectivity; stored as fraction of specular in V8 material settings; if undefined defaults to 0.0 */\n reflect?: number;\n /** If true, this material has a surface reflectance color; if undefined, defaults to false. If false, reflectance color is actually set to specular color */\n HasReflectColor?: boolean;\n /** Surface reflectance color; if undefined, defaults to black */\n reflect_color?: RgbFactorProps;\n /** A scale by which to multiply the components of the normals read from [[Map.Normal]], if a normal map is defined.\n * Default: 1.0\n */\n pbr_normal?: number;\n /** An optional set of texture maps associated with this material. */\n Map?: RenderMaterialAssetMapsProps;\n}\n\n/** Properties that define a [RenderMaterialElement]($backend).\n * @see [[RenderMaterial]] for the representation used by the display system.\n * @public\n * @extensions\n */\nexport interface RenderMaterialProps extends DefinitionElementProps {\n /** The name of a palette that can be used to categorize multiple materials. */\n paletteName: string;\n /** An optional description of the material. */\n description?: string;\n jsonProperties?: {\n /** A container for various \"assets\" describing aspects of the material. */\n materialAssets?: {\n /** Properties of the material describing how it is displayed. */\n renderMaterial?: RenderMaterialAssetProps;\n };\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MaterialProps.js","sourceRoot":"","sources":["../../src/MaterialProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAqBH;;;GAGG;AACH,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,wCAAwC;IACxC,6DAAY,CAAA;IACZ,yDAAU,CAAA;IACV,mEAAe,CAAA;IACf,qDAAQ,CAAA;IACR,yDAAU,CAAA;AACZ,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AA4CD;;GAEG;AACH,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,wBAAwB;IACxB,mDAAQ,CAAA;IACR;;OAEG;IACH,yDAAgB,CAAA;IAChB,uFAAuF;IACvF,uEAAuB,CAAA;AACzB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { DefinitionElementProps } from \"./ElementProps\";\nimport { TextureMapping } from \"./TextureMapping\";\n\n/** Describes a color as an array of three numbers ranging from 0 to 1 where the first entry corresponds to the color's red component,\n * the second to green, and the third to blue.\n * @see usage in [[RenderMaterialAssetProps]].\n * @public\n * @extensions\n */\nexport type RgbFactorProps = number[];\n\n/** A 2d point specified as an array of 2 numbers [x, y].\n * @see usage in [[TextureMapProps]].\n * @public\n * @extensions\n */\nexport type Point2dProps = number[];\n\n/** Describes the units in which a [[TextureMapProps]]' scale is expressed.\n * @public\n * @extensions\n */\nexport enum TextureMapUnits {\n /** Indicates the scale has no units. */\n Relative = 0,\n Meters = 3,\n Millimeters = 4,\n Feet = 5,\n Inches = 6,\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/** As part of a [[RenderMaterialAssetProps]], describes how to map a [[RenderTexture]]'s image to the triangles of a mesh to which the material is applied.\n * @see [[RenderMaterialAssetMapsProps]] for the supported types of texture mappings.\n * @public\n * @extensions\n */\nexport interface TextureMapProps {\n /** Angle in degrees to rotate texture when applying; defaults to 0.0 if undefined */\n pattern_angle?: number;\n /** If true, flip the pattern map in U; if undefined, defaults to false */\n pattern_u_flip?: boolean;\n /** If true, flip the pattern map in V; if undefined, defaults to false */\n pattern_flip?: boolean;\n /** X, Y scale to apply to the pattern map; if undefined, defaults to {0,0}, which is almost never useful. */\n pattern_scale?: Point2dProps;\n /** X, Y offset to apply to the pattern map; if undefined, defaults to {0,0} */\n pattern_offset?: Point2dProps;\n /** Units to use when applying the scaling; if undefined, defaults to [[TextureMapUnits.Relative]] */\n pattern_scalemode?: TextureMapUnits;\n /** Mapping mode to use for the texture application; if undefined, defaults to [[TextureMapping.Mode.Parametric]] */\n pattern_mapping?: TextureMapping.Mode;\n /** Weight at which to combine diffuse image and color; if undefined, defaults to 1.0 */\n pattern_weight?: number;\n /** If true, override the mapping mode with constant LOD mapping for the normal map, defaults to false.\n * @deprecated in 4.4 - will not be removed until after 2026-06-13. It never functioned properly - use [[pattern_useconstantlod]] instead.\n */\n pattern_useConstantLod?: boolean;\n /** If true, override the mapping mode with constant LOD mapping for the normal map, defaults to false. */\n pattern_useconstantlod?: boolean;\n /** The number of times the texture is repeated if pattern_useconstantlod is true. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. Defaults to 1.*/\n pattern_constantlod_repetitions?: number;\n /** An offset in world units used to shift the texture when pattern_useconstantlod is true. Defaults to (0, 0). */\n pattern_constantlod_offset?: Point2dProps;\n /** The minimum distance (from the eye to the surface) at which to clamp the texture size when pattern_useconstantlod is true. Defaults to 1. */\n pattern_constantlod_mindistanceclamp?: number;\n /** The maximum distance (from the eye to the surface) at which to clamp the texture size when pattern_useconstantlod is true. Defaults to 2^32. */\n pattern_constantlod_maxdistanceclamp?: number;\n /** The Id of the persistent [Texture]($backend) element defining the texture image. */\n TextureId: Id64String;\n}\n\n/** Flags applied to a [[NormalMapProps]]. The enum values can be combined using bitwise operators.\n * @public\n */\nexport enum NormalMapFlags {\n /** No special flags. */\n None = 0,\n /** Indicates that the Y component of each vector - stored in the texture's green channel - points upward along the positive Y axis and should\n * be negated. By default it points downward.\n */\n GreenUp = 1 << 0,\n /** If true, override the mapping mode with constant LOD mapping for the normal map. */\n UseConstantLod = 1 << 1,\n}\n\n/** Describes how to apply [normal mapping](https://en.wikipedia.org/wiki/Normal_mapping) to a surface material.\n * @see [[RenderMaterialAssetMapsProps.Normal]] to define a normal map for a [[RenderMaterialAssetProps]].\n * @public\n */\nexport interface NormalMapProps extends TextureMapProps {\n /** Flags controlling how the normal map is applied. Default: [[NormalMapFlags.None]]. */\n NormalFlags?: NormalMapFlags;\n}\n\n/** Describes different types of textures to be applied to a surface material to alter its appearance.\n * @note While technically both [[Pattern]] and [[Normal]] can define their own mapping parameters (`pattern_angle`, `pattern_mapping`, etc), in practice\n * if both maps are present they are expected to have identical mapping parameters, with the exception of `TextureId`.\n * @see [[RenderMaterialAssetProps.Map]] to define the texture maps for a material asset.\n * @public\n */\nexport interface RenderMaterialAssetMapsProps {\n /** Maps an image describing the diffuse color of the surface, replacing or mixing with the surface's own color. */\n Pattern?: TextureMapProps;\n /** Maps a [normal map](https://en.wikipedia.org/wiki/Normal_mapping) to the surface, simulating more complex surface details than are\n * present in the surface's geometry.\n */\n Normal?: NormalMapProps;\n /** Maps an image describing detailed minor height variation of the surface geometry. */\n Bump?: TextureMapProps;\n /** Maps an image describing the diffuse color of the surface, replacing or mixing with the surface's own color. */\n Diffuse?: TextureMapProps;\n /** Maps an image describing the glossiness of the surface's finish */\n Finish?: TextureMapProps;\n /** Maps an image describing glowing parts of the surface */\n GlowColor?: TextureMapProps;\n /** Maps an image describing the reflectiveness of the surface */\n Reflect?: TextureMapProps;\n /** Maps an image describing the specular component of the surface */\n Specular?: TextureMapProps;\n /** Maps an image describing the translucency of the surface, how much light comes out the back of the surface */\n TranslucencyColor?: TextureMapProps;\n /** Maps an image describing the transparency of the surface, how visible objects behind this object are */\n TransparentColor?: TextureMapProps;\n /** Maps an image describing the displacement of the surface geometry */\n Displacement?: TextureMapProps;\n}\n\n/** Describes the graphical properties of a [RenderMaterialElement]($backend) as part of a [[RenderMaterialProps]].\n * This representation is used to persist the material properties into the [IModelDb]($backend), but is unwieldy and verbose.\n * @see [RenderMaterialElementParams]($backend) for a somewhat more ergonomic representation.\n * @public\n * @extensions\n */\nexport interface RenderMaterialAssetProps {\n /** If true, this material has a fill/diffuse color; if undefined, defaults to false */\n HasBaseColor?: boolean;\n /** Surface color used for fill or diffuse illumination; if undefined, defaults to black */\n color?: RgbFactorProps;\n /** If true, this material has a specular color; if undefined, defaults to false */\n HasSpecularColor?: boolean;\n /** Surface color used for specular illumination; if undefined, defaults to black */\n specular_color?: RgbFactorProps;\n /** If true, this material has a specular exponent; if undefined, defaults to false */\n HasFinish?: boolean;\n /** Specular exponent (surface shininess); range is 0 to 128; if undefined, defaults to 13.5 */\n finish?: number;\n /** If true, then this material overrides the surface transparency to be the value of [[transmit]].\n * If false, then this material overrides the surface to be fully opaque.\n * If undefined, then this material does not override the surface transparency at all.\n */\n HasTransmit?: boolean;\n /** Surface transparency; if undefined, defaults to 0.0. Has no effect unless [[HasTransmit]] is true. */\n transmit?: number;\n /** If true, this material has a value for diffuse reflectivity; if undefined, defaults to false */\n HasDiffuse?: boolean;\n /** Surface diffuse reflectivity; if undefined, defaults to 0.6 */\n diffuse?: number;\n /** If true, this material has a value for specular reflectivity; if undefined, defaults to false. If false, specular value is actually set to 0.0 */\n HasSpecular?: boolean;\n /** Surface specular reflectivity; if undefined, defaults to 0.4 */\n specular?: number;\n /** If true, this material has a value for environmental reflectivity; if undefined, defaults to false */\n HasReflect?: boolean;\n /** Surface environmental reflectivity; stored as fraction of specular in V8 material settings; if undefined defaults to 0.0 */\n reflect?: number;\n /** If true, this material has a surface reflectance color; if undefined, defaults to false. If false, reflectance color is actually set to specular color */\n HasReflectColor?: boolean;\n /** Surface reflectance color; if undefined, defaults to black */\n reflect_color?: RgbFactorProps;\n /** A scale by which to multiply the components of the normals read from [[Map.Normal]], if a normal map is defined.\n * Default: 1.0\n */\n pbr_normal?: number;\n /** An optional set of texture maps associated with this material. */\n Map?: RenderMaterialAssetMapsProps;\n}\n\n/** Properties that define a [RenderMaterialElement]($backend).\n * @see [[RenderMaterial]] for the representation used by the display system.\n * @public\n * @extensions\n */\nexport interface RenderMaterialProps extends DefinitionElementProps {\n /** The name of a palette that can be used to categorize multiple materials. */\n paletteName: string;\n /** An optional description of the material. */\n description?: string;\n jsonProperties?: {\n /** A container for various \"assets\" describing aspects of the material. */\n materialAssets?: {\n /** Properties of the material describing how it is displayed. */\n renderMaterial?: RenderMaterialAssetProps;\n };\n };\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Geometry
|
|
3
3
|
*/
|
|
4
|
+
import { Transform } from "@itwin/core-geometry";
|
|
4
5
|
/** An affine transformation with an additional Z Offset.
|
|
5
6
|
* The equations are:
|
|
6
7
|
* given a = scale * cos(rotation) and b = scale * sin(rotation)
|
|
@@ -53,6 +54,9 @@ export declare class Helmert2DWithZOffset implements Helmert2DWithZOffsetProps {
|
|
|
53
54
|
/** Compares two Helmert2DWithZOffset objects applying a minuscule tolerance.
|
|
54
55
|
* @public */
|
|
55
56
|
equals(other: Helmert2DWithZOffset): boolean;
|
|
57
|
+
/** Convert Helmert2DWithZOffset object into Transfrom object
|
|
58
|
+
* @public */
|
|
59
|
+
convertHelmertToTransform(): Transform;
|
|
56
60
|
}
|
|
57
61
|
/** Additional Transform definition
|
|
58
62
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdditionalTransform.d.ts","sourceRoot":"","sources":["../../../src/geometry/AdditionalTransform.ts"],"names":[],"mappings":"AAIA;;GAEG;
|
|
1
|
+
{"version":3,"file":"AdditionalTransform.d.ts","sourceRoot":"","sources":["../../../src/geometry/AdditionalTransform.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAwC,SAAS,EAAY,MAAM,sBAAsB,CAAC;AAEjG;;;;;;;;GAQG;AACH,MAAM,WAAW,yBAAyB;IACxC,6BAA6B;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,qBAAa,oBAAqB,YAAW,yBAAyB;IACpE,6BAA6B;IACtB,YAAY,EAAG,MAAM,CAAC;IAC7B,6BAA6B;IACtB,YAAY,EAAG,MAAM,CAAC;IAC7B,wCAAwC;IACjC,YAAY,EAAG,MAAM,CAAC;IAC7B,oEAAoE;IAC7D,MAAM,EAAG,MAAM,CAAC;IACvB,iFAAiF;IAC1E,KAAK,EAAG,MAAM,CAAC;gBAEV,IAAI,CAAC,EAAE,yBAAyB;IAU5C;iBACa;WACC,QAAQ,CAAC,IAAI,EAAE,yBAAyB,GAAG,oBAAoB;IAI7E;iBACa;IACN,MAAM,IAAI,yBAAyB;IAI1C;kBACc;IACP,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO;IAQnD;iBACa;IACN,yBAAyB,IAAI,SAAS;CAe9C;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,gFAAgF;IAChF,oBAAoB,CAAC,EAAE,yBAAyB,CAAC;CAClD;AAED;;;;;EAKE;AACF,qBAAa,mBAAoB,YAAW,wBAAwB;IAElE,gFAAgF;IAChF,SAAgB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;gBAEzC,IAAI,CAAC,EAAE,wBAAwB;IAKlD;iBACa;WACC,QAAQ,CAAC,IAAI,EAAE,wBAAwB,GAAG,mBAAmB;IAI3E;iBACa;IACN,MAAM,IAAI,wBAAwB;IAIzC;kBACc;IACP,MAAM,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO;CASnD"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module Geometry
|
|
7
7
|
*/
|
|
8
8
|
// cspell:ignore Helmert
|
|
9
|
-
import { Geometry } from "@itwin/core-geometry";
|
|
9
|
+
import { Angle, AxisIndex, Geometry, Matrix3d, Transform, Vector3d } from "@itwin/core-geometry";
|
|
10
10
|
/** An affine transformation with an additional Z Offset.
|
|
11
11
|
* The equations are:
|
|
12
12
|
* given a = scale * cos(rotation) and b = scale * sin(rotation)
|
|
@@ -56,6 +56,15 @@ export class Helmert2DWithZOffset {
|
|
|
56
56
|
Math.abs(this.rotDeg - other.rotDeg) < Geometry.smallAngleDegrees &&
|
|
57
57
|
Math.abs(this.scale - other.scale) < Geometry.smallFraction);
|
|
58
58
|
}
|
|
59
|
+
/** Convert Helmert2DWithZOffset object into Transfrom object
|
|
60
|
+
* @public */
|
|
61
|
+
convertHelmertToTransform() {
|
|
62
|
+
const rotationXY = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, Angle.createDegrees(this?.rotDeg));
|
|
63
|
+
rotationXY.scaleColumnsInPlace(this.scale, this.scale, 1.0);
|
|
64
|
+
const translation = Vector3d.create(this.translationX, this.translationY, this.translationZ);
|
|
65
|
+
const helmertTransform = Transform.createRefs(translation, rotationXY);
|
|
66
|
+
return helmertTransform;
|
|
67
|
+
}
|
|
59
68
|
}
|
|
60
69
|
/** Additional Transform implementation.
|
|
61
70
|
* An additional transform is a transformation that can apply to either the horizontal or vertical coordinates of a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdditionalTransform.js","sourceRoot":"","sources":["../../../src/geometry/AdditionalTransform.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,wBAAwB;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"AdditionalTransform.js","sourceRoot":"","sources":["../../../src/geometry/AdditionalTransform.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,wBAAwB;AAExB,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAwBjG;;;;;;;;;GASG;AACH,MAAM,OAAO,oBAAoB;IAC/B,6BAA6B;IACtB,YAAY,CAAU;IAC7B,6BAA6B;IACtB,YAAY,CAAU;IAC7B,wCAAwC;IACjC,YAAY,CAAU;IAC7B,oEAAoE;IAC7D,MAAM,CAAU;IACvB,iFAAiF;IAC1E,KAAK,CAAU;IAEtB,YAAY,IAAgC;QAC1C,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YACtC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC;IAED;iBACa;IACN,MAAM,CAAC,QAAQ,CAAC,IAA+B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B,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,YAAY,CAClB,CAAC;QACF,MAAM,gBAAgB,GAAG,SAAS,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvE,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF;AAWD;;;;;EAKE;AACF,MAAM,OAAO,mBAAmB;IAE9B,gFAAgF;IAChE,oBAAoB,CAAwB;IAE5D,YAAmB,IAA+B;QAChD,IAAI,IAAI;YACN,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACjI,CAAC;IAED;iBACa;IACN,MAAM,CAAC,QAAQ,CAAC,IAA8B;QACnD,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED;iBACa;IACN,MAAM;QACX,OAAO,EAAE,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC7D,CAAC;IAED;kBACc;IACP,MAAM,CAAC,KAA0B;QACtC,IAAI,CAAC,IAAI,CAAC,oBAAoB,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,oBAAoB,KAAK,SAAS,CAAC;YAC1F,OAAO,KAAK,CAAC;QAEf,IAAI,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAqB,CAAC;YAC7F,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Geometry\n */\n// cspell:ignore Helmert\n\nimport { Angle, AxisIndex, Geometry, Matrix3d, Transform, Vector3d } from \"@itwin/core-geometry\";\n\n/** An affine transformation with an additional Z Offset.\n * The equations are:\n * given a = scale * cos(rotation) and b = scale * sin(rotation)\n * X = a * x - b * y + translationX\n * Y = b * x + a * y + translationY\n * Z = z + translationZ\n * @public\n * @extensions\n */\nexport interface Helmert2DWithZOffsetProps {\n /** The X post translation */\n translationX: number;\n /** The Y post-translation */\n translationY: number;\n /** The Z post-translation or Z offset*/\n translationZ: number;\n /** The rotation in the trigonometric (CCW) direction in degrees. */\n rotDeg: number;\n /** The scale. This scale applies to both X and Y axises. Does not apply to Z. */\n scale: number;\n}\n\n/** An affine transformation with an additional Z Offset.\n * The equations are:\n * given a = scale * cos(rotation) and b = scale * sin(rotation)\n * X = a * x - b * y + translationX\n * Y = b * x + a * y + translationY\n * Z = z + translationZ\n *\n * Note that the class only implements the definition and not the operation.\n * @public\n */\nexport class Helmert2DWithZOffset implements Helmert2DWithZOffsetProps {\n /** The X post translation */\n public translationX!: number;\n /** The Y post-translation */\n public translationY!: number;\n /** The Z post-translation or Z offset*/\n public translationZ!: number;\n /** The rotation in the trigonometric (CCW) direction in degrees. */\n public rotDeg!: number;\n /** The scale. This scale applies to both X and Y axises. Does not apply to Z. */\n public scale!: number;\n\n constructor(data?: Helmert2DWithZOffsetProps) {\n if (data) {\n this.translationX = data.translationX;\n this.translationY = data.translationY;\n this.translationZ = data.translationZ;\n this.rotDeg = data.rotDeg;\n this.scale = data.scale;\n }\n }\n\n /** Creates an Helmert Transform from JSON representation.\n * @public */\n public static fromJSON(data: Helmert2DWithZOffsetProps): Helmert2DWithZOffset {\n return new Helmert2DWithZOffset(data);\n }\n\n /** Creates a JSON from the Helmert Transform definition\n * @public */\n public toJSON(): Helmert2DWithZOffsetProps {\n return { translationX: this.translationX, translationY: this.translationY, translationZ: this.translationZ, rotDeg: this.rotDeg, scale: this.scale };\n }\n\n /** Compares two Helmert2DWithZOffset objects applying a minuscule tolerance.\n * @public */\n public equals(other: Helmert2DWithZOffset): boolean {\n return (Math.abs(this.translationX - other.translationX) < Geometry.smallMetricDistance &&\n Math.abs(this.translationY - other.translationY) < Geometry.smallMetricDistance &&\n Math.abs(this.translationZ - other.translationZ) < Geometry.smallMetricDistance &&\n Math.abs(this.rotDeg - other.rotDeg) < Geometry.smallAngleDegrees &&\n Math.abs(this.scale - other.scale) < Geometry.smallFraction);\n }\n\n /** Convert Helmert2DWithZOffset object into Transfrom object\n * @public */\n public convertHelmertToTransform(): Transform {\n const rotationXY = Matrix3d.createRotationAroundAxisIndex(\n AxisIndex.Z,\n Angle.createDegrees(this?.rotDeg)\n );\n rotationXY.scaleColumnsInPlace(this.scale, this.scale, 1.0);\n const translation = Vector3d.create(\n this.translationX,\n this.translationY,\n this.translationZ\n );\n const helmertTransform = Transform.createRefs(translation, rotationXY);\n\n return helmertTransform;\n }\n}\n\n/** Additional Transform definition\n * @public\n * @extensions\n */\nexport interface AdditionalTransformProps {\n /** The properties of a 2D Helmert transform with Z offset if one is defined. */\n helmert2DWithZOffset?: Helmert2DWithZOffsetProps;\n}\n\n/** Additional Transform implementation.\n * An additional transform is a transformation that can apply to either the horizontal or vertical coordinates of a\n * geographic CRS. The transformation is applied after the latitude/longitude have been projected thus the process\n * is applied to the result Cartesian coordinates of the projection process.\n * @public\n*/\nexport class AdditionalTransform implements AdditionalTransformProps {\n\n /** The properties of a 2D Helmert transform with Z offset if one is defined. */\n public readonly helmert2DWithZOffset?: Helmert2DWithZOffset;\n\n public constructor(data?: AdditionalTransformProps) {\n if (data)\n this.helmert2DWithZOffset = data.helmert2DWithZOffset ? Helmert2DWithZOffset.fromJSON(data.helmert2DWithZOffset) : undefined;\n }\n\n /** Creates an Additional Transform from JSON representation.\n * @public */\n public static fromJSON(data: AdditionalTransformProps): AdditionalTransform {\n return new AdditionalTransform(data);\n }\n\n /** Creates a JSON from the Additional Transform definition\n * @public */\n public toJSON(): AdditionalTransformProps {\n return { helmert2DWithZOffset: this.helmert2DWithZOffset };\n }\n\n /** Compares two additional transforms applying a minuscule tolerance to comparing numbers.\n * @public */\n public equals(other: AdditionalTransform): boolean {\n if ((this.helmert2DWithZOffset === undefined) !== (other.helmert2DWithZOffset === undefined))\n return false;\n\n if (this.helmert2DWithZOffset && !this.helmert2DWithZOffset.equals(other.helmert2DWithZOffset!))\n return false;\n\n return true;\n }\n}\n\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Rendering
|
|
3
3
|
*/
|
|
4
|
+
import { ColorDef } from "../ColorDef";
|
|
5
|
+
import { LinePixels } from "../LinePixels";
|
|
4
6
|
import { OctEncodedNormalPair } from "../OctEncodedNormal";
|
|
5
7
|
import { PolylineIndices } from "../RenderPolyline";
|
|
6
8
|
/** @internal */
|
|
@@ -19,10 +21,22 @@ export declare class MeshEdge {
|
|
|
19
21
|
compareTo(other: MeshEdge): number;
|
|
20
22
|
}
|
|
21
23
|
/** @internal */
|
|
24
|
+
export interface EdgeAppearanceOverrides {
|
|
25
|
+
color?: ColorDef;
|
|
26
|
+
linePixels?: LinePixels;
|
|
27
|
+
width?: number;
|
|
28
|
+
}
|
|
29
|
+
/** @internal */
|
|
30
|
+
export interface MeshPolylineGroup {
|
|
31
|
+
polylines: MeshPolyline[];
|
|
32
|
+
appearance?: EdgeAppearanceOverrides;
|
|
33
|
+
}
|
|
34
|
+
/** @internal */
|
|
22
35
|
export declare class MeshEdges {
|
|
23
36
|
visible: MeshEdge[];
|
|
24
37
|
silhouette: MeshEdge[];
|
|
25
|
-
|
|
38
|
+
appearance?: EdgeAppearanceOverrides;
|
|
39
|
+
polylineGroups: MeshPolylineGroup[];
|
|
26
40
|
silhouetteNormals: OctEncodedNormalPair[];
|
|
27
41
|
constructor();
|
|
28
42
|
}
|
|
@@ -42,10 +56,10 @@ export declare class SilhouetteEdgeArgs extends EdgeArgs {
|
|
|
42
56
|
}
|
|
43
57
|
/** @internal */
|
|
44
58
|
export declare class PolylineEdgeArgs {
|
|
45
|
-
|
|
46
|
-
constructor(
|
|
47
|
-
init(
|
|
48
|
-
get
|
|
59
|
+
groups?: MeshPolylineGroup[];
|
|
60
|
+
constructor(groups?: MeshPolylineGroup[]);
|
|
61
|
+
init(groups?: MeshPolylineGroup[]): boolean;
|
|
62
|
+
get numGroups(): number;
|
|
49
63
|
get isValid(): boolean;
|
|
50
64
|
clear(): void;
|
|
51
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMesh.d.ts","sourceRoot":"","sources":["../../../src/internal/RenderMesh.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,gBAAgB;AAChB,qBAAa,YAAY;IACvB,SAAgB,OAAO,EAAE,eAAe,CAAC;gBAEtB,OAAO,GAAE,eAAoB;IAIzC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAMtB,KAAK;CACb;AAED,gBAAgB;AAChB,MAAM,MAAM,gBAAgB,GAAG,YAAY,EAAE,CAAC;AAE9C,gBAAgB;AAChB,qBAAa,QAAQ;IACZ,OAAO,WAAU;gBAEL,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAY5C,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM;CAO1C;AAED,gBAAgB;AAChB,qBAAa,SAAS;IACb,OAAO,EAAE,QAAQ,EAAE,CAAM;IACzB,UAAU,EAAE,QAAQ,EAAE,CAAM;IAC5B,
|
|
1
|
+
{"version":3,"file":"RenderMesh.d.ts","sourceRoot":"","sources":["../../../src/internal/RenderMesh.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,O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AAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAExB,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS;IAU1B,KAAK;CAItB;AAED,gBAAgB;AAChB,qBAAa,gBAAgB;IACpB,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAC;gBAEjB,MAAM,CAAC,EAAE,iBAAiB,EAAE;IAIxC,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,GAAG,OAAO;IAKlD,IAAW,SAAS,WAAuC;IAC3D,IAAW,OAAO,YAAiC;IAC5C,KAAK;CACb"}
|
|
@@ -44,7 +44,8 @@ export class MeshEdge {
|
|
|
44
44
|
export class MeshEdges {
|
|
45
45
|
visible = [];
|
|
46
46
|
silhouette = [];
|
|
47
|
-
|
|
47
|
+
appearance;
|
|
48
|
+
polylineGroups = [];
|
|
48
49
|
silhouetteNormals = [];
|
|
49
50
|
constructor() { }
|
|
50
51
|
}
|
|
@@ -79,14 +80,16 @@ export class SilhouetteEdgeArgs extends EdgeArgs {
|
|
|
79
80
|
}
|
|
80
81
|
/** @internal */
|
|
81
82
|
export class PolylineEdgeArgs {
|
|
82
|
-
|
|
83
|
-
constructor(
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
groups;
|
|
84
|
+
constructor(groups) {
|
|
85
|
+
this.init(groups);
|
|
86
|
+
}
|
|
87
|
+
init(groups) {
|
|
88
|
+
this.groups = groups?.filter((group) => group.polylines.length > 0);
|
|
86
89
|
return this.isValid;
|
|
87
90
|
}
|
|
88
|
-
get
|
|
89
|
-
get isValid() { return this.
|
|
90
|
-
clear() { this.
|
|
91
|
+
get numGroups() { return this.groups?.length ?? 0; }
|
|
92
|
+
get isValid() { return this.numGroups > 0; }
|
|
93
|
+
clear() { this.groups = undefined; }
|
|
91
94
|
}
|
|
92
95
|
//# sourceMappingURL=RenderMesh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderMesh.js","sourceRoot":"","sources":["../../../src/internal/RenderM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AS,IAAI,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YAC/D,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC;YAClC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,iBAAiB,CAAC;QAC7C,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEe,KAAK;QACnB,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC;CACF;AAED,gBAAgB;AAChB,MAAM,OAAO,gBAAgB;IACpB,MAAM,CAAuB;IAEpC,YAAmB,MAA4B;QAC7C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IAEM,IAAI,CAAC,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3D,IAAW,OAAO,KAAK,OAAO,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5C,KAAK,KAAK,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CAC5C","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { ColorDef } from \"../ColorDef\";\nimport { LinePixels } from \"../LinePixels\";\nimport { OctEncodedNormalPair } from \"../OctEncodedNormal\";\nimport { PolylineIndices } from \"../RenderPolyline\";\n\n/** @internal */\nexport class MeshPolyline {\n public readonly indices: PolylineIndices;\n\n public constructor(indices: PolylineIndices = []) {\n this.indices = indices.slice();\n }\n\n public addIndex(index: number) {\n const { indices } = this;\n if (indices.length === 0 || indices[indices.length - 1] !== index)\n indices.push(index);\n }\n\n public clear() { this.indices.length = 0; }\n}\n\n/** @internal */\nexport type MeshPolylineList = MeshPolyline[];\n\n/** @internal */\nexport class MeshEdge {\n public indices = [0, 0];\n\n public constructor(index0?: number, index1?: number) {\n if (undefined === index0 || undefined === index1)\n return;\n if (index0 < index1) {\n this.indices[0] = index0;\n this.indices[1] = index1;\n } else {\n this.indices[0] = index1;\n this.indices[1] = index0;\n }\n }\n\n public compareTo(other: MeshEdge): number {\n let diff = this.indices[0] - other.indices[0];\n if (0 === diff)\n diff = this.indices[1] - other.indices[1];\n\n return diff;\n }\n}\n\n/** @internal */\nexport interface EdgeAppearanceOverrides {\n color?: ColorDef;\n linePixels?: LinePixels;\n width?: number;\n}\n\n/** @internal */\nexport interface MeshPolylineGroup {\n polylines: MeshPolyline[];\n appearance?: EdgeAppearanceOverrides;\n}\n\n/** @internal */\nexport class MeshEdges {\n public visible: MeshEdge[] = [];\n public silhouette: MeshEdge[] = [];\n public appearance?: EdgeAppearanceOverrides;\n public polylineGroups: MeshPolylineGroup[] = [];\n public silhouetteNormals: OctEncodedNormalPair[] = [];\n public constructor() { }\n}\n\n/** @internal */\nexport class EdgeArgs {\n public edges?: MeshEdge[];\n\n public init(meshEdges?: MeshEdges): boolean {\n this.clear();\n if (undefined !== meshEdges && 0 < meshEdges.visible.length)\n this.edges = meshEdges.visible;\n\n return this.isValid;\n }\n\n public clear(): void { this.edges = undefined; }\n public get isValid(): boolean { return 0 < this.numEdges; }\n public get numEdges() { return undefined !== this.edges ? this.edges.length : 0; }\n}\n\n/** @internal */\nexport class SilhouetteEdgeArgs extends EdgeArgs {\n public normals?: OctEncodedNormalPair[];\n\n public override init(meshEdges?: MeshEdges) {\n this.clear();\n if (undefined !== meshEdges && 0 < meshEdges.silhouette.length) {\n this.edges = meshEdges.silhouette;\n this.normals = meshEdges.silhouetteNormals;\n }\n\n return this.isValid;\n }\n\n public override clear() {\n this.normals = undefined;\n super.clear();\n }\n}\n\n/** @internal */\nexport class PolylineEdgeArgs {\n public groups?: MeshPolylineGroup[];\n\n public constructor(groups?: MeshPolylineGroup[]) {\n this.init(groups);\n }\n\n public init(groups?: MeshPolylineGroup[]): boolean {\n this.groups = groups?.filter((group) => group.polylines.length > 0);\n return this.isValid;\n }\n\n public get numGroups() { return this.groups?.length ?? 0; }\n public get isValid() { return this.numGroups > 0; }\n public clear() { this.groups = undefined; }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { DecorationGeometryProps, SnapRequestProps, SnapResponseProps } from "./Snapping";
|
|
2
|
-
export { EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs } from "./RenderMesh";
|
|
2
|
+
export { type EdgeAppearanceOverrides, EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs } from "./RenderMesh";
|
|
3
3
|
export { MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTable } from "./PackedFeatureTable";
|
|
4
4
|
export type { BackendReadable, BackendWritable, BackendBuffer } from "./BackendTypes";
|
|
5
5
|
export { RenderMaterialParams } from "./RenderMaterialParams";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-package.d.ts","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EACL,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"cross-package.d.ts","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/F,OAAO,EACL,KAAK,uBAAuB,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EACvI,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAAE,uBAAuB,EAAE,kBAAkB,EAC1E,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAG/F,OAAO,
|
|
1
|
+
{"version":3,"file":"cross-package.js","sourceRoot":"","sources":["../../../src/internal/cross-package.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAG/F,OAAO,EACyB,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAyB,gBAAgB,EAAE,kBAAkB,EACvI,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,4BAA4B,EAAE,uBAAuB,EAAE,kBAAkB,EAC1E,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nexport type { DecorationGeometryProps, SnapRequestProps, SnapResponseProps } from \"./Snapping\";\nexport {\n type EdgeAppearanceOverrides, EdgeArgs, MeshEdge, MeshEdges, MeshPolyline, type MeshPolylineList, PolylineEdgeArgs, SilhouetteEdgeArgs\n} from \"./RenderMesh\";\nexport {\n MultiModelPackedFeatureTable, PackedFeatureModelTable, PackedFeatureTable\n} from \"./PackedFeatureTable\";\nexport type { BackendReadable, BackendWritable, BackendBuffer } from \"./BackendTypes\";\nexport { RenderMaterialParams } from \"./RenderMaterialParams\";\nexport { RenderTextureParams } from \"./RenderTextureParams\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-common",
|
|
3
|
-
"version": "5.1.0-dev.
|
|
3
|
+
"version": "5.1.0-dev.69",
|
|
4
4
|
"description": "iTwin.js components common to frontend and backend",
|
|
5
5
|
"main": "lib/cjs/core-common.js",
|
|
6
6
|
"module": "lib/esm/core-common.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"js-base64": "^3.6.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@itwin/core-bentley": "5.1.0-dev.
|
|
31
|
-
"@itwin/core-geometry": "5.1.0-dev.
|
|
30
|
+
"@itwin/core-bentley": "5.1.0-dev.69",
|
|
31
|
+
"@itwin/core-geometry": "5.1.0-dev.69"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@itwin/eslint-plugin": "5.2.2-dev.2",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"rimraf": "^6.0.1",
|
|
43
43
|
"typescript": "~5.6.2",
|
|
44
44
|
"vitest": "^3.0.6",
|
|
45
|
-
"@itwin/build-tools": "5.1.0-dev.
|
|
46
|
-
"@itwin/core-
|
|
47
|
-
"@itwin/core-
|
|
45
|
+
"@itwin/build-tools": "5.1.0-dev.69",
|
|
46
|
+
"@itwin/core-geometry": "5.1.0-dev.69",
|
|
47
|
+
"@itwin/core-bentley": "5.1.0-dev.69"
|
|
48
48
|
},
|
|
49
49
|
"nyc": {
|
|
50
50
|
"extends": "./node_modules/@itwin/build-tools/.nycrc",
|