@itwin/ecschema-rpcinterface-tests 4.0.0-dev.55 → 4.0.0-dev.58
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/dist/_d48c.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +632 -489
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/object-storage.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_itwin_object-storage-azure_1_5_0_node_modules_itwin_obj-e3e81d.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_3_1_node_modules_loaders_gl_draco_di-d3af41.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_reflect-metadata_0_1_13_node_modules_reflect-metadata_R-610cb3.bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -50167,6 +50167,13 @@ class TextureMapping {
|
|
|
50167
50167
|
this.weight = props?.textureWeight ?? 1;
|
|
50168
50168
|
this.mode = props?.mapMode ?? Mode.Parametric;
|
|
50169
50169
|
this.worldMapping = props?.worldMapping ?? false;
|
|
50170
|
+
this.useConstantLod = props?.useConstantLod ?? false;
|
|
50171
|
+
this.constantLodParams = {
|
|
50172
|
+
repetitions: props?.constantLodParams?.repetitions ?? 1,
|
|
50173
|
+
offset: props?.constantLodParams?.offset ?? { x: 0, y: 0 },
|
|
50174
|
+
minDistClamp: props?.constantLodParams?.minDistClamp ?? 1,
|
|
50175
|
+
maxDistClamp: props?.constantLodParams?.maxDistClamp ?? 4096 * 1024 * 1024,
|
|
50176
|
+
};
|
|
50170
50177
|
}
|
|
50171
50178
|
/**
|
|
50172
50179
|
* Generates UV parameters for textured surfaces. Returns undefined on failure.
|
|
@@ -114082,7 +114089,6 @@ class BranchUniforms {
|
|
|
114082
114089
|
this._mvp32 = new _Matrix__WEBPACK_IMPORTED_MODULE_4__.Matrix4();
|
|
114083
114090
|
this._m32 = new _Matrix__WEBPACK_IMPORTED_MODULE_4__.Matrix4();
|
|
114084
114091
|
this._v32 = new _Matrix__WEBPACK_IMPORTED_MODULE_4__.Matrix3();
|
|
114085
|
-
this._mvn32 = new _Matrix__WEBPACK_IMPORTED_MODULE_4__.Matrix3();
|
|
114086
114092
|
// Working state
|
|
114087
114093
|
this._scratchTransform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
114088
114094
|
this._scratchTransform2 = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
@@ -114165,10 +114171,6 @@ class BranchUniforms {
|
|
|
114165
114171
|
if (this.update(uniform, geom, isViewCoords))
|
|
114166
114172
|
uniform.setMatrix3(this._v32);
|
|
114167
114173
|
}
|
|
114168
|
-
bindModelViewNTransform(uniform, geom, isViewCoords) {
|
|
114169
|
-
if (this.update(uniform, geom, isViewCoords))
|
|
114170
|
-
uniform.setMatrix3(this._mvn32);
|
|
114171
|
-
}
|
|
114172
114174
|
update(uniform, geometry, isViewCoords) {
|
|
114173
114175
|
const uniforms = this._target.uniforms[isViewCoords ? "viewRect" : "frustum"];
|
|
114174
114176
|
if (!(0,_Sync__WEBPACK_IMPORTED_MODULE_6__.sync)(uniforms, this))
|
|
@@ -114200,7 +114202,6 @@ class BranchUniforms {
|
|
|
114200
114202
|
}
|
|
114201
114203
|
else {
|
|
114202
114204
|
const viewMatrix = this._target.uniforms.frustum.viewMatrix;
|
|
114203
|
-
mv = viewMatrix.clone(this._scratchTransform);
|
|
114204
114205
|
if (undefined !== instancedGeom) {
|
|
114205
114206
|
// For instanced geometry, the "model view" matrix is really a transform from center of instanced geometry range to view.
|
|
114206
114207
|
// Shader will compute final model-view matrix based on this and the per-instance transform.
|
|
@@ -114208,10 +114209,10 @@ class BranchUniforms {
|
|
|
114208
114209
|
const viewToWorldRot = viewMatrix.matrix.inverse(this._scratchViewToWorld);
|
|
114209
114210
|
const rotateAboutOrigin = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createFixedPointAndMatrix(vio, viewToWorldRot, this._scratchTransform2);
|
|
114210
114211
|
const viModelMatrix = rotateAboutOrigin.multiplyTransformTransform(instancedGeom.getRtcModelTransform(modelMatrix), this._scratchVIModelMatrix);
|
|
114211
|
-
mv.multiplyTransformTransform(viModelMatrix,
|
|
114212
|
+
mv = viewMatrix.multiplyTransformTransform(viModelMatrix, this._scratchTransform);
|
|
114212
114213
|
}
|
|
114213
114214
|
else {
|
|
114214
|
-
mv.multiplyTransformTransform(instancedGeom.getRtcModelTransform(modelMatrix),
|
|
114215
|
+
mv = viewMatrix.multiplyTransformTransform(instancedGeom.getRtcModelTransform(modelMatrix), this._scratchTransform);
|
|
114215
114216
|
}
|
|
114216
114217
|
}
|
|
114217
114218
|
else {
|
|
@@ -114219,10 +114220,10 @@ class BranchUniforms {
|
|
|
114219
114220
|
const viewToWorldRot = viewMatrix.matrix.inverse(this._scratchViewToWorld);
|
|
114220
114221
|
const rotateAboutOrigin = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createFixedPointAndMatrix(vio, viewToWorldRot, this._scratchTransform2);
|
|
114221
114222
|
const viModelMatrix = rotateAboutOrigin.multiplyTransformTransform(modelMatrix, this._scratchVIModelMatrix);
|
|
114222
|
-
mv.multiplyTransformTransform(viModelMatrix,
|
|
114223
|
+
mv = viewMatrix.multiplyTransformTransform(viModelMatrix, this._scratchTransform);
|
|
114223
114224
|
}
|
|
114224
114225
|
else {
|
|
114225
|
-
mv =
|
|
114226
|
+
mv = viewMatrix.multiplyTransformTransform(modelMatrix, this._scratchTransform);
|
|
114226
114227
|
}
|
|
114227
114228
|
}
|
|
114228
114229
|
}
|
|
@@ -114230,6 +114231,9 @@ class BranchUniforms {
|
|
|
114230
114231
|
this._m32.initFromTransform(modelMatrix);
|
|
114231
114232
|
this._v32.initFromMatrix3d(this._target.uniforms.frustum.viewMatrix.matrix);
|
|
114232
114233
|
}
|
|
114234
|
+
else if (undefined !== geometry.asSurface?.mesh.constantLodVParams) {
|
|
114235
|
+
this._m32.initFromTransform(modelMatrix);
|
|
114236
|
+
}
|
|
114233
114237
|
_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createTransform(mv, this._mv);
|
|
114234
114238
|
this._mv32.initFromTransform(mv);
|
|
114235
114239
|
// Don't bother computing mvp for instanced geometry - it's not used.
|
|
@@ -120131,19 +120135,35 @@ class MeshData {
|
|
|
120131
120135
|
this.hasFeatures = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.FeatureIndexType.Empty !== params.vertices.featureIndexType;
|
|
120132
120136
|
if (_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.FeatureIndexType.Uniform === params.vertices.featureIndexType)
|
|
120133
120137
|
this.uniformFeatureId = params.vertices.uniformFeatureID;
|
|
120138
|
+
this.textureUsesConstantLod = false;
|
|
120139
|
+
this.normalMapUsesConstantLod = false;
|
|
120134
120140
|
if (undefined !== params.surface.textureMapping) {
|
|
120135
120141
|
this.texture = params.surface.textureMapping.texture;
|
|
120136
120142
|
this._textureAlwaysDisplayed = params.surface.textureMapping.alwaysDisplayed;
|
|
120137
120143
|
if (undefined !== params.surface.material && !params.surface.material.isAtlas) {
|
|
120138
120144
|
const matTM = params.surface.material.material.textureMapping;
|
|
120139
|
-
if (undefined !== matTM
|
|
120140
|
-
|
|
120141
|
-
|
|
120145
|
+
if (undefined !== matTM) {
|
|
120146
|
+
this.textureUsesConstantLod = this.texture && matTM.params.useConstantLod;
|
|
120147
|
+
if (undefined !== matTM.normalMapParams) {
|
|
120148
|
+
this.normalMapUsesConstantLod = matTM.normalMapParams.useConstantLod;
|
|
120149
|
+
if (undefined !== matTM.normalMapParams.normalMap) {
|
|
120150
|
+
this.normalMap = matTM.normalMapParams.normalMap;
|
|
120151
|
+
}
|
|
120152
|
+
else {
|
|
120153
|
+
// If there are normal map params but the normal map is not present, use the texture as a normal map instead of a pattern map.
|
|
120154
|
+
this.normalMap = this.texture;
|
|
120155
|
+
this.texture = undefined;
|
|
120156
|
+
}
|
|
120142
120157
|
}
|
|
120143
|
-
|
|
120144
|
-
|
|
120145
|
-
this.
|
|
120146
|
-
this.
|
|
120158
|
+
if (this.normalMapUsesConstantLod || this.textureUsesConstantLod) {
|
|
120159
|
+
this.constantLodVParams = new Float32Array(3);
|
|
120160
|
+
this.constantLodVParams[0] = matTM.params.constantLodParams.offset.x; // x offset
|
|
120161
|
+
this.constantLodVParams[1] = matTM.params.constantLodParams.offset.y; // y offset
|
|
120162
|
+
this.constantLodVParams[3] = 0.0; // placeholder for orto view distance
|
|
120163
|
+
this.constantLodFParams = new Float32Array(3);
|
|
120164
|
+
this.constantLodFParams[0] = matTM.params.constantLodParams.minDistClamp; // Minimum texture size
|
|
120165
|
+
this.constantLodFParams[1] = matTM.params.constantLodParams.maxDistClamp; // Maximum texture size
|
|
120166
|
+
this.constantLodFParams[2] = matTM.params.constantLodParams.repetitions; // # repetitions of pattern (to scale it)
|
|
120147
120167
|
}
|
|
120148
120168
|
}
|
|
120149
120169
|
}
|
|
@@ -127952,6 +127972,8 @@ class SurfaceGeometry extends _MeshGeometry__WEBPACK_IMPORTED_MODULE_7__.MeshGeo
|
|
|
127952
127972
|
}
|
|
127953
127973
|
flags[0 /* SurfaceBitIndex.HasTexture */] = this.useTexture(params) ? 1 : 0;
|
|
127954
127974
|
flags[8 /* SurfaceBitIndex.HasNormalMap */] = this.useNormalMap(params) ? 1 : 0;
|
|
127975
|
+
flags[10 /* SurfaceBitIndex.UseConstantLodTextureMapping */] = this.mesh.textureUsesConstantLod ? 1 : 0;
|
|
127976
|
+
flags[11 /* SurfaceBitIndex.UseConstantLodNormalMapMapping */] = this.mesh.normalMapUsesConstantLod ? 1 : 0;
|
|
127955
127977
|
// The transparency threshold controls how transparent a surface must be to allow light to pass through; more opaque surfaces cast shadows.
|
|
127956
127978
|
flags[4 /* SurfaceBitIndex.TransparencyThreshold */] = params.target.isDrawingShadowMap ? 1 : 0;
|
|
127957
127979
|
flags[5 /* SurfaceBitIndex.BackgroundFill */] = 0;
|
|
@@ -134519,7 +134541,6 @@ function createVolClassCopyZProgram(context) {
|
|
|
134519
134541
|
_Texture__WEBPACK_IMPORTED_MODULE_4__.Texture2DHandle.bindSampler(uniform, geom.texture, _RenderFlags__WEBPACK_IMPORTED_MODULE_3__.TextureUnit.Zero);
|
|
134520
134542
|
});
|
|
134521
134543
|
});
|
|
134522
|
-
frag.addExtension("GL_EXT_frag_depth");
|
|
134523
134544
|
frag.set(18 /* FragmentShaderComponent.FinalizeDepth */, depthFromTexture);
|
|
134524
134545
|
builder.vert.headerComment = "//!V! VolClassCopyZ";
|
|
134525
134546
|
builder.frag.headerComment = "//!F! VolClassCopyZ";
|
|
@@ -138788,6 +138809,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
138788
138809
|
/* harmony import */ var _Vertex__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Vertex */ "../../core/frontend/lib/esm/render/webgl/glsl/Vertex.js");
|
|
138789
138810
|
/* harmony import */ var _SurfaceGeometry__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../SurfaceGeometry */ "../../core/frontend/lib/esm/render/webgl/SurfaceGeometry.js");
|
|
138790
138811
|
/* harmony import */ var _Wiremesh__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Wiremesh */ "../../core/frontend/lib/esm/render/webgl/glsl/Wiremesh.js");
|
|
138812
|
+
/* harmony import */ var _itwin_core_common__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
|
|
138791
138813
|
/*---------------------------------------------------------------------------------------------
|
|
138792
138814
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
138793
138815
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -138818,10 +138840,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
138818
138840
|
|
|
138819
138841
|
|
|
138820
138842
|
|
|
138843
|
+
|
|
138844
|
+
const constantLodTextureLookup = `
|
|
138845
|
+
vec4 constantLodTextureLookup(sampler2D textureSampler) {
|
|
138846
|
+
float logDepth = log2(v_uvCustom.z);
|
|
138847
|
+
float f = fract(logDepth);
|
|
138848
|
+
float p = floor(logDepth);
|
|
138849
|
+
// When p changes, both tc1 and tc2 jumped by a power of 2 at that transition (and f goes from ~1 to 0).
|
|
138850
|
+
// This caused a line to show up with incorrect tex coords, we believe due to a problem with the derivative
|
|
138851
|
+
// that is auto calculated on the tex coords for the mip-map. The below approach attempts to "smooth"
|
|
138852
|
+
// the transition of the coord in use at the transition by only changing the coord that is not in use
|
|
138853
|
+
// (but by 2 powers of 2) and switching the mix selector to account for it. It does this by using whether
|
|
138854
|
+
// p is odd or even to select which way it is going, so it alternates at the boundaries. This fixes the
|
|
138855
|
+
// line problem.
|
|
138856
|
+
float p1, p2;
|
|
138857
|
+
if (0u == (uint(p) & 1u)) { // p is even
|
|
138858
|
+
p1 = p;
|
|
138859
|
+
p2 = p + 1.0;
|
|
138860
|
+
} else { // p is odd
|
|
138861
|
+
p1 = p + 1.0;
|
|
138862
|
+
p2 = p;
|
|
138863
|
+
f = 1.0 - f;
|
|
138864
|
+
}
|
|
138865
|
+
|
|
138866
|
+
vec2 tc1 = v_uvCustom.xy / clamp(pow(2.0, p1), float(u_constantLodFParams.x), float(u_constantLodFParams.y)) * u_constantLodFParams.z;
|
|
138867
|
+
vec2 tc2 = v_uvCustom.xy / clamp(pow(2.0, p2), float(u_constantLodFParams.x), float(u_constantLodFParams.y)) * u_constantLodFParams.z;
|
|
138868
|
+
return mix(TEXTURE(textureSampler, tc1), TEXTURE(textureSampler, tc2), f);
|
|
138869
|
+
}
|
|
138870
|
+
`;
|
|
138821
138871
|
// NB: Textures do not contain pre-multiplied alpha.
|
|
138822
138872
|
const sampleSurfaceTexture = `
|
|
138823
138873
|
vec4 sampleSurfaceTexture() {
|
|
138824
|
-
|
|
138874
|
+
vec4 clr;
|
|
138875
|
+
if (!isSurfaceBitSet(kSurfaceBit_HasTexture))
|
|
138876
|
+
clr = vec4(1.0, 1.0, 1.0, 1.0);
|
|
138877
|
+
else if (u_surfaceFlags[kSurfaceBitIndex_UseConstantLodTextureMapping])
|
|
138878
|
+
clr = constantLodTextureLookup(s_texture);
|
|
138879
|
+
else
|
|
138880
|
+
clr = TEXTURE(s_texture, v_texCoord);
|
|
138881
|
+
return clr;
|
|
138825
138882
|
}
|
|
138826
138883
|
`;
|
|
138827
138884
|
const applyMaterialColor = `
|
|
@@ -138971,6 +139028,10 @@ const adjustEyeSpace = `
|
|
|
138971
139028
|
if (kRenderOrder_BlankingRegion == u_renderOrder)
|
|
138972
139029
|
v_eyeSpace.z -= blankingRegionOffset * (u_frustum.y - u_frustum.x);
|
|
138973
139030
|
`;
|
|
139031
|
+
const computeConstantLodUvCustom = `
|
|
139032
|
+
vec2 worldpos = (u_modelToWorld * vec4(rawPos.xyz, 0.0)).xy;
|
|
139033
|
+
v_uvCustom = vec3((u_constantLodVParams.xy + worldpos) * vec2(1.0, -1.0), kFrustumType_Perspective == u_frustum.z ? -v_eyeSpace.z : u_constantLodVParams.z);
|
|
139034
|
+
`;
|
|
138974
139035
|
const computePositionPostlude = `
|
|
138975
139036
|
return u_proj * pos;
|
|
138976
139037
|
`;
|
|
@@ -138985,17 +139046,17 @@ function createCommon(isInstanced, animated, shadowable, isHiliter, positionType
|
|
|
138985
139046
|
(0,_SolarShadowMapping__WEBPACK_IMPORTED_MODULE_17__.addSolarShadowMap)(builder);
|
|
138986
139047
|
(0,_Vertex__WEBPACK_IMPORTED_MODULE_20__.addProjectionMatrix)(vert);
|
|
138987
139048
|
(0,_Vertex__WEBPACK_IMPORTED_MODULE_20__.addModelViewMatrix)(vert);
|
|
138988
|
-
let computePosition;
|
|
138989
|
-
if (isHiliter
|
|
138990
|
-
computePosition = computePositionPrelude + computePositionPostlude;
|
|
138991
|
-
}
|
|
138992
|
-
else {
|
|
139049
|
+
let computePosition = computePositionPrelude;
|
|
139050
|
+
if (!isHiliter || _System__WEBPACK_IMPORTED_MODULE_5__.System.instance.supportsLogZBuffer) {
|
|
138993
139051
|
(0,_Common__WEBPACK_IMPORTED_MODULE_9__.addFrustum)(builder);
|
|
138994
139052
|
(0,_FeatureSymbology__WEBPACK_IMPORTED_MODULE_11__.addRenderOrder)(builder.vert);
|
|
138995
139053
|
(0,_FeatureSymbology__WEBPACK_IMPORTED_MODULE_11__.addRenderOrderConstants)(builder.vert);
|
|
138996
139054
|
builder.addVarying("v_eyeSpace", 4 /* VariableType.Vec3 */);
|
|
138997
|
-
computePosition
|
|
139055
|
+
computePosition += adjustEyeSpace;
|
|
138998
139056
|
}
|
|
139057
|
+
if (!isHiliter)
|
|
139058
|
+
computePosition += computeConstantLodUvCustom;
|
|
139059
|
+
computePosition += computePositionPostlude;
|
|
138999
139060
|
vert.set(10 /* VertexShaderComponent.ComputePosition */, computePosition);
|
|
139000
139061
|
return builder;
|
|
139001
139062
|
}
|
|
@@ -139029,6 +139090,8 @@ function addSurfaceFlagsLookup(builder) {
|
|
|
139029
139090
|
builder.addConstant("kSurfaceBitIndex_OverrideRgb", 1 /* VariableType.Int */, 7 /* SurfaceBitIndex.OverrideRgb */.toString());
|
|
139030
139091
|
builder.addConstant("kSurfaceBitIndex_HasNormalMap", 1 /* VariableType.Int */, 8 /* SurfaceBitIndex.HasNormalMap */.toString());
|
|
139031
139092
|
builder.addConstant("kSurfaceBitIndex_HasMaterialAtlas", 1 /* VariableType.Int */, 9 /* SurfaceBitIndex.HasMaterialAtlas */.toString());
|
|
139093
|
+
builder.addConstant("kSurfaceBitIndex_UseConstantLodTextureMapping", 1 /* VariableType.Int */, 10 /* SurfaceBitIndex.UseConstantLodTextureMapping */.toString());
|
|
139094
|
+
builder.addConstant("kSurfaceBitIndex_UseConstantLodNormalMapMapping", 1 /* VariableType.Int */, 11 /* SurfaceBitIndex.UseConstantLodNormalMapMapping */.toString());
|
|
139032
139095
|
// Surface flags which get modified in vertex shader are still passed to fragment shader as a single float & are thus
|
|
139033
139096
|
// used differently there & so require different constants. Unused constants are commented out.
|
|
139034
139097
|
builder.addBitFlagConstant("kSurfaceBit_HasTexture", 0 /* SurfaceBitIndex.HasTexture */);
|
|
@@ -139113,7 +139176,11 @@ const finalizeNormalNormalMap = `
|
|
|
139113
139176
|
vec3 biTangent = cross (normal, tangent);
|
|
139114
139177
|
if (flip)
|
|
139115
139178
|
biTangent = -biTangent;
|
|
139116
|
-
vec3 normM
|
|
139179
|
+
vec3 normM;
|
|
139180
|
+
if (u_surfaceFlags[kSurfaceBitIndex_UseConstantLodNormalMapMapping])
|
|
139181
|
+
normM = constantLodTextureLookup(s_normalMap).xyz;
|
|
139182
|
+
else
|
|
139183
|
+
normM = TEXTURE(s_normalMap, v_texCoord).xyz;
|
|
139117
139184
|
if (length (normM) > 0.0001) { // check for empty normal texture
|
|
139118
139185
|
normM = (normM - 0.5) * 2.0;
|
|
139119
139186
|
normM = normalize (normM);
|
|
@@ -139177,7 +139244,7 @@ const computeBaseColor = `
|
|
|
139177
139244
|
surfaceColor.rgb = (u_reverseWhiteOnWhite && isAlmostWhite.r && isAlmostWhite.g && isAlmostWhite.b ? vec3(0.0, 0.0, 0.0) : surfaceColor.rgb);
|
|
139178
139245
|
return vec4(surfaceColor.rgb * g_surfaceTexel.rgb, g_surfaceTexel.a);
|
|
139179
139246
|
`;
|
|
139180
|
-
const surfaceFlagArray = new Int32Array(
|
|
139247
|
+
const surfaceFlagArray = new Int32Array(12 /* SurfaceBitIndex.Count */);
|
|
139181
139248
|
/** @internal */
|
|
139182
139249
|
function addSurfaceFlags(builder, withFeatureOverrides, withFeatureColor) {
|
|
139183
139250
|
addSurfaceFlagsLookup(builder.vert);
|
|
@@ -139188,7 +139255,7 @@ function addSurfaceFlags(builder, withFeatureOverrides, withFeatureColor) {
|
|
|
139188
139255
|
compute += returnSurfaceFlags;
|
|
139189
139256
|
builder.addFunctionComputedVarying("v_surfaceFlags", 2 /* VariableType.Float */, "computeSurfaceFlags", compute);
|
|
139190
139257
|
builder.frag.addInitializer("surfaceFlags = uint(floor(v_surfaceFlags + 0.5));");
|
|
139191
|
-
builder.addUniformArray("u_surfaceFlags", 0 /* VariableType.Boolean */,
|
|
139258
|
+
builder.addUniformArray("u_surfaceFlags", 0 /* VariableType.Boolean */, 12 /* SurfaceBitIndex.Count */, (prog) => {
|
|
139192
139259
|
prog.addGraphicUniform("u_surfaceFlags", (uniform, params) => {
|
|
139193
139260
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== params.geometry.asSurface);
|
|
139194
139261
|
const mesh = params.geometry.asSurface;
|
|
@@ -139206,17 +139273,19 @@ function addNormal(builder, animated) {
|
|
|
139206
139273
|
builder.frag.addGlobal("g_normal", 4 /* VariableType.Vec3 */);
|
|
139207
139274
|
let finalizeNormal = finalizeNormalPrelude;
|
|
139208
139275
|
finalizeNormal += finalizeNormalNormalMap;
|
|
139276
|
+
builder.frag.addFunction(constantLodTextureLookup);
|
|
139209
139277
|
builder.frag.addUniform("u_normalMapScale", 2 /* VariableType.Float */, (prog) => {
|
|
139210
139278
|
prog.addGraphicUniform("u_normalMapScale", (uniform, params) => {
|
|
139211
|
-
|
|
139212
|
-
|
|
139213
|
-
undefined !==
|
|
139214
|
-
|
|
139215
|
-
|
|
139216
|
-
|
|
139217
|
-
|
|
139218
|
-
|
|
139219
|
-
|
|
139279
|
+
if (undefined !== params.geometry.materialInfo && !params.geometry.materialInfo.isAtlas) {
|
|
139280
|
+
const normalMapParams = params.geometry.materialInfo.textureMapping?.normalMapParams;
|
|
139281
|
+
if (undefined !== normalMapParams) {
|
|
139282
|
+
let normalMapScale = 1.0;
|
|
139283
|
+
normalMapScale = normalMapParams.scale ?? 1.0;
|
|
139284
|
+
if (normalMapParams.greenUp)
|
|
139285
|
+
normalMapScale = -normalMapScale;
|
|
139286
|
+
uniform.setUniform1f(normalMapScale);
|
|
139287
|
+
}
|
|
139288
|
+
}
|
|
139220
139289
|
});
|
|
139221
139290
|
});
|
|
139222
139291
|
finalizeNormal += finalizeNormalPostlude;
|
|
@@ -139252,7 +139321,6 @@ function addTexture(builder, animated, isThematic, isPointCloud, isHilite) {
|
|
|
139252
139321
|
}
|
|
139253
139322
|
});
|
|
139254
139323
|
});
|
|
139255
|
-
builder.frag.addFunction(sampleSurfaceTexture);
|
|
139256
139324
|
}
|
|
139257
139325
|
builder.frag.addUniform("s_texture", 8 /* VariableType.Sampler2D */, (prog) => {
|
|
139258
139326
|
prog.addGraphicUniform("s_texture", (uniform, params) => {
|
|
@@ -139331,8 +139399,17 @@ function createSurfaceBuilder(flags) {
|
|
|
139331
139399
|
opts &= ~16 /* FeatureSymbologyOptions.Alpha */;
|
|
139332
139400
|
(0,_PlanarClassification__WEBPACK_IMPORTED_MODULE_15__.addColorPlanarClassifier)(builder, flags.isTranslucent, flags.isThematic);
|
|
139333
139401
|
}
|
|
139334
|
-
if (flags.isThematic)
|
|
139402
|
+
if (flags.isThematic) {
|
|
139335
139403
|
(0,_Thematic__WEBPACK_IMPORTED_MODULE_18__.addThematicDisplay)(builder);
|
|
139404
|
+
}
|
|
139405
|
+
else {
|
|
139406
|
+
builder.vert.addUniform("u_modelToWorld", 7 /* VariableType.Mat4 */, (prog) => {
|
|
139407
|
+
prog.addGraphicUniform("u_modelToWorld", (uniform, params) => {
|
|
139408
|
+
if (undefined !== params.geometry.asSurface?.mesh.constantLodVParams)
|
|
139409
|
+
params.target.uniforms.branch.bindModelToWorldTransform(uniform, params.geometry, false);
|
|
139410
|
+
});
|
|
139411
|
+
});
|
|
139412
|
+
}
|
|
139336
139413
|
(0,_FeatureSymbology__WEBPACK_IMPORTED_MODULE_11__.addFeatureSymbology)(builder, feat, opts);
|
|
139337
139414
|
addSurfaceFlags(builder, 2 /* FeatureMode.Overrides */ === feat, true);
|
|
139338
139415
|
(0,_FeatureSymbology__WEBPACK_IMPORTED_MODULE_11__.addSurfaceDiscard)(builder, flags);
|
|
@@ -139376,6 +139453,25 @@ function createSurfaceBuilder(flags) {
|
|
|
139376
139453
|
(0,_Fragment__WEBPACK_IMPORTED_MODULE_12__.addAltPickBufferOutputs)(builder.frag);
|
|
139377
139454
|
}
|
|
139378
139455
|
}
|
|
139456
|
+
builder.addVarying("v_uvCustom", 4 /* VariableType.Vec3 */);
|
|
139457
|
+
builder.vert.addUniform("u_constantLodVParams", 4 /* VariableType.Vec3 */, (prog) => {
|
|
139458
|
+
prog.addGraphicUniform("u_constantLodVParams", (uniform, params) => {
|
|
139459
|
+
const vParams = params.geometry.asSurface?.mesh.constantLodVParams;
|
|
139460
|
+
if (undefined !== vParams) {
|
|
139461
|
+
vParams[2] = params.target.planFrustum.points[_itwin_core_common__WEBPACK_IMPORTED_MODULE_23__.Npc.LeftTopRear].distance(params.target.planFrustum.points[_itwin_core_common__WEBPACK_IMPORTED_MODULE_23__.Npc.RightTopRear]);
|
|
139462
|
+
uniform.setUniform3fv(vParams);
|
|
139463
|
+
}
|
|
139464
|
+
});
|
|
139465
|
+
});
|
|
139466
|
+
builder.frag.addUniform("u_constantLodFParams", 4 /* VariableType.Vec3 */, (prog) => {
|
|
139467
|
+
prog.addGraphicUniform("u_constantLodFParams", (uniform, params) => {
|
|
139468
|
+
const fParams = params.geometry.asSurface?.mesh.constantLodFParams;
|
|
139469
|
+
if (undefined !== fParams)
|
|
139470
|
+
uniform.setUniform3fv(fParams);
|
|
139471
|
+
});
|
|
139472
|
+
});
|
|
139473
|
+
builder.frag.addFunction(constantLodTextureLookup);
|
|
139474
|
+
builder.frag.addFunction(sampleSurfaceTexture);
|
|
139379
139475
|
builder.frag.addGlobal("g_surfaceTexel", 5 /* VariableType.Vec4 */);
|
|
139380
139476
|
builder.frag.set(1 /* FragmentShaderComponent.ComputeBaseColor */, (flags.isThematic === 0 /* IsThematic.No */) ? computeBaseColor : "return getSurfaceColor();");
|
|
139381
139477
|
if (flags.isClassified)
|
|
@@ -139881,33 +139977,31 @@ const computeLineCode = "\nfloat computeLineCode() { return g_lineCode; }\n";
|
|
|
139881
139977
|
function addSamplePosition(vert) {
|
|
139882
139978
|
vert.addFunction(getSamplePosition(vert.positionType));
|
|
139883
139979
|
}
|
|
139980
|
+
const getSamplePositionPrelude = `
|
|
139981
|
+
vec4 samplePosition(float index) {
|
|
139982
|
+
vec2 tc = compute_vert_coords(index);`;
|
|
139983
|
+
const getSamplePositionQuantizedPostlude = `
|
|
139984
|
+
vec4 e0 = floor(TEXTURE(u_vertLUT, tc) * 255.0 + 0.5);
|
|
139985
|
+
tc.x += g_vert_stepX;
|
|
139986
|
+
vec4 e1 = floor(TEXTURE(u_vertLUT, tc) * 255.0 + 0.5);
|
|
139987
|
+
vec3 qpos = vec3(decodeUInt16(e0.xy), decodeUInt16(e0.zw), decodeUInt16(e1.xy));
|
|
139988
|
+
return unquantizePosition(qpos, u_qOrigin, u_qScale);
|
|
139989
|
+
}
|
|
139990
|
+
`;
|
|
139991
|
+
const getSamplePositionUnquantizedPostlude = `
|
|
139992
|
+
uvec3 vux = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
|
|
139993
|
+
tc.x += g_vert_stepX;
|
|
139994
|
+
uvec3 vuy = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
|
|
139995
|
+
tc.x += g_vert_stepX;
|
|
139996
|
+
uvec3 vuz = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
|
|
139997
|
+
tc.x += g_vert_stepX;
|
|
139998
|
+
uvec3 vuw = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
|
|
139999
|
+
uvec3 u = (vuw << 24) | (vuz << 16) | (vuy << 8) | vux;
|
|
140000
|
+
return vec4(uintBitsToFloat(u), 1.0);
|
|
140001
|
+
}
|
|
140002
|
+
`;
|
|
139884
140003
|
function getSamplePosition(type) {
|
|
139885
|
-
|
|
139886
|
-
vec4 samplePosition(float index) {
|
|
139887
|
-
vec2 tc = compute_vert_coords(index);`;
|
|
139888
|
-
if ("quantized" === type) {
|
|
139889
|
-
return `
|
|
139890
|
-
${prelude}
|
|
139891
|
-
vec4 e0 = floor(TEXTURE(u_vertLUT, tc) * 255.0 + 0.5);
|
|
139892
|
-
tc.x += g_vert_stepX;
|
|
139893
|
-
vec4 e1 = floor(TEXTURE(u_vertLUT, tc) * 255.0 + 0.5);
|
|
139894
|
-
vec3 qpos = vec3(decodeUInt16(e0.xy), decodeUInt16(e0.zw), decodeUInt16(e1.xy));
|
|
139895
|
-
return unquantizePosition(qpos, u_qOrigin, u_qScale);
|
|
139896
|
-
}
|
|
139897
|
-
`;
|
|
139898
|
-
}
|
|
139899
|
-
return `
|
|
139900
|
-
${prelude}
|
|
139901
|
-
uvec3 vux = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
|
|
139902
|
-
tc.x += g_vert_stepX;
|
|
139903
|
-
uvec3 vuy = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
|
|
139904
|
-
tc.x += g_vert_stepX;
|
|
139905
|
-
uvec3 vuz = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
|
|
139906
|
-
tc.x += g_vert_stepX;
|
|
139907
|
-
uvec3 vuw = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
|
|
139908
|
-
uvec3 u = (vuw << 24) | (vuz << 16) | (vuy << 8) | vux;
|
|
139909
|
-
return vec4(uintBitsToFloat(u), 1.0);
|
|
139910
|
-
}`;
|
|
140004
|
+
return `${getSamplePositionPrelude}${"quantized" === type ? getSamplePositionQuantizedPostlude : getSamplePositionUnquantizedPostlude}`;
|
|
139911
140005
|
}
|
|
139912
140006
|
/** @internal */
|
|
139913
140007
|
function addModelViewProjectionMatrix(vert) {
|
|
@@ -173845,7 +173939,11 @@ class Geometry {
|
|
|
173845
173939
|
static resolveToUndefined(value, targetValue) {
|
|
173846
173940
|
return value === targetValue ? undefined : value;
|
|
173847
173941
|
}
|
|
173848
|
-
/**
|
|
173942
|
+
/**
|
|
173943
|
+
* Simple interpolation between values, but choosing (based on fraction) a or b as starting
|
|
173944
|
+
* point for maximum accuracy.
|
|
173945
|
+
* * If `f = 0`, then `a` is returned and if `f = 1`, then `b` is returned.
|
|
173946
|
+
*/
|
|
173849
173947
|
static interpolate(a, f, b) {
|
|
173850
173948
|
return f <= 0.5 ? a + f * (b - a) : b - (1.0 - f) * (b - a);
|
|
173851
173949
|
}
|
|
@@ -202672,11 +202770,11 @@ class Angle {
|
|
|
202672
202770
|
}
|
|
202673
202771
|
}
|
|
202674
202772
|
/**
|
|
202675
|
-
|
|
202676
|
-
|
|
202677
|
-
|
|
202678
|
-
|
|
202679
|
-
|
|
202773
|
+
* Create an Angle from a JSON object
|
|
202774
|
+
* @param json object from JSON.parse. If a number, value is in *DEGREES*
|
|
202775
|
+
* @param defaultValRadians if json is undefined, default value in radians.
|
|
202776
|
+
* @return a new Angle
|
|
202777
|
+
*/
|
|
202680
202778
|
static fromJSON(json, defaultValRadians) {
|
|
202681
202779
|
const val = new Angle();
|
|
202682
202780
|
val.setFromJSON(json, defaultValRadians);
|
|
@@ -202731,21 +202829,15 @@ class Angle {
|
|
|
202731
202829
|
// all larger radians reference from 360 degrees (2PI)
|
|
202732
202830
|
return 360.0 + 180 * ((radians - 2.0 * pi) / pi);
|
|
202733
202831
|
}
|
|
202734
|
-
/**
|
|
202735
|
-
* Return the cosine of this Angle object's angle.
|
|
202736
|
-
*/
|
|
202832
|
+
/** Return the cosine of this Angle object's angle */
|
|
202737
202833
|
cos() {
|
|
202738
202834
|
return Math.cos(this._radians);
|
|
202739
202835
|
}
|
|
202740
|
-
/**
|
|
202741
|
-
* Return the sine of this Angle object's angle.
|
|
202742
|
-
*/
|
|
202836
|
+
/** Return the sine of this Angle object's angle */
|
|
202743
202837
|
sin() {
|
|
202744
202838
|
return Math.sin(this._radians);
|
|
202745
202839
|
}
|
|
202746
|
-
/**
|
|
202747
|
-
* Return the tangent of this Angle object's angle.
|
|
202748
|
-
*/
|
|
202840
|
+
/** Return the tangent of this Angle object's angle */
|
|
202749
202841
|
tan() {
|
|
202750
202842
|
return Math.tan(this._radians);
|
|
202751
202843
|
}
|
|
@@ -202757,11 +202849,11 @@ class Angle {
|
|
|
202757
202849
|
static isHalfCircleRadians(radians) {
|
|
202758
202850
|
return Math.abs(Math.abs(radians) - Math.PI) <= _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadians;
|
|
202759
202851
|
}
|
|
202760
|
-
/**
|
|
202852
|
+
/** Test if the angle is a full circle */
|
|
202761
202853
|
get isFullCircle() {
|
|
202762
202854
|
return Angle.isFullCircleRadians(this._radians);
|
|
202763
202855
|
}
|
|
202764
|
-
/**
|
|
202856
|
+
/** Test if the angle is a half circle (in either direction) */
|
|
202765
202857
|
get isHalfCircle() {
|
|
202766
202858
|
return Angle.isHalfCircleRadians(this._radians);
|
|
202767
202859
|
}
|
|
@@ -202830,7 +202922,7 @@ class Angle {
|
|
|
202830
202922
|
// fall through for NaN disaster.
|
|
202831
202923
|
return 0;
|
|
202832
202924
|
}
|
|
202833
|
-
/**
|
|
202925
|
+
/** Return a (newly allocated) Angle object with value 0 radians */
|
|
202834
202926
|
static zero() {
|
|
202835
202927
|
return new Angle(0);
|
|
202836
202928
|
}
|
|
@@ -202984,19 +203076,19 @@ class Angle {
|
|
|
202984
203076
|
return value;
|
|
202985
203077
|
}
|
|
202986
203078
|
/**
|
|
202987
|
-
|
|
202988
|
-
|
|
202989
|
-
|
|
202990
|
-
|
|
202991
|
-
|
|
202992
|
-
|
|
202993
|
-
|
|
202994
|
-
|
|
202995
|
-
|
|
202996
|
-
|
|
202997
|
-
|
|
202998
|
-
|
|
202999
|
-
|
|
203079
|
+
* Return the half angle cosine, sine, and radians for given dot products between vectors. The vectors define
|
|
203080
|
+
* an ellipse using x(t) = c + U cos(t) + V sin(t) so U and V are at angle t=0 degree and t=90 degree. The
|
|
203081
|
+
* half angle t0 is an angle such that x(t0) is one of the ellipse semi-axis.
|
|
203082
|
+
* * This construction arises e.g. in `Arc3d.toScaledMatrix3d`.
|
|
203083
|
+
* * Given ellipse x(t) = c + U cos(t) + V sin(t), find t0 such that radial vector W(t0) = x(t0) - c is
|
|
203084
|
+
* perpendicular to the ellipse.
|
|
203085
|
+
* * Then 0 = W(t0).x'(t0) = (U cos(t0) + V sin(t0)).(V cos(t0) - U sin(t0)) = U.V cos(2t0) + 0.5 (V.V - U.U) sin(2t0)
|
|
203086
|
+
* implies sin(2t0) / cos(2t0) = 2 U.V / (U.U - V.V), i.e., t0 can be computed given the three dot products on the RHS.
|
|
203087
|
+
* math details can be found at docs/learning/geometry/Angle.md
|
|
203088
|
+
* @param dotUU dot product of vectorU with itself
|
|
203089
|
+
* @param dotVV dot product of vectorV with itself
|
|
203090
|
+
* @param dotUV dot product of vectorU with vectorV
|
|
203091
|
+
*/
|
|
203000
203092
|
static dotProductsToHalfAngleTrigValues(dotUU, dotVV, dotUV, favorZero = true) {
|
|
203001
203093
|
const cos2t0 = dotUU - dotVV;
|
|
203002
203094
|
const sin2t0 = 2.0 * dotUV;
|
|
@@ -203005,9 +203097,8 @@ class Angle {
|
|
|
203005
203097
|
return Angle.trigValuesToHalfAngleTrigValues(cos2t0, sin2t0);
|
|
203006
203098
|
}
|
|
203007
203099
|
/**
|
|
203008
|
-
*
|
|
203100
|
+
* Returns the angle between two vectors, with the vectors given as xyz components
|
|
203009
203101
|
* * The returned angle is between 0 and PI
|
|
203010
|
-
*
|
|
203011
203102
|
* @param ux x component of vector u
|
|
203012
203103
|
* @param uy y component of vector u
|
|
203013
203104
|
* @param uz z component of vector u
|
|
@@ -203020,7 +203111,8 @@ class Angle {
|
|
|
203020
203111
|
return Math.atan2(_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.crossProductMagnitude(ux, uy, uz, vx, vy, vz), uDotV);
|
|
203021
203112
|
}
|
|
203022
203113
|
/**
|
|
203023
|
-
*
|
|
203114
|
+
* Returns the angle between two vectors, with the vectors given as xyz components, and an up vector to resolve
|
|
203115
|
+
* angle to a full 2PI range.
|
|
203024
203116
|
* * The returned angle is (-PI < radians <= PI) or (0 <= radians < 2 * PI)
|
|
203025
203117
|
* * The angle is in the plane of the U and V vectors.
|
|
203026
203118
|
* * The upVector determines a positive side of the plane but need not be strictly perpendicular to the plane.
|
|
@@ -203034,7 +203126,8 @@ class Angle {
|
|
|
203034
203126
|
* @param upVectorX x component of vector to positive side of plane.
|
|
203035
203127
|
* @param upVectorY y component of vector to positive side of plane.
|
|
203036
203128
|
* @param upVectorZ z component of vector to positive side of plane.
|
|
203037
|
-
* @param adjustToAllPositive if true, return strictly non-negative sweep (0 <= radians < 2*PI).
|
|
203129
|
+
* @param adjustToAllPositive if true, return strictly non-negative sweep (0 <= radians < 2*PI). If false, return
|
|
203130
|
+
* signed (-PI < radians <= PI)
|
|
203038
203131
|
*/
|
|
203039
203132
|
static orientedRadiansBetweenVectorsXYZ(ux, uy, uz, vx, vy, vz, upVectorX, upVectorY, upVectorZ, adjustToPositive = false) {
|
|
203040
203133
|
const uDotV = ux * vx + uy * vy + uz * vz;
|
|
@@ -203045,8 +203138,8 @@ class Angle {
|
|
|
203045
203138
|
const crossMagnitude = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(wx, wy, wz);
|
|
203046
203139
|
if (upDotW < 0.0) {
|
|
203047
203140
|
if (adjustToPositive) {
|
|
203048
|
-
// The turn is greater than 180 degrees. Take a peculiarly oriented atan2 to get the excess-180 part as
|
|
203049
|
-
// This gives the smoothest numerical transition passing PI.
|
|
203141
|
+
// The turn is greater than 180 degrees. Take a peculiarly oriented atan2 to get the excess-180 part as
|
|
203142
|
+
// addition to PI. This gives the smoothest numerical transition passing PI.
|
|
203050
203143
|
return Math.PI + Math.atan2(crossMagnitude, -uDotV);
|
|
203051
203144
|
}
|
|
203052
203145
|
else {
|
|
@@ -203161,7 +203254,8 @@ class AngleSweep {
|
|
|
203161
203254
|
get endAngle() {
|
|
203162
203255
|
return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.createRadians(this._radians1);
|
|
203163
203256
|
}
|
|
203164
|
-
/**
|
|
203257
|
+
/**
|
|
203258
|
+
* Create a sweep as one of
|
|
203165
203259
|
* * A clone of a given sweep
|
|
203166
203260
|
* * 0 to given angle
|
|
203167
203261
|
* * full circle if no arg given (sweep 0 to 360 degrees)
|
|
@@ -203173,7 +203267,8 @@ class AngleSweep {
|
|
|
203173
203267
|
return new AngleSweep(0, data.radians);
|
|
203174
203268
|
return AngleSweep.create360();
|
|
203175
203269
|
}
|
|
203176
|
-
/**
|
|
203270
|
+
/**
|
|
203271
|
+
* (private) constructor with start and end angles in radians.
|
|
203177
203272
|
* * Use explicitly named static methods to clarify intent and units of inputs:
|
|
203178
203273
|
*
|
|
203179
203274
|
* * createStartEndRadians (startRadians:number, endRadians:number)
|
|
@@ -203188,9 +203283,9 @@ class AngleSweep {
|
|
|
203188
203283
|
this._radians1 = endRadians;
|
|
203189
203284
|
}
|
|
203190
203285
|
/**
|
|
203191
|
-
*
|
|
203286
|
+
* Directly set the start and end angles in radians
|
|
203192
203287
|
* * If the difference between startRadians and endRadians is greater than 360, the function limits the angle sweep to 360.
|
|
203193
|
-
|
|
203288
|
+
*/
|
|
203194
203289
|
setStartEndRadians(startRadians = 0, endRadians = 2.0 * Math.PI) {
|
|
203195
203290
|
const delta = endRadians - startRadians;
|
|
203196
203291
|
if (_Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isFullCircleRadians(delta)) {
|
|
@@ -203199,14 +203294,14 @@ class AngleSweep {
|
|
|
203199
203294
|
this._radians0 = startRadians;
|
|
203200
203295
|
this._radians1 = endRadians;
|
|
203201
203296
|
}
|
|
203202
|
-
/**
|
|
203297
|
+
/** Directly set the start and end angles in degrees */
|
|
203203
203298
|
setStartEndDegrees(startDegrees = 0, endDegrees = 360.0) {
|
|
203204
203299
|
this.setStartEndRadians(_Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.degreesToRadians(startDegrees), _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.degreesToRadians(endDegrees));
|
|
203205
203300
|
}
|
|
203206
203301
|
/**
|
|
203207
|
-
*
|
|
203302
|
+
* Create an AngleSweep from start and end angles given in radians.
|
|
203208
203303
|
* * If the difference between startRadians and endRadians is greater than 360, the function limits the angle sweep to 360.
|
|
203209
|
-
|
|
203304
|
+
*/
|
|
203210
203305
|
static createStartEndRadians(startRadians = 0, endRadians = 2.0 * Math.PI, result) {
|
|
203211
203306
|
result = result ? result : new AngleSweep();
|
|
203212
203307
|
result.setStartEndRadians(startRadians, endRadians);
|
|
@@ -203216,23 +203311,23 @@ class AngleSweep {
|
|
|
203216
203311
|
cloneMinusRadians(radians) {
|
|
203217
203312
|
return new AngleSweep(this._radians0 - radians, this._radians1 - radians);
|
|
203218
203313
|
}
|
|
203219
|
-
/**
|
|
203314
|
+
/** Create an AngleSweep from start and end angles given in degrees. */
|
|
203220
203315
|
static createStartEndDegrees(startDegrees = 0, endDegrees = 360, result) {
|
|
203221
203316
|
return AngleSweep.createStartEndRadians(_Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.degreesToRadians(startDegrees), _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.degreesToRadians(endDegrees), result);
|
|
203222
203317
|
}
|
|
203223
|
-
/**
|
|
203318
|
+
/** Create an angle sweep from strongly typed start and end angles */
|
|
203224
203319
|
static createStartEnd(startAngle, endAngle, result) {
|
|
203225
203320
|
result = result ? result : new AngleSweep();
|
|
203226
203321
|
result.setStartEndRadians(startAngle.radians, endAngle.radians);
|
|
203227
203322
|
return result;
|
|
203228
203323
|
}
|
|
203229
|
-
/**
|
|
203324
|
+
/** Create an AngleSweep from start and end angles given in radians. */
|
|
203230
203325
|
static createStartSweepRadians(startRadians = 0, sweepRadians = Math.PI, result) {
|
|
203231
203326
|
result = result ? result : new AngleSweep();
|
|
203232
203327
|
result.setStartEndRadians(startRadians, startRadians + sweepRadians);
|
|
203233
203328
|
return result;
|
|
203234
203329
|
}
|
|
203235
|
-
/**
|
|
203330
|
+
/** Create an AngleSweep from start and sweep given in degrees. */
|
|
203236
203331
|
static createStartSweepDegrees(startDegrees = 0, sweepDegrees = 360, result) {
|
|
203237
203332
|
return AngleSweep.createStartEndRadians(_Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.degreesToRadians(startDegrees), _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.degreesToRadians(startDegrees + sweepDegrees), result);
|
|
203238
203333
|
}
|
|
@@ -203244,17 +203339,17 @@ class AngleSweep {
|
|
|
203244
203339
|
interpolate(fraction, other) {
|
|
203245
203340
|
return new AngleSweep(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(this._radians0, fraction, other._radians0), _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(this._radians1, fraction, other._radians1));
|
|
203246
203341
|
}
|
|
203247
|
-
/**
|
|
203342
|
+
/** Copy from other AngleSweep. */
|
|
203248
203343
|
setFrom(other) {
|
|
203249
203344
|
this._radians0 = other._radians0;
|
|
203250
203345
|
this._radians1 = other._radians1;
|
|
203251
203346
|
}
|
|
203252
|
-
/**
|
|
203347
|
+
/** Create a full circle sweep (CCW). startRadians defaults to 0 */
|
|
203253
203348
|
static create360(startRadians) {
|
|
203254
203349
|
startRadians = startRadians ? startRadians : 0.0;
|
|
203255
203350
|
return new AngleSweep(startRadians, startRadians + 2.0 * Math.PI);
|
|
203256
203351
|
}
|
|
203257
|
-
/**
|
|
203352
|
+
/** Create a sweep from the south pole to the north pole (-90 to +90). */
|
|
203258
203353
|
static createFullLatitude() {
|
|
203259
203354
|
return AngleSweep.createStartEndRadians(-0.5 * Math.PI, 0.5 * Math.PI);
|
|
203260
203355
|
}
|
|
@@ -203264,7 +203359,8 @@ class AngleSweep {
|
|
|
203264
203359
|
this._radians0 = this._radians1;
|
|
203265
203360
|
this._radians1 = tmp;
|
|
203266
203361
|
}
|
|
203267
|
-
/**
|
|
203362
|
+
/**
|
|
203363
|
+
* Return a sweep for the "other" part of the circle.
|
|
203268
203364
|
* @param reverseDirection true to move backwards (CW) from start to end, false to more forwards (CCW) from start to end.
|
|
203269
203365
|
*/
|
|
203270
203366
|
cloneComplement(reverseDirection = false, result) {
|
|
@@ -203274,9 +203370,7 @@ class AngleSweep {
|
|
|
203274
203370
|
else
|
|
203275
203371
|
return AngleSweep.createStartEndRadians(this.endRadians, this.startRadians + s * Math.PI, result);
|
|
203276
203372
|
}
|
|
203277
|
-
/**
|
|
203278
|
-
* Restrict start and end angles into the range (-90,+90) in degrees.
|
|
203279
|
-
* */
|
|
203373
|
+
/** Restrict start and end angles into the range (-90,+90) in degrees */
|
|
203280
203374
|
capLatitudeInPlace() {
|
|
203281
203375
|
const limit = 0.5 * Math.PI;
|
|
203282
203376
|
this._radians0 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.clampToStartEnd(this._radians0, -limit, limit);
|
|
@@ -203296,7 +203390,7 @@ class AngleSweep {
|
|
|
203296
203390
|
return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this._radians0, -a)
|
|
203297
203391
|
&& _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this._radians1, a);
|
|
203298
203392
|
}
|
|
203299
|
-
/**
|
|
203393
|
+
/** Return a clone of this sweep. */
|
|
203300
203394
|
clone() {
|
|
203301
203395
|
return new AngleSweep(this._radians0, this._radians1);
|
|
203302
203396
|
}
|
|
@@ -203310,15 +203404,16 @@ class AngleSweep {
|
|
|
203310
203404
|
fractionToAngle(fraction) {
|
|
203311
203405
|
return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.createRadians(this.fractionToRadians(fraction));
|
|
203312
203406
|
}
|
|
203313
|
-
/**
|
|
203407
|
+
/**
|
|
203408
|
+
* Return 2PI divided by the sweep radians (i.e. 360 degrees divided by sweep angle).
|
|
203314
203409
|
* * This is the number of fractional intervals required to cover a whole circle.
|
|
203315
203410
|
*/
|
|
203316
203411
|
fractionPeriod() {
|
|
203317
203412
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.safeDivideFraction(Math.PI * 2.0, Math.abs(this._radians1 - this._radians0), 1.0);
|
|
203318
203413
|
}
|
|
203319
|
-
/**
|
|
203414
|
+
/**
|
|
203415
|
+
* Return the fractionalized position of the given angle (as Angle) computed without consideration of
|
|
203320
203416
|
* 2PI period and without consideration of angle sweep direction (CW or CCW).
|
|
203321
|
-
*
|
|
203322
203417
|
* * the start angle is at fraction 0
|
|
203323
203418
|
* * the end angle is at fraction 1
|
|
203324
203419
|
* * interior angles are between 0 and 1
|
|
@@ -203331,8 +203426,8 @@ class AngleSweep {
|
|
|
203331
203426
|
angleToUnboundedFraction(theta) {
|
|
203332
203427
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.safeDivideFraction(theta.radians - this._radians0, this._radians1 - this._radians0, 1.0);
|
|
203333
203428
|
}
|
|
203334
|
-
/**
|
|
203335
|
-
*
|
|
203429
|
+
/**
|
|
203430
|
+
* Return the fractionalized position of the given angle (as radians), computed with consideration of 2PI period.
|
|
203336
203431
|
* * consider radians0 as `start` angle of the sweep and radians1 as `end` angle of the sweep
|
|
203337
203432
|
* * fraction is always positive
|
|
203338
203433
|
* * the start angle is at fraction 0
|
|
@@ -203357,8 +203452,8 @@ class AngleSweep {
|
|
|
203357
203452
|
const fraction2 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.safeDivideFraction(delta2, -sweep, zeroSweepDefault);
|
|
203358
203453
|
return fraction2;
|
|
203359
203454
|
}
|
|
203360
|
-
/**
|
|
203361
|
-
*
|
|
203455
|
+
/**
|
|
203456
|
+
* Return the fractionalized position of the given angle (as radians), computed with consideration of 2PI period.
|
|
203362
203457
|
* * fraction is always positive
|
|
203363
203458
|
* * the start angle is at fraction 0
|
|
203364
203459
|
* * the end angle is at fraction 1
|
|
@@ -203369,8 +203464,8 @@ class AngleSweep {
|
|
|
203369
203464
|
radiansToPositivePeriodicFraction(radians, zeroSweepDefault = 0.0) {
|
|
203370
203465
|
return AngleSweep.radiansToPositivePeriodicFractionStartEnd(radians, this._radians0, this._radians1, zeroSweepDefault);
|
|
203371
203466
|
}
|
|
203372
|
-
/**
|
|
203373
|
-
*
|
|
203467
|
+
/**
|
|
203468
|
+
* Return the fractionalized position of the given angle (as Angle), computed with consideration of 2PI period.
|
|
203374
203469
|
* * fraction is always positive
|
|
203375
203470
|
* * the start angle is at fraction 0
|
|
203376
203471
|
* * the end angle is at fraction 1
|
|
@@ -203381,8 +203476,8 @@ class AngleSweep {
|
|
|
203381
203476
|
angleToPositivePeriodicFraction(theta) {
|
|
203382
203477
|
return this.radiansToPositivePeriodicFraction(theta.radians);
|
|
203383
203478
|
}
|
|
203384
|
-
/**
|
|
203385
|
-
*
|
|
203479
|
+
/**
|
|
203480
|
+
* Return the fractionalized position of the given array of angles (as radian), computed with consideration of 2PI period.
|
|
203386
203481
|
* * fraction is always positive
|
|
203387
203482
|
* * the start angle is at fraction 0
|
|
203388
203483
|
* * the end angle is at fraction 1
|
|
@@ -203396,9 +203491,9 @@ class AngleSweep {
|
|
|
203396
203491
|
data.reassign(i, this.radiansToPositivePeriodicFraction(data.atUncheckedIndex(i)));
|
|
203397
203492
|
}
|
|
203398
203493
|
}
|
|
203399
|
-
/**
|
|
203494
|
+
/**
|
|
203495
|
+
* Return the fractionalized position of the given angle (as radian) computed with consideration of
|
|
203400
203496
|
* 2PI period and with consideration of angle sweep direction (CW or CCW).
|
|
203401
|
-
*
|
|
203402
203497
|
* * the start angle is at fraction 0
|
|
203403
203498
|
* * the end angle is at fraction 1
|
|
203404
203499
|
* * interior angles are between 0 and 1
|
|
@@ -203422,9 +203517,9 @@ class AngleSweep {
|
|
|
203422
203517
|
const fraction = 0.5 + _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.safeDivideFraction(delta2, -sweep, 0.0);
|
|
203423
203518
|
return fraction;
|
|
203424
203519
|
}
|
|
203425
|
-
/**
|
|
203520
|
+
/**
|
|
203521
|
+
* Return the fractionalized position of the given angle (as Angle) computed with consideration of
|
|
203426
203522
|
* 2PI period and with consideration of angle sweep direction (CW or CCW).
|
|
203427
|
-
*
|
|
203428
203523
|
* * the start angle is at fraction 0
|
|
203429
203524
|
* * the end angle is at fraction 1
|
|
203430
203525
|
* * interior angles are between 0 and 1
|
|
@@ -203435,7 +203530,7 @@ class AngleSweep {
|
|
|
203435
203530
|
angleToSignedPeriodicFraction(theta) {
|
|
203436
203531
|
return this.radiansToSignedPeriodicFraction(theta.radians);
|
|
203437
203532
|
}
|
|
203438
|
-
/**
|
|
203533
|
+
/** Test if the given angle (as radians) is within sweep (between radians0 and radians1) */
|
|
203439
203534
|
static isRadiansInStartEnd(radians, radians0, radians1, allowPeriodShift = true) {
|
|
203440
203535
|
const delta0 = radians - radians0;
|
|
203441
203536
|
const delta1 = radians - radians1;
|
|
@@ -203445,16 +203540,16 @@ class AngleSweep {
|
|
|
203445
203540
|
return allowPeriodShift ? _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansAllowPeriodShift(radians, radians0) : _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(radians, radians0);
|
|
203446
203541
|
return allowPeriodShift ? this.radiansToPositivePeriodicFractionStartEnd(radians, radians0, radians1, 1000.0) <= 1.0 : false;
|
|
203447
203542
|
}
|
|
203448
|
-
/**
|
|
203543
|
+
/** Test if the given angle (as radians) is within sweep */
|
|
203449
203544
|
isRadiansInSweep(radians, allowPeriodShift = true) {
|
|
203450
203545
|
return AngleSweep.isRadiansInStartEnd(radians, this.startRadians, this.endRadians, allowPeriodShift);
|
|
203451
203546
|
}
|
|
203452
|
-
/**
|
|
203547
|
+
/** Test if the given angle (as Angle) is within the sweep */
|
|
203453
203548
|
isAngleInSweep(angle) {
|
|
203454
203549
|
return this.isRadiansInSweep(angle.radians);
|
|
203455
203550
|
}
|
|
203456
|
-
/**
|
|
203457
|
-
*
|
|
203551
|
+
/**
|
|
203552
|
+
* Set this AngleSweep from various sources:
|
|
203458
203553
|
* * if json is undefined, a full-circle sweep is returned.
|
|
203459
203554
|
* * If json is an AngleSweep object, it is cloned
|
|
203460
203555
|
* * If json is an array of 2 numbers, those numbers are start and end angles in degrees.
|
|
@@ -203476,7 +203571,7 @@ class AngleSweep {
|
|
|
203476
203571
|
else
|
|
203477
203572
|
this.setStartEndRadians(); // default full circle
|
|
203478
203573
|
}
|
|
203479
|
-
/**
|
|
203574
|
+
/** Create an AngleSweep from a json object. */
|
|
203480
203575
|
static fromJSON(json) {
|
|
203481
203576
|
const result = AngleSweep.create360();
|
|
203482
203577
|
result.setFromJSON(json);
|
|
@@ -203489,7 +203584,8 @@ class AngleSweep {
|
|
|
203489
203584
|
toJSON() {
|
|
203490
203585
|
return [this.startDegrees, this.endDegrees];
|
|
203491
203586
|
}
|
|
203492
|
-
/**
|
|
203587
|
+
/**
|
|
203588
|
+
* Test if this angle sweep and other angle sweep match with radians tolerance.
|
|
203493
203589
|
* * Period shifts are allowed.
|
|
203494
203590
|
*/
|
|
203495
203591
|
isAlmostEqualAllowPeriodShift(other) {
|
|
@@ -203498,14 +203594,16 @@ class AngleSweep {
|
|
|
203498
203594
|
return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansAllowPeriodShift(this._radians0, other._radians0)
|
|
203499
203595
|
&& _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansAllowPeriodShift(this._radians1 - this._radians0, other._radians1 - other._radians0);
|
|
203500
203596
|
}
|
|
203501
|
-
/**
|
|
203597
|
+
/**
|
|
203598
|
+
* Test if this angle sweep and other angle sweep match with radians tolerance.
|
|
203502
203599
|
* * Period shifts are not allowed.
|
|
203503
203600
|
*/
|
|
203504
203601
|
isAlmostEqualNoPeriodShift(other) {
|
|
203505
203602
|
return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this._radians0, other._radians0)
|
|
203506
203603
|
&& _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this._radians1 - this._radians0, other._radians1 - other._radians0);
|
|
203507
203604
|
}
|
|
203508
|
-
/**
|
|
203605
|
+
/**
|
|
203606
|
+
* Test if start and end angles match with radians tolerance.
|
|
203509
203607
|
* * Period shifts are not allowed.
|
|
203510
203608
|
* * This function is equivalent to isAlmostEqualNoPeriodShift. It is present for consistency with other classes.
|
|
203511
203609
|
* However, it is recommended to use isAlmostEqualNoPeriodShift which has a clearer name.
|
|
@@ -210772,7 +210870,7 @@ class Matrix3d {
|
|
|
210772
210870
|
return undefined;
|
|
210773
210871
|
}
|
|
210774
210872
|
/**
|
|
210775
|
-
* Multiply `matrixInverse * [x,y,z]` and return result as `Point4d` the
|
|
210873
|
+
* Multiply `matrixInverse * [x,y,z]` and return result as a `Point4d` with the given weight as the last coordinate.
|
|
210776
210874
|
* * Equivalent to solving `matrix * result = [x,y,z]` for an unknown `result`.
|
|
210777
210875
|
* * Result is `undefined` if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
|
|
210778
210876
|
* @return result as a Point4d with the same weight.
|
|
@@ -210908,20 +211006,17 @@ class Matrix3d {
|
|
|
210908
211006
|
}
|
|
210909
211007
|
/**
|
|
210910
211008
|
* Multiply `this` Matrix3d (considered to be a Transform with 0 `origin`) times `other` Transform.
|
|
210911
|
-
* **Note:** If `other = [B b]`, then
|
|
210912
|
-
* Then `this * other` is defined as [A*B Aa]. That's because we create a 4x4 matrix for each Transform
|
|
210913
|
-
* with the 3x3 `matrix` and `origin` as upper 3x4 part of a 4x4 matrix and 0001 as the final row. Then we
|
|
210914
|
-
* multiply those two 4x4 matrixes:
|
|
211009
|
+
* * **Note:** If `this = [A 0]` and `other = [B b]`, then `this * other` is defined as [A*B Ab] because:
|
|
210915
211010
|
* ```
|
|
210916
211011
|
* equation
|
|
210917
211012
|
* \begin{matrix}
|
|
210918
|
-
* \text{
|
|
210919
|
-
* \text{
|
|
211013
|
+
* \text{this matrix }\bold{A}\text{ promoted to block Transform} & \blockTransform{A}{0} \\
|
|
211014
|
+
* \text{other Transform with `matrix` part }\bold{B}\text{ and origin part }\bold{b} & \blockTransform{B}{b}\\
|
|
210920
211015
|
* \text{product}& \blockTransform{A}{0}\blockTransform{B}{b}=\blockTransform{AB}{Ab}
|
|
210921
211016
|
* \end{matrix}
|
|
210922
211017
|
* ```
|
|
210923
211018
|
* @param other the `other` Transform to be multiplied to `this` matrix.
|
|
210924
|
-
* @param result optional preallocated result to reuse.
|
|
211019
|
+
* @param result optional preallocated `result` to reuse.
|
|
210925
211020
|
*/
|
|
210926
211021
|
multiplyMatrixTransform(other, result) {
|
|
210927
211022
|
if (!result)
|
|
@@ -211704,7 +211799,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
211704
211799
|
|
|
211705
211800
|
/* cspell:word cxcz, cxsz, cxcy, cxsy, sxcz, sxsz, sxcy, sxsy, cycz, cysz, sycz, sysz */
|
|
211706
211801
|
/**
|
|
211707
|
-
*
|
|
211802
|
+
* Represents a non-trivial rotation using three simple axis rotation angles and an order in which to apply them.
|
|
211708
211803
|
* * This class accommodates application-specific interpretation of "multiplying 3 rotation matrices" with regard to
|
|
211709
211804
|
* * Whether a "vector" is a "row" or a "column"
|
|
211710
211805
|
* * The order in which the X,Y,Z rotations are applied.
|
|
@@ -211762,7 +211857,7 @@ class OrderedRotationAngles {
|
|
|
211762
211857
|
get zRadians() {
|
|
211763
211858
|
return this._z.radians;
|
|
211764
211859
|
}
|
|
211765
|
-
/**
|
|
211860
|
+
/** The flag controlling whether vectors are treated as rows or as columns */
|
|
211766
211861
|
static get treatVectorsAsColumns() {
|
|
211767
211862
|
return OrderedRotationAngles._sTreatVectorsAsColumns;
|
|
211768
211863
|
}
|
|
@@ -211845,7 +211940,7 @@ class OrderedRotationAngles {
|
|
|
211845
211940
|
* * In the failure case the method's return value is `undefined`.
|
|
211846
211941
|
* * In the failure case, if the optional result was supplied, that result will nonetheless be filled with
|
|
211847
211942
|
* a set of angles.
|
|
211848
|
-
|
|
211943
|
+
*/
|
|
211849
211944
|
static createFromMatrix3d(matrix, order, result) {
|
|
211850
211945
|
// treat vector as columns
|
|
211851
211946
|
let m11 = matrix.coffs[0], m12 = matrix.coffs[1], m13 = matrix.coffs[2];
|
|
@@ -212642,21 +212737,19 @@ class Point2dArrayCarrier extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_
|
|
|
212642
212737
|
return undefined;
|
|
212643
212738
|
}
|
|
212644
212739
|
/**
|
|
212645
|
-
|
|
212646
|
-
|
|
212647
|
-
|
|
212648
|
-
|
|
212649
|
-
|
|
212650
|
-
|
|
212651
|
-
|
|
212740
|
+
* Return the cross product of vectors from point at originIndex to points at indexA and indexB
|
|
212741
|
+
* @param originIndex index of origin
|
|
212742
|
+
* @param indexA index of first target within the array
|
|
212743
|
+
* @param indexB index of second target within the array
|
|
212744
|
+
* @param result caller-allocated vector.
|
|
212745
|
+
* @returns return true if indexA, indexB both valid
|
|
212746
|
+
*/
|
|
212652
212747
|
crossProductIndexIndexIndex(originIndex, indexA, indexB) {
|
|
212653
212748
|
if (this.isValidIndex(originIndex) && this.isValidIndex(indexA) && this.isValidIndex(indexB))
|
|
212654
212749
|
return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_1__.XY.crossProductToPoints(this.data[originIndex], this.data[indexA], this.data[indexB]);
|
|
212655
212750
|
return undefined;
|
|
212656
212751
|
}
|
|
212657
|
-
/**
|
|
212658
|
-
* read-only property for number of XYZ in the collection.
|
|
212659
|
-
*/
|
|
212752
|
+
/** Read-only property for number of XYZ in the collection. */
|
|
212660
212753
|
get length() {
|
|
212661
212754
|
return this.data.length;
|
|
212662
212755
|
}
|
|
@@ -212702,10 +212795,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
212702
212795
|
* @module CartesianGeometry
|
|
212703
212796
|
*/
|
|
212704
212797
|
// cspell:word JSONXY
|
|
212705
|
-
// cspell:word CWXY
|
|
212798
|
+
// cspell:word CWXY CCWXY
|
|
212706
212799
|
|
|
212707
212800
|
|
|
212708
|
-
/**
|
|
212801
|
+
/**
|
|
212802
|
+
* Minimal object containing x,y and operations that are meaningful without change in both point and vector.
|
|
212709
212803
|
* * `XY` is not instantiable.
|
|
212710
212804
|
* * The derived (instantiable) classes are
|
|
212711
212805
|
* * `Point2d`
|
|
@@ -212750,11 +212844,11 @@ class XY {
|
|
|
212750
212844
|
isAlmostEqualXY(x, y, tol) {
|
|
212751
212845
|
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.x, x, tol) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.y, y, tol);
|
|
212752
212846
|
}
|
|
212753
|
-
/**
|
|
212847
|
+
/** Return a json array `[x,y]` */
|
|
212754
212848
|
toJSON() {
|
|
212755
212849
|
return [this.x, this.y];
|
|
212756
212850
|
}
|
|
212757
|
-
/**
|
|
212851
|
+
/** Return a json object `{x: 1, y:2}` */
|
|
212758
212852
|
toJSONXY() {
|
|
212759
212853
|
return { x: this.x, y: this.y };
|
|
212760
212854
|
}
|
|
@@ -212762,7 +212856,7 @@ class XY {
|
|
|
212762
212856
|
* Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
|
|
212763
212857
|
* * If no JSON input is provided, 0 would be used as default values for x and y.
|
|
212764
212858
|
* @param json the JSON input
|
|
212765
|
-
|
|
212859
|
+
*/
|
|
212766
212860
|
setFromJSON(json) {
|
|
212767
212861
|
if (Array.isArray(json)) {
|
|
212768
212862
|
this.set(json[0] || 0, json[1] || 0);
|
|
@@ -212790,17 +212884,13 @@ class XY {
|
|
|
212790
212884
|
maxDiff(other) {
|
|
212791
212885
|
return Math.max(Math.abs(this.x - other.x), Math.abs(this.y - other.y));
|
|
212792
212886
|
}
|
|
212793
|
-
/**
|
|
212794
|
-
* Return the x,y component corresponding to 0,1.
|
|
212795
|
-
*/
|
|
212887
|
+
/** Return the x,y component corresponding to 0,1 */
|
|
212796
212888
|
at(index) {
|
|
212797
212889
|
if (index < 0.5)
|
|
212798
212890
|
return this.x;
|
|
212799
212891
|
return this.y;
|
|
212800
212892
|
}
|
|
212801
|
-
/**
|
|
212802
|
-
* Set value at index 0 or 1.
|
|
212803
|
-
*/
|
|
212893
|
+
/** Set value at index 0 or 1 */
|
|
212804
212894
|
setAt(index, value) {
|
|
212805
212895
|
if (index < 0.5)
|
|
212806
212896
|
this.x = value;
|
|
@@ -212817,7 +212907,7 @@ class XY {
|
|
|
212817
212907
|
}
|
|
212818
212908
|
return index;
|
|
212819
212909
|
}
|
|
212820
|
-
/**
|
|
212910
|
+
/** Returns true if the x,y components are both small by metric metric tolerance */
|
|
212821
212911
|
get isAlmostZero() {
|
|
212822
212912
|
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(this.x) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(this.y);
|
|
212823
212913
|
}
|
|
@@ -212833,11 +212923,11 @@ class XY {
|
|
|
212833
212923
|
magnitudeSquared() {
|
|
212834
212924
|
return this.x * this.x + this.y * this.y;
|
|
212835
212925
|
}
|
|
212836
|
-
/**
|
|
212926
|
+
/** Returns true if the x,y components are exactly equal. */
|
|
212837
212927
|
isExactEqual(other) {
|
|
212838
212928
|
return this.x === other.x && this.y === other.y;
|
|
212839
212929
|
}
|
|
212840
|
-
/**
|
|
212930
|
+
/** Returns true if x,y match `other` within metric tolerance */
|
|
212841
212931
|
isAlmostEqualMetric(other, distanceTol = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
212842
212932
|
return this.maxDiff(other) <= distanceTol;
|
|
212843
212933
|
}
|
|
@@ -212849,7 +212939,7 @@ class XY {
|
|
|
212849
212939
|
unitVectorTo(other, result) {
|
|
212850
212940
|
return this.vectorTo(other, result).normalize(result);
|
|
212851
212941
|
}
|
|
212852
|
-
/**
|
|
212942
|
+
/** Cross product of vectors from origin to targets */
|
|
212853
212943
|
static crossProductToPoints(origin, targetA, targetB) {
|
|
212854
212944
|
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.crossProductXYXY(targetA.x - origin.x, targetA.y - origin.y, targetB.x - origin.x, targetB.y - origin.y);
|
|
212855
212945
|
}
|
|
@@ -212862,7 +212952,7 @@ class Point2d extends XY {
|
|
|
212862
212952
|
constructor(x = 0, y = 0) {
|
|
212863
212953
|
super(x, y);
|
|
212864
212954
|
}
|
|
212865
|
-
/**
|
|
212955
|
+
/** Return a new Point2d with x,y coordinates from this. */
|
|
212866
212956
|
clone(result) {
|
|
212867
212957
|
return Point2d.create(this.x, this.y, result);
|
|
212868
212958
|
}
|
|
@@ -212884,7 +212974,7 @@ class Point2d extends XY {
|
|
|
212884
212974
|
* Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
|
|
212885
212975
|
* * If no JSON input is provided, 0 would be used as default values for x and y.
|
|
212886
212976
|
* @param json the JSON input
|
|
212887
|
-
|
|
212977
|
+
*/
|
|
212888
212978
|
static fromJSON(json) {
|
|
212889
212979
|
const val = new Point2d();
|
|
212890
212980
|
val.setFromJSON(json);
|
|
@@ -212900,7 +212990,8 @@ class Point2d extends XY {
|
|
|
212900
212990
|
static createZero(result) {
|
|
212901
212991
|
return Point2d.create(0, 0, result);
|
|
212902
212992
|
}
|
|
212903
|
-
/**
|
|
212993
|
+
/**
|
|
212994
|
+
* Starting at this point, move along vector by tangentFraction of the vector length, and then
|
|
212904
212995
|
* to the left by leftFraction of the perpendicular vector length.
|
|
212905
212996
|
* @param tangentFraction distance to move along the vector, as a fraction of vector
|
|
212906
212997
|
* @param leftFraction distance to move perpendicular to the vector, as a fraction of the rotated vector
|
|
@@ -212911,7 +213002,8 @@ class Point2d extends XY {
|
|
|
212911
213002
|
const dy = vector.y;
|
|
212912
213003
|
return Point2d.create(this.x + tangentFraction * dx - leftFraction * dy, this.y + tangentFraction * dy + leftFraction * dx);
|
|
212913
213004
|
}
|
|
212914
|
-
/**
|
|
213005
|
+
/**
|
|
213006
|
+
* Interpolate at tangentFraction between this instance and point, and then Move by leftFraction
|
|
212915
213007
|
* along the xy perpendicular of the vector between the points.
|
|
212916
213008
|
*/
|
|
212917
213009
|
forwardLeftInterpolate(tangentFraction, leftFraction, point) {
|
|
@@ -212974,7 +213066,8 @@ class Point2d extends XY {
|
|
|
212974
213066
|
const y2 = target2.y - this.y;
|
|
212975
213067
|
return x1 * y2 - y1 * x2;
|
|
212976
213068
|
}
|
|
212977
|
-
/**
|
|
213069
|
+
/**
|
|
213070
|
+
* Return the fractional coordinate of the projection of this instance x,y onto the
|
|
212978
213071
|
* line from startPoint to endPoint.
|
|
212979
213072
|
* @param startPoint start point of line
|
|
212980
213073
|
* @param endPoint end point of line
|
|
@@ -212988,7 +213081,8 @@ class Point2d extends XY {
|
|
|
212988
213081
|
return numerator / denominator;
|
|
212989
213082
|
}
|
|
212990
213083
|
}
|
|
212991
|
-
/**
|
|
213084
|
+
/**
|
|
213085
|
+
* 2D vector with `x`,`y` as properties
|
|
212992
213086
|
* @public
|
|
212993
213087
|
*/
|
|
212994
213088
|
class Vector2d extends XY {
|
|
@@ -213026,7 +213120,7 @@ class Vector2d extends XY {
|
|
|
213026
213120
|
static createZero(result) {
|
|
213027
213121
|
return Vector2d.create(0, 0, result);
|
|
213028
213122
|
}
|
|
213029
|
-
/**
|
|
213123
|
+
/** Copy contents from another Point3d, Point2d, Vector2d, or Vector3d, or leading entries of Float64Array */
|
|
213030
213124
|
static createFrom(data, result) {
|
|
213031
213125
|
if (data instanceof Float64Array) {
|
|
213032
213126
|
if (data.length >= 2)
|
|
@@ -213041,7 +213135,7 @@ class Vector2d extends XY {
|
|
|
213041
213135
|
* Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
|
|
213042
213136
|
* * If no JSON input is provided, 0 would be used as default values for x and y.
|
|
213043
213137
|
* @param json the JSON input
|
|
213044
|
-
|
|
213138
|
+
*/
|
|
213045
213139
|
static fromJSON(json) {
|
|
213046
213140
|
const val = new Vector2d();
|
|
213047
213141
|
val.setFromJSON(json);
|
|
@@ -213073,7 +213167,8 @@ class Vector2d extends XY {
|
|
|
213073
213167
|
}
|
|
213074
213168
|
return undefined;
|
|
213075
213169
|
}
|
|
213076
|
-
/**
|
|
213170
|
+
/**
|
|
213171
|
+
* Return a (new or optionally reused) vector which is `this` divided by `denominator`
|
|
213077
213172
|
* * return undefined if denominator is zero.
|
|
213078
213173
|
*/
|
|
213079
213174
|
safeDivideOrNull(denominator, result) {
|
|
@@ -213094,7 +213189,7 @@ class Vector2d extends XY {
|
|
|
213094
213189
|
* it's returning the length of the projection as a fraction of the target magnitude.
|
|
213095
213190
|
* @param target the target vector
|
|
213096
213191
|
* @param defaultFraction the returned value in case magnitude square of target vector is very small
|
|
213097
|
-
|
|
213192
|
+
*/
|
|
213098
213193
|
fractionOfProjectionToVector(target, defaultFraction) {
|
|
213099
213194
|
/*
|
|
213100
213195
|
* projection length is (this.target)/||target||
|
|
@@ -213149,7 +213244,7 @@ class Vector2d extends XY {
|
|
|
213149
213244
|
}
|
|
213150
213245
|
return result;
|
|
213151
213246
|
}
|
|
213152
|
-
/**
|
|
213247
|
+
/** Return a new Vector2d rotated CCW by given angle */
|
|
213153
213248
|
rotateXY(angle, result) {
|
|
213154
213249
|
const s = angle.sin();
|
|
213155
213250
|
const c = angle.cos();
|
|
@@ -213161,7 +213256,8 @@ class Vector2d extends XY {
|
|
|
213161
213256
|
result.y = xx * s + yy * c;
|
|
213162
213257
|
return result;
|
|
213163
213258
|
}
|
|
213164
|
-
/**
|
|
213259
|
+
/**
|
|
213260
|
+
* Return a vector computed at fractional position between this vector and vectorB
|
|
213165
213261
|
* @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`.
|
|
213166
213262
|
* True fractions are "between", negatives are "before this", beyond 1 is "beyond vectorB".
|
|
213167
213263
|
* @param vectorB second vector
|
|
@@ -213184,14 +213280,14 @@ class Vector2d extends XY {
|
|
|
213184
213280
|
}
|
|
213185
213281
|
return result;
|
|
213186
213282
|
}
|
|
213187
|
-
/**
|
|
213283
|
+
/** Return {this + vector}. */
|
|
213188
213284
|
plus(vector, result) {
|
|
213189
213285
|
result = result ? result : new Vector2d();
|
|
213190
213286
|
result.x = this.x + vector.x;
|
|
213191
213287
|
result.y = this.y + vector.y;
|
|
213192
213288
|
return result;
|
|
213193
213289
|
}
|
|
213194
|
-
/**
|
|
213290
|
+
/** Return {this - vector}. */
|
|
213195
213291
|
minus(vector, result) {
|
|
213196
213292
|
result = result ? result : new Vector2d();
|
|
213197
213293
|
result.x = this.x - vector.x;
|
|
@@ -213226,34 +213322,34 @@ class Vector2d extends XY {
|
|
|
213226
213322
|
result.y = this.y * scale;
|
|
213227
213323
|
return result;
|
|
213228
213324
|
}
|
|
213229
|
-
/**
|
|
213325
|
+
/** Return a vector parallel to this but with specified length */
|
|
213230
213326
|
scaleToLength(length, result) {
|
|
213231
213327
|
const mag = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.correctSmallMetricDistance(this.magnitude());
|
|
213232
213328
|
if (mag === 0)
|
|
213233
213329
|
return undefined;
|
|
213234
213330
|
return this.scale(length / mag, result);
|
|
213235
213331
|
}
|
|
213236
|
-
/**
|
|
213332
|
+
/** Return the dot product of this with vectorB */
|
|
213237
213333
|
dotProduct(vectorB) {
|
|
213238
213334
|
return this.x * vectorB.x + this.y * vectorB.y;
|
|
213239
213335
|
}
|
|
213240
|
-
/**
|
|
213336
|
+
/** Dot product with vector from pointA to pointB */
|
|
213241
213337
|
dotProductStartEnd(pointA, pointB) {
|
|
213242
213338
|
return this.x * (pointB.x - pointA.x) + this.y * (pointB.y - pointA.y);
|
|
213243
213339
|
}
|
|
213244
|
-
/**
|
|
213340
|
+
/** Vector cross product {this CROSS vectorB} */
|
|
213245
213341
|
crossProduct(vectorB) {
|
|
213246
213342
|
return this.x * vectorB.y - this.y * vectorB.x;
|
|
213247
213343
|
}
|
|
213248
213344
|
/**
|
|
213249
|
-
*
|
|
213345
|
+
* Return the radians (as a simple number, not strongly typed Angle) signed angle from this to vectorB.
|
|
213250
213346
|
* This is positive if the shortest turn is counterclockwise, negative if clockwise.
|
|
213251
213347
|
*/
|
|
213252
213348
|
radiansTo(vectorB) {
|
|
213253
213349
|
return Math.atan2(this.crossProduct(vectorB), this.dotProduct(vectorB));
|
|
213254
213350
|
}
|
|
213255
213351
|
/**
|
|
213256
|
-
*
|
|
213352
|
+
* Return the (strongly typed) signed angle from this to vectorB.
|
|
213257
213353
|
* This is positive if the shortest turn is counterclockwise, negative if clockwise.
|
|
213258
213354
|
*/
|
|
213259
213355
|
angleTo(vectorB) {
|
|
@@ -213341,7 +213437,7 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
|
|
|
213341
213437
|
super();
|
|
213342
213438
|
this.data = data;
|
|
213343
213439
|
}
|
|
213344
|
-
/**
|
|
213440
|
+
/** Test if `index` is a valid index into the array. */
|
|
213345
213441
|
isValidIndex(index) {
|
|
213346
213442
|
return index >= 0 && index < this.data.length;
|
|
213347
213443
|
}
|
|
@@ -213383,23 +213479,23 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
|
|
|
213383
213479
|
return undefined;
|
|
213384
213480
|
}
|
|
213385
213481
|
/**
|
|
213386
|
-
*
|
|
213482
|
+
* Access x of indexed point
|
|
213387
213483
|
* * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
|
|
213388
|
-
|
|
213484
|
+
*/
|
|
213389
213485
|
getXAtUncheckedPointIndex(pointIndex) {
|
|
213390
213486
|
return this.data[pointIndex].x;
|
|
213391
213487
|
}
|
|
213392
213488
|
/**
|
|
213393
|
-
*
|
|
213489
|
+
* Access y of indexed point
|
|
213394
213490
|
* * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
|
|
213395
|
-
|
|
213491
|
+
*/
|
|
213396
213492
|
getYAtUncheckedPointIndex(pointIndex) {
|
|
213397
213493
|
return this.data[pointIndex].y;
|
|
213398
213494
|
}
|
|
213399
213495
|
/**
|
|
213400
|
-
*
|
|
213496
|
+
* Access z of indexed point
|
|
213401
213497
|
* * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
|
|
213402
|
-
|
|
213498
|
+
*/
|
|
213403
213499
|
getZAtUncheckedPointIndex(pointIndex) {
|
|
213404
213500
|
return this.data[pointIndex].z;
|
|
213405
213501
|
}
|
|
@@ -213466,10 +213562,7 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
|
|
|
213466
213562
|
if (this.isValidIndex(originIndex) && this.isValidIndex(indexA) && this.isValidIndex(indexB))
|
|
213467
213563
|
result.addCrossProductToTargetsInPlace(data[originIndex].x, data[originIndex].y, data[originIndex].z, data[indexA].x, data[indexA].y, data[indexA].z, data[indexB].x, data[indexB].y, data[indexB].z);
|
|
213468
213564
|
}
|
|
213469
|
-
/**
|
|
213470
|
-
* Accumulate scale times the x,y,z values at index to the sum.
|
|
213471
|
-
* No action if index is out of bounds.
|
|
213472
|
-
*/
|
|
213565
|
+
/** Accumulate scale times the x,y,z values at index to the sum. No action if index is out of bounds */
|
|
213473
213566
|
accumulateScaledXYZ(index, scale, sum) {
|
|
213474
213567
|
if (this.isValidIndex(index)) {
|
|
213475
213568
|
const point = this.data[index];
|
|
@@ -213478,20 +213571,19 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
|
|
|
213478
213571
|
sum.z += scale * point.z;
|
|
213479
213572
|
}
|
|
213480
213573
|
}
|
|
213481
|
-
/**
|
|
213482
|
-
* read-only property for number of XYZ in the collection.
|
|
213483
|
-
*/
|
|
213574
|
+
/** Read-only property for number of XYZ in the collection */
|
|
213484
213575
|
get length() {
|
|
213485
213576
|
return this.data.length;
|
|
213486
213577
|
}
|
|
213487
|
-
/**
|
|
213578
|
+
/**
|
|
213579
|
+
* Push a (clone of) point onto the collection
|
|
213488
213580
|
* * point itself is not pushed -- xyz data is extracted into the native form of the collection.
|
|
213489
213581
|
*/
|
|
213490
213582
|
push(data) {
|
|
213491
213583
|
this.data.push(data.clone());
|
|
213492
213584
|
}
|
|
213493
213585
|
/**
|
|
213494
|
-
*
|
|
213586
|
+
* Push a new point (given by coordinates) onto the collection
|
|
213495
213587
|
* @param x x coordinate
|
|
213496
213588
|
* @param y y coordinate
|
|
213497
213589
|
* @param z z coordinate
|
|
@@ -213499,26 +213591,26 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
|
|
|
213499
213591
|
pushXYZ(x, y, z) {
|
|
213500
213592
|
this.data.push(_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(x === undefined ? 0.0 : x, y === undefined ? 0.0 : y, z === undefined ? 0.0 : z));
|
|
213501
213593
|
}
|
|
213502
|
-
/**
|
|
213594
|
+
/** Extract (copy) the final point */
|
|
213503
213595
|
back(result) {
|
|
213504
213596
|
if (this.data.length > 0) {
|
|
213505
213597
|
return this.data[this.data.length - 1].clone(result);
|
|
213506
213598
|
}
|
|
213507
213599
|
return undefined;
|
|
213508
213600
|
}
|
|
213509
|
-
/**
|
|
213601
|
+
/** Extract (copy) the first point */
|
|
213510
213602
|
front(result) {
|
|
213511
213603
|
if (this.data.length > 0) {
|
|
213512
213604
|
return this.data[0].clone(result);
|
|
213513
213605
|
}
|
|
213514
213606
|
return undefined;
|
|
213515
213607
|
}
|
|
213516
|
-
/**
|
|
213608
|
+
/** Remove the final point. */
|
|
213517
213609
|
pop() {
|
|
213518
213610
|
if (this.data.length > 0)
|
|
213519
213611
|
this.data.pop();
|
|
213520
213612
|
}
|
|
213521
|
-
/**
|
|
213613
|
+
/** Remove all points. */
|
|
213522
213614
|
clear() {
|
|
213523
213615
|
this.data.length = 0;
|
|
213524
213616
|
}
|
|
@@ -213587,7 +213679,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
213587
213679
|
|
|
213588
213680
|
// cspell:words CWXY CCWXY arctan Rodrigues
|
|
213589
213681
|
/**
|
|
213590
|
-
*
|
|
213682
|
+
* * `XYZ` is a minimal object containing x,y,z and operations that are meaningful without change in both
|
|
213683
|
+
* point and vector.
|
|
213591
213684
|
* * `XYZ` is not instantiable.
|
|
213592
213685
|
* * The derived (instantiable) classes are
|
|
213593
213686
|
* * `Point3d`
|
|
@@ -213631,7 +213724,8 @@ class XYZ {
|
|
|
213631
213724
|
static isXYAndZ(arg) {
|
|
213632
213725
|
return this.isXAndY(arg) && this.hasZ(arg);
|
|
213633
213726
|
}
|
|
213634
|
-
/**
|
|
213727
|
+
/**
|
|
213728
|
+
* Test if arg is any of:
|
|
213635
213729
|
* * XAndY
|
|
213636
213730
|
* * XYAndZ
|
|
213637
213731
|
* * [number,number]
|
|
@@ -213640,7 +213734,8 @@ class XYZ {
|
|
|
213640
213734
|
static isAnyImmediatePointType(arg) {
|
|
213641
213735
|
return Point3d.isXAndY(arg) || _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isNumberArray(arg, 2);
|
|
213642
213736
|
}
|
|
213643
|
-
/**
|
|
213737
|
+
/**
|
|
213738
|
+
* Look for (in order) an x coordinate present as:
|
|
213644
213739
|
* * arg.x
|
|
213645
213740
|
* * arg[0]
|
|
213646
213741
|
*/
|
|
@@ -213651,7 +213746,8 @@ class XYZ {
|
|
|
213651
213746
|
return arg[0];
|
|
213652
213747
|
return defaultValue;
|
|
213653
213748
|
}
|
|
213654
|
-
/**
|
|
213749
|
+
/**
|
|
213750
|
+
* Look for (in order) an x coordinate present as:
|
|
213655
213751
|
* * arg.y
|
|
213656
213752
|
* * arg[1]
|
|
213657
213753
|
*/
|
|
@@ -213662,7 +213758,8 @@ class XYZ {
|
|
|
213662
213758
|
return arg[1];
|
|
213663
213759
|
return defaultValue;
|
|
213664
213760
|
}
|
|
213665
|
-
/**
|
|
213761
|
+
/**
|
|
213762
|
+
* Look for (in order) an x coordinate present as:
|
|
213666
213763
|
* * arg.z
|
|
213667
213764
|
* * arg[2]
|
|
213668
213765
|
*/
|
|
@@ -213725,7 +213822,8 @@ class XYZ {
|
|
|
213725
213822
|
this.setZero();
|
|
213726
213823
|
}
|
|
213727
213824
|
}
|
|
213728
|
-
/**
|
|
213825
|
+
/**
|
|
213826
|
+
* Returns true if this and other have equal x,y,z parts within Geometry.smallMetricDistance.
|
|
213729
213827
|
* @param other The other XYAndZ to compare
|
|
213730
213828
|
* @param tol The tolerance for the comparison. If undefined, use [[Geometry.smallMetricDistance]]
|
|
213731
213829
|
*/
|
|
@@ -213806,9 +213904,7 @@ class XYZ {
|
|
|
213806
213904
|
maxDiff(other) {
|
|
213807
213905
|
return Math.max(Math.abs(this.x - other.x), Math.abs(this.y - other.y), Math.abs(this.z - other.z));
|
|
213808
213906
|
}
|
|
213809
|
-
/**
|
|
213810
|
-
* Return the x,y, z component corresponding to 0,1,2.
|
|
213811
|
-
*/
|
|
213907
|
+
/** Return the x,y, z component corresponding to 0,1,2 */
|
|
213812
213908
|
at(index) {
|
|
213813
213909
|
if (index < 0.5)
|
|
213814
213910
|
return this.x;
|
|
@@ -213816,9 +213912,7 @@ class XYZ {
|
|
|
213816
213912
|
return this.z;
|
|
213817
213913
|
return this.y;
|
|
213818
213914
|
}
|
|
213819
|
-
/**
|
|
213820
|
-
* Set value at index 0 or 1 or 2.
|
|
213821
|
-
*/
|
|
213915
|
+
/** Set value at index 0 or 1 or 2 */
|
|
213822
213916
|
setAt(index, value) {
|
|
213823
213917
|
if (index < 0.5)
|
|
213824
213918
|
this.x = value;
|
|
@@ -213872,27 +213966,27 @@ class XYZ {
|
|
|
213872
213966
|
magnitudeSquaredXY() {
|
|
213873
213967
|
return this.x * this.x + this.y * this.y;
|
|
213874
213968
|
}
|
|
213875
|
-
/**
|
|
213969
|
+
/** Exact equality test. */
|
|
213876
213970
|
isExactEqual(other) {
|
|
213877
213971
|
return this.x === other.x && this.y === other.y && this.z === other.z;
|
|
213878
213972
|
}
|
|
213879
|
-
/**
|
|
213973
|
+
/** Equality test with Geometry.smallMetricDistance tolerance */
|
|
213880
213974
|
isAlmostEqualMetric(other) {
|
|
213881
213975
|
return this.maxDiff(other) <= _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance;
|
|
213882
213976
|
}
|
|
213883
|
-
/**
|
|
213977
|
+
/** Add x,y,z from other in place. */
|
|
213884
213978
|
addInPlace(other) {
|
|
213885
213979
|
this.x += other.x;
|
|
213886
213980
|
this.y += other.y;
|
|
213887
213981
|
this.z += other.z;
|
|
213888
213982
|
}
|
|
213889
|
-
/**
|
|
213983
|
+
/** Add x,y,z from other in place. */
|
|
213890
213984
|
subtractInPlace(other) {
|
|
213891
213985
|
this.x -= other.x;
|
|
213892
213986
|
this.y -= other.y;
|
|
213893
213987
|
this.z -= other.z;
|
|
213894
213988
|
}
|
|
213895
|
-
/**
|
|
213989
|
+
/** Add (in place) the scaled x,y,z of other */
|
|
213896
213990
|
addScaledInPlace(other, scale) {
|
|
213897
213991
|
this.x += scale * other.x;
|
|
213898
213992
|
this.y += scale * other.y;
|
|
@@ -213904,7 +213998,7 @@ class XYZ {
|
|
|
213904
213998
|
this.y *= scale;
|
|
213905
213999
|
this.z *= scale;
|
|
213906
214000
|
}
|
|
213907
|
-
/**
|
|
214001
|
+
/** Add to x, y, z parts */
|
|
213908
214002
|
addXYZInPlace(dx = 0.0, dy = 0.0, dz = 0.0) {
|
|
213909
214003
|
this.x += dx;
|
|
213910
214004
|
this.y += dy;
|
|
@@ -213922,7 +214016,8 @@ class XYZ {
|
|
|
213922
214016
|
scaledVectorTo(other, scale, result) {
|
|
213923
214017
|
return Vector3d.create(scale * (other.x - this.x), scale * (other.y - this.y), scale * (other.z - this.z), result);
|
|
213924
214018
|
}
|
|
213925
|
-
/**
|
|
214019
|
+
/**
|
|
214020
|
+
* Return a unit vector from this vector to other. Return a 000 vector if the input is too small to normalize.
|
|
213926
214021
|
* @param other target of created vector.
|
|
213927
214022
|
* @param result optional result vector.
|
|
213928
214023
|
*/
|
|
@@ -213933,7 +214028,7 @@ class XYZ {
|
|
|
213933
214028
|
freeze() {
|
|
213934
214029
|
return Object.freeze(this);
|
|
213935
214030
|
}
|
|
213936
|
-
/**
|
|
214031
|
+
/** Access x part of XYZProps (which may be .x or [0]) */
|
|
213937
214032
|
static x(xyz, defaultValue = 0) {
|
|
213938
214033
|
if (xyz === undefined)
|
|
213939
214034
|
return defaultValue;
|
|
@@ -213943,7 +214038,7 @@ class XYZ {
|
|
|
213943
214038
|
return xyz.x;
|
|
213944
214039
|
return defaultValue;
|
|
213945
214040
|
}
|
|
213946
|
-
/**
|
|
214041
|
+
/** Access x part of XYZProps (which may be .x or [0]) */
|
|
213947
214042
|
static y(xyz, defaultValue = 0) {
|
|
213948
214043
|
if (xyz === undefined)
|
|
213949
214044
|
return defaultValue;
|
|
@@ -213953,7 +214048,7 @@ class XYZ {
|
|
|
213953
214048
|
return xyz.y;
|
|
213954
214049
|
return defaultValue;
|
|
213955
214050
|
}
|
|
213956
|
-
/**
|
|
214051
|
+
/** Access x part of XYZProps (which may be .x or [0]) */
|
|
213957
214052
|
static z(xyz, defaultValue = 0) {
|
|
213958
214053
|
if (xyz === undefined)
|
|
213959
214054
|
return defaultValue;
|
|
@@ -213988,7 +214083,8 @@ class Point3d extends XYZ {
|
|
|
213988
214083
|
clone(result) {
|
|
213989
214084
|
return Point3d.create(this.x, this.y, this.z, result);
|
|
213990
214085
|
}
|
|
213991
|
-
/**
|
|
214086
|
+
/**
|
|
214087
|
+
* Create a new Point3d with given coordinates
|
|
213992
214088
|
* @param x x part
|
|
213993
214089
|
* @param y y part
|
|
213994
214090
|
* @param z z part
|
|
@@ -214061,8 +214157,8 @@ class Point3d extends XYZ {
|
|
|
214061
214157
|
static createZero(result) {
|
|
214062
214158
|
return Point3d.create(0, 0, 0, result);
|
|
214063
214159
|
}
|
|
214064
|
-
/**
|
|
214065
|
-
*
|
|
214160
|
+
/**
|
|
214161
|
+
* Return the cross product of the vectors from this to pointA and pointB
|
|
214066
214162
|
* * the result is a vector
|
|
214067
214163
|
* * the result is perpendicular to both vectors, with right hand orientation
|
|
214068
214164
|
* * the magnitude of the vector is twice the area of the triangle.
|
|
@@ -214070,21 +214166,20 @@ class Point3d extends XYZ {
|
|
|
214070
214166
|
crossProductToPoints(pointA, pointB, result) {
|
|
214071
214167
|
return Vector3d.createCrossProduct(pointA.x - this.x, pointA.y - this.y, pointA.z - this.z, pointB.x - this.x, pointB.y - this.y, pointB.z - this.z, result);
|
|
214072
214168
|
}
|
|
214073
|
-
/** Return the magnitude of the cross product of the vectors from this to pointA and pointB
|
|
214074
|
-
*/
|
|
214169
|
+
/** Return the magnitude of the cross product of the vectors from this to pointA and pointB */
|
|
214075
214170
|
crossProductToPointsMagnitude(pointA, pointB) {
|
|
214076
214171
|
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.crossProductMagnitude(pointA.x - this.x, pointA.y - this.y, pointA.z - this.z, pointB.x - this.x, pointB.y - this.y, pointB.z - this.z);
|
|
214077
214172
|
}
|
|
214078
|
-
/**
|
|
214079
|
-
*
|
|
214173
|
+
/**
|
|
214174
|
+
* Return the triple product of the vectors from this to pointA, pointB, pointC
|
|
214080
214175
|
* * This is a scalar (number)
|
|
214081
214176
|
* * This is 6 times the (signed) volume of the tetrahedron on the 4 points.
|
|
214082
214177
|
*/
|
|
214083
214178
|
tripleProductToPoints(pointA, pointB, pointC) {
|
|
214084
214179
|
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.tripleProduct(pointA.x - this.x, pointA.y - this.y, pointA.z - this.z, pointB.x - this.x, pointB.y - this.y, pointB.z - this.z, pointC.x - this.x, pointC.y - this.y, pointC.z - this.z);
|
|
214085
214180
|
}
|
|
214086
|
-
/**
|
|
214087
|
-
*
|
|
214181
|
+
/**
|
|
214182
|
+
* Return the cross product of the vectors from this to pointA and pointB
|
|
214088
214183
|
* * the result is a scalar
|
|
214089
214184
|
* * the magnitude of the vector is twice the signed area of the triangle.
|
|
214090
214185
|
* * this is positive for counter-clockwise order of the points, negative for clockwise.
|
|
@@ -214094,8 +214189,8 @@ class Point3d extends XYZ {
|
|
|
214094
214189
|
}
|
|
214095
214190
|
/**
|
|
214096
214191
|
* Return a point interpolated between `this` point and the `other` point.
|
|
214097
|
-
* *
|
|
214098
|
-
|
|
214192
|
+
* * Fraction specifies where the interpolated point is located on the line passing `this` and `other`.
|
|
214193
|
+
*/
|
|
214099
214194
|
interpolate(fraction, other, result) {
|
|
214100
214195
|
if (fraction <= 0.5)
|
|
214101
214196
|
return Point3d.create(this.x + fraction * (other.x - this.x), this.y + fraction * (other.y - this.y), this.z + fraction * (other.z - this.z), result);
|
|
@@ -214148,7 +214243,8 @@ class Point3d extends XYZ {
|
|
|
214148
214243
|
static createScale(source, scale, result) {
|
|
214149
214244
|
return Point3d.create(source.x * scale, source.y * scale, source.z * scale, result);
|
|
214150
214245
|
}
|
|
214151
|
-
/**
|
|
214246
|
+
/**
|
|
214247
|
+
* Create a point that is a linear combination (weighted sum) of 2 input points.
|
|
214152
214248
|
* @param pointA first input point
|
|
214153
214249
|
* @param scaleA scale factor for pointA
|
|
214154
214250
|
* @param pointB second input point
|
|
@@ -214186,7 +214282,8 @@ class Point3d extends XYZ {
|
|
|
214186
214282
|
return startPoint.dotVectorsToTargets(endPoint, this) / denominator;
|
|
214187
214283
|
}
|
|
214188
214284
|
}
|
|
214189
|
-
/**
|
|
214285
|
+
/**
|
|
214286
|
+
* 3D vector with `x`,`y`,`z` as properties
|
|
214190
214287
|
* @public
|
|
214191
214288
|
*/
|
|
214192
214289
|
class Vector3d extends XYZ {
|
|
@@ -214211,7 +214308,7 @@ class Vector3d extends XYZ {
|
|
|
214211
214308
|
return Vector3d.create(this.x, this.y, this.z, result);
|
|
214212
214309
|
}
|
|
214213
214310
|
/**
|
|
214214
|
-
*
|
|
214311
|
+
* Return a Vector3d (new or reused from optional result)
|
|
214215
214312
|
* @param x x component
|
|
214216
214313
|
* @param y y component
|
|
214217
214314
|
* @param z z component
|
|
@@ -214264,7 +214361,6 @@ class Vector3d extends XYZ {
|
|
|
214264
214361
|
}
|
|
214265
214362
|
/**
|
|
214266
214363
|
* Return the cross product of the vectors from origin to pointA and pointB.
|
|
214267
|
-
*
|
|
214268
214364
|
* * the result is a vector
|
|
214269
214365
|
* * the result is perpendicular to both vectors, with right hand orientation
|
|
214270
214366
|
* * the magnitude of the vector is twice the area of the triangle.
|
|
@@ -214441,7 +214537,8 @@ class Vector3d extends XYZ {
|
|
|
214441
214537
|
this.z *= a;
|
|
214442
214538
|
return true;
|
|
214443
214539
|
}
|
|
214444
|
-
/**
|
|
214540
|
+
/**
|
|
214541
|
+
* Create a normalized vector from the inputs.
|
|
214445
214542
|
* @param result optional result
|
|
214446
214543
|
* @returns undefined if and only if normalization fails
|
|
214447
214544
|
*/
|
|
@@ -214475,7 +214572,8 @@ class Vector3d extends XYZ {
|
|
|
214475
214572
|
return defaultFraction;
|
|
214476
214573
|
return numerator / denominator;
|
|
214477
214574
|
}
|
|
214478
|
-
/**
|
|
214575
|
+
/**
|
|
214576
|
+
* Return a new vector with components negated from the calling instance.
|
|
214479
214577
|
* @param result optional result vector.
|
|
214480
214578
|
*/
|
|
214481
214579
|
negate(result) {
|
|
@@ -214557,7 +214655,8 @@ class Vector3d extends XYZ {
|
|
|
214557
214655
|
const normal = this.crossProduct(target).normalize();
|
|
214558
214656
|
return normal ? normal.crossProduct(this, result) : undefined;
|
|
214559
214657
|
}
|
|
214560
|
-
/**
|
|
214658
|
+
/**
|
|
214659
|
+
* Rotate this vector 90 degrees around an axis vector.
|
|
214561
214660
|
* * Note that simple cross is in the plane perpendicular to axis -- it loses the part
|
|
214562
214661
|
* of "this" that is along the axis. The unit and scale is supposed to fix that.
|
|
214563
214662
|
* This matches with Rodrigues' rotation formula because cos(theta) = 0 and sin(theta) = 1
|
|
@@ -214646,8 +214745,10 @@ class Vector3d extends XYZ {
|
|
|
214646
214745
|
static createAdd2Scaled(vectorA, scaleA, vectorB, scaleB, result) {
|
|
214647
214746
|
return Vector3d.create(vectorA.x * scaleA + vectorB.x * scaleB, vectorA.y * scaleA + vectorB.y * scaleB, vectorA.z * scaleA + vectorB.z * scaleB, result);
|
|
214648
214747
|
}
|
|
214649
|
-
/**
|
|
214650
|
-
*
|
|
214748
|
+
/**
|
|
214749
|
+
* Return the (strongly typed Vector3d) `thisVector3d + vectorA * scalarA + vectorB * scalarB`
|
|
214750
|
+
* with all components presented as numbers
|
|
214751
|
+
*/
|
|
214651
214752
|
static createAdd2ScaledXYZ(ax, ay, az, scaleA, bx, by, bz, scaleB, result) {
|
|
214652
214753
|
return Vector3d.create(ax * scaleA + bx * scaleB, ay * scaleA + by * scaleB, az * scaleA + bz * scaleB, result);
|
|
214653
214754
|
}
|
|
@@ -214674,7 +214775,8 @@ class Vector3d extends XYZ {
|
|
|
214674
214775
|
return undefined;
|
|
214675
214776
|
return this.scale(length / mag, result);
|
|
214676
214777
|
}
|
|
214677
|
-
/**
|
|
214778
|
+
/**
|
|
214779
|
+
* Compute the cross product of this vector with `vectorB`. Immediately pass it to `normalize`.
|
|
214678
214780
|
* @param vectorB second vector for cross product.
|
|
214679
214781
|
* @returns see `Vector3d` method `normalize()` for error condition.
|
|
214680
214782
|
*/
|
|
@@ -214761,7 +214863,8 @@ class Vector3d extends XYZ {
|
|
|
214761
214863
|
crossProductMagnitude(vectorB) {
|
|
214762
214864
|
return Math.sqrt(this.crossProductMagnitudeSquared(vectorB));
|
|
214763
214865
|
}
|
|
214764
|
-
/**
|
|
214866
|
+
/**
|
|
214867
|
+
* Return the dot product of this vector with vectorB.
|
|
214765
214868
|
* @param vectorB second vector of cross product
|
|
214766
214869
|
* @returns the dot product of this instance with vectorB
|
|
214767
214870
|
*/
|
|
@@ -214817,7 +214920,8 @@ class Vector3d extends XYZ {
|
|
|
214817
214920
|
return this.x * (pointB.x - pointA.x)
|
|
214818
214921
|
+ this.y * (pointB.y - pointA.y);
|
|
214819
214922
|
}
|
|
214820
|
-
/**
|
|
214923
|
+
/**
|
|
214924
|
+
* Dot product with vector from pointA to pointB, with pointB given as (weighted) wx,wy,wz,w
|
|
214821
214925
|
* * We need to unweight pointB (which is a homogeneous point) to be able to participate in the
|
|
214822
214926
|
* vector dot product
|
|
214823
214927
|
* * if the weight is near zero metric, the return is zero.
|
|
@@ -214861,7 +214965,7 @@ class Vector3d extends XYZ {
|
|
|
214861
214965
|
return Vector3d.createCrossProduct(this.x, this.y, this.z, vectorB.x, vectorB.y, vectorB.z, result);
|
|
214862
214966
|
}
|
|
214863
214967
|
/**
|
|
214864
|
-
*
|
|
214968
|
+
* Return cross product of `this` with the vector `(x, y, z)`
|
|
214865
214969
|
* @param x x component of second vector
|
|
214866
214970
|
* @param y y component of second vector
|
|
214867
214971
|
* @param z z component of second vector
|
|
@@ -214871,12 +214975,12 @@ class Vector3d extends XYZ {
|
|
|
214871
214975
|
return Vector3d.createCrossProduct(this.x, this.y, this.z, x, y, z, result);
|
|
214872
214976
|
}
|
|
214873
214977
|
/**
|
|
214874
|
-
|
|
214875
|
-
|
|
214876
|
-
|
|
214877
|
-
|
|
214878
|
-
|
|
214879
|
-
|
|
214978
|
+
* Return the angle in radians (not as strongly typed Angle) from this vector to vectorB.
|
|
214979
|
+
* * The returned angle is between 0 and `Math.PI`.
|
|
214980
|
+
* * The returned angle is measured in the plane containing the two vectors.
|
|
214981
|
+
* * Use `planarRadiansTo` and `signedRadiansTo` to return an angle measured in a specific plane.
|
|
214982
|
+
* @param vectorB target vector.
|
|
214983
|
+
*/
|
|
214880
214984
|
radiansTo(vectorB) {
|
|
214881
214985
|
// ||axb|| = ||a|| ||b|| |sin(t)| and a.b = ||a|| ||b|| cos(t) ==>
|
|
214882
214986
|
// ||axb|| / a.b = sin(t)/cos(t) = tan(t) ==> t = arctan(||axb|| / a.b).
|
|
@@ -214912,16 +215016,16 @@ class Vector3d extends XYZ {
|
|
|
214912
215016
|
return _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createAtan2(this.crossProductXY(vectorB), this.dotProductXY(vectorB));
|
|
214913
215017
|
}
|
|
214914
215018
|
/**
|
|
214915
|
-
|
|
214916
|
-
|
|
214917
|
-
|
|
214918
|
-
|
|
214919
|
-
|
|
214920
|
-
|
|
214921
|
-
|
|
214922
|
-
|
|
214923
|
-
|
|
214924
|
-
|
|
215019
|
+
* Return the angle in radians (not as strongly-typed Angle) from this vector to vectorB, measured
|
|
215020
|
+
* in their containing plane whose normal lies in the same half-space as vectorW.
|
|
215021
|
+
* * The returned angle is between `-Math.PI` and `Math.PI`.
|
|
215022
|
+
* * If the cross product of this vector and vectorB lies on the same side of the plane as vectorW,
|
|
215023
|
+
* this function returns `radiansTo(vectorB)`; otherwise, it returns `-radiansTo(vectorB)`.
|
|
215024
|
+
* * `vectorW` does not have to be perpendicular to the plane.
|
|
215025
|
+
* * Use `planarRadiansTo` to measure the angle between vectors that are projected to another plane.
|
|
215026
|
+
* @param vectorB target vector.
|
|
215027
|
+
* @param vectorW determines the side of the plane in which the returned angle is measured
|
|
215028
|
+
*/
|
|
214925
215029
|
signedRadiansTo(vectorB, vectorW) {
|
|
214926
215030
|
const p = this.crossProduct(vectorB);
|
|
214927
215031
|
const theta = Math.atan2(p.magnitude(), this.dotProduct(vectorB));
|
|
@@ -214930,7 +215034,8 @@ class Vector3d extends XYZ {
|
|
|
214930
215034
|
else
|
|
214931
215035
|
return theta;
|
|
214932
215036
|
}
|
|
214933
|
-
/**
|
|
215037
|
+
/**
|
|
215038
|
+
* Return the (strongly-typed) angle from this vector to vectorB, measured
|
|
214934
215039
|
* in their containing plane whose normal lies in the same half-space as vectorW.
|
|
214935
215040
|
* * The returned angle is between -180 and 180 degrees.
|
|
214936
215041
|
* * If the cross product of this vector and vectorB lies on the same side of the plane as vectorW,
|
|
@@ -214973,15 +215078,19 @@ class Vector3d extends XYZ {
|
|
|
214973
215078
|
planarAngleTo(vectorB, planeNormal) {
|
|
214974
215079
|
return _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(this.planarRadiansTo(vectorB, planeNormal));
|
|
214975
215080
|
}
|
|
214976
|
-
/**
|
|
214977
|
-
|
|
215081
|
+
/**
|
|
215082
|
+
* Return the smallest angle (in radians) from the (bidirectional) line containing `this`
|
|
215083
|
+
* to the (bidirectional) line containing `vectorB`
|
|
215084
|
+
*/
|
|
214978
215085
|
smallerUnorientedRadiansTo(vectorB) {
|
|
214979
215086
|
const c = this.dotProduct(vectorB);
|
|
214980
215087
|
const s = this.crossProductMagnitude(vectorB);
|
|
214981
215088
|
return Math.atan2(Math.abs(s), Math.abs(c));
|
|
214982
215089
|
}
|
|
214983
|
-
/**
|
|
214984
|
-
*
|
|
215090
|
+
/**
|
|
215091
|
+
* Return the smallest (strongly typed) angle from the (bidirectional) line containing `this`
|
|
215092
|
+
* to the (bidirectional) line containing `vectorB`
|
|
215093
|
+
*/
|
|
214985
215094
|
smallerUnorientedAngleTo(vectorB) {
|
|
214986
215095
|
return _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(this.smallerUnorientedRadiansTo(vectorB));
|
|
214987
215096
|
}
|
|
@@ -220882,7 +220991,7 @@ class Transform {
|
|
|
220882
220991
|
}
|
|
220883
220992
|
/**
|
|
220884
220993
|
* Return a modified copy of `this` Transform so that its `matrix` part is rigid (`origin` part is untouched).
|
|
220885
|
-
* *
|
|
220994
|
+
* * @see [[Matrix3d.axisOrderCrossProductsInPlace]] documentation for details of how the matrix is modified to rigid.
|
|
220886
220995
|
*/
|
|
220887
220996
|
cloneRigid(axisOrder = _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.XYZ) {
|
|
220888
220997
|
const modifiedMatrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidFromMatrix3d(this.matrix, axisOrder);
|
|
@@ -220890,7 +220999,7 @@ class Transform {
|
|
|
220890
220999
|
return undefined;
|
|
220891
221000
|
return new Transform(this.origin.cloneAsPoint3d(), modifiedMatrix);
|
|
220892
221001
|
}
|
|
220893
|
-
/** Create a Transform with the given `origin` and `matrix`. */
|
|
221002
|
+
/** Create a Transform with the given `origin` and `matrix`. Inputs are captured, not cloned. */
|
|
220894
221003
|
static createRefs(origin, matrix, result) {
|
|
220895
221004
|
if (!origin)
|
|
220896
221005
|
origin = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero();
|
|
@@ -220901,7 +221010,7 @@ class Transform {
|
|
|
220901
221010
|
}
|
|
220902
221011
|
return new Transform(origin, matrix);
|
|
220903
221012
|
}
|
|
220904
|
-
/** Create a Transform with complete contents given */
|
|
221013
|
+
/** Create a Transform with complete contents given. `q` inputs make the matrix and `a` inputs make the origin */
|
|
220905
221014
|
static createRowValues(qxx, qxy, qxz, ax, qyx, qyy, qyz, ay, qzx, qzy, qzz, az, result) {
|
|
220906
221015
|
if (result) {
|
|
220907
221016
|
result._origin.set(ax, ay, az);
|
|
@@ -220916,6 +221025,8 @@ class Transform {
|
|
|
220916
221025
|
}
|
|
220917
221026
|
/**
|
|
220918
221027
|
* Create a Transform with translation provided by x,y,z parts.
|
|
221028
|
+
* * Translation Transform maps any vector `v` to `v + p` where `p = (x,y,z)`
|
|
221029
|
+
* * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/MoveCube
|
|
220919
221030
|
* @param x x part of translation
|
|
220920
221031
|
* @param y y part of translation
|
|
220921
221032
|
* @param z z part of translation
|
|
@@ -220927,6 +221038,8 @@ class Transform {
|
|
|
220927
221038
|
}
|
|
220928
221039
|
/**
|
|
220929
221040
|
* Create a Transform with specified `translation` part.
|
|
221041
|
+
* * Translation Transform maps any vector `v` to `v + translation`
|
|
221042
|
+
* * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/MoveCube
|
|
220930
221043
|
* @param translation x,y,z parts of the translation
|
|
220931
221044
|
* @param result optional pre-allocated Transform
|
|
220932
221045
|
* @returns new or updated transform
|
|
@@ -220973,6 +221086,7 @@ class Transform {
|
|
|
220973
221086
|
* local-to-world mapping.
|
|
220974
221087
|
* * This function is a closely related to `createFixedPointAndMatrix` whose point input is the fixed point
|
|
220975
221088
|
* of the world-to-world transformation.
|
|
221089
|
+
* * If origin is `undefined`, (0,0,0) is used. If matrix is `undefined` the identity matrix is used.
|
|
220976
221090
|
*/
|
|
220977
221091
|
static createOriginAndMatrix(origin, matrix, result) {
|
|
220978
221092
|
if (result) {
|
|
@@ -220998,7 +221112,7 @@ class Transform {
|
|
|
220998
221112
|
}
|
|
220999
221113
|
/**
|
|
221000
221114
|
* Create a Transform such that its `matrix` part is rigid.
|
|
221001
|
-
*
|
|
221115
|
+
* @see [[Matrix3d.createRigidFromColumns]] for details of how the matrix is created to be rigid.
|
|
221002
221116
|
*/
|
|
221003
221117
|
static createRigidFromOriginAndColumns(origin, vectorX, vectorY, axisOrder, result) {
|
|
221004
221118
|
const matrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidFromColumns(vectorX, vectorY, axisOrder, result ? result._matrix : undefined);
|
|
@@ -221010,10 +221124,10 @@ class Transform {
|
|
|
221010
221124
|
return result;
|
|
221011
221125
|
}
|
|
221012
221126
|
/**
|
|
221013
|
-
* We don't want to pass "origin" to createRefs because createRefs does not clone "origin"
|
|
221014
|
-
*
|
|
221015
|
-
*
|
|
221016
|
-
*
|
|
221127
|
+
* We don't want to pass "origin" to createRefs because createRefs does not clone "origin". That means if "origin"
|
|
221128
|
+
* is changed via Transform at any point, the initial "origin" passed by the user is also changed. To avoid that,
|
|
221129
|
+
* we pass "undefined" to createRefs so that it allocates a new point which then we set it to the "origin" which
|
|
221130
|
+
* is passed by user in the next line.
|
|
221017
221131
|
*/
|
|
221018
221132
|
result = Transform.createRefs(undefined, matrix);
|
|
221019
221133
|
result._origin.setFromPoint3d(origin);
|
|
@@ -221036,18 +221150,19 @@ class Transform {
|
|
|
221036
221150
|
return Transform.createRefs(undefined, matrix.clone());
|
|
221037
221151
|
}
|
|
221038
221152
|
/**
|
|
221039
|
-
* Create a transform with the specified `matrix` and points `a` and `b`. The returned Transform
|
|
221040
|
-
* point `p` to `M*(p-a) + b` (i.e., `Tp = M*(p-a) + b`) so
|
|
221153
|
+
* Create a transform with the specified `matrix` and points `a` and `b`. The returned Transform maps
|
|
221154
|
+
* point `p` to `M*(p-a) + b` (i.e., `Tp = M*(p-a) + b`), so maps `a` to 'b'.
|
|
221041
221155
|
*/
|
|
221042
221156
|
static createMatrixPickupPutdown(matrix, a, b, result) {
|
|
221043
|
-
// we define the origin o = b - M*a so Tp = M*p + o = M*p + (b - M*a) = M*(
|
|
221157
|
+
// we define the origin o = b - M*a so Tp = M*p + o = M*p + (b - M*a) = M*(p-a) + b
|
|
221044
221158
|
const origin = _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.xyzMinusMatrixTimesXYZ(b, matrix, a);
|
|
221045
221159
|
return Transform.createRefs(origin, matrix.clone(), result);
|
|
221046
221160
|
}
|
|
221047
221161
|
/**
|
|
221048
221162
|
* Create a Transform which leaves the fixedPoint unchanged and scales everything else around it by
|
|
221049
|
-
* a single scale factor. The returned Transform
|
|
221163
|
+
* a single scale factor. The returned Transform maps a point `p` to `M*p + (f - M*f)`
|
|
221050
221164
|
* where `f` is the fixedPoint and M is the scale matrix (i.e., `Tp = M*(p-f) + f`).
|
|
221165
|
+
* * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/ScaleCube
|
|
221051
221166
|
*/
|
|
221052
221167
|
static createScaleAboutPoint(fixedPoint, scale, result) {
|
|
221053
221168
|
const matrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createScale(scale, scale, scale);
|
|
@@ -221089,8 +221204,7 @@ class Transform {
|
|
|
221089
221204
|
return _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.xyzPlusMatrixTimesCoordinates(this._origin, this._matrix, x, y, z, result);
|
|
221090
221205
|
}
|
|
221091
221206
|
/**
|
|
221092
|
-
* Multiply a specific row (component) of the
|
|
221093
|
-
* at the same row. Return the result.
|
|
221207
|
+
* Multiply a specific row (component) of the 3x4 instance times (x,y,z,1). Return the result.
|
|
221094
221208
|
*/
|
|
221095
221209
|
multiplyComponentXYZ(componentIndex, x, y, z = 0) {
|
|
221096
221210
|
const coffs = this._matrix.coffs;
|
|
@@ -221098,8 +221212,7 @@ class Transform {
|
|
|
221098
221212
|
return this.origin.at(componentIndex) + (coffs[idx] * x) + (coffs[idx + 1] * y) + (coffs[idx + 2] * z);
|
|
221099
221213
|
}
|
|
221100
221214
|
/**
|
|
221101
|
-
* Multiply a specific row (component) of the
|
|
221102
|
-
* at the same row times w. Return the result.
|
|
221215
|
+
* Multiply a specific row (component) of the 3x4 instance times (x,y,z,w). Return the result.
|
|
221103
221216
|
*/
|
|
221104
221217
|
multiplyComponentXYZW(componentIndex, x, y, z, w) {
|
|
221105
221218
|
const coffs = this._matrix.coffs;
|
|
@@ -221107,31 +221220,38 @@ class Transform {
|
|
|
221107
221220
|
return (this.origin.at(componentIndex) * w) + (coffs[idx] * x) + (coffs[idx + 1] * y) + (coffs[idx + 2] * z);
|
|
221108
221221
|
}
|
|
221109
221222
|
/**
|
|
221110
|
-
*
|
|
221111
|
-
*
|
|
221223
|
+
* Transform the homogeneous point. Return as a new `Point4d`, or in the pre-allocated result (if result is given).
|
|
221224
|
+
* * If `p = (x,y,z)` then this method computes `Tp = M*p + o*w` and returns the `Point4d` formed by `Tp` in the
|
|
221225
|
+
* first three coordinates, and `w` in the fourth.
|
|
221226
|
+
* * Logically, this is multiplication by the 4x4 matrix formed from the 3x4 instance augmented with fourth row 0001.
|
|
221112
221227
|
*/
|
|
221113
221228
|
multiplyXYZW(x, y, z, w, result) {
|
|
221114
221229
|
return _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.xyzPlusMatrixTimesWeightedCoordinates(this._origin, this._matrix, x, y, z, w, result);
|
|
221115
221230
|
}
|
|
221116
221231
|
/**
|
|
221117
|
-
*
|
|
221118
|
-
*
|
|
221119
|
-
* (
|
|
221232
|
+
* Transform the homogeneous point. Return as new `Float64Array` with size 4, or in the pre-allocated result (if
|
|
221233
|
+
* result is given).
|
|
221234
|
+
* * If `p = (x,y,z)` then this method computes `Tp = M*p + o*w` and returns the `Float64Array` formed by `Tp`
|
|
221235
|
+
* in the first 3 numbers of the array and `w` as the fourth.
|
|
221236
|
+
* * Logically, this is multiplication by the 4x4 matrix formed from the 3x4 instance augmented with fourth row 0001.
|
|
221120
221237
|
*/
|
|
221121
221238
|
multiplyXYZWToFloat64Array(x, y, z, w, result) {
|
|
221122
221239
|
return _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.xyzPlusMatrixTimesWeightedCoordinatesToFloat64Array(this._origin, this._matrix, x, y, z, w, result);
|
|
221123
221240
|
}
|
|
221124
221241
|
/**
|
|
221125
|
-
*
|
|
221126
|
-
*
|
|
221242
|
+
* * Transform the point. Return as new `Float64Array` with size 3, or in the pre-allocated result (if result is given).
|
|
221243
|
+
* * If `p = (x,y,z)` then this method computes `Tp = M*p + o` and returns it as the first 3 elements of the array.
|
|
221127
221244
|
*/
|
|
221128
221245
|
multiplyXYZToFloat64Array(x, y, z, result) {
|
|
221129
221246
|
return _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.xyzPlusMatrixTimesCoordinatesToFloat64Array(this._origin, this._matrix, x, y, z, result);
|
|
221130
221247
|
}
|
|
221131
221248
|
/**
|
|
221132
|
-
*
|
|
221133
|
-
*
|
|
221134
|
-
*
|
|
221249
|
+
* Multiply the homogeneous point by the transpose of `this` Transform. Return as a new `Point4d` or in the
|
|
221250
|
+
* pre-allocated result (if result is given).
|
|
221251
|
+
* * If `p = (x,y,z)` then this method computes `M^t*p` and returns it in the first three coordinates of the `Point4d`,
|
|
221252
|
+
* and `o*p + w` in the fourth.
|
|
221253
|
+
* * Logically, this is multiplication by the transpose of the 4x4 matrix formed from the 3x4 instance augmented with
|
|
221254
|
+
* fourth row 0001.
|
|
221135
221255
|
*/
|
|
221136
221256
|
multiplyTransposeXYZW(x, y, z, w, result) {
|
|
221137
221257
|
const coffs = this._matrix.coffs;
|
|
@@ -221150,9 +221270,9 @@ class Transform {
|
|
|
221150
221270
|
this.multiplyPoint3dArrayInPlace(chain);
|
|
221151
221271
|
}
|
|
221152
221272
|
/**
|
|
221153
|
-
*
|
|
221154
|
-
* `p = MInverse
|
|
221155
|
-
*
|
|
221273
|
+
* Multiply the point by the inverse Transform.
|
|
221274
|
+
* * If for a point `p` we have `Tp = M*p + o = q`, then `p = MInverse*(q - o) = TInverse q` so `TInverse`
|
|
221275
|
+
* Transform has matrix part `MInverse` and origin part `-MInverse*o`.
|
|
221156
221276
|
* * Return as a new point or in the optional `result`.
|
|
221157
221277
|
* * Returns `undefined` if the `matrix` part if this Transform is singular.
|
|
221158
221278
|
*/
|
|
@@ -221160,9 +221280,13 @@ class Transform {
|
|
|
221160
221280
|
return this._matrix.multiplyInverseXYZAsPoint3d(point.x - this._origin.x, point.y - this._origin.y, point.z - this._origin.z, result);
|
|
221161
221281
|
}
|
|
221162
221282
|
/**
|
|
221163
|
-
*
|
|
221164
|
-
* `p =
|
|
221165
|
-
*
|
|
221283
|
+
* Multiply the homogenous point by the inverse Transform.
|
|
221284
|
+
* * If for a point `p` we have `Tp = M*p + o = q`, then `p = MInverse*(q - o) = TInverse q` so `TInverse` Transform
|
|
221285
|
+
* has matrix part `MInverse` and origin part `-MInverse*o`.
|
|
221286
|
+
* * This method computes `TInverse p = MInverse*p - w*MInverse*o` and returns the `Point4d` formed by `TInverse*p`
|
|
221287
|
+
* in the first three coordinates, and `w` in the fourth.
|
|
221288
|
+
* * Logically, this is multiplication by the inverse of the 4x4 matrix formed from the 3x4 instance augmented with
|
|
221289
|
+
* fourth row 0001. This is equivalent to the 4x4 matrix formed in similar fashion from the inverse of this instance.
|
|
221166
221290
|
* * Return as a new point or in the optional `result`.
|
|
221167
221291
|
* * Returns `undefined` if the `matrix` part if this Transform is singular.
|
|
221168
221292
|
*/
|
|
@@ -221171,9 +221295,9 @@ class Transform {
|
|
|
221171
221295
|
return this._matrix.multiplyInverseXYZW(weightedPoint.x - w * this.origin.x, weightedPoint.y - w * this.origin.y, weightedPoint.z - w * this.origin.z, w, result);
|
|
221172
221296
|
}
|
|
221173
221297
|
/**
|
|
221174
|
-
*
|
|
221175
|
-
* `p = MInverse
|
|
221176
|
-
*
|
|
221298
|
+
* Multiply the point by the inverse Transform.
|
|
221299
|
+
* * If for a point `p` we have `Tp = M*p + o = q`, then `p = MInverse*(q - o) = TInverse q` so `TInverse` Transform
|
|
221300
|
+
* has matrix part `MInverse` and origin part `-MInverse*o`.
|
|
221177
221301
|
* * Return as a new point or in the optional `result`.
|
|
221178
221302
|
* * Returns `undefined` if the `matrix` part if this Transform is singular.
|
|
221179
221303
|
*/
|
|
@@ -221212,35 +221336,35 @@ class Transform {
|
|
|
221212
221336
|
return numSource;
|
|
221213
221337
|
}
|
|
221214
221338
|
/**
|
|
221215
|
-
*
|
|
221216
|
-
*
|
|
221217
|
-
*
|
|
221218
|
-
* * If `
|
|
221219
|
-
* * If `
|
|
221339
|
+
* Multiply each point in the array by the inverse of `this` Transform.
|
|
221340
|
+
* * For a transform `T = [M o]` the inverse transform `T' = [M' -M'o]` exists if and only if `M` has an inverse
|
|
221341
|
+
* `M'`. Indeed, for any point `p`, we have `T'Tp = T'(Mp + o) = M'(Mp + o) - M'o = M'Mp + M'o - M'o = p.`
|
|
221342
|
+
* * If `result` is given, resize it to match the input `points` array and update it with original points `p[]`.
|
|
221343
|
+
* * If `result` is not given, return a new array.
|
|
221220
221344
|
* * Returns `undefined` if the `matrix` part if this Transform is singular.
|
|
221221
221345
|
*/
|
|
221222
|
-
multiplyInversePoint3dArray(points,
|
|
221346
|
+
multiplyInversePoint3dArray(points, result) {
|
|
221223
221347
|
if (!this._matrix.computeCachedInverse(true))
|
|
221224
221348
|
return undefined;
|
|
221225
221349
|
const originX = this.origin.x;
|
|
221226
221350
|
const originY = this.origin.y;
|
|
221227
221351
|
const originZ = this.origin.z;
|
|
221228
|
-
if (
|
|
221229
|
-
const n = Transform.matchArrayLengths(points,
|
|
221352
|
+
if (result) {
|
|
221353
|
+
const n = Transform.matchArrayLengths(points, result, _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero);
|
|
221230
221354
|
for (let i = 0; i < n; i++)
|
|
221231
|
-
this._matrix.multiplyInverseXYZAsPoint3d(points[i].x - originX, points[i].y - originY, points[i].z - originZ,
|
|
221355
|
+
this._matrix.multiplyInverseXYZAsPoint3d(points[i].x - originX, points[i].y - originY, points[i].z - originZ, result[i]);
|
|
221356
|
+
return result;
|
|
221232
221357
|
}
|
|
221233
|
-
|
|
221358
|
+
result = [];
|
|
221234
221359
|
for (const point of points)
|
|
221235
|
-
|
|
221236
|
-
return
|
|
221360
|
+
result.push(this._matrix.multiplyInverseXYZAsPoint3d(point.x - originX, point.y - originY, point.z - originZ));
|
|
221361
|
+
return result;
|
|
221237
221362
|
}
|
|
221238
221363
|
/**
|
|
221239
|
-
*
|
|
221240
|
-
*
|
|
221241
|
-
*
|
|
221242
|
-
*
|
|
221243
|
-
* * Returns `true` if the `matrix` part if this Transform is invertible and `false if singular.
|
|
221364
|
+
* Multiply each point in the array by the inverse of `this` Transform in place.
|
|
221365
|
+
* * For a transform `T = [M o]` the inverse transform `T' = [M' -M'o]` exists if and only if `M` has an inverse
|
|
221366
|
+
* `M'`. Indeed, for any point `p`, we have `T'Tp = T'(Mp + o) = M'(Mp + o) - M'o = M'Mp + M'o - M'o = p.`
|
|
221367
|
+
* * Returns `true` if the `matrix` part if this Transform is invertible and `false` if singular.
|
|
221244
221368
|
*/
|
|
221245
221369
|
multiplyInversePoint3dArrayInPlace(points) {
|
|
221246
221370
|
if (!this._matrix.computeCachedInverse(true))
|
|
@@ -221309,7 +221433,8 @@ class Transform {
|
|
|
221309
221433
|
/**
|
|
221310
221434
|
* Calculate `transformA * transformB` and store it into the calling instance (`this`).
|
|
221311
221435
|
* * **Note:** If `transformA = [A a]` and `transformB = [B b]` then `transformA * transformB` is defined as
|
|
221312
|
-
* `[A*B Ab+a]`.
|
|
221436
|
+
* `[A*B Ab+a]`.
|
|
221437
|
+
* * @see [[multiplyTransformTransform]] documentation for math details.
|
|
221313
221438
|
* @param transformA first operand
|
|
221314
221439
|
* @param transformB second operand
|
|
221315
221440
|
*/
|
|
@@ -221319,19 +221444,17 @@ class Transform {
|
|
|
221319
221444
|
}
|
|
221320
221445
|
/**
|
|
221321
221446
|
* Multiply `this` Transform times `other` Transform.
|
|
221322
|
-
* **Note:** If `this = [A a]` and `other = [B b]` then `this * other` is defined as [A*B Ab+a]
|
|
221323
|
-
* That's because we create a 4x4 matrix for each Transform with the 3x3 `matrix` and `origin`
|
|
221324
|
-
* as upper 3x4 part of a 4x4 matrix and 0001 as the final row. Then we multiply those two 4x4 matrixes:
|
|
221447
|
+
* * **Note:** If `this = [A a]` and `other = [B b]` then `this * other` is defined as [A*B Ab+a] because:
|
|
221325
221448
|
* ```
|
|
221326
221449
|
* equation
|
|
221327
221450
|
* \begin{matrix}
|
|
221328
|
-
* \text{
|
|
221329
|
-
* \text{
|
|
221451
|
+
* \text{this Transform with matrix part }\bold{A}\text{ and origin part }\bold{a} & \blockTransform{A}{a}\\
|
|
221452
|
+
* \text{other Transform with matrix part }\bold{B}\text{ and origin part }\bold{b} & \blockTransform{B}{b} \\
|
|
221330
221453
|
* \text{product}& \blockTransform{A}{a}\blockTransform{B}{b}=\blockTransform{AB}{Ab + a}
|
|
221331
221454
|
* \end{matrix}
|
|
221332
221455
|
* ```
|
|
221333
221456
|
* @param other the 'other` Transform to be multiplied to `this` Transform.
|
|
221334
|
-
* @param result optional preallocated result to reuse.
|
|
221457
|
+
* @param result optional preallocated `result` to reuse.
|
|
221335
221458
|
*/
|
|
221336
221459
|
multiplyTransformTransform(other, result) {
|
|
221337
221460
|
if (!result)
|
|
@@ -221341,20 +221464,17 @@ class Transform {
|
|
|
221341
221464
|
}
|
|
221342
221465
|
/**
|
|
221343
221466
|
* Multiply `this` Transform times `other` Matrix3d (considered to be a Transform with 0 `origin`).
|
|
221344
|
-
* **Note:** If `this = [A a]`, then
|
|
221345
|
-
* Then `this * other` is defined as [A*B a]. That's because we create a 4x4 matrix for each Transform
|
|
221346
|
-
* with the 3x3 `matrix` and `origin` as upper 3x4 part of a 4x4 matrix and 0001 as the final row. Then we
|
|
221347
|
-
* multiply those two 4x4 matrixes:
|
|
221467
|
+
* * **Note:** If `this = [A a]` and `other = [B 0]`, then `this * other` is defined as [A*B a] because:
|
|
221348
221468
|
* ```
|
|
221349
221469
|
* equation
|
|
221350
221470
|
* \begin{matrix}
|
|
221351
|
-
* \text{
|
|
221352
|
-
* \text{
|
|
221471
|
+
* \text{this Transform with matrix part }\bold{A}\text{ and origin part }\bold{a} & \blockTransform{A}{a}\\
|
|
221472
|
+
* \text{other matrix }\bold{B}\text{ promoted to block Transform} & \blockTransform{B}{0} \\
|
|
221353
221473
|
* \text{product}& \blockTransform{A}{a}\blockTransform{B}{0}=\blockTransform{AB}{a}
|
|
221354
221474
|
* \end{matrix}
|
|
221355
221475
|
* ```
|
|
221356
221476
|
* @param other the `other` Matrix3d to be multiplied to `this` Transform.
|
|
221357
|
-
* @param result optional preallocated result to reuse.
|
|
221477
|
+
* @param result optional preallocated `result` to reuse.
|
|
221358
221478
|
*/
|
|
221359
221479
|
multiplyTransformMatrix3d(other, result) {
|
|
221360
221480
|
if (!result)
|
|
@@ -221364,13 +221484,13 @@ class Transform {
|
|
|
221364
221484
|
return result;
|
|
221365
221485
|
}
|
|
221366
221486
|
/**
|
|
221367
|
-
* Return the
|
|
221487
|
+
* Return the range of the transformed corners.
|
|
221368
221488
|
* * The 8 corners are transformed individually.
|
|
221369
221489
|
* * **Note:** Suppose you have a geometry, a range box around that geometry, and your Transform is a rotation.
|
|
221370
221490
|
* If you rotate the range box and recompute a new range box around the rotated range box, then the new range
|
|
221371
221491
|
* box will have a larger volume than the original range box. However, if you rotate the geometry itself and
|
|
221372
221492
|
* then recompute the range box, it will be a tighter range box around the rotated geometry. `multiplyRange`
|
|
221373
|
-
* function creates the larger range box because it only has access to the range box and the geometry itself.
|
|
221493
|
+
* function creates the larger range box because it only has access to the range box and not the geometry itself.
|
|
221374
221494
|
*/
|
|
221375
221495
|
multiplyRange(range, result) {
|
|
221376
221496
|
if (range.isNull)
|
|
@@ -221394,7 +221514,7 @@ class Transform {
|
|
|
221394
221514
|
}
|
|
221395
221515
|
/**
|
|
221396
221516
|
* Return a Transform which is the inverse of `this` Transform.
|
|
221397
|
-
* * If `transform = [M o]` then `transformInverse = [MInverse MInverse
|
|
221517
|
+
* * If `transform = [M o]` then `transformInverse = [MInverse -MInverse*o]`
|
|
221398
221518
|
* * Return `undefined` if this Transform's matrix is singular.
|
|
221399
221519
|
*/
|
|
221400
221520
|
inverse(result) {
|
|
@@ -221409,14 +221529,14 @@ class Transform {
|
|
|
221409
221529
|
return Transform.createRefs(matrixInverse.multiplyXYZ(-this._origin.x, -this._origin.y, -this._origin.z), matrixInverse);
|
|
221410
221530
|
}
|
|
221411
221531
|
/**
|
|
221412
|
-
* Initialize 2 Transforms
|
|
221413
|
-
*
|
|
221414
|
-
* @param min the min corner of the box
|
|
221415
|
-
* @param max the max corner of the box
|
|
221416
|
-
* @param npcToGlobal maps
|
|
221417
|
-
*
|
|
221418
|
-
* @param globalToNpc maps
|
|
221419
|
-
*
|
|
221532
|
+
* Initialize 2 Transforms that map between the unit box (specified by 000 and 111) and the range box specified
|
|
221533
|
+
* by the input points.
|
|
221534
|
+
* @param min the min corner of the range box
|
|
221535
|
+
* @param max the max corner of the range box
|
|
221536
|
+
* @param npcToGlobal maps NPC coordinates into range box coordinates. Specifically, maps 000 to `min` and maps
|
|
221537
|
+
* 111 to `max`. This Transform is the inverse of `globalToNpc`. Object created by caller, re-initialized here.
|
|
221538
|
+
* @param globalToNpc maps range box coordinates into NPC coordinates. Specifically, maps `min` to 000 and maps
|
|
221539
|
+
* `max` to 111. This Transform is the inverse of `npcToGlobal`. Object created by caller, re-initialized here.
|
|
221420
221540
|
* * NPC stands for `Normalized Projection Coordinate`
|
|
221421
221541
|
*/
|
|
221422
221542
|
static initFromRange(min, max, npcToGlobal, globalToNpc) {
|
|
@@ -221669,11 +221789,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
221669
221789
|
*/
|
|
221670
221790
|
class YawPitchRollAngles {
|
|
221671
221791
|
/**
|
|
221672
|
-
*
|
|
221792
|
+
* Constructor
|
|
221673
221793
|
* @param yaw counterclockwise rotation angle around z
|
|
221674
221794
|
* @param pitch **clockwise** rotation angle around y
|
|
221675
221795
|
* @param roll counterclockwise rotation angle around x
|
|
221676
|
-
|
|
221796
|
+
*/
|
|
221677
221797
|
constructor(yaw = _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.zero(), pitch = _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.zero(), roll = _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.zero()) {
|
|
221678
221798
|
this.yaw = yaw;
|
|
221679
221799
|
this.pitch = pitch;
|
|
@@ -221687,29 +221807,29 @@ class YawPitchRollAngles {
|
|
|
221687
221807
|
return Object.freeze(this);
|
|
221688
221808
|
}
|
|
221689
221809
|
/**
|
|
221690
|
-
*
|
|
221810
|
+
* Constructor for YawPitchRollAngles with angles in degrees.
|
|
221691
221811
|
* @param yawDegrees counterclockwise rotation angle (in degrees) around z
|
|
221692
221812
|
* @param pitchDegrees **clockwise** rotation angle (in degrees) around y
|
|
221693
221813
|
* @param rollDegrees counterclockwise rotation angle (in degrees) around x
|
|
221694
|
-
|
|
221814
|
+
*/
|
|
221695
221815
|
static createDegrees(yawDegrees, pitchDegrees, rollDegrees) {
|
|
221696
221816
|
return new YawPitchRollAngles(_Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.createDegrees(yawDegrees), _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.createDegrees(pitchDegrees), _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.createDegrees(rollDegrees));
|
|
221697
221817
|
}
|
|
221698
221818
|
/**
|
|
221699
|
-
*
|
|
221819
|
+
* Constructor for YawPitchRollAngles with angles in radians.
|
|
221700
221820
|
* @param yawRadians counterclockwise rotation angle (in radians) around z
|
|
221701
221821
|
* @param pitchRadians **clockwise** rotation angle (in radians) around y
|
|
221702
221822
|
* @param rollRadians counterclockwise rotation angle (in radians) around x
|
|
221703
|
-
|
|
221823
|
+
*/
|
|
221704
221824
|
static createRadians(yawRadians, pitchRadians, rollRadians) {
|
|
221705
221825
|
return new YawPitchRollAngles(_Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.createRadians(yawRadians), _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.createRadians(pitchRadians), _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.createRadians(rollRadians));
|
|
221706
221826
|
}
|
|
221707
|
-
/**
|
|
221827
|
+
/** Construct a `YawPitchRoll` object from an object with 3 named angles */
|
|
221708
221828
|
static fromJSON(json) {
|
|
221709
221829
|
json = json ? json : {};
|
|
221710
221830
|
return new YawPitchRollAngles(_Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.fromJSON(json.yaw), _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.fromJSON(json.pitch), _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.fromJSON(json.roll));
|
|
221711
221831
|
}
|
|
221712
|
-
/**
|
|
221832
|
+
/** Populate yaw, pitch and roll fields using `Angle.fromJSON` */
|
|
221713
221833
|
setFromJSON(json) {
|
|
221714
221834
|
json = json ? json : {};
|
|
221715
221835
|
this.yaw = _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.fromJSON(json.yaw);
|
|
@@ -221719,7 +221839,7 @@ class YawPitchRollAngles {
|
|
|
221719
221839
|
/**
|
|
221720
221840
|
* Convert to a JSON object of form { pitch: 20 , roll: 30 , yaw: 10 }. Angles are in degrees.
|
|
221721
221841
|
* Any values that are exactly zero (with tolerance `Geometry.smallAngleRadians`) are omitted.
|
|
221722
|
-
|
|
221842
|
+
*/
|
|
221723
221843
|
toJSON() {
|
|
221724
221844
|
const val = {};
|
|
221725
221845
|
if (!this.pitch.isAlmostZero)
|
|
@@ -221749,15 +221869,12 @@ class YawPitchRollAngles {
|
|
|
221749
221869
|
&& this.pitch.isAlmostEqualAllowPeriodShift(other.pitch)
|
|
221750
221870
|
&& this.roll.isAlmostEqualAllowPeriodShift(other.roll);
|
|
221751
221871
|
}
|
|
221752
|
-
/**
|
|
221753
|
-
* Make a copy of this YawPitchRollAngles.
|
|
221754
|
-
*/
|
|
221872
|
+
/** Make a copy of this YawPitchRollAngles */
|
|
221755
221873
|
clone() {
|
|
221756
221874
|
return new YawPitchRollAngles(this.yaw.clone(), this.pitch.clone(), this.roll.clone());
|
|
221757
221875
|
}
|
|
221758
221876
|
/**
|
|
221759
221877
|
* Expand the angles into a (rigid rotation) matrix.
|
|
221760
|
-
*
|
|
221761
221878
|
* * The returned matrix is "rigid" (i.e., it has unit length rows and columns, and its transpose is its inverse).
|
|
221762
221879
|
* * The rigid matrix is always a right handed coordinate system.
|
|
221763
221880
|
* @param result optional pre-allocated `Matrix3d`
|
|
@@ -221794,7 +221911,8 @@ class YawPitchRollAngles {
|
|
|
221794
221911
|
*/
|
|
221795
221912
|
return _Matrix3d__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRowValues(cz * cy, -(sz * cx + cz * sy * sx), (sz * sx - cz * sy * cx), sz * cy, (cz * cx - sz * sy * sx), -(cz * sx + sz * sy * cx), sy, cy * sx, cy * cx, result);
|
|
221796
221913
|
}
|
|
221797
|
-
/**
|
|
221914
|
+
/**
|
|
221915
|
+
* Returns true if this rotation does nothing.
|
|
221798
221916
|
* * If allowPeriodShift is false, any nonzero angle is considered a non-identity
|
|
221799
221917
|
* * If allowPeriodShift is true, all angles are individually allowed to be any multiple of 360 degrees.
|
|
221800
221918
|
*/
|
|
@@ -221839,7 +221957,8 @@ class YawPitchRollAngles {
|
|
|
221839
221957
|
angles: YawPitchRollAngles.createFromMatrix3d(transform.matrix),
|
|
221840
221958
|
};
|
|
221841
221959
|
}
|
|
221842
|
-
/**
|
|
221960
|
+
/**
|
|
221961
|
+
* Attempts to create a YawPitchRollAngles object from a Matrix3d
|
|
221843
221962
|
* * This conversion fails if the matrix is not rigid (unit rows and columns, and transpose is inverse)
|
|
221844
221963
|
* * In the failure case the method's return value is `undefined`.
|
|
221845
221964
|
* * In the failure case, if the optional result was supplied, that result will nonetheless be filled with
|
|
@@ -246151,19 +246270,22 @@ class SteppedIndexFunctionFactory {
|
|
|
246151
246270
|
static createConstant(value = 0) {
|
|
246152
246271
|
return (_i, _n) => value;
|
|
246153
246272
|
}
|
|
246154
|
-
/**
|
|
246273
|
+
/**
|
|
246274
|
+
* Return a function that steps linearly
|
|
246155
246275
|
* * f(i,n) = y0 + (i/n) * a
|
|
246156
246276
|
*/
|
|
246157
246277
|
static createLinear(a, f0 = 0) {
|
|
246158
246278
|
return (i, n) => (f0 + a * (i / n));
|
|
246159
246279
|
}
|
|
246160
|
-
/**
|
|
246280
|
+
/**
|
|
246281
|
+
* Return a function that steps with cosine of angles in sweep
|
|
246161
246282
|
* * f(i,n) = y0 + amplitude * cos(i/n)
|
|
246162
246283
|
*/
|
|
246163
246284
|
static createCosine(amplitude, sweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.create360(), f0 = 0) {
|
|
246164
246285
|
return (i, n) => (f0 + amplitude * Math.cos(sweep.fractionToRadians(i / n)));
|
|
246165
246286
|
}
|
|
246166
|
-
/**
|
|
246287
|
+
/**
|
|
246288
|
+
* Return a function that steps with cosine of angles in sweep.
|
|
246167
246289
|
* * f(i,n) = y0 + amplitude * sin(i/n)
|
|
246168
246290
|
*/
|
|
246169
246291
|
static createSine(amplitude, sweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.create360(), f0 = 0) {
|
|
@@ -246175,7 +246297,8 @@ class SteppedIndexFunctionFactory {
|
|
|
246175
246297
|
* @alpha
|
|
246176
246298
|
*/
|
|
246177
246299
|
class Sample {
|
|
246178
|
-
/**
|
|
246300
|
+
/**
|
|
246301
|
+
* Return an array of Point3d, with x,y,z all stepping through a range of values.
|
|
246179
246302
|
* x varies fastest, then y then z
|
|
246180
246303
|
*/
|
|
246181
246304
|
static createPoint3dLattice(low, step, high) {
|
|
@@ -246186,7 +246309,8 @@ class Sample {
|
|
|
246186
246309
|
points.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(x, y, z));
|
|
246187
246310
|
return points;
|
|
246188
246311
|
}
|
|
246189
|
-
/**
|
|
246312
|
+
/**
|
|
246313
|
+
* Return an array of Point2d, with x,y all stepping through a range of values.
|
|
246190
246314
|
* x varies fastest, then y
|
|
246191
246315
|
*/
|
|
246192
246316
|
static createPoint2dLattice(low, step, high) {
|
|
@@ -246234,7 +246358,8 @@ class Sample {
|
|
|
246234
246358
|
static createCenteredRectangleXY(cx, cy, ax, ay, z = 0) {
|
|
246235
246359
|
return this.createRectangleXY(cx - ax, cy - ay, 2 * ax, 2 * ay, z);
|
|
246236
246360
|
}
|
|
246237
|
-
/**
|
|
246361
|
+
/**
|
|
246362
|
+
* Access the last point in the array. push another shifted by dx,dy,dz.
|
|
246238
246363
|
* * No push if all are 0.
|
|
246239
246364
|
* * If array is empty, push a leading 000
|
|
246240
246365
|
*/
|
|
@@ -246256,7 +246381,8 @@ class Sample {
|
|
|
246256
246381
|
points.push(points[0].clone());
|
|
246257
246382
|
return points;
|
|
246258
246383
|
}
|
|
246259
|
-
/**
|
|
246384
|
+
/**
|
|
246385
|
+
* Create points for an L shaped polygon
|
|
246260
246386
|
* * lower left at x0,y0.
|
|
246261
246387
|
* * ax,ay are larger side lengths (lower left to corners along x and y directions)
|
|
246262
246388
|
* * bx,by are smaller side lengths (inner corner to points along x and y directions)
|
|
@@ -246281,7 +246407,7 @@ class Sample {
|
|
|
246281
246407
|
return [
|
|
246282
246408
|
plane0, plane1, plane2,
|
|
246283
246409
|
_clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_6__.ClipPlane.createNormalAndDistance(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(3, 4, 0), 2.0),
|
|
246284
|
-
_clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_6__.ClipPlane.createEdgeXY(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 0, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(24, 32, 0))
|
|
246410
|
+
_clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_6__.ClipPlane.createEdgeXY(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 0, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(24, 32, 0)),
|
|
246285
246411
|
];
|
|
246286
246412
|
}
|
|
246287
246413
|
/**
|
|
@@ -246297,16 +246423,17 @@ class Sample {
|
|
|
246297
246423
|
const quadrant4 = _clipping_ConvexClipPlaneSet__WEBPACK_IMPORTED_MODULE_7__.ConvexClipPlaneSet.createXYBox(0, -1, 1, 0);
|
|
246298
246424
|
result.push(_clipping_UnionOfConvexClipPlaneSets__WEBPACK_IMPORTED_MODULE_8__.UnionOfConvexClipPlaneSets.createConvexSets([
|
|
246299
246425
|
quadrant1.clone(),
|
|
246300
|
-
quadrant4.clone()
|
|
246426
|
+
quadrant4.clone(),
|
|
246301
246427
|
]));
|
|
246302
246428
|
result.push(_clipping_UnionOfConvexClipPlaneSets__WEBPACK_IMPORTED_MODULE_8__.UnionOfConvexClipPlaneSets.createConvexSets([
|
|
246303
246429
|
quadrant1.clone(),
|
|
246304
246430
|
quadrant2.clone(),
|
|
246305
|
-
quadrant4.clone()
|
|
246431
|
+
quadrant4.clone(),
|
|
246306
246432
|
]));
|
|
246307
246433
|
return result;
|
|
246308
246434
|
}
|
|
246309
|
-
/**
|
|
246435
|
+
/**
|
|
246436
|
+
* Create (unweighted) bspline curves.
|
|
246310
246437
|
* order varies from 2 to 5
|
|
246311
246438
|
*/
|
|
246312
246439
|
static createBsplineCurves(includeMultipleKnots = false) {
|
|
@@ -246343,7 +246470,8 @@ class Sample {
|
|
|
246343
246470
|
}
|
|
246344
246471
|
return result;
|
|
246345
246472
|
}
|
|
246346
|
-
/**
|
|
246473
|
+
/**
|
|
246474
|
+
* Create weighted bspline curves.
|
|
246347
246475
|
* order varies from 2 to 5
|
|
246348
246476
|
*/
|
|
246349
246477
|
static createBspline3dHCurves() {
|
|
@@ -246381,8 +246509,7 @@ class Sample {
|
|
|
246381
246509
|
}
|
|
246382
246510
|
return result;
|
|
246383
246511
|
}
|
|
246384
|
-
/** Create weighted bsplines for circular arcs.
|
|
246385
|
-
*/
|
|
246512
|
+
/** Create weighted bsplines for circular arcs. */
|
|
246386
246513
|
static createBspline3dHArcs() {
|
|
246387
246514
|
const result = [];
|
|
246388
246515
|
const halfRadians = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.degreesToRadians(60.0);
|
|
@@ -246397,14 +246524,15 @@ class Sample {
|
|
|
246397
246524
|
_geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_10__.Point4d.create(-1, 0, 0, c),
|
|
246398
246525
|
_geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_10__.Point4d.create(-c, -s, 0, 1),
|
|
246399
246526
|
_geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_10__.Point4d.create(c, -s, 0, c),
|
|
246400
|
-
_geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_10__.Point4d.create(1, 0, 0, 1)
|
|
246527
|
+
_geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_10__.Point4d.create(1, 0, 0, 1),
|
|
246401
246528
|
];
|
|
246402
246529
|
const knots = [0, 0, 1, 1, 2, 2, 3, 3];
|
|
246403
246530
|
const curve = _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_11__.BSplineCurve3dH.create(points, knots, 3);
|
|
246404
246531
|
result.push(curve);
|
|
246405
246532
|
return result;
|
|
246406
246533
|
}
|
|
246407
|
-
/**
|
|
246534
|
+
/**
|
|
246535
|
+
* Return array [x,y,z,w] bspline control points for an arc in 90 degree bspline spans.
|
|
246408
246536
|
* @param points array of [x,y,z,w]
|
|
246409
246537
|
* @param center center of arc
|
|
246410
246538
|
* @param axes matrix with 0 and 90 degree axes
|
|
@@ -246450,7 +246578,7 @@ class Sample {
|
|
|
246450
246578
|
result.push(b);
|
|
246451
246579
|
return result;
|
|
246452
246580
|
}
|
|
246453
|
-
/**
|
|
246581
|
+
/** Create a plane from origin and normal coordinates -- default to 001 normal if needed. */
|
|
246454
246582
|
static createPlane(x, y, z, u, v, w) {
|
|
246455
246583
|
const point = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(x, y, z);
|
|
246456
246584
|
const vector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(u, v, w).normalize();
|
|
@@ -246470,22 +246598,23 @@ class Sample {
|
|
|
246470
246598
|
return [
|
|
246471
246599
|
_curve_LineString3d__WEBPACK_IMPORTED_MODULE_15__.LineString3d.createPoints([
|
|
246472
246600
|
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0),
|
|
246473
|
-
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 0, 0)
|
|
246601
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 0, 0),
|
|
246474
246602
|
]),
|
|
246475
246603
|
_curve_LineString3d__WEBPACK_IMPORTED_MODULE_15__.LineString3d.createPoints([
|
|
246476
246604
|
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0),
|
|
246477
246605
|
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 0, 0),
|
|
246478
|
-
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 1, 0)
|
|
246606
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 1, 0),
|
|
246479
246607
|
]),
|
|
246480
246608
|
_curve_LineString3d__WEBPACK_IMPORTED_MODULE_15__.LineString3d.createPoints([
|
|
246481
246609
|
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0),
|
|
246482
246610
|
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 0, 0),
|
|
246483
246611
|
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 1, 0),
|
|
246484
|
-
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(2, 2, 0)
|
|
246485
|
-
])
|
|
246612
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(2, 2, 0),
|
|
246613
|
+
]),
|
|
246486
246614
|
];
|
|
246487
246615
|
}
|
|
246488
|
-
/**
|
|
246616
|
+
/**
|
|
246617
|
+
* Assorted Matrix3d:
|
|
246489
246618
|
* * identity
|
|
246490
246619
|
* * rotation around x
|
|
246491
246620
|
* * rotation around general vector
|
|
@@ -246510,10 +246639,11 @@ class Sample {
|
|
|
246510
246639
|
_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createTranslationXYZ(1, 2, 0),
|
|
246511
246640
|
_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createTranslationXYZ(1, 2, 3),
|
|
246512
246641
|
_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createFixedPointAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(4, 1, -2), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createUniformScale(2.0)),
|
|
246513
|
-
_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createFixedPointAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(4, 1, -2), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundVector(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(1, 2, 3), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createRadians(10)))
|
|
246642
|
+
_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createFixedPointAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(4, 1, -2), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundVector(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(1, 2, 3), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createRadians(10))),
|
|
246514
246643
|
];
|
|
246515
246644
|
}
|
|
246516
|
-
/**
|
|
246645
|
+
/**
|
|
246646
|
+
* Return an array of Matrix3d with various skew and scale. This includes at least:
|
|
246517
246647
|
* * identity
|
|
246518
246648
|
* * 3 distinct diagonals.
|
|
246519
246649
|
* * The distinct diagonal base with smaller value added to other 6 spots in succession.
|
|
@@ -246532,9 +246662,10 @@ class Sample {
|
|
|
246532
246662
|
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRowValues(5, 2, 3, 2, 6, 1, -1, 2, 7),
|
|
246533
246663
|
];
|
|
246534
246664
|
}
|
|
246535
|
-
/**
|
|
246665
|
+
/**
|
|
246666
|
+
* Return an array of singular Matrix3d. This includes at least:
|
|
246536
246667
|
* * all zeros
|
|
246537
|
-
* * one
|
|
246668
|
+
* * one non-zero column
|
|
246538
246669
|
* * two independent columns, third is zero
|
|
246539
246670
|
* * two independent columns, third is sum of those
|
|
246540
246671
|
* * two independent columns, third is copy of one
|
|
@@ -246546,26 +246677,26 @@ class Sample {
|
|
|
246546
246677
|
const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
|
|
246547
246678
|
return [
|
|
246548
246679
|
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createZero(),
|
|
246549
|
-
// one
|
|
246680
|
+
// one non-zero column
|
|
246550
246681
|
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vectorU, vector0, vector0),
|
|
246551
246682
|
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vector0, vectorU, vector0),
|
|
246552
|
-
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vector0, vector0,
|
|
246553
|
-
// two independent
|
|
246683
|
+
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vector0, vector0, vectorU),
|
|
246684
|
+
// two independent non-zero columns with one zero column
|
|
246554
246685
|
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vectorU, vectorV, vector0),
|
|
246555
246686
|
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vector0, vectorU, vectorV),
|
|
246556
|
-
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(
|
|
246557
|
-
//
|
|
246687
|
+
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vectorU, vector0, vectorV),
|
|
246688
|
+
// two independent columns with one dependent column
|
|
246558
246689
|
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vectorU, vectorV, vectorUPlusV),
|
|
246559
246690
|
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vectorU, vectorUPlusV, vectorV),
|
|
246560
|
-
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vectorUPlusV,
|
|
246561
|
-
// two independent with duplicate
|
|
246562
|
-
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vectorU, vectorV, vectorU),
|
|
246691
|
+
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vectorUPlusV, vectorU, vectorV),
|
|
246692
|
+
// two independent with columns with one duplicate column
|
|
246563
246693
|
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vectorU, vectorU, vectorV),
|
|
246564
|
-
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(
|
|
246694
|
+
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vectorU, vectorV, vectorU),
|
|
246695
|
+
_geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createColumns(vectorV, vectorU, vectorU),
|
|
246565
246696
|
];
|
|
246566
246697
|
}
|
|
246567
246698
|
/**
|
|
246568
|
-
*
|
|
246699
|
+
* Return an array of rigid transforms. This includes (at least)
|
|
246569
246700
|
* * Identity
|
|
246570
246701
|
* * translation with identity matrix
|
|
246571
246702
|
* * rotation around origin and arbitrary vector
|
|
@@ -246580,16 +246711,15 @@ class Sample {
|
|
|
246580
246711
|
_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createTranslationXYZ(distanceScale3 * 1, distanceScale3 * 2, distanceScale3 * 3),
|
|
246581
246712
|
_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createFixedPointAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundVector(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitY(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(10))),
|
|
246582
246713
|
_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createFixedPointAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(distanceScale4 * 4, distanceScale4 * 1, -distanceScale4 * 2), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundVector(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(1, 2, 3), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(10))),
|
|
246583
|
-
_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createFixedPointAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(distanceScale4 * 4, distanceScale4 * 1, -distanceScale4 * 2), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundVector(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(-2, 1, 4), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(35)))
|
|
246714
|
+
_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createFixedPointAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(distanceScale4 * 4, distanceScale4 * 1, -distanceScale4 * 2), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundVector(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(-2, 1, 4), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(35))),
|
|
246584
246715
|
];
|
|
246585
246716
|
}
|
|
246586
|
-
/**
|
|
246587
|
-
* Return a single rigid transform with all terms nonzero.
|
|
246588
|
-
*/
|
|
246717
|
+
/** Return a single rigid transform with all terms nonzero. */
|
|
246589
246718
|
static createMessyRigidTransform(fixedPoint) {
|
|
246590
246719
|
return _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createFixedPointAndMatrix(fixedPoint ? fixedPoint : _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 2, 3), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundVector(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(0.3, -0.2, 1.2), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(15.7)));
|
|
246591
246720
|
}
|
|
246592
|
-
/**
|
|
246721
|
+
/**
|
|
246722
|
+
* Return various rigid matrices:
|
|
246593
246723
|
* * identity
|
|
246594
246724
|
* * small rotations around x, y, z
|
|
246595
246725
|
* * small rotation around (1,2,3)
|
|
@@ -246619,9 +246749,7 @@ class Sample {
|
|
|
246619
246749
|
}
|
|
246620
246750
|
return result;
|
|
246621
246751
|
}
|
|
246622
|
-
/**
|
|
246623
|
-
* Create full Map4d for each `Sample.createInvertibleTransforms ()`
|
|
246624
|
-
*/
|
|
246752
|
+
/** Create full Map4d for each `Sample.createInvertibleTransforms()` */
|
|
246625
246753
|
static createMap4ds() {
|
|
246626
246754
|
const result = [];
|
|
246627
246755
|
let transform;
|
|
@@ -246639,7 +246767,12 @@ class Sample {
|
|
|
246639
246767
|
static createSimplePaths(withGaps = false) {
|
|
246640
246768
|
const point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0);
|
|
246641
246769
|
const point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(10, 0, 0);
|
|
246642
|
-
const p1 = [
|
|
246770
|
+
const p1 = [
|
|
246771
|
+
point1, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 10, 0),
|
|
246772
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(6, 10, 0),
|
|
246773
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(6, 10, 0),
|
|
246774
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 10, 0),
|
|
246775
|
+
];
|
|
246643
246776
|
const segment1 = _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_19__.LineSegment3d.create(point0, point1);
|
|
246644
246777
|
const vectorU = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitX(3);
|
|
246645
246778
|
const vectorV = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitY(3);
|
|
@@ -246654,7 +246787,8 @@ class Sample {
|
|
|
246654
246787
|
simplePaths.push(_curve_Path__WEBPACK_IMPORTED_MODULE_21__.Path.create(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_19__.LineSegment3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(10, 0, 0)), _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_19__.LineSegment3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(10, 10, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(5, 0, 0))));
|
|
246655
246788
|
return simplePaths;
|
|
246656
246789
|
}
|
|
246657
|
-
/**
|
|
246790
|
+
/**
|
|
246791
|
+
* Assorted `Path` with lines and arcs.
|
|
246658
246792
|
* Specifically useful for offset tests.
|
|
246659
246793
|
*/
|
|
246660
246794
|
static createLineArcPaths() {
|
|
@@ -246683,12 +246817,16 @@ class Sample {
|
|
|
246683
246817
|
}
|
|
246684
246818
|
/** Assorted `PointString3d` objects. */
|
|
246685
246819
|
static createSimplePointStrings() {
|
|
246686
|
-
const p1 = [
|
|
246820
|
+
const p1 = [
|
|
246821
|
+
[_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 10, 0)],
|
|
246822
|
+
[_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(6, 10, 0)],
|
|
246823
|
+
[_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(6, 10, 0), [_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(6, 10, 0)]],
|
|
246824
|
+
];
|
|
246687
246825
|
const simplePaths = [
|
|
246688
246826
|
_curve_PointString3d__WEBPACK_IMPORTED_MODULE_22__.PointString3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 2, 0)),
|
|
246689
246827
|
_curve_PointString3d__WEBPACK_IMPORTED_MODULE_22__.PointString3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(10, 0, 0)),
|
|
246690
246828
|
_curve_PointString3d__WEBPACK_IMPORTED_MODULE_22__.PointString3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(10, 0, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(10, 5, 0)),
|
|
246691
|
-
_curve_PointString3d__WEBPACK_IMPORTED_MODULE_22__.PointString3d.create(p1)
|
|
246829
|
+
_curve_PointString3d__WEBPACK_IMPORTED_MODULE_22__.PointString3d.create(p1),
|
|
246692
246830
|
];
|
|
246693
246831
|
return simplePaths;
|
|
246694
246832
|
}
|
|
@@ -246717,8 +246855,7 @@ class Sample {
|
|
|
246717
246855
|
* @param dx1 distance along x axis at y=dy
|
|
246718
246856
|
* @param numPhase number of phases of the jump.
|
|
246719
246857
|
* @param dyReturn y value for return to origin. If 0, the wave ends at y=0 after then final "down" with one extra horizontal dx0
|
|
246720
|
-
*
|
|
246721
|
-
*
|
|
246858
|
+
* If nonzero, rise to that y value, return to x=0, and return down to origin.
|
|
246722
246859
|
*/
|
|
246723
246860
|
static createSquareWave(origin, dx0, dy, dx1, numPhase, dyReturn) {
|
|
246724
246861
|
const result = [origin.clone()];
|
|
@@ -246779,7 +246916,7 @@ class Sample {
|
|
|
246779
246916
|
}
|
|
246780
246917
|
return points;
|
|
246781
246918
|
}
|
|
246782
|
-
/**
|
|
246919
|
+
/** Append sawtooth with x distances successively scaled by xFactor */
|
|
246783
246920
|
static appendVariableSawTooth(points, dxLow, riseX, riseY, dxHigh, numPhase, xFactor) {
|
|
246784
246921
|
let factor = 1.0;
|
|
246785
246922
|
for (let i = 0; i < numPhase; i++) {
|
|
@@ -246820,7 +246957,8 @@ class Sample {
|
|
|
246820
246957
|
data.push(data[0].clone());
|
|
246821
246958
|
return data;
|
|
246822
246959
|
}
|
|
246823
|
-
/**
|
|
246960
|
+
/**
|
|
246961
|
+
* Append to a linestring, taking steps along given vector directions
|
|
246824
246962
|
* If the linestring is empty, a 000 point is added.
|
|
246825
246963
|
* @param linestring LineString3d to receive points.
|
|
246826
246964
|
* @param numPhase number of phases of the sawtooth
|
|
@@ -246837,7 +246975,8 @@ class Sample {
|
|
|
246837
246975
|
}
|
|
246838
246976
|
}
|
|
246839
246977
|
}
|
|
246840
|
-
/**
|
|
246978
|
+
/**
|
|
246979
|
+
* Assorted regions with arc boundaries
|
|
246841
246980
|
* * full circle
|
|
246842
246981
|
* * with varying sweep:
|
|
246843
246982
|
* * partial arc with single chord closure
|
|
@@ -246864,7 +247003,8 @@ class Sample {
|
|
|
246864
247003
|
}
|
|
246865
247004
|
return result;
|
|
246866
247005
|
}
|
|
246867
|
-
/**
|
|
247006
|
+
/**
|
|
247007
|
+
* Assorted loops in xy plane:
|
|
246868
247008
|
* * unit square
|
|
246869
247009
|
* * rectangle
|
|
246870
247010
|
* * L shape
|
|
@@ -246904,10 +247044,14 @@ class Sample {
|
|
|
246904
247044
|
];
|
|
246905
247045
|
if (includeBCurves) {
|
|
246906
247046
|
const ey = 1.0;
|
|
246907
|
-
result.push(_curve_ParityRegion__WEBPACK_IMPORTED_MODULE_24__.ParityRegion.create(_curve_Loop__WEBPACK_IMPORTED_MODULE_23__.Loop.create(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_19__.LineSegment3d.create(point0, pointA), _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_9__.BSplineCurve3d.createUniformKnots([
|
|
247047
|
+
result.push(_curve_ParityRegion__WEBPACK_IMPORTED_MODULE_24__.ParityRegion.create(_curve_Loop__WEBPACK_IMPORTED_MODULE_23__.Loop.create(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_19__.LineSegment3d.create(point0, pointA), _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_9__.BSplineCurve3d.createUniformKnots([
|
|
247048
|
+
pointA,
|
|
247049
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(ax + 1, ey),
|
|
246908
247050
|
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(ax + 1, 2 * ey),
|
|
246909
247051
|
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(ax + 2, 3 * ey),
|
|
246910
|
-
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(ax + 1, 4 * ey),
|
|
247052
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(ax + 1, 4 * ey),
|
|
247053
|
+
pointB,
|
|
247054
|
+
], 3), _curve_Arc3d__WEBPACK_IMPORTED_MODULE_20__.Arc3d.createCircularStartMiddleEnd(pointB, pointC1, point0))));
|
|
246911
247055
|
}
|
|
246912
247056
|
return result;
|
|
246913
247057
|
}
|
|
@@ -246921,7 +247065,7 @@ class Sample {
|
|
|
246921
247065
|
const by = 2.0;
|
|
246922
247066
|
const result = [
|
|
246923
247067
|
_curve_UnionRegion__WEBPACK_IMPORTED_MODULE_25__.UnionRegion.create(_curve_Loop__WEBPACK_IMPORTED_MODULE_23__.Loop.create(_curve_LineString3d__WEBPACK_IMPORTED_MODULE_15__.LineString3d.createRectangleXY(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0), ax, ay)), _curve_Loop__WEBPACK_IMPORTED_MODULE_23__.Loop.create(_curve_LineString3d__WEBPACK_IMPORTED_MODULE_15__.LineString3d.createRectangleXY(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 2 * ay, 0), bx, by))),
|
|
246924
|
-
_curve_UnionRegion__WEBPACK_IMPORTED_MODULE_25__.UnionRegion.create(_curve_Loop__WEBPACK_IMPORTED_MODULE_23__.Loop.create(_curve_LineString3d__WEBPACK_IMPORTED_MODULE_15__.LineString3d.create(Sample.createRectangleXY(parityRange.low.x, parityRange.high.y + 0.5, parityRange.xLength(), parityRange.yLength()))), parityRegions[0])
|
|
247068
|
+
_curve_UnionRegion__WEBPACK_IMPORTED_MODULE_25__.UnionRegion.create(_curve_Loop__WEBPACK_IMPORTED_MODULE_23__.Loop.create(_curve_LineString3d__WEBPACK_IMPORTED_MODULE_15__.LineString3d.create(Sample.createRectangleXY(parityRange.low.x, parityRange.high.y + 0.5, parityRange.xLength(), parityRange.yLength()))), parityRegions[0]),
|
|
246925
247069
|
];
|
|
246926
247070
|
return result;
|
|
246927
247071
|
}
|
|
@@ -246940,7 +247084,8 @@ class Sample {
|
|
|
246940
247084
|
];
|
|
246941
247085
|
return result;
|
|
246942
247086
|
}
|
|
246943
|
-
/**
|
|
247087
|
+
/**
|
|
247088
|
+
* Assorted smooth curve primitives:
|
|
246944
247089
|
* * line segments
|
|
246945
247090
|
* * arcs
|
|
246946
247091
|
*/
|
|
@@ -246955,7 +247100,7 @@ class Sample {
|
|
|
246955
247100
|
_curve_Arc3d__WEBPACK_IMPORTED_MODULE_20__.Arc3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(size, alpha * size, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(-alpha * beta * size, beta * size, 0), _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(-40, 270)),
|
|
246956
247101
|
];
|
|
246957
247102
|
}
|
|
246958
|
-
/**
|
|
247103
|
+
/** Assorted small polyface grids, possibly expanded by gridMultiplier */
|
|
246959
247104
|
static createSimpleIndexedPolyfaces(gridMultiplier) {
|
|
246960
247105
|
const meshes = [
|
|
246961
247106
|
Sample.createTriangularUnitGridPolyface(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitX(), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitY(), gridMultiplier * 3, 2 * gridMultiplier, false, false, false),
|
|
@@ -247186,7 +247331,7 @@ class Sample {
|
|
|
247186
247331
|
}
|
|
247187
247332
|
return _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_28__.BSplineSurface3dH.create(xyzPoles, weights, numU, orderU, undefined, numV, orderV, undefined);
|
|
247188
247333
|
}
|
|
247189
|
-
/**
|
|
247334
|
+
/** Assorted linear sweeps */
|
|
247190
247335
|
static createSimpleLinearSweeps() {
|
|
247191
247336
|
const result = [];
|
|
247192
247337
|
const base = _curve_Loop__WEBPACK_IMPORTED_MODULE_23__.Loop.create(_curve_LineString3d__WEBPACK_IMPORTED_MODULE_15__.LineString3d.createRectangleXY(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(), 2, 3));
|
|
@@ -247205,7 +247350,7 @@ class Sample {
|
|
|
247205
247350
|
const xyPoints = [
|
|
247206
247351
|
_geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Point2d.create(0, 0),
|
|
247207
247352
|
_geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Point2d.create(1, 0),
|
|
247208
|
-
_geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Point2d.create(1, 1)
|
|
247353
|
+
_geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Point2d.create(1, 1),
|
|
247209
247354
|
];
|
|
247210
247355
|
result.push(_solid_LinearSweep__WEBPACK_IMPORTED_MODULE_30__.LinearSweep.createZSweep(xyPoints, 1, 3, false));
|
|
247211
247356
|
// this forces artificial closure point . . .
|
|
@@ -247249,7 +247394,7 @@ class Sample {
|
|
|
247249
247394
|
for (const axis of [
|
|
247250
247395
|
_geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_14__.Ray3d.createXYZUVW(0, 0, 0, 0, 1, 0),
|
|
247251
247396
|
_geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_14__.Ray3d.createXYZUVW(5, 0, 0, 0, 1, 0),
|
|
247252
|
-
_geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_14__.Ray3d.createXYZUVW(-1, 0, 0, -1, 1, 0)
|
|
247397
|
+
_geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_14__.Ray3d.createXYZUVW(-1, 0, 0, -1, 1, 0),
|
|
247253
247398
|
]) {
|
|
247254
247399
|
result.push(_solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_31__.RotationalSweep.create(base, axis, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(45.0), false));
|
|
247255
247400
|
result.push(_solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_31__.RotationalSweep.create(base, axis, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(150.0), true));
|
|
@@ -247274,7 +247419,7 @@ class Sample {
|
|
|
247274
247419
|
/** Create true (non-spherical) ellipsoids. */
|
|
247275
247420
|
static createEllipsoids() {
|
|
247276
247421
|
return [
|
|
247277
|
-
_solid_Sphere__WEBPACK_IMPORTED_MODULE_32__.Sphere.createEllipsoid(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createOriginAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRowValues(4, 1, 1, 1, 4, 1, 0.5, 0.2, 5)), _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createFullLatitude(), true)
|
|
247422
|
+
_solid_Sphere__WEBPACK_IMPORTED_MODULE_32__.Sphere.createEllipsoid(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createOriginAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRowValues(4, 1, 1, 1, 4, 1, 0.5, 0.2, 5)), _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createFullLatitude(), true),
|
|
247278
247423
|
];
|
|
247279
247424
|
}
|
|
247280
247425
|
/** Create assorted cones. */
|
|
@@ -247332,8 +247477,7 @@ class Sample {
|
|
|
247332
247477
|
result.push(_solid_Box__WEBPACK_IMPORTED_MODULE_35__.Box.createDgnBox(cornerA, frameY.columnX(), frameY.columnY(), cornerA.plusScaled(frameY.columnZ(), h), aX, aY, bX, bY, capped));
|
|
247333
247478
|
return result;
|
|
247334
247479
|
}
|
|
247335
|
-
/**
|
|
247336
|
-
*/
|
|
247480
|
+
/** Create an array of points for a rectangle with corners (x0,y0,z) and (x1,y1,z) */
|
|
247337
247481
|
static createRectangle(x0, y0, x1, y1, z = 0.0, closed = false) {
|
|
247338
247482
|
const points = [
|
|
247339
247483
|
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(x0, y0, z),
|
|
@@ -247345,8 +247489,7 @@ class Sample {
|
|
|
247345
247489
|
points.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(x0, y0, z));
|
|
247346
247490
|
return points;
|
|
247347
247491
|
}
|
|
247348
|
-
/**
|
|
247349
|
-
*/
|
|
247492
|
+
/** Create an array of points for a rectangle with corners of a Range2d. */
|
|
247350
247493
|
static createRectangleInRange2d(range, z = 0.0, closed = false) {
|
|
247351
247494
|
const x0 = range.low.x;
|
|
247352
247495
|
const x1 = range.high.x;
|
|
@@ -247455,8 +247598,9 @@ class Sample {
|
|
|
247455
247598
|
}
|
|
247456
247599
|
return points;
|
|
247457
247600
|
}
|
|
247458
|
-
/**
|
|
247459
|
-
*
|
|
247601
|
+
/**
|
|
247602
|
+
* Primary shape is a "triangle" with lower edge pushed in so it becomes a mild nonconvex quad.
|
|
247603
|
+
* Fractal effects are gentle.
|
|
247460
247604
|
*/
|
|
247461
247605
|
static nonConvexQuadSimpleFractal(numRecursion, perpendicularFactor) {
|
|
247462
247606
|
const pattern = [
|
|
@@ -247473,7 +247617,7 @@ class Sample {
|
|
|
247473
247617
|
];
|
|
247474
247618
|
return Sample.createRecursiveFractalPolygon(poles, pattern, numRecursion, perpendicularFactor);
|
|
247475
247619
|
}
|
|
247476
|
-
/**
|
|
247620
|
+
/** Create a diamond with convex fractal */
|
|
247477
247621
|
static createFractalDiamondConvexPattern(numRecursion, perpendicularFactor) {
|
|
247478
247622
|
const pattern = [
|
|
247479
247623
|
_geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Point2d.create(),
|
|
@@ -247570,7 +247714,7 @@ class Sample {
|
|
|
247570
247714
|
];
|
|
247571
247715
|
return Sample.createRecursiveFractalPolygon(poles, pattern, numRecursion, perpendicularFactor);
|
|
247572
247716
|
}
|
|
247573
|
-
/**
|
|
247717
|
+
/** Append interpolated points from the array tail to the target. */
|
|
247574
247718
|
static appendSplits(points, target, numSplit, includeTarget) {
|
|
247575
247719
|
const pointA = points[points.length - 1];
|
|
247576
247720
|
for (let i = 0; i < numSplit; i++)
|
|
@@ -247614,7 +247758,8 @@ class Sample {
|
|
|
247614
247758
|
geometry.push(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_19__.LineSegment3d.createXYZXYZ(x0, y1, z0, x0, y1, z1));
|
|
247615
247759
|
return geometry;
|
|
247616
247760
|
}
|
|
247617
|
-
/**
|
|
247761
|
+
/**
|
|
247762
|
+
* Assorted transition spirals
|
|
247618
247763
|
* * (All combinations of bearing radius bearing radius length subsets.)
|
|
247619
247764
|
*/
|
|
247620
247765
|
static createSimpleTransitionSpirals() {
|
|
@@ -247635,10 +247780,11 @@ class Sample {
|
|
|
247635
247780
|
_curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_41__.DirectSpiral3d.createFromLengthAndRadius("ChineseCubic", r0, r1, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(0), undefined, arcLength, undefined, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createOriginAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 2, 0), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundVector(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(15)))),
|
|
247636
247781
|
_curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_41__.DirectSpiral3d.createFromLengthAndRadius("JapaneseCubic", r0, r1, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(0), undefined, arcLength, undefined, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createOriginAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 2, 0), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundVector(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(15)))),
|
|
247637
247782
|
_curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_41__.DirectSpiral3d.createFromLengthAndRadius("DirectHalfCosine", r0, r1, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(0), undefined, arcLength, undefined, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createOriginAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 2, 0), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundVector(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(15)))),
|
|
247638
|
-
_curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_41__.DirectSpiral3d.createCzechCubic(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createIdentity(), arcLength, r1)
|
|
247783
|
+
_curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_41__.DirectSpiral3d.createCzechCubic(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createIdentity(), arcLength, r1),
|
|
247639
247784
|
];
|
|
247640
247785
|
}
|
|
247641
|
-
/**
|
|
247786
|
+
/**
|
|
247787
|
+
* Create a Bezier curve with significant twist effects
|
|
247642
247788
|
* * r and theta are circle in xy plane at steps in thetaStepper
|
|
247643
247789
|
* * z varies with sin(phi) at steps in phiStepper.
|
|
247644
247790
|
*/
|
|
@@ -247694,18 +247840,10 @@ class Sample {
|
|
|
247694
247840
|
result.push(_curve_CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_44__.CurveChainWithDistanceIndex.createCapture(_curve_Path__WEBPACK_IMPORTED_MODULE_21__.Path.create(// arc spline with smooth joins
|
|
247695
247841
|
_curve_Arc3d__WEBPACK_IMPORTED_MODULE_20__.Arc3d.createXY(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(5, 0), 5, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(180, 0)), _curve_Arc3d__WEBPACK_IMPORTED_MODULE_20__.Arc3d.createXY(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(15, 0), 5, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(180, 360)), _curve_Arc3d__WEBPACK_IMPORTED_MODULE_20__.Arc3d.createXY(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(25, 0), 5, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(180, 0)))));
|
|
247696
247842
|
result.push(_curve_CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_44__.CurveChainWithDistanceIndex.createCapture(_curve_Path__WEBPACK_IMPORTED_MODULE_21__.Path.create(// 2-pt Interpolation Curve
|
|
247697
|
-
_bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__.InterpolationCurve3d.createCapture(_bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__.InterpolationCurve3dOptions.create({
|
|
247698
|
-
fitPoints: [pointsA[0], pointsA[1]],
|
|
247699
|
-
})))));
|
|
247843
|
+
_bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__.InterpolationCurve3d.createCapture(_bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__.InterpolationCurve3dOptions.create({ fitPoints: [pointsA[0], pointsA[1]] })))));
|
|
247700
247844
|
result.push(_curve_CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_44__.CurveChainWithDistanceIndex.createCapture(_curve_Path__WEBPACK_IMPORTED_MODULE_21__.Path.create(// 3-pt Interpolation Curve
|
|
247701
|
-
_bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__.InterpolationCurve3d.createCapture(_bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__.InterpolationCurve3dOptions.create({
|
|
247702
|
-
|
|
247703
|
-
})))));
|
|
247704
|
-
result.push(_curve_CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_44__.CurveChainWithDistanceIndex.createCapture(_curve_Path__WEBPACK_IMPORTED_MODULE_21__.Path.create(_bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__.InterpolationCurve3d.createCapture(_bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__.InterpolationCurve3dOptions.create({
|
|
247705
|
-
fitPoints: pointsA,
|
|
247706
|
-
startTangent: _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, -1),
|
|
247707
|
-
endTangent: _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(-1, -1),
|
|
247708
|
-
})))));
|
|
247845
|
+
_bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__.InterpolationCurve3d.createCapture(_bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__.InterpolationCurve3dOptions.create({ fitPoints: [pointsA[0], pointsA[1], pointsA[2]] })))));
|
|
247846
|
+
result.push(_curve_CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_44__.CurveChainWithDistanceIndex.createCapture(_curve_Path__WEBPACK_IMPORTED_MODULE_21__.Path.create(_bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__.InterpolationCurve3d.createCapture(_bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__.InterpolationCurve3dOptions.create({ fitPoints: pointsA, startTangent: _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, -1), endTangent: _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(-1, -1) })))));
|
|
247709
247847
|
result.push(_curve_CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_44__.CurveChainWithDistanceIndex.createCapture(_curve_Path__WEBPACK_IMPORTED_MODULE_21__.Path.create(_curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_39__.IntegratedSpiral3d.createRadiusRadiusBearingBearing(_geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_40__.Segment1d.create(0, 100), _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(10, 75), _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_40__.Segment1d.create(0, 1), _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createOriginAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero(), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundAxisIndex(2, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(30))), "bloss"))));
|
|
247710
247848
|
result.push(_curve_CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_44__.CurveChainWithDistanceIndex.createCapture(_curve_Path__WEBPACK_IMPORTED_MODULE_21__.Path.create(_curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_41__.DirectSpiral3d.createDirectHalfCosine(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_16__.Transform.createOriginAndMatrix(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero(), _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundAxisIndex(2, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(110))), 50, 350, _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_40__.Segment1d.create(0, 1)))));
|
|
247711
247849
|
return result;
|
|
@@ -247789,7 +247927,7 @@ class Sample {
|
|
|
247789
247927
|
const sweep2 = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(160.0, 380.0);
|
|
247790
247928
|
for (const arcs of [
|
|
247791
247929
|
Sample.createArcs(1.0), Sample.createArcs(0.5),
|
|
247792
|
-
Sample.createArcs(1.0, sweep1), Sample.createArcs(0.3, sweep2)
|
|
247930
|
+
Sample.createArcs(1.0, sweep1), Sample.createArcs(0.3, sweep2),
|
|
247793
247931
|
]) {
|
|
247794
247932
|
for (const arc of arcs)
|
|
247795
247933
|
result.push(arc);
|
|
@@ -247892,10 +248030,10 @@ class Sample {
|
|
|
247892
248030
|
return points;
|
|
247893
248031
|
}
|
|
247894
248032
|
/**
|
|
247895
|
-
* *
|
|
247896
|
-
* *
|
|
247897
|
-
* *
|
|
247898
|
-
* *
|
|
248033
|
+
* * Let ay = 4
|
|
248034
|
+
* * Base polygon has vertices (0,0), (ax,0), (2*ax,0), (2* ax,ay), (ax,ay), (0,ay), (0,0).
|
|
248035
|
+
* * Shift the x coordinates of vertices 1,4 by indicated amounts (0-based numbering)
|
|
248036
|
+
* * Shift the y coordinates for points 1,2,3,4 by indicated amounts (in 0-based numbering)
|
|
247899
248037
|
* * This is useful for testing non-y-monotonic face situations.
|
|
247900
248038
|
* * Return as points.
|
|
247901
248039
|
* @param dy1
|
|
@@ -247915,7 +248053,7 @@ class Sample {
|
|
|
247915
248053
|
return points;
|
|
247916
248054
|
}
|
|
247917
248055
|
/**
|
|
247918
|
-
*
|
|
248056
|
+
* Make line segments for each pair of adjacent points.
|
|
247919
248057
|
* @param points array of points
|
|
247920
248058
|
* @param forceClosure if true, inspect coordinates to determine if a closure edge is needed.
|
|
247921
248059
|
*/
|
|
@@ -248031,7 +248169,8 @@ class Sample {
|
|
|
248031
248169
|
this.appendGeometry(this.createBagOfCurves(), result);
|
|
248032
248170
|
return result;
|
|
248033
248171
|
}
|
|
248034
|
-
/**
|
|
248172
|
+
/**
|
|
248173
|
+
* Create points on a sine wave
|
|
248035
248174
|
* Point i is origin + (i * xStep, a *sin(theta0 + i * dTheta), b * sin(beta0 + i * dBeta))
|
|
248036
248175
|
* * Default b is zero, so it is a simple sine wave
|
|
248037
248176
|
* * If the dTheta and dBeta are equal, it is a sine wave in a tilted plane.
|
|
@@ -248040,8 +248179,9 @@ class Sample {
|
|
|
248040
248179
|
static createPointSineWave(origin, numInterval = 24, xStep = Math.PI / 12, a = 1, thetaSweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(0, 360), b = 0, betaSweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(0, 180)) {
|
|
248041
248180
|
return this.createPointsByIndexFunctions(numInterval, SteppedIndexFunctionFactory.createLinear(xStep, origin ? origin.x : 0), SteppedIndexFunctionFactory.createCosine(a, thetaSweep, origin ? origin.y : 0), SteppedIndexFunctionFactory.createCosine(b, betaSweep, origin ? origin.z : 0));
|
|
248042
248181
|
}
|
|
248043
|
-
/**
|
|
248044
|
-
*
|
|
248182
|
+
/**
|
|
248183
|
+
* Create points with x,y,z independent functions of i and numInterval,
|
|
248184
|
+
* Point3d.create (fx(i,numInterval), fy(i,numInterval), fz(i, numInterval));
|
|
248045
248185
|
*/
|
|
248046
248186
|
static createPointsByIndexFunctions(numInterval, fx, fy, fz) {
|
|
248047
248187
|
const points = [];
|
|
@@ -248112,9 +248252,7 @@ class Sample {
|
|
|
248112
248252
|
builder.addGreedyTriangulationBetweenLineStrings(point0, point1);
|
|
248113
248253
|
return builder.claimPolyface();
|
|
248114
248254
|
}
|
|
248115
|
-
/**
|
|
248116
|
-
* create strokes on an arc at radius r0, then returning at radius r1.
|
|
248117
|
-
*/
|
|
248255
|
+
/** Create strokes on an arc at radius r0, then returning at radius r1. */
|
|
248118
248256
|
static createAnnulusPolyline(edgesPerQuadrant, center, r0, r1, theta0, theta1, addClosure) {
|
|
248119
248257
|
const point0 = [];
|
|
248120
248258
|
const point1 = [];
|
|
@@ -248184,7 +248322,12 @@ class Sample {
|
|
|
248184
248322
|
for (let yC = 0; yC + 1 <= ySweep; yC++) {
|
|
248185
248323
|
const yD = yC + 1;
|
|
248186
248324
|
if (acceptFunction(xA, yC))
|
|
248187
|
-
builder.addPolygon([
|
|
248325
|
+
builder.addPolygon([
|
|
248326
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(xA, yC, zA),
|
|
248327
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(xB, yC, zB),
|
|
248328
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(xB, yD, zB),
|
|
248329
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(xA, yD, zA),
|
|
248330
|
+
]);
|
|
248188
248331
|
}
|
|
248189
248332
|
}
|
|
248190
248333
|
}
|
|
@@ -248242,7 +248385,7 @@ Sample.plane3dByOriginAndUnitNormal = [
|
|
|
248242
248385
|
_geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_13__.Plane3dByOriginAndUnitNormal.createYZPlane(),
|
|
248243
248386
|
_geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_13__.Plane3dByOriginAndUnitNormal.createZXPlane(),
|
|
248244
248387
|
Sample.createPlane(0, 0, 0, 3, 0, 1),
|
|
248245
|
-
Sample.createPlane(1, 2, 3, 2, 4, -1)
|
|
248388
|
+
Sample.createPlane(1, 2, 3, 2, 4, -1),
|
|
248246
248389
|
];
|
|
248247
248390
|
/** Assorted Ray3d, not all unit direction vectors. */
|
|
248248
248391
|
Sample.ray3d = [
|
|
@@ -248250,7 +248393,7 @@ Sample.ray3d = [
|
|
|
248250
248393
|
Sample.createRay(0, 0, 0, 0, 1, 0),
|
|
248251
248394
|
Sample.createRay(0, 0, 0, 0, 0, 1),
|
|
248252
248395
|
Sample.createRay(0, 0, 0, 1, 2, 0),
|
|
248253
|
-
Sample.createRay(1, 2, 3, 4, 2, -1)
|
|
248396
|
+
Sample.createRay(1, 2, 3, 4, 2, -1),
|
|
248254
248397
|
];
|
|
248255
248398
|
/** Assorted angles. All principal directions, some others included. */
|
|
248256
248399
|
Sample.angle = [
|
|
@@ -248259,7 +248402,7 @@ Sample.angle = [
|
|
|
248259
248402
|
_geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(180),
|
|
248260
248403
|
_geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(-90),
|
|
248261
248404
|
_geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(30),
|
|
248262
|
-
_geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(-105)
|
|
248405
|
+
_geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(-105),
|
|
248263
248406
|
];
|
|
248264
248407
|
/** Assorted angle sweeps */
|
|
248265
248408
|
Sample.angleSweep = [
|
|
@@ -248268,35 +248411,35 @@ Sample.angleSweep = [
|
|
|
248268
248411
|
_geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(-90, 0),
|
|
248269
248412
|
_geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(0, -90),
|
|
248270
248413
|
_geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(0, 30),
|
|
248271
|
-
_geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(45, 110)
|
|
248414
|
+
_geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(45, 110),
|
|
248272
248415
|
];
|
|
248273
|
-
/**
|
|
248416
|
+
/** Assorted line segments */
|
|
248274
248417
|
Sample.lineSegment3d = [
|
|
248275
248418
|
_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_19__.LineSegment3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 0, 0)),
|
|
248276
248419
|
_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_19__.LineSegment3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 1, 0)),
|
|
248277
248420
|
_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_19__.LineSegment3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 1)),
|
|
248278
|
-
_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_19__.LineSegment3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 2, 3), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(-2, -3, 0.5))
|
|
248421
|
+
_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_19__.LineSegment3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 2, 3), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(-2, -3, 0.5)),
|
|
248279
248422
|
];
|
|
248280
|
-
/** Assorted Range1d:
|
|
248423
|
+
/** Assorted Range1d: single point, null, simple forward, simple reverse */
|
|
248281
248424
|
Sample.range1d = [
|
|
248282
248425
|
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range1d.createX(1),
|
|
248283
248426
|
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range1d.createNull(),
|
|
248284
248427
|
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range1d.createXX(1, 2),
|
|
248285
|
-
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range1d.createXX(2, 1)
|
|
248428
|
+
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range1d.createXX(2, 1),
|
|
248286
248429
|
];
|
|
248287
248430
|
/** Assorted range2d: single point, null, 2 point with various creation orders. */
|
|
248288
248431
|
Sample.range2d = [
|
|
248289
248432
|
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range2d.createXY(1, 2),
|
|
248290
248433
|
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range2d.createNull(),
|
|
248291
248434
|
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range2d.createXYXY(1, 2, 0, 3),
|
|
248292
|
-
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range2d.createXYXY(1, 2, 3, 4)
|
|
248435
|
+
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range2d.createXYXY(1, 2, 3, 4),
|
|
248293
248436
|
];
|
|
248294
248437
|
/** Assorted range2d: single point, null, 2 point with various creation orders. */
|
|
248295
248438
|
Sample.range3d = [
|
|
248296
248439
|
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range3d.createXYZ(1, 2, 3),
|
|
248297
248440
|
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range3d.createNull(),
|
|
248298
248441
|
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range3d.createXYZXYZ(1, 2, 0, 3, 4, 7),
|
|
248299
|
-
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range3d.createXYZXYZ(1, 2, 3, -2, -4, -1)
|
|
248442
|
+
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range3d.createXYZXYZ(1, 2, 3, -2, -4, -1),
|
|
248300
248443
|
];
|
|
248301
248444
|
|
|
248302
248445
|
|
|
@@ -288775,7 +288918,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
288775
288918
|
/***/ ((module) => {
|
|
288776
288919
|
|
|
288777
288920
|
"use strict";
|
|
288778
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.
|
|
288921
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.58","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs","build:ci":"npm run -s build && npm run -s build:esm","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-eslintrc -c \\"./node_modules/@itwin/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core/tree/master/core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.0.0-dev.58","@itwin/core-bentley":"workspace:^4.0.0-dev.58","@itwin/core-common":"workspace:^4.0.0-dev.58","@itwin/core-geometry":"workspace:^4.0.0-dev.58","@itwin/core-orbitgt":"workspace:^4.0.0-dev.58","@itwin/core-quantity":"workspace:^4.0.0-dev.58"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"^4.0.0-dev.32","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/deep-assign":"^0.1.0","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@types/qs":"^6.5.0","@types/semver":"7.3.10","@types/superagent":"^4.1.14","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^7.11.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~5.0.2","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/object-storage-azure":"^1.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","deep-assign":"^2.0.0","fuse.js":"^3.3.0","qs":"^6.5.3","semver":"^7.3.5","superagent":"^7.1.5","wms-capabilities":"0.4.0","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
|
|
288779
288922
|
|
|
288780
288923
|
/***/ })
|
|
288781
288924
|
|