@itwin/core-geometry 5.0.0-dev.93 → 5.0.0-dev.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/curve/StrokeOptions.d.ts +6 -1
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +7 -2
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts +8 -7
- package/lib/cjs/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +17 -16
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +11 -0
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +21 -0
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +5 -3
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +27 -23
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +47 -37
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +8 -3
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +26 -4
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.d.ts +35 -9
- package/lib/cjs/serialization/BGFBAccessors.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js +59 -15
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.d.ts +2 -2
- package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js +53 -40
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts +5 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js +17 -3
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js +1 -0
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts +8 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +20 -9
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.d.ts +36 -0
- package/lib/cjs/serialization/SerializationHelpers.d.ts.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js +117 -0
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts +4 -2
- package/lib/cjs/solid/Sphere.d.ts.map +1 -1
- package/lib/cjs/solid/Sphere.js +4 -2
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +6 -1
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +7 -2
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts +8 -7
- package/lib/esm/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +17 -16
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +11 -0
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +21 -0
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +5 -3
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +27 -23
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +47 -37
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +8 -3
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +26 -4
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.d.ts +35 -9
- package/lib/esm/serialization/BGFBAccessors.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js +59 -15
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.d.ts +2 -2
- package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBReader.js +53 -40
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.d.ts +5 -1
- package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js +17 -3
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js +1 -0
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts +8 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +20 -9
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.d.ts +36 -0
- package/lib/esm/serialization/SerializationHelpers.d.ts.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js +117 -0
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts +4 -2
- package/lib/esm/solid/Sphere.d.ts.map +1 -1
- package/lib/esm/solid/Sphere.js +4 -2
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/package.json +3 -3
|
@@ -45,7 +45,12 @@ export declare class StrokeOptions {
|
|
|
45
45
|
/** Whether normals are requested */
|
|
46
46
|
get needNormals(): boolean;
|
|
47
47
|
set needNormals(value: boolean);
|
|
48
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Whether to request facets that are viewable from the back.
|
|
50
|
+
* * Default value is true.
|
|
51
|
+
* * Set to false only if the requested facets are expected to form a closed volume with outward normals,
|
|
52
|
+
* indicating they are amenable to backface culling for improved display performance.
|
|
53
|
+
*/
|
|
49
54
|
get needTwoSided(): boolean;
|
|
50
55
|
set needTwoSided(value: boolean);
|
|
51
56
|
/** Optional color request flag */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StrokeOptions.d.ts","sourceRoot":"","sources":["../../../src/curve/StrokeOptions.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,aAAa;IACxB,+CAA+C;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IACzB,0EAA0E;IACnE,QAAQ,CAAC,EAAE,KAAK,CAAC;IACxB,yCAAyC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACI,gBAAgB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,MAAM;IAQpF;;;OAGG;IACI,+BAA+B,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM;IAQtG,iGAAiG;IAC1F,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAM5D;;;;OAIG;WACW,eAAe,IAAI,aAAa;IAK9C;;;;OAIG;WACW,eAAe,IAAI,aAAa;CAK/C"}
|
|
@@ -64,9 +64,14 @@ class StrokeOptions {
|
|
|
64
64
|
set needNormals(value) {
|
|
65
65
|
this._needNormals = value;
|
|
66
66
|
}
|
|
67
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Whether to request facets that are viewable from the back.
|
|
69
|
+
* * Default value is true.
|
|
70
|
+
* * Set to false only if the requested facets are expected to form a closed volume with outward normals,
|
|
71
|
+
* indicating they are amenable to backface culling for improved display performance.
|
|
72
|
+
*/
|
|
68
73
|
get needTwoSided() {
|
|
69
|
-
return this._needTwoSided !== undefined ? this._needTwoSided :
|
|
74
|
+
return this._needTwoSided !== undefined ? this._needTwoSided : true;
|
|
70
75
|
}
|
|
71
76
|
set needTwoSided(value) {
|
|
72
77
|
this._needTwoSided = value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StrokeOptions.js","sourceRoot":"","sources":["../../../src/curve/StrokeOptions.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAuC;AACvC,+CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,aAAa;IACxB,+CAA+C;IACxC,QAAQ,CAAU;IACzB,0EAA0E;IACnE,QAAQ,CAAS;IACxB,yCAAyC;IAClC,aAAa,CAAU;IAC9B;;;OAGG;IACI,gBAAgB,CAAW;IAClC,sCAAsC;IAC/B,sBAAsB,CAAU;IACvC,sDAAsD;IAC/C,iBAAiB,GAAY,KAAK,CAAC;IAClC,YAAY,CAAW;IACvB,aAAa,CAAW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C3F,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC;YACzC,MAAM,MAAM,GAAG,mBAAQ,CAAC,yBAAyB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YACxE,IAAI,MAAM,KAAK,SAAS;gBACtB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,iGAAiG;IAC1F,2BAA2B,CAAC,QAAgB;QACjD,IAAI,IAAI,CAAC,sBAAsB,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC;eACxF,IAAI,CAAC,sBAAsB,GAAG,QAAQ;YACzC,QAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC;QACzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,eAAe;QAC3B,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,QAAQ,GAAG,aAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC;IACjB,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,eAAe;QAC3B,MAAM,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QACpC,OAAO,CAAC,QAAQ,GAAG,aAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAlMD,sCAkMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { Geometry } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\n\n/**\n * Tolerance blob for various stroking methods.\n *\n * * Across many applications, the critical concepts are: chordTol, angleTol, maxEdgeLength\n * * Chord error is an distance measured from a curve or facet to its approximating stroke or facet.\n * * angle is the angle between two contiguous strokes or across a facet edge.\n * * maxEdgeLength is the length of a stroke or a edge of a facet.\n * * It is rare for all three to be active at once.\n * * Nearly all stroke and facet use cases will apply an angle tolerance.\n * * For curves, 15 degrees is typical\n * * For facets, 22.5 degrees is typical.\n * * Halving the angle tolerance will (roughly) make curves get twice as many strokes, and surfaces get 4 times as many facets.\n * * The angle tolerance has the useful property that its effect is independent of scale of that data. If data is suddenly scaled into millimeters rather than meters, the facet counts remain the same.\n * * When creating output for devices such as 3D printing will want a chord tolerance.\n * * For graphics display, use an angle tolerance of around 15 degrees and an chord tolerance which is the size of several pixels.\n * * Analysis meshes (e.g. Finite Elements) commonly need to apply maxEdgeLength.\n * * Using maxEdgeLength for graphics probably produces too many facets. For example, it causes long cylinders to get many nearly-square facets instead of the small number of long quads usually used for graphics.\n * * Facet tolerances are, as the Pirates' Code, guidelines, not absolute rules. Facet and stroke code may ignore tolerances in awkward situations.\n * * If multiple tolerances are in effect, the actual count will usually be based on the one that demands the most strokes or facets, unless it is so high that it violates some upper limit on the number of facets on an arc or a section of a curve.\n * @public\n */\nexport class StrokeOptions {\n /** Distance from stroke to actual geometry. */\n public chordTol?: number;\n /** Turning angle between strokes. Larger value leads to fewer strokes. */\n public angleTol?: Angle;\n /** Maximum length of a single stroke. */\n public maxEdgeLength?: number;\n /**\n * Caller expects convex facets.\n * @deprecated in 4.x - never used. See [[shouldTriangulate]] and [[maximizeConvexFacets]].\n */\n public needConvexFacets?: boolean;\n /** Minimum strokes on a primitive. */\n public minStrokesPerPrimitive?: number;\n /** Whether or not to triangulate each added facet. */\n public shouldTriangulate: boolean = false;\n private _needNormals?: boolean;\n private _needTwoSided?: boolean;\n private _needParams?: boolean;\n /** Whether params are requested. */\n public get needParams(): boolean {\n return this._needParams !== undefined ? this._needParams : false;\n }\n public set needParams(value: boolean) {\n this._needParams = value;\n }\n /** Whether normals are requested */\n public get needNormals(): boolean {\n return this._needNormals !== undefined ? this._needNormals : false;\n }\n public set needNormals(value: boolean) {\n this._needNormals = value;\n }\n /** Whether twoSided is requested. */\n public get needTwoSided(): boolean {\n return this._needTwoSided !== undefined ? this._needTwoSided : false;\n }\n public set needTwoSided(value: boolean) {\n this._needTwoSided = value;\n }\n /** Optional color request flag */\n public needColors?: boolean;\n /** Default number of strokes for a circle. */\n public defaultCircleStrokes = 16;\n /** Ask if angleTol is specified */\n public get hasAngleTol(): boolean {\n return this.angleTol !== undefined && Math.abs(this.angleTol.radians) > 0.0;\n }\n /** Ask if chordTol is specified */\n public get hasChordTol(): boolean {\n return this.chordTol !== undefined && this.chordTol > 0.0;\n }\n /** Ask if maxEdgeLength is specified */\n public get hasMaxEdgeLength(): boolean {\n return this.maxEdgeLength !== undefined && this.maxEdgeLength > 0.0;\n }\n private _maximizeConvexFacets?: boolean;\n /**\n * Whether to post-process a planar triangulation by removing edges to maximize the size of convex facets.\n * * Setting this to true also sets [[shouldTriangulate]] to true.\n */\n public get maximizeConvexFacets(): boolean {\n return this._maximizeConvexFacets ?? false;\n }\n public set maximizeConvexFacets(value: boolean) {\n this._maximizeConvexFacets = value;\n if (value)\n this.shouldTriangulate = value;\n }\n /** Return a deep clone */\n public clone(): StrokeOptions {\n const options = new StrokeOptions();\n options.chordTol = this.chordTol;\n options.angleTol = this.angleTol?.clone();\n options.maxEdgeLength = this.maxEdgeLength;\n options.minStrokesPerPrimitive = this.minStrokesPerPrimitive;\n options.shouldTriangulate = this.shouldTriangulate;\n options._needNormals = this._needNormals;\n options._needTwoSided = this._needTwoSided;\n options._needParams = this._needParams;\n options.needColors = this.needColors;\n options.defaultCircleStrokes = this.defaultCircleStrokes;\n options._maximizeConvexFacets = this._maximizeConvexFacets;\n return options;\n }\n /** Return stroke count which is the larger of the minCount or count needed for edge length condition. */\n public applyMaxEdgeLength(minCount: number, totalLength: number): number {\n totalLength = Math.abs(totalLength);\n if (this.maxEdgeLength && this.maxEdgeLength > 0.0 && minCount * this.maxEdgeLength < totalLength) {\n minCount = Geometry.stepCount(this.maxEdgeLength, totalLength, minCount);\n }\n return minCount;\n }\n /**\n * Return stroke count which is the larger of the existing count or count needed for angle condition for given\n * sweepRadians.\n * * defaultStepRadians is assumed to be larger than zero.\n */\n public applyAngleTol(minCount: number, sweepRadians: number, defaultStepRadians: number): number {\n return StrokeOptions.applyAngleTol(this, minCount, sweepRadians, defaultStepRadians);\n }\n /**\n * Return stroke count which is the larger of minCount and the count required to turn sweepRadians, using tolerance\n * from the options.\n */\n public static applyAngleTol(\n options: StrokeOptions | undefined, minCount: number, sweepRadians: number, defaultStepRadians?: number,\n ): number {\n sweepRadians = Math.abs(sweepRadians);\n let stepRadians = defaultStepRadians ? defaultStepRadians : Math.PI / 8.0;\n if (options && options.angleTol && options.angleTol.radians > 0.0)\n stepRadians = options.angleTol.radians;\n if (minCount * stepRadians < sweepRadians)\n minCount = Geometry.stepCount(stepRadians, sweepRadians, minCount);\n return minCount;\n }\n /**\n * Return the number of strokes needed for given edgeLength curve.\n * @param options\n * @param minCount smallest allowed count\n * @param edgeLength\n */\n public static applyMaxEdgeLength(\n options: StrokeOptions | undefined, minCount: number, edgeLength: number,\n ): number {\n if (edgeLength < 0)\n edgeLength = - edgeLength;\n if (minCount < 1)\n minCount = 1;\n if (options && options.maxEdgeLength && options.maxEdgeLength * minCount < edgeLength) {\n minCount = Geometry.stepCount(options.maxEdgeLength, edgeLength, minCount);\n }\n return minCount;\n }\n /**\n * Determine a stroke count for a (partial) circular arc of given radius. This considers angle, maxEdgeLength,\n * chord, and minimum stroke.\n */\n public applyTolerancesToArc(radius: number, sweepRadians: number = Math.PI * 2): number {\n let numStrokes = 1;\n numStrokes = this.applyAngleTol(numStrokes, sweepRadians, Math.PI * 0.25);\n numStrokes = this.applyMaxEdgeLength(numStrokes, sweepRadians * radius);\n numStrokes = this.applyChordTol(numStrokes, radius, sweepRadians);\n numStrokes = this.applyMinStrokesPerPrimitive(numStrokes);\n return numStrokes;\n }\n /** Return stroke count which is the larger of existing count or count needed for circular arc chord tolerance condition. */\n public applyChordTol(minCount: number, radius: number, sweepRadians: number): number {\n if (this.chordTol && this.chordTol > 0.0 && this.chordTol < radius) {\n const a = this.chordTol;\n const stepRadians = 2.0 * Math.acos((1.0 - a / radius));\n minCount = Geometry.stepCount(stepRadians, sweepRadians, minCount);\n }\n return minCount;\n }\n /**\n * Return stroke count which is the larger of existing count or count needed for circular arc chord tol with given\n * arc length and radians\n */\n public applyChordTolToLengthAndRadians(minCount: number, length: number, sweepRadians: number): number {\n if (this.chordTol && this.chordTol > 0.0) {\n const radius = Geometry.conditionalDivideFraction(length, sweepRadians);\n if (radius !== undefined)\n return this.applyChordTol(minCount, radius, sweepRadians);\n }\n return minCount;\n }\n /** Return stroke count which is the larger of existing count or `this.minStrokesPerPrimitive` */\n public applyMinStrokesPerPrimitive(minCount: number): number {\n if (this.minStrokesPerPrimitive !== undefined && Number.isFinite(this.minStrokesPerPrimitive)\n && this.minStrokesPerPrimitive > minCount)\n minCount = this.minStrokesPerPrimitive;\n return minCount;\n }\n /**\n * Create `StrokeOptions` with defaults appropriate for curves.\n * * angle tolerance of 15 degrees.\n * * all others inactive.\n */\n public static createForCurves(): StrokeOptions {\n const options = new StrokeOptions();\n options.angleTol = Angle.createDegrees(15.0);\n return options;\n }\n /**\n * Create `StrokeOptions` with defaults appropriate for surfaces facets\n * * angle tolerance of 22.5 degrees.\n * * all others inactive.\n */\n public static createForFacets(): StrokeOptions {\n const options = new StrokeOptions();\n options.angleTol = Angle.createDegrees(22.5);\n return options;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StrokeOptions.js","sourceRoot":"","sources":["../../../src/curve/StrokeOptions.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAuC;AACvC,+CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,M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CAAC;IACjB,CAAC;CACF;AAvMD,sCAuMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { Geometry } from \"../Geometry\";\nimport { Angle } from \"../geometry3d/Angle\";\n\n/**\n * Tolerance blob for various stroking methods.\n *\n * * Across many applications, the critical concepts are: chordTol, angleTol, maxEdgeLength\n * * Chord error is an distance measured from a curve or facet to its approximating stroke or facet.\n * * angle is the angle between two contiguous strokes or across a facet edge.\n * * maxEdgeLength is the length of a stroke or a edge of a facet.\n * * It is rare for all three to be active at once.\n * * Nearly all stroke and facet use cases will apply an angle tolerance.\n * * For curves, 15 degrees is typical\n * * For facets, 22.5 degrees is typical.\n * * Halving the angle tolerance will (roughly) make curves get twice as many strokes, and surfaces get 4 times as many facets.\n * * The angle tolerance has the useful property that its effect is independent of scale of that data. If data is suddenly scaled into millimeters rather than meters, the facet counts remain the same.\n * * When creating output for devices such as 3D printing will want a chord tolerance.\n * * For graphics display, use an angle tolerance of around 15 degrees and an chord tolerance which is the size of several pixels.\n * * Analysis meshes (e.g. Finite Elements) commonly need to apply maxEdgeLength.\n * * Using maxEdgeLength for graphics probably produces too many facets. For example, it causes long cylinders to get many nearly-square facets instead of the small number of long quads usually used for graphics.\n * * Facet tolerances are, as the Pirates' Code, guidelines, not absolute rules. Facet and stroke code may ignore tolerances in awkward situations.\n * * If multiple tolerances are in effect, the actual count will usually be based on the one that demands the most strokes or facets, unless it is so high that it violates some upper limit on the number of facets on an arc or a section of a curve.\n * @public\n */\nexport class StrokeOptions {\n /** Distance from stroke to actual geometry. */\n public chordTol?: number;\n /** Turning angle between strokes. Larger value leads to fewer strokes. */\n public angleTol?: Angle;\n /** Maximum length of a single stroke. */\n public maxEdgeLength?: number;\n /**\n * Caller expects convex facets.\n * @deprecated in 4.x - never used. See [[shouldTriangulate]] and [[maximizeConvexFacets]].\n */\n public needConvexFacets?: boolean;\n /** Minimum strokes on a primitive. */\n public minStrokesPerPrimitive?: number;\n /** Whether or not to triangulate each added facet. */\n public shouldTriangulate: boolean = false;\n private _needNormals?: boolean;\n private _needTwoSided?: boolean;\n private _needParams?: boolean;\n /** Whether params are requested. */\n public get needParams(): boolean {\n return this._needParams !== undefined ? this._needParams : false;\n }\n public set needParams(value: boolean) {\n this._needParams = value;\n }\n /** Whether normals are requested */\n public get needNormals(): boolean {\n return this._needNormals !== undefined ? this._needNormals : false;\n }\n public set needNormals(value: boolean) {\n this._needNormals = value;\n }\n /**\n * Whether to request facets that are viewable from the back.\n * * Default value is true.\n * * Set to false only if the requested facets are expected to form a closed volume with outward normals,\n * indicating they are amenable to backface culling for improved display performance.\n */\n public get needTwoSided(): boolean {\n return this._needTwoSided !== undefined ? this._needTwoSided : true;\n }\n public set needTwoSided(value: boolean) {\n this._needTwoSided = value;\n }\n /** Optional color request flag */\n public needColors?: boolean;\n /** Default number of strokes for a circle. */\n public defaultCircleStrokes = 16;\n /** Ask if angleTol is specified */\n public get hasAngleTol(): boolean {\n return this.angleTol !== undefined && Math.abs(this.angleTol.radians) > 0.0;\n }\n /** Ask if chordTol is specified */\n public get hasChordTol(): boolean {\n return this.chordTol !== undefined && this.chordTol > 0.0;\n }\n /** Ask if maxEdgeLength is specified */\n public get hasMaxEdgeLength(): boolean {\n return this.maxEdgeLength !== undefined && this.maxEdgeLength > 0.0;\n }\n private _maximizeConvexFacets?: boolean;\n /**\n * Whether to post-process a planar triangulation by removing edges to maximize the size of convex facets.\n * * Setting this to true also sets [[shouldTriangulate]] to true.\n */\n public get maximizeConvexFacets(): boolean {\n return this._maximizeConvexFacets ?? false;\n }\n public set maximizeConvexFacets(value: boolean) {\n this._maximizeConvexFacets = value;\n if (value)\n this.shouldTriangulate = value;\n }\n /** Return a deep clone */\n public clone(): StrokeOptions {\n const options = new StrokeOptions();\n options.chordTol = this.chordTol;\n options.angleTol = this.angleTol?.clone();\n options.maxEdgeLength = this.maxEdgeLength;\n options.minStrokesPerPrimitive = this.minStrokesPerPrimitive;\n options.shouldTriangulate = this.shouldTriangulate;\n options._needNormals = this._needNormals;\n options._needTwoSided = this._needTwoSided;\n options._needParams = this._needParams;\n options.needColors = this.needColors;\n options.defaultCircleStrokes = this.defaultCircleStrokes;\n options._maximizeConvexFacets = this._maximizeConvexFacets;\n return options;\n }\n /** Return stroke count which is the larger of the minCount or count needed for edge length condition. */\n public applyMaxEdgeLength(minCount: number, totalLength: number): number {\n totalLength = Math.abs(totalLength);\n if (this.maxEdgeLength && this.maxEdgeLength > 0.0 && minCount * this.maxEdgeLength < totalLength) {\n minCount = Geometry.stepCount(this.maxEdgeLength, totalLength, minCount);\n }\n return minCount;\n }\n /**\n * Return stroke count which is the larger of the existing count or count needed for angle condition for given\n * sweepRadians.\n * * defaultStepRadians is assumed to be larger than zero.\n */\n public applyAngleTol(minCount: number, sweepRadians: number, defaultStepRadians: number): number {\n return StrokeOptions.applyAngleTol(this, minCount, sweepRadians, defaultStepRadians);\n }\n /**\n * Return stroke count which is the larger of minCount and the count required to turn sweepRadians, using tolerance\n * from the options.\n */\n public static applyAngleTol(\n options: StrokeOptions | undefined, minCount: number, sweepRadians: number, defaultStepRadians?: number,\n ): number {\n sweepRadians = Math.abs(sweepRadians);\n let stepRadians = defaultStepRadians ? defaultStepRadians : Math.PI / 8.0;\n if (options && options.angleTol && options.angleTol.radians > 0.0)\n stepRadians = options.angleTol.radians;\n if (minCount * stepRadians < sweepRadians)\n minCount = Geometry.stepCount(stepRadians, sweepRadians, minCount);\n return minCount;\n }\n /**\n * Return the number of strokes needed for given edgeLength curve.\n * @param options\n * @param minCount smallest allowed count\n * @param edgeLength\n */\n public static applyMaxEdgeLength(\n options: StrokeOptions | undefined, minCount: number, edgeLength: number,\n ): number {\n if (edgeLength < 0)\n edgeLength = - edgeLength;\n if (minCount < 1)\n minCount = 1;\n if (options && options.maxEdgeLength && options.maxEdgeLength * minCount < edgeLength) {\n minCount = Geometry.stepCount(options.maxEdgeLength, edgeLength, minCount);\n }\n return minCount;\n }\n /**\n * Determine a stroke count for a (partial) circular arc of given radius. This considers angle, maxEdgeLength,\n * chord, and minimum stroke.\n */\n public applyTolerancesToArc(radius: number, sweepRadians: number = Math.PI * 2): number {\n let numStrokes = 1;\n numStrokes = this.applyAngleTol(numStrokes, sweepRadians, Math.PI * 0.25);\n numStrokes = this.applyMaxEdgeLength(numStrokes, sweepRadians * radius);\n numStrokes = this.applyChordTol(numStrokes, radius, sweepRadians);\n numStrokes = this.applyMinStrokesPerPrimitive(numStrokes);\n return numStrokes;\n }\n /** Return stroke count which is the larger of existing count or count needed for circular arc chord tolerance condition. */\n public applyChordTol(minCount: number, radius: number, sweepRadians: number): number {\n if (this.chordTol && this.chordTol > 0.0 && this.chordTol < radius) {\n const a = this.chordTol;\n const stepRadians = 2.0 * Math.acos((1.0 - a / radius));\n minCount = Geometry.stepCount(stepRadians, sweepRadians, minCount);\n }\n return minCount;\n }\n /**\n * Return stroke count which is the larger of existing count or count needed for circular arc chord tol with given\n * arc length and radians\n */\n public applyChordTolToLengthAndRadians(minCount: number, length: number, sweepRadians: number): number {\n if (this.chordTol && this.chordTol > 0.0) {\n const radius = Geometry.conditionalDivideFraction(length, sweepRadians);\n if (radius !== undefined)\n return this.applyChordTol(minCount, radius, sweepRadians);\n }\n return minCount;\n }\n /** Return stroke count which is the larger of existing count or `this.minStrokesPerPrimitive` */\n public applyMinStrokesPerPrimitive(minCount: number): number {\n if (this.minStrokesPerPrimitive !== undefined && Number.isFinite(this.minStrokesPerPrimitive)\n && this.minStrokesPerPrimitive > minCount)\n minCount = this.minStrokesPerPrimitive;\n return minCount;\n }\n /**\n * Create `StrokeOptions` with defaults appropriate for curves.\n * * angle tolerance of 15 degrees.\n * * all others inactive.\n */\n public static createForCurves(): StrokeOptions {\n const options = new StrokeOptions();\n options.angleTol = Angle.createDegrees(15.0);\n return options;\n }\n /**\n * Create `StrokeOptions` with defaults appropriate for surfaces facets\n * * angle tolerance of 22.5 degrees.\n * * all others inactive.\n */\n public static createForFacets(): StrokeOptions {\n const options = new StrokeOptions();\n options.angleTol = Angle.createDegrees(22.5);\n return options;\n }\n}\n"]}
|
|
@@ -19,18 +19,19 @@ import { Ray3d } from "./Ray3d";
|
|
|
19
19
|
import { Transform } from "./Transform";
|
|
20
20
|
import { XYAndZ } from "./XYZProps";
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* A complete unit sphere mapped by an arbitrary [[Transform]].
|
|
23
23
|
* * The (unit) sphere parameterization with respect to longitude `theta` and latitude `phi` is
|
|
24
24
|
* * `u = cos(theta) * cos (phi)`
|
|
25
25
|
* * `v = sin(theta) * cos(phi)`
|
|
26
26
|
* * `w = sin(phi)`
|
|
27
|
-
*
|
|
27
|
+
* * The sphere (u,v,w) multiply the x,y,z columns of the Ellipsoid transform.
|
|
28
|
+
* * Compare to [[Sphere]], which has the same parameterization, but is a [[SolidPrimitive]] with latitude sweep.
|
|
28
29
|
* @public
|
|
29
30
|
*/
|
|
30
31
|
export declare class Ellipsoid implements Clipper {
|
|
31
32
|
private _transform;
|
|
32
|
-
private
|
|
33
|
-
private
|
|
33
|
+
private _workUnitVectorA;
|
|
34
|
+
private _workUnitVectorB;
|
|
34
35
|
private _workPointA;
|
|
35
36
|
private _workPointB;
|
|
36
37
|
private constructor();
|
|
@@ -231,11 +232,11 @@ export declare class Ellipsoid implements Clipper {
|
|
|
231
232
|
* * if not given, return surface point and unit normal for unit sphere.
|
|
232
233
|
*/
|
|
233
234
|
static radiansToUnitNormalRay(ellipsoid: Ellipsoid | undefined, thetaRadians: number, phiRadians: number, result?: Ray3d): Ray3d | undefined;
|
|
234
|
-
/**
|
|
235
|
+
/** Implementation of [[Clipper.isPointOnOrInside]]. */
|
|
235
236
|
isPointOnOrInside(point: Point3d): boolean;
|
|
236
|
-
/** Announce "in" portions of a line segment.
|
|
237
|
+
/** Announce "in" portions of a line segment. Implementation of [[Clipper.announceClippedSegmentIntervals]]. */
|
|
237
238
|
announceClippedSegmentIntervals(f0: number, f1: number, pointA: Point3d, pointB: Point3d, announce?: AnnounceNumberNumber): boolean;
|
|
238
|
-
/** Announce "in" portions of a line segment.
|
|
239
|
+
/** Announce "in" portions of a line segment. Implementation of [[Clipper.announceClippedArcIntervals]] */
|
|
239
240
|
announceClippedArcIntervals(arc: Arc3d, announce?: AnnounceNumberNumberCurvePrimitive): boolean;
|
|
240
241
|
}
|
|
241
242
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ellipsoid.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Ellipsoid.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAA2B,MAAM,kCAAkC,CAAC;AAC1G,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,kCAAkC,EAAE,MAAM,yBAAyB,CAAC;AAEnG,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAKhD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAW,OAAO,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,KAAK,E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kB,CAAqB;IAC/C,OAAO;IAIP;;;;;;;OAOG;WACW,kBAAkB,CAAC,iBAAiB,EAAE,SAAS,EAC3D,WAAW,EAAE,uBAAuB,EAAE,SAAS,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,iBAAiB,EAAE,GAAG,SAAS;IAsDrI,OAAO,CAAC,uCAAuC;IAc/C,OAAO,CAAC,WAAW;IAUnB;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAqBjB,OAAO,CAAC,KAAK;IAGb;;;;;;;;;;OAUG;WACW,kCAAkC,CAAC,SAAS,EAAE,SAAS,EACnE,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,EAClD,4BAA4B,EAAE,MAAM,EACpC,4BAA4B,EAAE,MAAM,GAAG;QAAE,YAAY,EAAE,KAAK,CAAC;QAAC,oCAAoC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;CA6B3H"}
|
|
@@ -131,24 +131,25 @@ class EllipsoidComponentExtrema {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
|
-
*
|
|
134
|
+
* A complete unit sphere mapped by an arbitrary [[Transform]].
|
|
135
135
|
* * The (unit) sphere parameterization with respect to longitude `theta` and latitude `phi` is
|
|
136
136
|
* * `u = cos(theta) * cos (phi)`
|
|
137
137
|
* * `v = sin(theta) * cos(phi)`
|
|
138
138
|
* * `w = sin(phi)`
|
|
139
|
-
*
|
|
139
|
+
* * The sphere (u,v,w) multiply the x,y,z columns of the Ellipsoid transform.
|
|
140
|
+
* * Compare to [[Sphere]], which has the same parameterization, but is a [[SolidPrimitive]] with latitude sweep.
|
|
140
141
|
* @public
|
|
141
142
|
*/
|
|
142
143
|
class Ellipsoid {
|
|
143
144
|
_transform;
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
_workUnitVectorA;
|
|
146
|
+
_workUnitVectorB;
|
|
146
147
|
_workPointA;
|
|
147
148
|
_workPointB;
|
|
148
149
|
constructor(transform) {
|
|
149
150
|
this._transform = transform;
|
|
150
|
-
this.
|
|
151
|
-
this.
|
|
151
|
+
this._workUnitVectorA = Point3dVector3d_1.Vector3d.create();
|
|
152
|
+
this._workUnitVectorB = Point3dVector3d_1.Vector3d.create();
|
|
152
153
|
this._workPointA = Point3dVector3d_1.Point3d.create();
|
|
153
154
|
this._workPointB = Point3dVector3d_1.Point3d.create();
|
|
154
155
|
}
|
|
@@ -360,11 +361,11 @@ class Ellipsoid {
|
|
|
360
361
|
* @param result optional preallocated result
|
|
361
362
|
*/
|
|
362
363
|
radiansPairToGreatArc(thetaARadians, phiARadians, thetaBRadians, phiBRadians, result) {
|
|
363
|
-
Polynomials_1.SphereImplicit.radiansToUnitSphereXYZ(thetaARadians, phiARadians, this.
|
|
364
|
-
Polynomials_1.SphereImplicit.radiansToUnitSphereXYZ(thetaBRadians, phiBRadians, this.
|
|
365
|
-
const sweepAngle = this.
|
|
364
|
+
Polynomials_1.SphereImplicit.radiansToUnitSphereXYZ(thetaARadians, phiARadians, this._workUnitVectorA);
|
|
365
|
+
Polynomials_1.SphereImplicit.radiansToUnitSphereXYZ(thetaBRadians, phiBRadians, this._workUnitVectorB);
|
|
366
|
+
const sweepAngle = this._workUnitVectorA.angleTo(this._workUnitVectorB);
|
|
366
367
|
// the unit vectors (on unit sphere) are never 0, so this cannot fail.
|
|
367
|
-
const matrix = Matrix3d_1.Matrix3d.createRigidFromColumns(this.
|
|
368
|
+
const matrix = Matrix3d_1.Matrix3d.createRigidFromColumns(this._workUnitVectorA, this._workUnitVectorB, Geometry_1.AxisOrder.XYZ);
|
|
368
369
|
if (matrix !== undefined) {
|
|
369
370
|
const matrix1 = this._transform.matrix.multiplyMatrixMatrix(matrix);
|
|
370
371
|
return Arc3d_1.Arc3d.create(this._transform.getOrigin(), matrix1.columnX(), matrix1.columnY(), AngleSweep_1.AngleSweep.createStartEndRadians(0.0, sweepAngle.radians), result);
|
|
@@ -449,9 +450,9 @@ class Ellipsoid {
|
|
|
449
450
|
* @param result optional preallocated result
|
|
450
451
|
*/
|
|
451
452
|
radiansPairToEquatorialEllipsoid(thetaARadians, phiARadians, thetaBRadians, phiBRadians, result) {
|
|
452
|
-
Polynomials_1.SphereImplicit.radiansToUnitSphereXYZ(thetaARadians, phiARadians, this.
|
|
453
|
-
Polynomials_1.SphereImplicit.radiansToUnitSphereXYZ(thetaBRadians, phiBRadians, this.
|
|
454
|
-
const matrix = Matrix3d_1.Matrix3d.createRigidFromColumns(this.
|
|
453
|
+
Polynomials_1.SphereImplicit.radiansToUnitSphereXYZ(thetaARadians, phiARadians, this._workUnitVectorA);
|
|
454
|
+
Polynomials_1.SphereImplicit.radiansToUnitSphereXYZ(thetaBRadians, phiBRadians, this._workUnitVectorB);
|
|
455
|
+
const matrix = Matrix3d_1.Matrix3d.createRigidFromColumns(this._workUnitVectorA, this._workUnitVectorB, Geometry_1.AxisOrder.XYZ);
|
|
455
456
|
if (matrix) {
|
|
456
457
|
if (result) {
|
|
457
458
|
this._transform.multiplyTransformMatrix3d(matrix, result._transform);
|
|
@@ -628,14 +629,14 @@ class Ellipsoid {
|
|
|
628
629
|
result.direction.setFromPoint3d(result.origin);
|
|
629
630
|
return result;
|
|
630
631
|
}
|
|
631
|
-
/**
|
|
632
|
+
/** Implementation of [[Clipper.isPointOnOrInside]]. */
|
|
632
633
|
isPointOnOrInside(point) {
|
|
633
634
|
const localPoint = this._transform.multiplyInversePoint3d(point, this._workPointA);
|
|
634
635
|
if (localPoint !== undefined)
|
|
635
636
|
return localPoint.magnitude() <= 1.0;
|
|
636
637
|
return false;
|
|
637
638
|
}
|
|
638
|
-
/** Announce "in" portions of a line segment.
|
|
639
|
+
/** Announce "in" portions of a line segment. Implementation of [[Clipper.announceClippedSegmentIntervals]]. */
|
|
639
640
|
announceClippedSegmentIntervals(f0, f1, pointA, pointB, announce) {
|
|
640
641
|
const localA = this._transform.multiplyInversePoint3d(pointA, this._workPointA);
|
|
641
642
|
const localB = this._transform.multiplyInversePoint3d(pointB, this._workPointB);
|
|
@@ -674,7 +675,7 @@ class Ellipsoid {
|
|
|
674
675
|
}
|
|
675
676
|
return false;
|
|
676
677
|
}
|
|
677
|
-
/** Announce "in" portions of a line segment.
|
|
678
|
+
/** Announce "in" portions of a line segment. Implementation of [[Clipper.announceClippedArcIntervals]] */
|
|
678
679
|
announceClippedArcIntervals(arc, announce) {
|
|
679
680
|
const arcData = arc.toVectors();
|
|
680
681
|
let numAnnounce = 0;
|