@itwin/core-geometry 4.0.0-dev.22 → 4.0.0-dev.24
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/Geometry.d.ts +23 -0
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +25 -1
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +195 -8
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js +459 -11
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.d.ts +22 -7
- package/lib/cjs/geometry3d/IndexedXYCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js +41 -5
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +58 -4
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +102 -4
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts +10 -0
- package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js +14 -0
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts +0 -6
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js +0 -6
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +2 -2
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts +14 -1
- package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +33 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +120 -10
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +412 -12
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.d.ts +264 -0
- package/lib/cjs/polyface/FacetLocationDetail.d.ts.map +1 -0
- package/lib/cjs/polyface/FacetLocationDetail.js +378 -0
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -0
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +2 -5
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +5 -2
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +20 -14
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +21 -17
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +22 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +52 -2
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts +5 -5
- package/lib/cjs/solid/Sphere.js +5 -5
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/esm/Geometry.d.ts +23 -0
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +24 -0
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts +195 -8
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js +459 -12
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.d.ts +22 -7
- package/lib/esm/geometry3d/IndexedXYCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js +41 -5
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +58 -4
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +103 -5
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts +10 -0
- package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js +14 -0
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts +0 -6
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js +0 -6
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +2 -2
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts +14 -1
- package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +33 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +120 -10
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +411 -12
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.d.ts +264 -0
- package/lib/esm/polyface/FacetLocationDetail.d.ts.map +1 -0
- package/lib/esm/polyface/FacetLocationDetail.js +371 -0
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -0
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +2 -5
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +5 -2
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +20 -14
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +21 -17
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +22 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +52 -2
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts +5 -5
- package/lib/esm/solid/Sphere.js +5 -5
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FacetLocationDetail.js","sourceRoot":"","sources":["../../../src/polyface/FacetLocationDetail.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,mEAAwD;AACxD,mEAAkE;AAClE,2EAA2E;AAC3E,0CAAwD;AAExD,yDAA6E;AAG7E,6DAAyD;AASzD;;GAEG;AACH,MAAa,qBAAqB;IAehC,gCAAgC;IAChC;QACE,IAAI,CAAC,iBAAiB,GAAG,mBAAQ,CAAC,mBAAmB,CAAC;QACtD,IAAI,CAAC,kBAAkB,GAAG,mBAAQ,CAAC,aAAa,CAAC;IACnD,CAAC;CACF;AApBD,sDAoBC;AAuCD;;;GAGG;AACH,MAAa,6BAA6B;IAOxC,sCAAsC;IACtC,YAAoB,aAAqB,CAAC,CAAC,EAAE,MAA+B;QAC1E,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,4CAAsB,CAAC,MAAM,EAAE,CAAC;IACnE,CAAC;IACD,8BAA8B;IACvB,UAAU,CAAC,OAAgB,IAAI;QACpC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC;QACtB,IAAI,IAAI;YACN,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC1B,CAAC;IACD;;OAEG;IACI,MAAM,CAAC,MAAM,CAAC,UAAkB,EAAE,MAA+B,EAAE,MAAsC;QAC9G,IAAI,SAAS,KAAK,MAAM;YACtB,OAAO,IAAI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C/B,WAAW,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;aACpD;SACF;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD;;;;;OAKG;IACa,QAAQ,CAAC,WAAsB,EAAE,aAAoC,EAAE,oBAA4B,mBAAQ,CAAC,mBAAmB;QAC7I,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,KAAK,IAAI,CAAC,MAAM,IAAI,SAAS,KAAK,WAAW,EAAE;YAClF,MAAM,MAAM,GAAG,IAAI,CAAC,yBAAyB,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;YAChF,IAAI,SAAS,KAAK,MAAM;gBACtB,IAAI,CAAC,MAAM,GAAG,0BAAW,CAAC,yBAAyB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;SAC5E;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD;;;;MAIE;IACc,yBAAyB,CAAC,aAAoC,EAAE,oBAA4B,mBAAQ,CAAC,mBAAmB;QACtI,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,KAAK,IAAI,CAAC,uBAAuB,IAAI,SAAS,KAAK,aAAa,EAAE;YACrG,IAAI,CAAC,uBAAuB,GAAG,uBAAU,CAAC,4BAA4B,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;SAC9H;QACD,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACtC,CAAC;CACF;AAvGD,8DAuGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Polyface\r\n */\r\n\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { TriangleLocationDetail } from \"../geometry3d/BarycentricTriangle\";\r\nimport { Geometry, PolygonLocation } from \"../Geometry\";\r\nimport { PolyfaceVisitor } from \"./Polyface\";\r\nimport { PolygonLocationDetail, PolygonOps } from \"../geometry3d/PolygonOps\";\r\nimport { IndexedXYZCollection } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { IndexedXYCollection } from \"../geometry3d/IndexedXYCollection\";\r\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\r\n\r\n/** Callback for processing the detail for an intersected facet.\r\n * @param detail reference to the intersection data, with `detail.IsInsideOn === true`. Note that `detail` is owned by the caller; to persist, use `detail.clone`.\r\n * @param visitor at currently intersected facet\r\n * @returns true to accept this intersection and stop processing; false to continue to the next facet\r\n */\r\nexport type FacetIntersectCallback = (detail: FacetLocationDetail, visitor: PolyfaceVisitor) => boolean;\r\n\r\n/** Options for computing and processing facet intersection methods.\r\n * @see PolyfaceQuery.intersectRay3d\r\n */\r\nexport class FacetIntersectOptions {\r\n /** distance tolerance for testing coincidence with facet boundary */\r\n public distanceTolerance: number;\r\n /** fractional tolerance for snapping barycentric coordinates to a triangular facet edge */\r\n public parameterTolerance: number;\r\n /** whether to compute the normal at the intersection point */\r\n public needNormal?: boolean;\r\n /** whether to compute the uv parameter at the intersection point */\r\n public needParam?: boolean;\r\n /** whether to compute the color at the intersection point */\r\n public needColor?: boolean;\r\n /** whether to compute the barycentric coordinates of the point for a convex facet */\r\n public needBarycentricCoordinates?: boolean;\r\n /** optional callback to accept an intersected facet */\r\n public acceptIntersection?: FacetIntersectCallback;\r\n /** constructor with defaults */\r\n public constructor() {\r\n this.distanceTolerance = Geometry.smallMetricDistance;\r\n this.parameterTolerance = Geometry.smallFraction;\r\n }\r\n}\r\n/**\r\n * Carries data about a point in the plane of a facet of a mesh.\r\n * @see PolyfaceQuery.intersectRay3d\r\n * @public\r\n */\r\nexport interface FacetLocationDetail {\r\n /** Get the index of the referenced facet. */\r\n get facetIndex(): number;\r\n /** Get the number of edges of this facet. */\r\n get edgeCount(): number;\r\n /** Get the world coordinates of the point. */\r\n get point(): Point3d;\r\n /** Get the application-specific number. */\r\n get a(): number;\r\n /** Get the projection of the point onto the closest facet edge. */\r\n get closestEdge(): { startVertexIndex: number, edgeParam: number };\r\n /** Whether this instance specifies a valid location. */\r\n get isValid(): boolean;\r\n /** Whether the facet is convex. */\r\n get isConvex(): boolean;\r\n /** Whether the point is inside or on the facet. */\r\n get isInsideOrOn(): boolean;\r\n /** Get the code that classifies the location of the point with respect to the facet. */\r\n get classify(): PolygonLocation;\r\n /** Clone the instance */\r\n clone(): FacetLocationDetail;\r\n /** Set the instance contents from the other detail */\r\n copyContentsFrom(other: FacetLocationDetail): void;\r\n /** Get reference to cached normal interpolated from facet data. Inputs may be used to compute the cache. */\r\n getNormal(facetNormals?: IndexedXYZCollection, facetVertices?: IndexedXYZCollection, distanceTolerance?: number): Vector3d | undefined;\r\n /** Get reference to cached uv parameter interpolated from facet data. Inputs may be used to compute the cache. */\r\n getParam(facetParams?: IndexedXYCollection, facetVertices?: IndexedXYZCollection, distanceTolerance?: number): Point2d | undefined;\r\n /** Get cached color interpolated from facet data. Inputs may be used to compute the cache. */\r\n getColor(facetColors?: number[], facetVertices?: IndexedXYZCollection, distanceTolerance?: number): number | undefined;\r\n /** Get reference to cached barycentric coordinates of the point. Inputs may be used to compute the cache. */\r\n getBarycentricCoordinates(facetVertices?: IndexedXYZCollection, distanceTolerance?: number): number[] | undefined;\r\n}\r\n\r\n/**\r\n * Implementation of `FacetLocationDetail` for a triangular facet.\r\n * @public\r\n */\r\nexport class TriangularFacetLocationDetail implements FacetLocationDetail {\r\n private _facetIndex: number;\r\n private _detail: TriangleLocationDetail;\r\n private _normal?: Vector3d;\r\n private _param?: Point2d;\r\n private _color?: number;\r\n\r\n /** captures the detail if provided */\r\n private constructor(facetIndex: number = -1, detail?: TriangleLocationDetail) {\r\n this._facetIndex = facetIndex;\r\n this._detail = detail ? detail : TriangleLocationDetail.create();\r\n }\r\n /** Invalidate this detail. */\r\n public invalidate(deep: boolean = true) {\r\n this._facetIndex = -1;\r\n if (deep)\r\n this._detail.invalidate();\r\n this._normal = undefined;\r\n this._param = undefined;\r\n this._color = undefined;\r\n }\r\n /** Create a detail.\r\n * @param result optional pre-allocated object to fill and return\r\n */\r\n public static create(facetIndex: number, detail?: TriangleLocationDetail, result?: TriangularFacetLocationDetail): TriangularFacetLocationDetail {\r\n if (undefined === result)\r\n return new TriangularFacetLocationDetail(facetIndex, detail);\r\n result.invalidate(false); // detail might be owned by result!\r\n result._facetIndex = facetIndex;\r\n if (undefined !== detail)\r\n result._detail.copyContentsFrom(detail);\r\n return result;\r\n }\r\n /** Get the facet index. */\r\n public get facetIndex(): number {\r\n return this._facetIndex;\r\n }\r\n /** Get the edge count of this facet. */\r\n public get edgeCount(): number {\r\n return 3;\r\n }\r\n /** Get the world coordinates of the point. */\r\n public get point(): Point3d {\r\n return this._detail.world;\r\n }\r\n /** Get the application-specific number. */\r\n public get a(): number {\r\n return this._detail.a;\r\n }\r\n /** Get the projection of the point onto the closest facet edge. */\r\n public get closestEdge(): { startVertexIndex: number, edgeParam: number } {\r\n return { startVertexIndex: this._detail.closestEdgeIndex, edgeParam: this._detail.closestEdgeParam };\r\n }\r\n /** Test validity of fields other than _detail. */\r\n private get _isValid(): boolean {\r\n return this._facetIndex >= 0;\r\n }\r\n /** Whether this instance specifies a valid location. */\r\n public get isValid(): boolean {\r\n return this._isValid && this._detail.isValid;\r\n }\r\n /** Whether the facet is convex. */\r\n public get isConvex(): boolean {\r\n return true;\r\n }\r\n /** Whether the point is inside or on the polygon. */\r\n public get isInsideOrOn(): boolean {\r\n return this._isValid && this._detail.isInsideOrOn;\r\n }\r\n /** Get the code that classifies the location of the point with respect to the facet. */\r\n public get classify(): PolygonLocation {\r\n return this._detail.classify;\r\n }\r\n /** Clone the instance */\r\n public clone(): TriangularFacetLocationDetail {\r\n const detail = new TriangularFacetLocationDetail();\r\n detail.copyContentsFrom(this);\r\n return detail;\r\n }\r\n /** Set the instance contents from the other detail.\r\n * @param other detail to clone\r\n */\r\n public copyContentsFrom(other: TriangularFacetLocationDetail) {\r\n this._facetIndex = other._facetIndex;\r\n this._detail.copyContentsFrom(other._detail);\r\n this._normal = other._normal?.clone();\r\n this._param = other._param?.clone();\r\n this._color = other._color;\r\n }\r\n /** Get normal interpolated from facet data.\r\n * @param facetNormals used to compute the normal cache\r\n * @returns reference to cached normal\r\n */\r\n public getNormal(facetNormals?: IndexedXYZCollection): Vector3d | undefined {\r\n if (this._detail.isValid && undefined === this._normal && undefined !== facetNormals) {\r\n this._normal = Vector3d.create();\r\n const scales = [this._detail.local.x, this._detail.local.y, this._detail.local.z];\r\n facetNormals.linearCombination(scales, this._normal);\r\n }\r\n return this._normal;\r\n }\r\n /** Get uv parameter interpolated from facet data.\r\n * @param facetParams used to compute the uv parameter cache\r\n * @returns reference to cached uv parameter\r\n */\r\n public getParam(facetParams?: IndexedXYCollection): Point2d | undefined {\r\n if (this._detail.isValid && undefined === this._param && undefined !== facetParams) {\r\n this._param = Point2d.create();\r\n const scales = [this._detail.local.x, this._detail.local.y, this._detail.local.z];\r\n facetParams.linearCombination(scales, this._param);\r\n }\r\n return this._param;\r\n }\r\n /** Get color interpolated from facet data.\r\n * * Assumes barycentric coordinates are already computed in the TriangleLocationDetail member.\r\n * @param facetColors used to compute the color cache\r\n * @returns cached color\r\n */\r\n public getColor(facetColors?: number[]): number | undefined {\r\n if (this._detail.isValid && undefined === this._color && undefined !== facetColors) {\r\n const scales = [this._detail.local.x, this._detail.local.y, this._detail.local.z];\r\n this._color = NumberArray.linearCombinationOfColors(facetColors, scales);\r\n }\r\n return this._color;\r\n }\r\n /** Get the barycentric coordinates of this location.\r\n * @returns cached barycentric coordinates\r\n */\r\n public getBarycentricCoordinates(): number[] {\r\n return [this._detail.local.x, this._detail.local.y, this._detail.local.z];\r\n }\r\n}\r\n/**\r\n * Implementation of `FacetLocationDetail` for a non-convex facet.\r\n * * Facet vertex data interpolation is not available.\r\n * @public\r\n */\r\nexport class NonConvexFacetLocationDetail implements FacetLocationDetail {\r\n private _facetIndex: number;\r\n private _edgeCount: number;\r\n protected _detail: PolygonLocationDetail;\r\n\r\n /** captures the detail if provided */\r\n protected constructor(facetIndex: number = -1, edgeCount: number = 0, detail?: PolygonLocationDetail) {\r\n this._facetIndex = facetIndex;\r\n this._edgeCount = edgeCount;\r\n this._detail = detail ? detail : PolygonLocationDetail.create();\r\n }\r\n /** Invalidate this detail. */\r\n public invalidate(deep: boolean = true) {\r\n this._facetIndex = -1;\r\n this._edgeCount = 0;\r\n if (deep)\r\n this._detail.invalidate();\r\n }\r\n /** Create a detail.\r\n * @param result optional pre-allocated object to fill and return\r\n */\r\n public static create(facetIndex: number, edgeCount: number, detail?: PolygonLocationDetail, result?: NonConvexFacetLocationDetail): NonConvexFacetLocationDetail {\r\n if (undefined === result)\r\n return new NonConvexFacetLocationDetail(facetIndex, edgeCount, detail);\r\n result.invalidate(false); // detail might be owned by result!\r\n result._facetIndex = facetIndex;\r\n result._edgeCount = edgeCount;\r\n if (undefined !== detail && result._detail !== detail)\r\n result._detail.copyContentsFrom(detail);\r\n return result;\r\n }\r\n /** Get the facet index. */\r\n public get facetIndex(): number {\r\n return this._facetIndex;\r\n }\r\n /** Get the edge count of this facet. */\r\n public get edgeCount(): number {\r\n return this._edgeCount;\r\n }\r\n /** Get the world coordinates of the point. */\r\n public get point(): Point3d {\r\n return this._detail.point;\r\n }\r\n /** Get the application-specific number. */\r\n public get a(): number {\r\n return this._detail.a;\r\n }\r\n /** Get the projection of the point onto the closest facet edge. */\r\n public get closestEdge(): { startVertexIndex: number, edgeParam: number } {\r\n return { startVertexIndex: this._detail.closestEdgeIndex, edgeParam: this._detail.closestEdgeParam };\r\n }\r\n /** Test validity of fields other than _detail. */\r\n private get _isValid(): boolean {\r\n return this._facetIndex >= 0 && this._edgeCount >= 3;\r\n }\r\n /** Whether this instance specifies a valid location. */\r\n public get isValid(): boolean {\r\n return this._isValid && this._detail.isValid;\r\n }\r\n /** Whether the facet is convex. */\r\n public get isConvex(): boolean {\r\n return false;\r\n }\r\n /** Whether the point is inside or on the polygon. */\r\n public get isInsideOrOn(): boolean {\r\n return this._isValid && this._detail.isInsideOrOn;\r\n }\r\n /** Get the code that classifies the location of the point with respect to the facet. */\r\n public get classify(): PolygonLocation {\r\n return this._detail.code;\r\n }\r\n /** Clone the instance */\r\n public clone(): NonConvexFacetLocationDetail {\r\n const detail = new NonConvexFacetLocationDetail();\r\n detail.copyContentsFrom(this);\r\n return detail;\r\n }\r\n /** Set the instance contents from the other detail.\r\n * @param other detail to clone\r\n */\r\n public copyContentsFrom(other: NonConvexFacetLocationDetail) {\r\n this._facetIndex = other._facetIndex;\r\n this._edgeCount = other._edgeCount;\r\n this._detail.copyContentsFrom(other._detail);\r\n }\r\n /** Interpolated data is not defined for a non-convex facet.\r\n * @returns undefined\r\n */\r\n public getNormal(): Vector3d | undefined {\r\n return undefined;\r\n }\r\n /** Interpolated data is not defined for a non-convex facet.\r\n * @returns undefined\r\n */\r\n public getParam(): Point2d | undefined {\r\n return undefined;\r\n }\r\n /** Interpolated data is not defined for a non-convex facet.\r\n * @returns undefined\r\n */\r\n public getColor(): number | undefined {\r\n return undefined;\r\n }\r\n /** Barycentric coordinates are not defined for a non-convex facet.\r\n * @returns undefined\r\n */\r\n public getBarycentricCoordinates(): number[] | undefined {\r\n return undefined;\r\n }\r\n}\r\n/**\r\n * Implementation of `FacetLocationDetail` for a convex facet.\r\n * * If `edgeCount` is 3, `TriangularFacetLocationDetail` is more efficient.\r\n * @public\r\n */\r\nexport class ConvexFacetLocationDetail extends NonConvexFacetLocationDetail {\r\n private _normal?: Vector3d;\r\n private _param?: Point2d;\r\n private _color?: number;\r\n private _barycentricCoordinates?: number[];\r\n\r\n /** captures the detail if provided */\r\n private constructor(facetIndex: number = -1, edgeCount: number = 0, detail?: PolygonLocationDetail) {\r\n super(facetIndex, edgeCount, detail);\r\n }\r\n /** Invalidate this detail. */\r\n public override invalidate(deep: boolean = true) {\r\n super.invalidate(deep);\r\n this._normal = undefined;\r\n this._param = undefined;\r\n this._color = undefined;\r\n this._barycentricCoordinates = undefined;\r\n }\r\n /** Create a detail.\r\n * @param result optional pre-allocated object to fill and return\r\n */\r\n public static override create(facetIndex: number, edgeCount: number, detail?: PolygonLocationDetail, result?: ConvexFacetLocationDetail): ConvexFacetLocationDetail {\r\n if (undefined === result)\r\n return new ConvexFacetLocationDetail(facetIndex, edgeCount, detail);\r\n return super.create(facetIndex, edgeCount, detail, result);\r\n }\r\n /** Whether the facet is convex. */\r\n public override get isConvex(): boolean {\r\n return true;\r\n }\r\n /** Clone the instance */\r\n public override clone(): ConvexFacetLocationDetail {\r\n const detail = new ConvexFacetLocationDetail();\r\n detail.copyContentsFrom(this);\r\n return detail;\r\n }\r\n /** Set the instance contents from the other detail.\r\n * @param other detail to clone\r\n */\r\n public override copyContentsFrom(other: ConvexFacetLocationDetail) {\r\n super.copyContentsFrom(other);\r\n this._normal = other._normal?.clone();\r\n this._param = other._param?.clone();\r\n this._color = other._color;\r\n this._barycentricCoordinates = other._barycentricCoordinates?.slice();\r\n }\r\n /** Get normal interpolated from facet data.\r\n * @param facetNormals used to compute the normal cache\r\n * @param facetVertices used to compute the barycentric coordinate cache\r\n * @param distanceTolerance used to compute the barycentric coordinate cache\r\n * @returns reference to cached normal\r\n */\r\n public override getNormal(facetNormals?: IndexedXYZCollection, facetVertices?: IndexedXYZCollection, distanceTolerance: number = Geometry.smallMetricDistance): Vector3d | undefined {\r\n if (this._detail.isValid && undefined === this._normal && undefined !== facetNormals) {\r\n const scales = this.getBarycentricCoordinates(facetVertices, distanceTolerance);\r\n if (undefined !== scales) {\r\n this._normal = Vector3d.create();\r\n facetNormals.linearCombination(scales, this._normal);\r\n }\r\n }\r\n return this._normal;\r\n }\r\n /** Get uv parameter interpolated from facet data.\r\n * @param facetParams used to compute the uv parameter cache\r\n * @param facetVertices used to compute the barycentric coordinate cache\r\n * @param distanceTolerance used to compute the barycentric coordinate cache\r\n * @returns reference to cached uv parameter\r\n */\r\n public override getParam(facetParams?: IndexedXYCollection, facetVertices?: IndexedXYZCollection, distanceTolerance: number = Geometry.smallMetricDistance): Point2d | undefined {\r\n if (this._detail.isValid && undefined === this._param && undefined !== facetParams) {\r\n const scales = this.getBarycentricCoordinates(facetVertices, distanceTolerance);\r\n if (undefined !== scales) {\r\n this._param = Point2d.create();\r\n facetParams.linearCombination(scales, this._param);\r\n }\r\n }\r\n return this._param;\r\n }\r\n /** Get color interpolated from facet data.\r\n * @param facetColors used to compute the color cache\r\n * @param facetVertices used to compute the barycentric coordinate cache\r\n * @param distanceTolerance used to compute the barycentric coordinate cache\r\n * @returns cached color\r\n */\r\n public override getColor(facetColors?: number[], facetVertices?: IndexedXYZCollection, distanceTolerance: number = Geometry.smallMetricDistance): number | undefined {\r\n if (this._detail.isValid && undefined === this._color && undefined !== facetColors) {\r\n const scales = this.getBarycentricCoordinates(facetVertices, distanceTolerance);\r\n if (undefined !== scales)\r\n this._color = NumberArray.linearCombinationOfColors(facetColors, scales);\r\n }\r\n return this._color;\r\n }\r\n /** Get the barycentric coordinates of this location, if they have been computed.\r\n * @param facetVertices used to compute the barycentric coordinate cache\r\n * @param distanceTolerance used to compute the barycentric coordinate cache\r\n * @returns cached barycentric coordinates\r\n */\r\n public override getBarycentricCoordinates(facetVertices?: IndexedXYZCollection, distanceTolerance: number = Geometry.smallMetricDistance): number[] | undefined {\r\n if (this._detail.isValid && undefined === this._barycentricCoordinates && undefined !== facetVertices) {\r\n this._barycentricCoordinates = PolygonOps.convexBarycentricCoordinates(facetVertices, this._detail.point, distanceTolerance);\r\n }\r\n return this._barycentricCoordinates;\r\n }\r\n}\r\n"]}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Polyface
|
|
3
|
-
*/
|
|
4
1
|
import { Point2d } from "../geometry3d/Point2dVector2d";
|
|
5
|
-
import { PolyfaceData } from "./PolyfaceData";
|
|
6
2
|
import { IndexedPolyface, Polyface, PolyfaceVisitor } from "./Polyface";
|
|
3
|
+
import { PolyfaceData } from "./PolyfaceData";
|
|
7
4
|
/**
|
|
8
5
|
* An `IndexedPolyfaceVisitor` is an iterator-like object that "visits" facets of a mesh.
|
|
9
6
|
* * The visitor extends a `PolyfaceData ` class, so it can at any time hold all the data of a single facet.
|
|
@@ -21,7 +18,7 @@ export declare class IndexedPolyfaceVisitor extends PolyfaceData implements Poly
|
|
|
21
18
|
/** Set the number of vertices duplicated (e.g. 1 for start and end) in arrays in the visitor. */
|
|
22
19
|
setNumWrap(numWrap: number): void;
|
|
23
20
|
/** Return the number of edges in the current facet.
|
|
24
|
-
* *
|
|
21
|
+
* * Note that if this visitor has `numWrap` greater than zero, the number of edges is smaller than the number of points.
|
|
25
22
|
*/
|
|
26
23
|
get numEdgesThisFacet(): number;
|
|
27
24
|
/** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndexedPolyfaceVisitor.d.ts","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceVisitor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IndexedPolyfaceVisitor.d.ts","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceVisitor.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,YAAa,YAAW,eAAe;IACjF,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CA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,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAShH;AAoBD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAgBhF;AAED;;;;;;;GAOG;AACH,qBAAa,4BAA6B,SAAQ,sBAAsB;IACtE,OAAO,CAAC,mBAAmB,CAAW;IAEtC,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO;IAKP;;;;;;OAMG;WACW,mBAAmB,CAAC,QAAQ,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,4BAA4B;IAGzI,wEAAwE;IACxD,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAO7D,wEAAwE;IACxD,eAAe,IAAI,OAAO;IAU1C,sEAAsE;IACtD,KAAK,IAAI,IAAI;IAG7B,oFAAoF;IAC7E,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAMjE"}
|
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.IndexedPolyfaceSubsetVisitor = exports.interpolateColor = exports.IndexedPolyfaceVisitor = void 0;
|
|
8
|
-
|
|
8
|
+
/** @packageDocumentation
|
|
9
|
+
* @module Polyface
|
|
10
|
+
*/
|
|
9
11
|
const Geometry_1 = require("../Geometry");
|
|
12
|
+
const PolyfaceData_1 = require("./PolyfaceData");
|
|
10
13
|
/* eslint-disable @itwin/prefer-get */
|
|
11
14
|
/**
|
|
12
15
|
* An `IndexedPolyfaceVisitor` is an iterator-like object that "visits" facets of a mesh.
|
|
@@ -31,7 +34,7 @@ class IndexedPolyfaceVisitor extends PolyfaceData_1.PolyfaceData {
|
|
|
31
34
|
/** Set the number of vertices duplicated (e.g. 1 for start and end) in arrays in the visitor. */
|
|
32
35
|
setNumWrap(numWrap) { this._numWrap = numWrap; }
|
|
33
36
|
/** Return the number of edges in the current facet.
|
|
34
|
-
* *
|
|
37
|
+
* * Note that if this visitor has `numWrap` greater than zero, the number of edges is smaller than the number of points.
|
|
35
38
|
*/
|
|
36
39
|
get numEdgesThisFacet() { return this._numEdges; }
|
|
37
40
|
/** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndexedPolyfaceVisitor.js","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceVisitor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAM/F,iDAA8C;AAE9C,0CAAuC;AACvC,sCAAsC;AACtC;;;;GAIG;AACH,MAAa,sBAAuB,SAAQ,2BAAY;IAMtD,0EAA0E;IAC1E,YAAsB,MAAuB,EAAE,OAAe;QAC5D,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC5G,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO;YACrB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAExD,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC,CAAC;IAE/B,CAAC;IACD,yC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AAW,CAAC;YACpC,OAAO,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;SACvE;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,wEAAwE;IACxD,eAAe;QAC7B,IAAI,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE;YAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC3D,IAAI,MAAM,EAAE;gBACV,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACxB,OAAO,IAAI,CAAC;aACb;SACF;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,sEAAsE;IACtD,KAAK;QACnB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;IAC5B,CAAC;IACD,oFAAoF;IAC7E,gBAAgB,CAAC,WAAmB;QACzC,IAAI,WAAW,IAAI,CAAC,IAAI,WAAW,IAAI,IAAI,CAAC,gBAAgB,EAAE;YAC5D,OAAO,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;SAC9C;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAjDD,oEAiDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Polyface\r\n */\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { PolyfaceData } from \"./PolyfaceData\";\r\nimport { IndexedPolyface, Polyface, PolyfaceVisitor } from \"./Polyface\";\r\nimport { Geometry } from \"../Geometry\";\r\n/* eslint-disable @itwin/prefer-get */\r\n/**\r\n * An `IndexedPolyfaceVisitor` is an iterator-like object that \"visits\" facets of a mesh.\r\n * * The visitor extends a `PolyfaceData ` class, so it can at any time hold all the data of a single facet.\r\n * @public\r\n */\r\nexport class IndexedPolyfaceVisitor extends PolyfaceData implements PolyfaceVisitor {\r\n private _currentFacetIndex: number;\r\n private _nextFacetIndex: number;\r\n private _numWrap: number;\r\n private _numEdges: number;\r\n private _polyface: IndexedPolyface;\r\n // to be called from static factory method that validates the polyface ...\r\n protected constructor(facets: IndexedPolyface, numWrap: number) {\r\n super(facets.data.normalCount > 0, facets.data.paramCount > 0, facets.data.colorCount > 0, facets.twoSided);\r\n this._polyface = facets;\r\n this._numWrap = numWrap;\r\n if (facets.data.auxData)\r\n this.auxData = facets.data.auxData.createForVisitor();\r\n\r\n this.reset();\r\n this._numEdges = 0;\r\n this._nextFacetIndex = 0;\r\n this._currentFacetIndex = -1;\r\n\r\n }\r\n /** Return the client polyface object. */\r\n public clientPolyface(): Polyface { return this._polyface; }\r\n /** Set the number of vertices duplicated (e.g. 1 for start and end) in arrays in the visitor. */\r\n public setNumWrap(numWrap: number) { this._numWrap = numWrap; }\r\n\r\n /** Return the number of edges in the current facet.\r\n * * Not that if this visitor has `numWrap` greater than zero, the number of edges is smaller than the number of points.\r\n */\r\n public get numEdgesThisFacet(): number { return this._numEdges; }\r\n /** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays\r\n * Typical wrap counts are:\r\n * * 0 -- leave the point arrays with \"missing final edge\"\r\n * * 1 -- add point 0 as closure point\r\n * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.\r\n */\r\n public static create(polyface: IndexedPolyface, numWrap: number): IndexedPolyfaceVisitor {\r\n return new IndexedPolyfaceVisitor(polyface, numWrap);\r\n }\r\n /** Advance the iterator to a particular facet in the client polyface */\r\n public moveToReadIndex(facetIndex: number): boolean {\r\n if (!this._polyface.isValidFacetIndex(facetIndex))\r\n return false;\r\n this._currentFacetIndex = facetIndex;\r\n this._nextFacetIndex = facetIndex + 1;\r\n this._numEdges = this._polyface.numEdgeInFacet(facetIndex);\r\n this.resizeAllDataArrays(this._numEdges + this._numWrap);\r\n this.gatherIndexedData(this._polyface.data, this._polyface.facetIndex0(this._currentFacetIndex), this._polyface.facetIndex1(this._currentFacetIndex), this._numWrap);\r\n return true;\r\n }\r\n /** Advance the iterator to a the 'next' facet in the client polyface */\r\n public moveToNextFacet(): boolean {\r\n if (this._nextFacetIndex !== this._currentFacetIndex)\r\n return this.moveToReadIndex(this._nextFacetIndex);\r\n this._nextFacetIndex++;\r\n return true;\r\n }\r\n\r\n /** Reset the iterator to start at the first facet of the polyface. */\r\n public reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.\r\n }\r\n\r\n /**\r\n * Attempts to extract the distance parameter for the given vertex index on the current facet\r\n * Returns the distance parameter as a point. Returns undefined on failure.\r\n */\r\n public tryGetDistanceParameter(index: number, result?: Point2d): Point2d | undefined {\r\n if (index >= this.numEdgesThisFacet)\r\n return undefined;\r\n\r\n if (this.param === undefined || this._polyface.data.face.length === 0)\r\n return undefined;\r\n\r\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\r\n if (!faceData)\r\n return undefined;\r\n return faceData.convertParamXYToDistance(this.param.getXAtUncheckedPointIndex(index), this.param.getYAtUncheckedPointIndex(index), result);\r\n }\r\n\r\n /**\r\n * Attempts to extract the normalized parameter (0,1) for the given vertex index on the current facet.\r\n * Returns the normalized parameter as a point. Returns undefined on failure.\r\n */\r\n public tryGetNormalizedParameter(index: number, result?: Point2d): Point2d | undefined {\r\n if (index >= this.numEdgesThisFacet)\r\n return undefined;\r\n\r\n if (this.param === undefined || this._polyface.data.face.length === 0)\r\n return undefined;\r\n\r\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\r\n if (!faceData)\r\n return undefined;\r\n return faceData.convertParamXYToNormalized(this.param.getXAtUncheckedPointIndex(index), this.param.getYAtUncheckedPointIndex(index), result);\r\n }\r\n /** Return the index (in the client polyface) of the current facet */\r\n public currentReadIndex(): number { return this._currentFacetIndex; }\r\n /** Return the point index of vertex i within the currently loaded facet */\r\n public clientPointIndex(i: number): number { return this.pointIndex[i]; }\r\n /** Return the param index of vertex i within the currently loaded facet */\r\n public clientParamIndex(i: number): number { return this.paramIndex ? this.paramIndex[i] : -1; }\r\n /** Return the normal index of vertex i within the currently loaded facet */\r\n public clientNormalIndex(i: number): number { return this.normalIndex ? this.normalIndex[i] : -1; }\r\n /** Return the color index of vertex i within the currently loaded facet */\r\n public clientColorIndex(i: number): number { return this.colorIndex ? this.colorIndex[i] : -1; }\r\n /** Return the aux data index of vertex i within the currently loaded facet */\r\n public clientAuxIndex(i: number): number { return this.auxData ? this.auxData.indices[i] : -1; }\r\n\r\n /** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */\r\n public clearArrays(): void {\r\n if (this.point !== undefined)\r\n this.point.length = 0;\r\n if (this.param !== undefined)\r\n this.param.length = 0;\r\n if (this.normal !== undefined)\r\n this.normal.length = 0;\r\n if (this.color !== undefined)\r\n this.color.length = 0;\r\n }\r\n /** transfer data from a specified index of the other visitor as new data in this visitor. */\r\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\r\n this.point.pushFromGrowableXYZArray(other.point, index);\r\n if (this.color && other.color && index < other.color.length)\r\n this.color.push(other.color[index]);\r\n if (this.param && other.param && index < other.param.length)\r\n this.param.pushFromGrowableXYArray(other.param, index);\r\n if (this.normal && other.normal && index < other.normal.length)\r\n this.normal.pushFromGrowableXYZArray(other.normal, index);\r\n }\r\n /** transfer interpolated data from the other visitor.\r\n * * all data values are interpolated at `fraction` between `other` values at index0 and index1.\r\n */\r\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\r\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\r\n if (this.color && other.color && index0 < other.color.length && index1 < other.color.length)\r\n this.color.push(interpolateColor(other.color[index0], fraction, other.color[index1]));\r\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\r\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\r\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\r\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\r\n }\r\n}\r\n/**\r\n * * shift to right by shiftBits.\r\n * * mask off the low 8 bits\r\n * * interpolate the number\r\n * * truncate to floor\r\n * * shift left\r\n * * Hence all numbers in and out of the floating point are 0..255.\r\n * @param color0\r\n * @param fraction\r\n * @param color1\r\n * @param shiftBits\r\n */\r\nfunction interpolateByte(color0: number, fraction: number, color1: number, shiftBits: number): number {\r\n color0 = (color0 >>> shiftBits) & 0xFF;\r\n color1 = (color1 >>> shiftBits) & 0xFF;\r\n const color = Math.floor(color0 + fraction * (color1 - color0)) & 0xFF;\r\n return color << shiftBits;\r\n}\r\n\r\n/**\r\n * Interpolate each byte of color0 and color1 as integers.\r\n * @param color0 32 bit color (e.g. rgb+transparency)\r\n * @param fraction fractional position. This is clamped to 0..1 to prevent byte values outside their 0..255 range.\r\n * @param color1\r\n * @param shiftBits\r\n * @internal\r\n */\r\nexport function interpolateColor(color0: number, fraction: number, color1: number) {\r\n // don't allow fractions outside the individual byte ranges.\r\n fraction = Geometry.clamp(fraction, 0, 1);\r\n // interpolate each byte in place ....\r\n /*\r\n const byte0 = interpolateLowByte(color0 & 0xFF, fraction, color1 & 0xFF);\r\n const byte1 = interpolateLowByte((color0 & 0xFF00) >>> 8, fraction, (color1 & 0xFF00) >>> 8) << 8;\r\n const byte2 = interpolateLowByte((color0 & 0xFF0000) >>> 16, fraction, (color1 & 0xFF0000) >>> 16) << 16;\r\n const byte3 = interpolateLowByte((color0 & 0xFF000000) >>> 24, fraction, (color1 & 0xFF000000) >>> 24) << 24;\r\n */\r\n const byte0 = interpolateByte(color0, fraction, color1, 0);\r\n const byte1 = interpolateByte(color0, fraction, color1, 8);\r\n const byte2 = interpolateByte(color0, fraction, color1, 16);\r\n const byte3 = interpolateByte(color0, fraction, color1, 24);\r\n\r\n return (byte0 | byte1 | byte2 | byte3);\r\n}\r\n\r\n/**\r\n * An `IndexedPolyfaceSubsetVisitor` is an IndexedPolyfaceVisitor which only visits a subset of facets in the polyface.\r\n * * The subset is defined by an array of facet indices provided when this visitor is created.\r\n * * Within the subset visitor, \"facetIndex\" is understood as index within the subset array:\r\n * * moveToNextFacet moves only within the subset\r\n * * moveToReadIndex(i) moves underlying visitor's parentFacetIndex(i)\r\n * @public\r\n */\r\nexport class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {\r\n private _parentFacetIndices: number[];\r\n // index WITHIN THE _parentFacetIndices array.\r\n private _nextActiveIndex: number;\r\n private constructor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number) {\r\n super(polyface, numWrap);\r\n this._parentFacetIndices = activeFacetIndices.slice();\r\n this._nextActiveIndex = 0;\r\n }\r\n /** Create a visitor for iterating a subset of the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays\r\n * * Typical wrap counts are:\r\n * * 0 -- leave the point arrays with \"missing final edge\"\r\n * * 1 -- add point 0 as closure point\r\n * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.\r\n * * The activeFacetIndices array indicates all facets to be visited.\r\n */\r\n public static createSubsetVisitor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number): IndexedPolyfaceSubsetVisitor {\r\n return new IndexedPolyfaceSubsetVisitor(polyface, activeFacetIndices, numWrap);\r\n }\r\n /** Advance the iterator to a particular facet in the client polyface */\r\n public override moveToReadIndex(activeIndex: number): boolean {\r\n if (activeIndex >= 0 && activeIndex <= this._parentFacetIndices.length) {\r\n this._nextActiveIndex = activeIndex;\r\n return super.moveToReadIndex(this._parentFacetIndices[activeIndex++]);\r\n }\r\n return false;\r\n }\r\n /** Advance the iterator to a the 'next' facet in the client polyface */\r\n public override moveToNextFacet(): boolean {\r\n if (this._nextActiveIndex < this._parentFacetIndices.length) {\r\n const result = this.moveToReadIndex(this._nextActiveIndex);\r\n if (result) {\r\n this._nextActiveIndex++;\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Reset the iterator to start at the first facet of the polyface. */\r\n public override reset(): void {\r\n this._nextActiveIndex = 0;\r\n }\r\n /** return the parent facet index of the indicated index within the active facets */\r\n public parentFacetIndex(activeIndex: number): number | undefined {\r\n if (activeIndex >= 0 && activeIndex <= this._nextActiveIndex) {\r\n return this._parentFacetIndices[activeIndex];\r\n }\r\n return undefined;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"IndexedPolyfaceVisitor.js","sourceRoot":"","sources":["../../../src/polyface/IndexedPolyfaceVisitor.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,0CAAuC;AAGvC,iDAA8C;AAE9C,sCAAsC;AAEtC;;;;GAIG;AACH,MAAa,sBAAuB,SAAQ,2BAAY;IAMtD,0EAA0E;IAC1E,YAAsB,MAAuB,EAAE,OAAe;QAC5D,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC5G,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO;YACrB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAExD,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC,CAAC;IAE/B,CAAC;IACD,yCA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AW,CAAC;YACpC,OAAO,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;SACvE;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,wEAAwE;IACxD,eAAe;QAC7B,IAAI,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE;YAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAC3D,IAAI,MAAM,EAAE;gBACV,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACxB,OAAO,IAAI,CAAC;aACb;SACF;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,sEAAsE;IACtD,KAAK;QACnB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;IAC5B,CAAC;IACD,oFAAoF;IAC7E,gBAAgB,CAAC,WAAmB;QACzC,IAAI,WAAW,IAAI,CAAC,IAAI,WAAW,IAAI,IAAI,CAAC,gBAAgB,EAAE;YAC5D,OAAO,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;SAC9C;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAjDD,oEAiDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Polyface\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Point2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { IndexedPolyface, Polyface, PolyfaceVisitor } from \"./Polyface\";\r\nimport { PolyfaceData } from \"./PolyfaceData\";\r\n\r\n/* eslint-disable @itwin/prefer-get */\r\n\r\n/**\r\n * An `IndexedPolyfaceVisitor` is an iterator-like object that \"visits\" facets of a mesh.\r\n * * The visitor extends a `PolyfaceData ` class, so it can at any time hold all the data of a single facet.\r\n * @public\r\n */\r\nexport class IndexedPolyfaceVisitor extends PolyfaceData implements PolyfaceVisitor {\r\n private _currentFacetIndex: number;\r\n private _nextFacetIndex: number;\r\n private _numWrap: number;\r\n private _numEdges: number;\r\n private _polyface: IndexedPolyface;\r\n // to be called from static factory method that validates the polyface ...\r\n protected constructor(facets: IndexedPolyface, numWrap: number) {\r\n super(facets.data.normalCount > 0, facets.data.paramCount > 0, facets.data.colorCount > 0, facets.twoSided);\r\n this._polyface = facets;\r\n this._numWrap = numWrap;\r\n if (facets.data.auxData)\r\n this.auxData = facets.data.auxData.createForVisitor();\r\n\r\n this.reset();\r\n this._numEdges = 0;\r\n this._nextFacetIndex = 0;\r\n this._currentFacetIndex = -1;\r\n\r\n }\r\n /** Return the client polyface object. */\r\n public clientPolyface(): Polyface { return this._polyface; }\r\n /** Set the number of vertices duplicated (e.g. 1 for start and end) in arrays in the visitor. */\r\n public setNumWrap(numWrap: number) { this._numWrap = numWrap; }\r\n\r\n /** Return the number of edges in the current facet.\r\n * * Note that if this visitor has `numWrap` greater than zero, the number of edges is smaller than the number of points.\r\n */\r\n public get numEdgesThisFacet(): number { return this._numEdges; }\r\n /** Create a visitor for iterating the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays\r\n * Typical wrap counts are:\r\n * * 0 -- leave the point arrays with \"missing final edge\"\r\n * * 1 -- add point 0 as closure point\r\n * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.\r\n */\r\n public static create(polyface: IndexedPolyface, numWrap: number): IndexedPolyfaceVisitor {\r\n return new IndexedPolyfaceVisitor(polyface, numWrap);\r\n }\r\n /** Advance the iterator to a particular facet in the client polyface */\r\n public moveToReadIndex(facetIndex: number): boolean {\r\n if (!this._polyface.isValidFacetIndex(facetIndex))\r\n return false;\r\n this._currentFacetIndex = facetIndex;\r\n this._nextFacetIndex = facetIndex + 1;\r\n this._numEdges = this._polyface.numEdgeInFacet(facetIndex);\r\n this.resizeAllDataArrays(this._numEdges + this._numWrap);\r\n this.gatherIndexedData(this._polyface.data, this._polyface.facetIndex0(this._currentFacetIndex), this._polyface.facetIndex1(this._currentFacetIndex), this._numWrap);\r\n return true;\r\n }\r\n /** Advance the iterator to a the 'next' facet in the client polyface */\r\n public moveToNextFacet(): boolean {\r\n if (this._nextFacetIndex !== this._currentFacetIndex)\r\n return this.moveToReadIndex(this._nextFacetIndex);\r\n this._nextFacetIndex++;\r\n return true;\r\n }\r\n\r\n /** Reset the iterator to start at the first facet of the polyface. */\r\n public reset(): void {\r\n this.moveToReadIndex(0);\r\n this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.\r\n }\r\n\r\n /**\r\n * Attempts to extract the distance parameter for the given vertex index on the current facet\r\n * Returns the distance parameter as a point. Returns undefined on failure.\r\n */\r\n public tryGetDistanceParameter(index: number, result?: Point2d): Point2d | undefined {\r\n if (index >= this.numEdgesThisFacet)\r\n return undefined;\r\n\r\n if (this.param === undefined || this._polyface.data.face.length === 0)\r\n return undefined;\r\n\r\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\r\n if (!faceData)\r\n return undefined;\r\n return faceData.convertParamXYToDistance(this.param.getXAtUncheckedPointIndex(index), this.param.getYAtUncheckedPointIndex(index), result);\r\n }\r\n\r\n /**\r\n * Attempts to extract the normalized parameter (0,1) for the given vertex index on the current facet.\r\n * Returns the normalized parameter as a point. Returns undefined on failure.\r\n */\r\n public tryGetNormalizedParameter(index: number, result?: Point2d): Point2d | undefined {\r\n if (index >= this.numEdgesThisFacet)\r\n return undefined;\r\n\r\n if (this.param === undefined || this._polyface.data.face.length === 0)\r\n return undefined;\r\n\r\n const faceData = this._polyface.tryGetFaceData(this._currentFacetIndex);\r\n if (!faceData)\r\n return undefined;\r\n return faceData.convertParamXYToNormalized(this.param.getXAtUncheckedPointIndex(index), this.param.getYAtUncheckedPointIndex(index), result);\r\n }\r\n /** Return the index (in the client polyface) of the current facet */\r\n public currentReadIndex(): number { return this._currentFacetIndex; }\r\n /** Return the point index of vertex i within the currently loaded facet */\r\n public clientPointIndex(i: number): number { return this.pointIndex[i]; }\r\n /** Return the param index of vertex i within the currently loaded facet */\r\n public clientParamIndex(i: number): number { return this.paramIndex ? this.paramIndex[i] : -1; }\r\n /** Return the normal index of vertex i within the currently loaded facet */\r\n public clientNormalIndex(i: number): number { return this.normalIndex ? this.normalIndex[i] : -1; }\r\n /** Return the color index of vertex i within the currently loaded facet */\r\n public clientColorIndex(i: number): number { return this.colorIndex ? this.colorIndex[i] : -1; }\r\n /** Return the aux data index of vertex i within the currently loaded facet */\r\n public clientAuxIndex(i: number): number { return this.auxData ? this.auxData.indices[i] : -1; }\r\n\r\n /** clear the contents of all arrays. Use this along with transferDataFrom methods to build up new facets */\r\n public clearArrays(): void {\r\n if (this.point !== undefined)\r\n this.point.length = 0;\r\n if (this.param !== undefined)\r\n this.param.length = 0;\r\n if (this.normal !== undefined)\r\n this.normal.length = 0;\r\n if (this.color !== undefined)\r\n this.color.length = 0;\r\n }\r\n /** transfer data from a specified index of the other visitor as new data in this visitor. */\r\n public pushDataFrom(other: PolyfaceVisitor, index: number): void {\r\n this.point.pushFromGrowableXYZArray(other.point, index);\r\n if (this.color && other.color && index < other.color.length)\r\n this.color.push(other.color[index]);\r\n if (this.param && other.param && index < other.param.length)\r\n this.param.pushFromGrowableXYArray(other.param, index);\r\n if (this.normal && other.normal && index < other.normal.length)\r\n this.normal.pushFromGrowableXYZArray(other.normal, index);\r\n }\r\n /** transfer interpolated data from the other visitor.\r\n * * all data values are interpolated at `fraction` between `other` values at index0 and index1.\r\n */\r\n public pushInterpolatedDataFrom(other: PolyfaceVisitor, index0: number, fraction: number, index1: number): void {\r\n this.point.pushInterpolatedFromGrowableXYZArray(other.point, index0, fraction, index1);\r\n if (this.color && other.color && index0 < other.color.length && index1 < other.color.length)\r\n this.color.push(interpolateColor(other.color[index0], fraction, other.color[index1]));\r\n if (this.param && other.param && index0 < other.param.length && index1 < other.param.length)\r\n this.param.pushInterpolatedFromGrowableXYArray(other.param, index0, fraction, index1);\r\n if (this.normal && other.normal && index0 < other.normal.length && index1 < other.normal.length)\r\n this.normal.pushInterpolatedFromGrowableXYZArray(other.normal, index0, fraction, index1);\r\n }\r\n}\r\n/**\r\n * * shift to right by shiftBits.\r\n * * mask off the low 8 bits\r\n * * interpolate the number\r\n * * truncate to floor\r\n * * shift left\r\n * * Hence all numbers in and out of the floating point are 0..255.\r\n * @param color0\r\n * @param fraction\r\n * @param color1\r\n * @param shiftBits\r\n */\r\nfunction interpolateByte(color0: number, fraction: number, color1: number, shiftBits: number): number {\r\n color0 = (color0 >>> shiftBits) & 0xFF;\r\n color1 = (color1 >>> shiftBits) & 0xFF;\r\n const color = Math.floor(color0 + fraction * (color1 - color0)) & 0xFF;\r\n return color << shiftBits;\r\n}\r\n\r\n/**\r\n * Interpolate each byte of color0 and color1 as integers.\r\n * @param color0 32 bit color (e.g. rgb+transparency)\r\n * @param fraction fractional position. This is clamped to 0..1 to prevent byte values outside their 0..255 range.\r\n * @param color1\r\n * @param shiftBits\r\n * @internal\r\n */\r\nexport function interpolateColor(color0: number, fraction: number, color1: number) {\r\n // don't allow fractions outside the individual byte ranges.\r\n fraction = Geometry.clamp(fraction, 0, 1);\r\n // interpolate each byte in place ....\r\n /*\r\n const byte0 = interpolateLowByte(color0 & 0xFF, fraction, color1 & 0xFF);\r\n const byte1 = interpolateLowByte((color0 & 0xFF00) >>> 8, fraction, (color1 & 0xFF00) >>> 8) << 8;\r\n const byte2 = interpolateLowByte((color0 & 0xFF0000) >>> 16, fraction, (color1 & 0xFF0000) >>> 16) << 16;\r\n const byte3 = interpolateLowByte((color0 & 0xFF000000) >>> 24, fraction, (color1 & 0xFF000000) >>> 24) << 24;\r\n */\r\n const byte0 = interpolateByte(color0, fraction, color1, 0);\r\n const byte1 = interpolateByte(color0, fraction, color1, 8);\r\n const byte2 = interpolateByte(color0, fraction, color1, 16);\r\n const byte3 = interpolateByte(color0, fraction, color1, 24);\r\n\r\n return (byte0 | byte1 | byte2 | byte3);\r\n}\r\n\r\n/**\r\n * An `IndexedPolyfaceSubsetVisitor` is an IndexedPolyfaceVisitor which only visits a subset of facets in the polyface.\r\n * * The subset is defined by an array of facet indices provided when this visitor is created.\r\n * * Within the subset visitor, \"facetIndex\" is understood as index within the subset array:\r\n * * moveToNextFacet moves only within the subset\r\n * * moveToReadIndex(i) moves underlying visitor's parentFacetIndex(i)\r\n * @public\r\n */\r\nexport class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {\r\n private _parentFacetIndices: number[];\r\n // index WITHIN THE _parentFacetIndices array.\r\n private _nextActiveIndex: number;\r\n private constructor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number) {\r\n super(polyface, numWrap);\r\n this._parentFacetIndices = activeFacetIndices.slice();\r\n this._nextActiveIndex = 0;\r\n }\r\n /** Create a visitor for iterating a subset of the facets of `polyface`, with indicated number of points to be added to each facet to produce closed point arrays\r\n * * Typical wrap counts are:\r\n * * 0 -- leave the point arrays with \"missing final edge\"\r\n * * 1 -- add point 0 as closure point\r\n * * 2 -- add points 0 and 1 as closure and wrap point. This is useful when vertex visit requires two adjacent vectors, e.g. for cross products.\r\n * * The activeFacetIndices array indicates all facets to be visited.\r\n */\r\n public static createSubsetVisitor(polyface: IndexedPolyface, activeFacetIndices: number[], numWrap: number): IndexedPolyfaceSubsetVisitor {\r\n return new IndexedPolyfaceSubsetVisitor(polyface, activeFacetIndices, numWrap);\r\n }\r\n /** Advance the iterator to a particular facet in the client polyface */\r\n public override moveToReadIndex(activeIndex: number): boolean {\r\n if (activeIndex >= 0 && activeIndex <= this._parentFacetIndices.length) {\r\n this._nextActiveIndex = activeIndex;\r\n return super.moveToReadIndex(this._parentFacetIndices[activeIndex++]);\r\n }\r\n return false;\r\n }\r\n /** Advance the iterator to a the 'next' facet in the client polyface */\r\n public override moveToNextFacet(): boolean {\r\n if (this._nextActiveIndex < this._parentFacetIndices.length) {\r\n const result = this.moveToReadIndex(this._nextActiveIndex);\r\n if (result) {\r\n this._nextActiveIndex++;\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Reset the iterator to start at the first facet of the polyface. */\r\n public override reset(): void {\r\n this._nextActiveIndex = 0;\r\n }\r\n /** return the parent facet index of the indicated index within the active facets */\r\n public parentFacetIndex(activeIndex: number): number | undefined {\r\n if (activeIndex >= 0 && activeIndex <= this._nextActiveIndex) {\r\n return this._parentFacetIndices[activeIndex];\r\n }\r\n return undefined;\r\n }\r\n}\r\n"]}
|
|
@@ -6,6 +6,8 @@ import { AnyCurve, AnyRegion } from "../curve/CurveChain";
|
|
|
6
6
|
import { CurvePrimitive } from "../curve/CurvePrimitive";
|
|
7
7
|
import { GeometryQuery } from "../curve/GeometryQuery";
|
|
8
8
|
import { LineString3d } from "../curve/LineString3d";
|
|
9
|
+
import { Loop } from "../curve/Loop";
|
|
10
|
+
import { ParityRegion } from "../curve/ParityRegion";
|
|
9
11
|
import { StrokeOptions } from "../curve/StrokeOptions";
|
|
10
12
|
import { NullGeometryHandler, UVSurface } from "../geometry3d/GeometryHandler";
|
|
11
13
|
import { GrowableXYArray } from "../geometry3d/GrowableXYArray";
|
|
@@ -16,6 +18,7 @@ import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
|
|
|
16
18
|
import { Range3d } from "../geometry3d/Range";
|
|
17
19
|
import { Segment1d } from "../geometry3d/Segment1d";
|
|
18
20
|
import { Transform } from "../geometry3d/Transform";
|
|
21
|
+
import { XAndY } from "../geometry3d/XYZProps";
|
|
19
22
|
import { Box } from "../solid/Box";
|
|
20
23
|
import { Cone } from "../solid/Cone";
|
|
21
24
|
import { LinearSweep } from "../solid/LinearSweep";
|
|
@@ -25,7 +28,6 @@ import { Sphere } from "../solid/Sphere";
|
|
|
25
28
|
import { TorusPipe } from "../solid/TorusPipe";
|
|
26
29
|
import { HalfEdge, HalfEdgeGraph, HalfEdgeToBooleanFunction } from "../topology/Graph";
|
|
27
30
|
import { IndexedPolyface, PolyfaceVisitor } from "./Polyface";
|
|
28
|
-
import { XAndY } from "../geometry3d/XYZProps";
|
|
29
31
|
/**
|
|
30
32
|
*
|
|
31
33
|
* * Simple construction for strongly typed GeometryQuery objects:
|
|
@@ -36,27 +38,27 @@ import { XAndY } from "../geometry3d/XYZProps";
|
|
|
36
38
|
* * `builder.addGeometryQuery(g: GeometryQuery)`
|
|
37
39
|
* * `builder.addCone(cone: Cone)`
|
|
38
40
|
* * `builder.addTorusPipe(surface: TorusPipe)`
|
|
39
|
-
* * `builder.
|
|
41
|
+
* * `builder.addLinearSweepLineStringsXYZOnly(surface: LinearSweep)`
|
|
40
42
|
* * `builder.addRotationalSweep(surface: RotationalSweep)`
|
|
41
43
|
* * `builder.addLinearSweep(surface: LinearSweep)`
|
|
42
44
|
* * `builder.addRuledSweep(surface: RuledSweep)`
|
|
43
45
|
* * `builder.addSphere(sphere: Sphere)`
|
|
44
46
|
* * `builder.addBox(box: Box)`
|
|
45
47
|
* * `builder.addIndexedPolyface(polyface)`
|
|
46
|
-
* * Extract with `builder.claimPolyface
|
|
48
|
+
* * Extract with `builder.claimPolyface(true)`
|
|
47
49
|
*
|
|
48
50
|
* * Simple construction for ephemeral constructive data:
|
|
49
51
|
*
|
|
50
52
|
* * Create a builder with `builder = PolyfaceBuilder.create()`
|
|
51
53
|
* * Add from fragmentary data:
|
|
52
|
-
* * `builder.
|
|
53
|
-
* * `builder.
|
|
54
|
-
* * `builder.
|
|
55
|
-
* * `builder.
|
|
56
|
-
* * `builder.addPolygon
|
|
57
|
-
* * `builder.addTransformedUnitBox
|
|
58
|
-
* * `builder.addTriangleFan
|
|
59
|
-
* * `builder.
|
|
54
|
+
* * `builder.addBetweenLineStringsWithStoredIndices(linestringA linestringB)`
|
|
55
|
+
* * `builder.addBetweenLineStringsWithRuleEdgeNormals(linestringA, vA, linestringB, vB, addClosure)`
|
|
56
|
+
* * `builder.addBetweenTransformedLineStrings(curves, transformA, transformB, addClosure)`
|
|
57
|
+
* * `builder.addLinearSweepLineStringsXYZOnly(contour, vector)`
|
|
58
|
+
* * `builder.addPolygon(points, numPointsToUse)`
|
|
59
|
+
* * `builder.addTransformedUnitBox(transform)`
|
|
60
|
+
* * `builder.addTriangleFan(conePoint, linestring, toggleOrientation)`
|
|
61
|
+
* * `builder.addTrianglesInUncheckedConvexPolygon(linestring, toggle)`
|
|
60
62
|
* * `builder.addUVGridBody(surface,numU, numV, createFanInCaps)`
|
|
61
63
|
* * `builder.addGraph(Graph, acceptFaceFunction)`
|
|
62
64
|
* * Extract with `builder.claimPolyface(true)`
|
|
@@ -65,10 +67,10 @@ import { XAndY } from "../geometry3d/XYZProps";
|
|
|
65
67
|
* * Create a builder with `builder = PolyfaceBuilder.create()`
|
|
66
68
|
* * Add GeometryQuery objects
|
|
67
69
|
* * `builder.addPoint(point)`
|
|
68
|
-
* * `builder.findOrAddPointInLineString
|
|
70
|
+
* * `builder.findOrAddPointInLineString(linestring, index)`
|
|
69
71
|
* * `builder.addPointXYZ(x,y,z)`
|
|
70
|
-
* * `builder.addTriangleFacet
|
|
71
|
-
* * `builder.addQuadFacet
|
|
72
|
+
* * `builder.addTriangleFacet(points)`
|
|
73
|
+
* * `builder.addQuadFacet(points)`
|
|
72
74
|
* @public
|
|
73
75
|
*/
|
|
74
76
|
export declare class PolyfaceBuilder extends NullGeometryHandler {
|
|
@@ -350,6 +352,10 @@ export declare class PolyfaceBuilder extends NullGeometryHandler {
|
|
|
350
352
|
handleRotationalSweep(g: RotationalSweep): any;
|
|
351
353
|
/** Double dispatch handler for RuledSweep */
|
|
352
354
|
handleRuledSweep(g: RuledSweep): any;
|
|
355
|
+
/** Double dispatch handler for Loop */
|
|
356
|
+
handleLoop(g: Loop): any;
|
|
357
|
+
/** Double dispatch handler for ParityRegion */
|
|
358
|
+
handleParityRegion(g: ParityRegion): any;
|
|
353
359
|
/** add facets for a GeometryQuery object. This is double dispatch through `dispatchToGeometryHandler(this)` */
|
|
354
360
|
addGeometryQuery(g: GeometryQuery): void;
|
|
355
361
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolyfaceBuilder.d.ts","sourceRoot":"","sources":["../../../src/polyface/PolyfaceBuilder.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"PolyfaceBuilder.d.ts","sourceRoot":"","sources":["../../../src/polyface/PolyfaceBuilder.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAMvD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAG1E,OAAO,EAA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I,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS;IAiHvG;;;OAGG;WACW,4BAA4B,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,GAAG,SAAS;IAM1F;;;;;;;;;OASG;IACI,wCAAwC,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,YAAY,GAAG,oBAAoB,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,YAAY,GAAG,oBAAoB;IAUlK,OAAO,CAAC,yBAAyB;IAuBjC;;;;;;;;OAQG;IACI,eAAe,CAAC,UAAU,EAAE,oBAAoB,GAAG,OAAO,EAAE,GAAG,cAAc,EAAE,WAAW,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,EAAE,cAAc,GAAE,MAAW;IAgBtJ,sGAAsG;IACtG,OAAO,CAAC,cAAc;IAWtB;;MAEE;IACF,OAAO,CAAC,YAAY;IAyCpB;;;;;;OAMG;IACI,uBAAuB,CAAC,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,gBAAgB,GAAE,OAAe,GAAG,OAAO;CA0C3H"}
|
|
@@ -16,6 +16,7 @@ const CylindricalRange_1 = require("../curve/Query/CylindricalRange");
|
|
|
16
16
|
const StrokeCountChain_1 = require("../curve/Query/StrokeCountChain");
|
|
17
17
|
const StrokeOptions_1 = require("../curve/StrokeOptions");
|
|
18
18
|
const Geometry_1 = require("../Geometry");
|
|
19
|
+
const Angle_1 = require("../geometry3d/Angle");
|
|
19
20
|
const BilinearPatch_1 = require("../geometry3d/BilinearPatch");
|
|
20
21
|
const FrameBuilder_1 = require("../geometry3d/FrameBuilder");
|
|
21
22
|
const GeometryHandler_1 = require("../geometry3d/GeometryHandler");
|
|
@@ -37,11 +38,10 @@ const Graph_1 = require("../topology/Graph");
|
|
|
37
38
|
const Triangulation_1 = require("../topology/Triangulation");
|
|
38
39
|
const BoxTopology_1 = require("./BoxTopology");
|
|
39
40
|
const GreedyTriangulationBetweenLineStrings_1 = require("./GreedyTriangulationBetweenLineStrings");
|
|
41
|
+
const IndexedEdgeMatcher_1 = require("./IndexedEdgeMatcher");
|
|
42
|
+
const IndexedPolyfaceVisitor_1 = require("./IndexedPolyfaceVisitor");
|
|
40
43
|
const Polyface_1 = require("./Polyface");
|
|
41
44
|
const PolyfaceQuery_1 = require("./PolyfaceQuery");
|
|
42
|
-
const Angle_1 = require("../geometry3d/Angle");
|
|
43
|
-
const IndexedPolyfaceVisitor_1 = require("./IndexedPolyfaceVisitor");
|
|
44
|
-
const IndexedEdgeMatcher_1 = require("./IndexedEdgeMatcher");
|
|
45
45
|
/* eslint-disable @typescript-eslint/naming-convention, @typescript-eslint/prefer-for-of */
|
|
46
46
|
/**
|
|
47
47
|
* A FacetSector
|
|
@@ -139,27 +139,27 @@ FacetSector._edgeVector = Point3dVector3d_1.Vector3d.create();
|
|
|
139
139
|
* * `builder.addGeometryQuery(g: GeometryQuery)`
|
|
140
140
|
* * `builder.addCone(cone: Cone)`
|
|
141
141
|
* * `builder.addTorusPipe(surface: TorusPipe)`
|
|
142
|
-
* * `builder.
|
|
142
|
+
* * `builder.addLinearSweepLineStringsXYZOnly(surface: LinearSweep)`
|
|
143
143
|
* * `builder.addRotationalSweep(surface: RotationalSweep)`
|
|
144
144
|
* * `builder.addLinearSweep(surface: LinearSweep)`
|
|
145
145
|
* * `builder.addRuledSweep(surface: RuledSweep)`
|
|
146
146
|
* * `builder.addSphere(sphere: Sphere)`
|
|
147
147
|
* * `builder.addBox(box: Box)`
|
|
148
148
|
* * `builder.addIndexedPolyface(polyface)`
|
|
149
|
-
* * Extract with `builder.claimPolyface
|
|
149
|
+
* * Extract with `builder.claimPolyface(true)`
|
|
150
150
|
*
|
|
151
151
|
* * Simple construction for ephemeral constructive data:
|
|
152
152
|
*
|
|
153
153
|
* * Create a builder with `builder = PolyfaceBuilder.create()`
|
|
154
154
|
* * Add from fragmentary data:
|
|
155
|
-
* * `builder.
|
|
156
|
-
* * `builder.
|
|
157
|
-
* * `builder.
|
|
158
|
-
* * `builder.
|
|
159
|
-
* * `builder.addPolygon
|
|
160
|
-
* * `builder.addTransformedUnitBox
|
|
161
|
-
* * `builder.addTriangleFan
|
|
162
|
-
* * `builder.
|
|
155
|
+
* * `builder.addBetweenLineStringsWithStoredIndices(linestringA linestringB)`
|
|
156
|
+
* * `builder.addBetweenLineStringsWithRuleEdgeNormals(linestringA, vA, linestringB, vB, addClosure)`
|
|
157
|
+
* * `builder.addBetweenTransformedLineStrings(curves, transformA, transformB, addClosure)`
|
|
158
|
+
* * `builder.addLinearSweepLineStringsXYZOnly(contour, vector)`
|
|
159
|
+
* * `builder.addPolygon(points, numPointsToUse)`
|
|
160
|
+
* * `builder.addTransformedUnitBox(transform)`
|
|
161
|
+
* * `builder.addTriangleFan(conePoint, linestring, toggleOrientation)`
|
|
162
|
+
* * `builder.addTrianglesInUncheckedConvexPolygon(linestring, toggle)`
|
|
163
163
|
* * `builder.addUVGridBody(surface,numU, numV, createFanInCaps)`
|
|
164
164
|
* * `builder.addGraph(Graph, acceptFaceFunction)`
|
|
165
165
|
* * Extract with `builder.claimPolyface(true)`
|
|
@@ -168,10 +168,10 @@ FacetSector._edgeVector = Point3dVector3d_1.Vector3d.create();
|
|
|
168
168
|
* * Create a builder with `builder = PolyfaceBuilder.create()`
|
|
169
169
|
* * Add GeometryQuery objects
|
|
170
170
|
* * `builder.addPoint(point)`
|
|
171
|
-
* * `builder.findOrAddPointInLineString
|
|
171
|
+
* * `builder.findOrAddPointInLineString(linestring, index)`
|
|
172
172
|
* * `builder.addPointXYZ(x,y,z)`
|
|
173
|
-
* * `builder.addTriangleFacet
|
|
174
|
-
* * `builder.addQuadFacet
|
|
173
|
+
* * `builder.addTriangleFacet(points)`
|
|
174
|
+
* * `builder.addQuadFacet(points)`
|
|
175
175
|
* @public
|
|
176
176
|
*/
|
|
177
177
|
class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
@@ -1073,7 +1073,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1073
1073
|
addTriangulatedRegion(region) {
|
|
1074
1074
|
const contour = SweepContour_1.SweepContour.createForLinearSweep(region);
|
|
1075
1075
|
if (contour)
|
|
1076
|
-
contour.emitFacets(this,
|
|
1076
|
+
contour.emitFacets(this, this.reversedFlag, undefined);
|
|
1077
1077
|
}
|
|
1078
1078
|
/**
|
|
1079
1079
|
* * Recursively visit all children of data.
|
|
@@ -1463,6 +1463,10 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1463
1463
|
handleRotationalSweep(g) { return this.addRotationalSweep(g); }
|
|
1464
1464
|
/** Double dispatch handler for RuledSweep */
|
|
1465
1465
|
handleRuledSweep(g) { return this.addRuledSweep(g); }
|
|
1466
|
+
/** Double dispatch handler for Loop */
|
|
1467
|
+
handleLoop(g) { return this.addTriangulatedRegion(g); }
|
|
1468
|
+
/** Double dispatch handler for ParityRegion */
|
|
1469
|
+
handleParityRegion(g) { return this.addTriangulatedRegion(g); }
|
|
1466
1470
|
/** add facets for a GeometryQuery object. This is double dispatch through `dispatchToGeometryHandler(this)` */
|
|
1467
1471
|
addGeometryQuery(g) { g.dispatchToGeometryHandler(this); }
|
|
1468
1472
|
/**
|