@itwin/core-geometry 5.5.0-dev.4 → 5.5.0-dev.6
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 +7 -0
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +9 -0
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js +2 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js +4 -1
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.js +14 -4
- package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.d.ts +2 -0
- package/lib/cjs/bspline/BezierCurve3dH.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.js +19 -3
- package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts +8 -2
- package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js +10 -4
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js +4 -4
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.d.ts +0 -3
- package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +9 -2
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts +59 -9
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +124 -55
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipVector.js +12 -8
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +0 -2
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +19 -18
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +4 -5
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/cjs/core-geometry.d.ts +0 -1
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +0 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.js +2 -2
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +12 -4
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +52 -33
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +13 -6
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.js +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +13 -1
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +12 -4
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +14 -5
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +5 -4
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +7 -4
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +25 -16
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +90 -72
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Path.d.ts +0 -3
- package/lib/cjs/curve/Path.d.ts.map +1 -1
- package/lib/cjs/curve/Path.js +9 -2
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js +25 -31
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.d.ts +7 -1
- package/lib/cjs/curve/Query/StrokeCountChain.d.ts.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js +27 -36
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js +7 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +8 -5
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +6 -6
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js +4 -1
- package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +6 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +5 -21
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +29 -73
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +55 -13
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +238 -110
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +1 -4
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js +9 -9
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +11 -14
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +18 -18
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts +7 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts +19 -7
- package/lib/cjs/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +26 -11
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js +11 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +5 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js +11 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +49 -8
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +90 -37
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +100 -3
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +125 -0
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +10 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +53 -34
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts +49 -2
- package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js +67 -9
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +24 -32
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +147 -180
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +5 -5
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +13 -3
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +0 -3
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +5 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.d.ts +2 -2
- package/lib/cjs/geometry3d/SortablePolygon.d.ts.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js +14 -18
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.d.ts +8 -0
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +15 -9
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.d.ts +4 -2
- package/lib/cjs/numerics/ClusterableArray.d.ts.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js +6 -4
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Newton.d.ts +3 -1
- package/lib/cjs/numerics/Newton.d.ts.map +1 -1
- package/lib/cjs/numerics/Newton.js +5 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/polyface/AuxData.d.ts +1 -4
- package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
- package/lib/cjs/polyface/AuxData.js +5 -1
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js +3 -3
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +14 -16
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +84 -28
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +277 -217
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.d.ts +4 -3
- package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js +11 -4
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +9 -7
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js +3 -2
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +2 -2
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +14 -12
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.d.ts +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js +10 -6
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +4 -3
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +3 -5
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.d.ts +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js +4 -8
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js +1 -0
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js +37 -7
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.d.ts +4 -4
- package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js +24 -40
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js +9 -3
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.d.ts +0 -3
- package/lib/cjs/serialization/SerializationHelpers.d.ts.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js +16 -7
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Box.d.ts +2 -2
- package/lib/cjs/solid/Box.d.ts.map +1 -1
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.d.ts +3 -2
- package/lib/cjs/solid/Cone.d.ts.map +1 -1
- package/lib/cjs/solid/Cone.js +4 -1
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
- package/lib/cjs/solid/LinearSweep.js +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js +1 -3
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.d.ts +4 -3
- package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.d.ts +4 -4
- package/lib/cjs/topology/ChainMerge.d.ts.map +1 -1
- package/lib/cjs/topology/ChainMerge.js +11 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.d.ts +2 -0
- package/lib/cjs/topology/Graph.d.ts.map +1 -1
- package/lib/cjs/topology/Graph.js +5 -0
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js +2 -0
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js +23 -16
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.d.ts +20 -9
- package/lib/cjs/topology/HalfEdgePositionDetail.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js +17 -13
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js +3 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts +6 -2
- package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js +41 -35
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.d.ts +7 -3
- package/lib/cjs/topology/MaskManager.d.ts.map +1 -1
- package/lib/cjs/topology/MaskManager.js +10 -4
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.d.ts.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/Triangulation.d.ts +2 -1
- package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
- package/lib/cjs/topology/Triangulation.js +12 -7
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/esm/Geometry.d.ts +7 -0
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +9 -0
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js +2 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js +4 -1
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.js +14 -4
- package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.d.ts +2 -0
- package/lib/esm/bspline/BezierCurve3dH.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js +19 -3
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts +8 -2
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js +10 -4
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js +4 -4
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.d.ts +0 -3
- package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +9 -2
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts +59 -9
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +124 -55
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
- package/lib/esm/clipping/ClipVector.js +12 -8
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +0 -2
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +20 -19
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +4 -5
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/esm/core-geometry.d.ts +0 -1
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +0 -1
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.js +2 -2
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +12 -4
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +53 -34
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +13 -6
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.js +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +13 -1
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +12 -4
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +14 -5
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +5 -4
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +7 -4
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +25 -16
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +90 -72
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Path.d.ts +0 -3
- package/lib/esm/curve/Path.d.ts.map +1 -1
- package/lib/esm/curve/Path.js +9 -2
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js +25 -31
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.d.ts +7 -1
- package/lib/esm/curve/Query/StrokeCountChain.d.ts.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js +27 -36
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js +7 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +8 -5
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +6 -6
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js +4 -1
- package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +6 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +5 -21
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +29 -73
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +55 -13
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +239 -111
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +1 -4
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js +9 -9
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +11 -14
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +18 -18
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts +7 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts +19 -7
- package/lib/esm/geometry3d/Ellipsoid.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +26 -11
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.js +11 -1
- package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +5 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js +11 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +49 -8
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +90 -37
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +100 -3
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +125 -0
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +10 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +53 -34
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts +49 -2
- package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js +67 -9
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js +1 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +24 -32
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +147 -180
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +5 -5
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +13 -3
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +0 -3
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +5 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.d.ts +2 -2
- package/lib/esm/geometry3d/SortablePolygon.d.ts.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js +14 -18
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.d.ts +8 -0
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +15 -9
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.d.ts +4 -2
- package/lib/esm/numerics/ClusterableArray.d.ts.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js +6 -4
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Newton.d.ts +3 -1
- package/lib/esm/numerics/Newton.d.ts.map +1 -1
- package/lib/esm/numerics/Newton.js +5 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/polyface/AuxData.d.ts +1 -4
- package/lib/esm/polyface/AuxData.d.ts.map +1 -1
- package/lib/esm/polyface/AuxData.js +5 -1
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js +3 -3
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +14 -16
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +84 -28
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +277 -217
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.d.ts +4 -3
- package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js +11 -4
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +9 -7
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js +3 -2
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js +2 -2
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +14 -12
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.d.ts +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js +10 -6
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js +4 -3
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +3 -5
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.d.ts +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js +4 -8
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js +1 -0
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBReader.js +37 -7
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.d.ts +4 -4
- package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js +24 -40
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js +9 -3
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.d.ts +0 -3
- package/lib/esm/serialization/SerializationHelpers.d.ts.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js +16 -7
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Box.d.ts +2 -2
- package/lib/esm/solid/Box.d.ts.map +1 -1
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.d.ts +3 -2
- package/lib/esm/solid/Cone.d.ts.map +1 -1
- package/lib/esm/solid/Cone.js +4 -1
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +1 -1
- package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
- package/lib/esm/solid/LinearSweep.js +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/esm/solid/RotationalSweep.js +1 -3
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/TorusPipe.d.ts +4 -3
- package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.d.ts +4 -4
- package/lib/esm/topology/ChainMerge.d.ts.map +1 -1
- package/lib/esm/topology/ChainMerge.js +11 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.d.ts +2 -0
- package/lib/esm/topology/Graph.d.ts.map +1 -1
- package/lib/esm/topology/Graph.js +5 -0
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js +2 -0
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js +23 -16
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.d.ts +20 -9
- package/lib/esm/topology/HalfEdgePositionDetail.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js +17 -13
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js +4 -2
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.d.ts +6 -2
- package/lib/esm/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js +41 -35
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.d.ts +7 -3
- package/lib/esm/topology/MaskManager.d.ts.map +1 -1
- package/lib/esm/topology/MaskManager.js +10 -4
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.d.ts.map +1 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/Triangulation.d.ts +2 -1
- package/lib/esm/topology/Triangulation.d.ts.map +1 -1
- package/lib/esm/topology/Triangulation.js +12 -7
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/package.json +3 -3
- package/lib/cjs/serialization/GeometrySamples.d.ts +0 -705
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +0 -1
- package/lib/cjs/serialization/GeometrySamples.js +0 -2433
- package/lib/cjs/serialization/GeometrySamples.js.map +0 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +0 -705
- package/lib/esm/serialization/GeometrySamples.d.ts.map +0 -1
- package/lib/esm/serialization/GeometrySamples.js +0 -2428
- package/lib/esm/serialization/GeometrySamples.js.map +0 -1
|
@@ -8,6 +8,7 @@ exports.HalfEdgeGraphSearch = exports.PolyfaceBuilder = void 0;
|
|
|
8
8
|
/** @packageDocumentation
|
|
9
9
|
* @module Polyface
|
|
10
10
|
*/
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
11
12
|
const Arc3d_1 = require("../curve/Arc3d");
|
|
12
13
|
const ConstructCurveBetweenCurves_1 = require("../curve/ConstructCurveBetweenCurves");
|
|
13
14
|
const CurveCollection_1 = require("../curve/CurveCollection");
|
|
@@ -128,7 +129,7 @@ class FacetSector {
|
|
|
128
129
|
static computeNormalsAlongRuleLine(sectorA, sectorB) {
|
|
129
130
|
// We expect that if a sector's sectionDerivative is defined, then so is its normal. If a normal is undefined, the
|
|
130
131
|
// crossProduct returns an object that goes unused---not good, but the garbage collector will clean it up.
|
|
131
|
-
if (sectorA.sectionDerivative && sectorB.sectionDerivative) {
|
|
132
|
+
if (sectorA.sectionDerivative && sectorB.sectionDerivative && sectorA.normal && sectorB.normal) {
|
|
132
133
|
const vectorAB = FacetSector._edgeVector;
|
|
133
134
|
Point3dVector3d_1.Vector3d.createStartEnd(sectorA.xyz, sectorB.xyz, vectorAB);
|
|
134
135
|
sectorA.sectionDerivative.crossProduct(vectorAB, sectorA.normal);
|
|
@@ -167,8 +168,8 @@ class FacetSector {
|
|
|
167
168
|
* * `builder.addLinearSweepLineStringsXYZOnly(contour, vector)`
|
|
168
169
|
* * `builder.addPolygon(points, numPointsToUse)`
|
|
169
170
|
* * `builder.addTransformedUnitBox(transform)`
|
|
170
|
-
* * `builder.addTriangleFan(conePoint, linestring,
|
|
171
|
-
* * `builder.addTrianglesInUncheckedConvexPolygon(linestring,
|
|
171
|
+
* * `builder.addTriangleFan(conePoint, linestring, reverse)`
|
|
172
|
+
* * `builder.addTrianglesInUncheckedConvexPolygon(linestring, reverse)`
|
|
172
173
|
* * `builder.addUVGridBody(surface,numU, numV, createFanInCaps)`
|
|
173
174
|
* * `builder.addGraph(Graph, acceptFaceFunction)`
|
|
174
175
|
* * Extract with `builder.claimPolyface(true)`
|
|
@@ -264,22 +265,22 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
264
265
|
* Add triangles from `conePoint` to each far edge.
|
|
265
266
|
* @param conePoint the common vertex of all triangles.
|
|
266
267
|
* @param ls linestring with point coordinates.
|
|
267
|
-
* @param
|
|
268
|
+
* @param reverse if `true`, wrap the triangle creation in toggleReversedFacetFlag.
|
|
268
269
|
*/
|
|
269
|
-
addTriangleFan(conePoint, ls,
|
|
270
|
+
addTriangleFan(conePoint, ls, reverse) {
|
|
270
271
|
const n = ls.numPoints();
|
|
271
272
|
if (n > 2) {
|
|
272
|
-
if (
|
|
273
|
+
if (reverse)
|
|
273
274
|
this.toggleReversedFacetFlag();
|
|
274
275
|
const index0 = this.addPoint(conePoint);
|
|
275
|
-
let index1 = this.
|
|
276
|
+
let index1 = this.findOrAddPointInLineStringUnchecked(ls, 0);
|
|
276
277
|
let index2 = 0;
|
|
277
278
|
for (let i = 1; i < n; i++) {
|
|
278
|
-
index2 = this.
|
|
279
|
+
index2 = this.findOrAddPointInLineStringUnchecked(ls, i);
|
|
279
280
|
this.addIndexedTrianglePointIndexes(index0, index1, index2);
|
|
280
281
|
index1 = index2;
|
|
281
282
|
}
|
|
282
|
-
if (
|
|
283
|
+
if (reverse)
|
|
283
284
|
this.toggleReversedFacetFlag();
|
|
284
285
|
}
|
|
285
286
|
}
|
|
@@ -289,18 +290,20 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
289
290
|
* @param ls linestring with point coordinates.
|
|
290
291
|
* @param reverse if `true`, wrap the triangle creation in toggleReversedFacetFlag.
|
|
291
292
|
*/
|
|
292
|
-
addTrianglesInUncheckedConvexPolygon(ls,
|
|
293
|
+
addTrianglesInUncheckedConvexPolygon(ls, reverse) {
|
|
293
294
|
const n = ls.numPoints();
|
|
294
295
|
if (n > 2) {
|
|
295
|
-
if (
|
|
296
|
+
if (reverse)
|
|
296
297
|
this.toggleReversedFacetFlag();
|
|
297
298
|
let normal;
|
|
298
299
|
let normalIndex;
|
|
299
300
|
if (this._options.needNormals) {
|
|
300
301
|
normal = ls.quickUnitNormal(PolyfaceBuilder._workVectorFindOrAdd);
|
|
301
|
-
if (
|
|
302
|
-
|
|
303
|
-
|
|
302
|
+
if (normal) {
|
|
303
|
+
if (reverse)
|
|
304
|
+
normal.scaleInPlace(-1.0);
|
|
305
|
+
normalIndex = this._polyface.addNormal(normal);
|
|
306
|
+
}
|
|
304
307
|
}
|
|
305
308
|
const needParams = this._options.needParams;
|
|
306
309
|
const packedUV = needParams ? ls.packedUVParams : undefined;
|
|
@@ -308,27 +311,27 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
308
311
|
let paramIndex1 = -1;
|
|
309
312
|
let paramIndex2 = -1;
|
|
310
313
|
if (packedUV) {
|
|
311
|
-
paramIndex0 = this.
|
|
312
|
-
paramIndex1 = this.
|
|
314
|
+
paramIndex0 = this.addParamInGrowableXYArrayUnchecked(packedUV, 0);
|
|
315
|
+
paramIndex1 = this.addParamInGrowableXYArrayUnchecked(packedUV, 1);
|
|
313
316
|
}
|
|
314
|
-
const pointIndex0 = this.
|
|
315
|
-
let pointIndex1 = this.
|
|
317
|
+
const pointIndex0 = this.findOrAddPointInLineStringUnchecked(ls, 0);
|
|
318
|
+
let pointIndex1 = this.findOrAddPointInLineStringUnchecked(ls, 1);
|
|
316
319
|
let pointIndex2 = 0;
|
|
317
320
|
let numEdge = n;
|
|
318
321
|
if (ls.isPhysicallyClosed)
|
|
319
322
|
numEdge--;
|
|
320
323
|
for (let i = 2; i < numEdge; i++, pointIndex1 = pointIndex2, paramIndex1 = paramIndex2) {
|
|
321
|
-
pointIndex2 = this.
|
|
324
|
+
pointIndex2 = this.findOrAddPointInLineStringUnchecked(ls, i);
|
|
322
325
|
this.addIndexedTrianglePointIndexes(pointIndex0, pointIndex1, pointIndex2, false);
|
|
323
326
|
if (normalIndex !== undefined)
|
|
324
327
|
this.addIndexedTriangleNormalIndexes(normalIndex, normalIndex, normalIndex);
|
|
325
328
|
if (packedUV) {
|
|
326
|
-
paramIndex2 = this.
|
|
329
|
+
paramIndex2 = this.addParamInGrowableXYArrayUnchecked(packedUV, i);
|
|
327
330
|
this.addIndexedTriangleParamIndexes(paramIndex0, paramIndex1, paramIndex2);
|
|
328
331
|
}
|
|
329
332
|
this._polyface.terminateFacet();
|
|
330
333
|
}
|
|
331
|
-
if (
|
|
334
|
+
if (reverse)
|
|
332
335
|
this.toggleReversedFacetFlag();
|
|
333
336
|
}
|
|
334
337
|
}
|
|
@@ -344,8 +347,24 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
344
347
|
static _workVectorFindOrAdd = Point3dVector3d_1.Vector3d.create();
|
|
345
348
|
static _workUVFindOrAdd = Point2dVector2d_1.Point2d.create();
|
|
346
349
|
/**
|
|
347
|
-
* Add a point to the polyface.
|
|
348
|
-
* prior point with the same coordinates.
|
|
350
|
+
* Add a point to the polyface.
|
|
351
|
+
* * The implementation is free to either create a new point or return the index of a prior point with the same coordinates.
|
|
352
|
+
* * The index is unchecked. Use [[findOrAddPointInLineString]] to check index validity.
|
|
353
|
+
* @param ls the linestring.
|
|
354
|
+
* @param index index of the point in the linestring.
|
|
355
|
+
* @param transform (optional) transform to be applied.
|
|
356
|
+
* @param priorIndex (optional) index of a prior point to check for possible duplicate value.
|
|
357
|
+
* @returns the point index in the polyface.
|
|
358
|
+
*/
|
|
359
|
+
findOrAddPointInLineStringUnchecked(ls, index, transform, priorIndex) {
|
|
360
|
+
const q = ls.pointAtUnchecked(index, PolyfaceBuilder._workPointFindOrAddA);
|
|
361
|
+
if (transform)
|
|
362
|
+
transform.multiplyPoint3d(q, q);
|
|
363
|
+
return this._polyface.addPoint(q, priorIndex);
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Add a point to the polyface.
|
|
367
|
+
* * The implementation is free to either create a new point or return the index of a prior point with the same coordinates.
|
|
349
368
|
* @param ls the linestring.
|
|
350
369
|
* @param index index of the point in the linestring.
|
|
351
370
|
* @param transform (optional) transform to be applied.
|
|
@@ -353,35 +372,59 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
353
372
|
* @returns the point index in the polyface.
|
|
354
373
|
*/
|
|
355
374
|
findOrAddPointInLineString(ls, index, transform, priorIndex) {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
if (transform)
|
|
359
|
-
transform.multiplyPoint3d(q, q);
|
|
360
|
-
return this._polyface.addPoint(q, priorIndex);
|
|
361
|
-
}
|
|
375
|
+
if (ls.packedPoints.isIndexValid(index))
|
|
376
|
+
return this.findOrAddPointInLineStringUnchecked(ls, index, transform, priorIndex);
|
|
362
377
|
return undefined;
|
|
363
378
|
}
|
|
364
379
|
/**
|
|
365
|
-
* Add a point to the polyface.
|
|
366
|
-
* prior point with the same coordinates.
|
|
380
|
+
* Add a point to the polyface.
|
|
381
|
+
* * The implementation is free to either create a new point or return the index of a prior point with the same coordinates.
|
|
382
|
+
* * The index is unchecked. Use [[findOrAddPointInGrowableXYZArray]] to check index validity.
|
|
367
383
|
* @param xyz the array of points.
|
|
368
384
|
* @param index index of the point in the array.
|
|
369
385
|
* @param transform (optional) transform to be applied.
|
|
370
386
|
* @param priorIndex (optional) index of a prior point to check for possible duplicate value.
|
|
371
387
|
* @returns the point index in the polyface.
|
|
372
388
|
*/
|
|
389
|
+
findOrAddPointInGrowableXYZArrayUnchecked(xyz, index, transform, priorIndex) {
|
|
390
|
+
const q = xyz.getPoint3dAtUncheckedPointIndex(index, PolyfaceBuilder._workPointFindOrAddA);
|
|
391
|
+
if (transform)
|
|
392
|
+
transform.multiplyPoint3d(q, q);
|
|
393
|
+
return this._polyface.addPoint(q, priorIndex);
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Add a point to the polyface.
|
|
397
|
+
* * The implementation is free to either create a new point or return the index of a prior point with the same coordinates.
|
|
398
|
+
* @param xyz the array of points.
|
|
399
|
+
* @param index index of the point in the array.
|
|
400
|
+
* @param transform (optional) transform to be applied.
|
|
401
|
+
* @param priorIndex (optional) index of a prior point to check for possible duplicate value.
|
|
402
|
+
* @returns the point index in the polyface, or undefined if the index is invalid.
|
|
403
|
+
*/
|
|
373
404
|
findOrAddPointInGrowableXYZArray(xyz, index, transform, priorIndex) {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
if (transform)
|
|
377
|
-
transform.multiplyPoint3d(q, q);
|
|
378
|
-
return this._polyface.addPoint(q, priorIndex);
|
|
379
|
-
}
|
|
405
|
+
if (xyz.isIndexValid(index))
|
|
406
|
+
return this.findOrAddPointInGrowableXYZArrayUnchecked(xyz, index, transform, priorIndex);
|
|
380
407
|
return undefined;
|
|
381
408
|
}
|
|
382
409
|
/**
|
|
383
|
-
* Add a normal to the polyface.
|
|
384
|
-
* prior normal with the same coordinates.
|
|
410
|
+
* Add a normal to the polyface.
|
|
411
|
+
* * The implementation is free to either create a new normal or return the index of a prior normal with the same coordinates.
|
|
412
|
+
* * The index is unchecked. Use [[findOrAddNormalInGrowableXYZArray]] to check index validity.
|
|
413
|
+
* @param xyz the array of normals.
|
|
414
|
+
* @param index index of the normal in the array.
|
|
415
|
+
* @param transform (optional) transform to be applied.
|
|
416
|
+
* @param priorIndex (optional) index of a prior point to check for possible duplicate value.
|
|
417
|
+
* @returns the normal index in the polyface.
|
|
418
|
+
*/
|
|
419
|
+
findOrAddNormalInGrowableXYZArrayUnchecked(xyz, index, transform, priorIndex) {
|
|
420
|
+
const q = xyz.getVector3dAtUncheckedVectorIndex(index, PolyfaceBuilder._workVectorFindOrAdd);
|
|
421
|
+
if (transform)
|
|
422
|
+
transform.multiplyVector(q, q);
|
|
423
|
+
return this._polyface.addNormal(q, priorIndex);
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Add a normal to the polyface.
|
|
427
|
+
* * The implementation is free to either create a new normal or return the index of a prior normal with the same coordinates.
|
|
385
428
|
* @param xyz the array of normals.
|
|
386
429
|
* @param index index of the normal in the array.
|
|
387
430
|
* @param transform (optional) transform to be applied.
|
|
@@ -389,14 +432,21 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
389
432
|
* @returns the normal index in the polyface.
|
|
390
433
|
*/
|
|
391
434
|
findOrAddNormalInGrowableXYZArray(xyz, index, transform, priorIndex) {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
if (transform)
|
|
395
|
-
transform.multiplyVector(q, q);
|
|
396
|
-
return this._polyface.addNormal(q, priorIndex);
|
|
397
|
-
}
|
|
435
|
+
if (xyz.isIndexValid(index))
|
|
436
|
+
return this.findOrAddNormalInGrowableXYZArrayUnchecked(xyz, index, transform, priorIndex);
|
|
398
437
|
return undefined;
|
|
399
438
|
}
|
|
439
|
+
/**
|
|
440
|
+
* Add a uv parameter to the polyface.
|
|
441
|
+
* * The index is unchecked. Use [[addParamInGrowableXYArray]] to check index validity.
|
|
442
|
+
* @param data the array of uv data.
|
|
443
|
+
* @param index index of the param in the array.
|
|
444
|
+
* @returns the uv parameter index in the polyface.
|
|
445
|
+
*/
|
|
446
|
+
addParamInGrowableXYArrayUnchecked(data, index) {
|
|
447
|
+
const q = data.getPoint2dAtUncheckedPointIndex(index, PolyfaceBuilder._workUVFindOrAdd);
|
|
448
|
+
return this._polyface.addParam(q);
|
|
449
|
+
}
|
|
400
450
|
/**
|
|
401
451
|
* Add a uv parameter to the polyface.
|
|
402
452
|
* @param data the array of uv data.
|
|
@@ -404,16 +454,15 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
404
454
|
* @returns the uv parameter index in the polyface.
|
|
405
455
|
*/
|
|
406
456
|
addParamInGrowableXYArray(data, index) {
|
|
407
|
-
if (
|
|
408
|
-
return
|
|
409
|
-
const q = data.getPoint2dAtCheckedPointIndex(index, PolyfaceBuilder._workUVFindOrAdd);
|
|
410
|
-
if (q)
|
|
411
|
-
return this._polyface.addParam(q);
|
|
457
|
+
if (data.isIndexValid(index))
|
|
458
|
+
return this.addParamInGrowableXYArrayUnchecked(data, index);
|
|
412
459
|
return undefined;
|
|
413
460
|
}
|
|
414
461
|
/**
|
|
415
|
-
* Add a uv parameter to the polyface, taking `u` from `ls.fractions` and `v` from input.
|
|
416
|
-
*
|
|
462
|
+
* Add a uv parameter to the polyface, taking `u` from `ls.fractions` and `v` from input.
|
|
463
|
+
* * If `index` is an invalid index for `ls.fractions`, `u` is computed as `index / ls.points.length`.
|
|
464
|
+
* * The implementation is free to either create a new param or return the index of a
|
|
465
|
+
* prior param with the same coordinates.
|
|
417
466
|
* @param ls the linestring.
|
|
418
467
|
* @param index index of the point in the linestring.
|
|
419
468
|
* @param v the v parameter.
|
|
@@ -422,8 +471,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
422
471
|
* @returns the uv parameter index in the polyface.
|
|
423
472
|
*/
|
|
424
473
|
findOrAddParamInLineString(ls, index, v, priorIndexA, priorIndexB) {
|
|
425
|
-
const u =
|
|
426
|
-
ls.fractions.atUncheckedIndex(index) : index / ls.points.length;
|
|
474
|
+
const u = ls.fractions?.atIndex(index) ?? index / ls.points.length;
|
|
427
475
|
return this._polyface.addParamUV(u, v, priorIndexA, priorIndexB);
|
|
428
476
|
}
|
|
429
477
|
/**
|
|
@@ -451,80 +499,91 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
451
499
|
addPointXYZ(x, y, z) {
|
|
452
500
|
return this._polyface.addPointXYZ(x, y, z);
|
|
453
501
|
}
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
const
|
|
459
|
-
const
|
|
460
|
-
return
|
|
502
|
+
static _workVector0;
|
|
503
|
+
static _workVector1;
|
|
504
|
+
/** Returns a uv-to-world transform whose inverse can be applied to points on a triangular facet in order to obtain UV parameters. */
|
|
505
|
+
getUVTransformForTriangleFacet(pointA, pointB, pointC, result) {
|
|
506
|
+
const vectorAB = PolyfaceBuilder._workVector0 = pointA.vectorTo(pointB, PolyfaceBuilder._workVector0);
|
|
507
|
+
const vectorAC = PolyfaceBuilder._workVector1 = pointA.vectorTo(pointC, PolyfaceBuilder._workVector1);
|
|
508
|
+
return Transform_1.Transform.createRigidFromOriginAndColumns(pointA, vectorAB, vectorAC, Geometry_1.AxisOrder.XYZ, result);
|
|
461
509
|
}
|
|
462
510
|
/** Returns the normal to a triangular facet. */
|
|
463
|
-
getNormalForTriangularFacet(pointA, pointB, pointC) {
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
511
|
+
getNormalForTriangularFacet(pointA, pointB, pointC, result) {
|
|
512
|
+
const normal = pointA.crossProductToPoints(pointB, pointC, result);
|
|
513
|
+
return normal.tryNormalizeInPlace() ? normal : Point3dVector3d_1.Vector3d.createZero(result);
|
|
514
|
+
}
|
|
515
|
+
// below uv/normal temp vars are held by addQuadFacet and should not be used in methods called by it
|
|
516
|
+
static _workUV0;
|
|
517
|
+
static _workUV1;
|
|
518
|
+
static _workUV2;
|
|
519
|
+
static _workUV3;
|
|
520
|
+
static _workNormal0;
|
|
521
|
+
static _workNormal1;
|
|
522
|
+
static _workNormal2;
|
|
523
|
+
static _workNormal3;
|
|
524
|
+
static _workTransform;
|
|
471
525
|
/**
|
|
472
526
|
* Add a quad to the polyface given its points in order around the edges.
|
|
473
527
|
* @param points array of at least four vertices.
|
|
474
|
-
* @param params (optional) array of at least four uv parameters
|
|
475
|
-
*
|
|
476
|
-
* @param normals (optional) array of at least four vectors
|
|
477
|
-
* normal is calculated
|
|
478
|
-
* @param colors (optional) array of at least four colors.
|
|
528
|
+
* @param params (optional) array of at least four uv parameters. If `undefined` or insufficiently sized
|
|
529
|
+
* or quad is degenerate, and params are needed, uv are calculated from `points`.
|
|
530
|
+
* @param normals (optional) array of at least four vectors. If `undefined` or insufficiently sized,
|
|
531
|
+
* and normals are needed, the quad is assumed to be planar and its normal is calculated from `points`.
|
|
532
|
+
* @param colors (optional) array of at least four colors. If `undefined` or insufficiently sized, and
|
|
533
|
+
* colors are needed, color 0 is used.
|
|
479
534
|
*/
|
|
480
535
|
addQuadFacet(points, params, normals, colors) {
|
|
481
|
-
if (points instanceof GrowableXYZArray_1.GrowableXYZArray)
|
|
482
|
-
points = points.getPoint3dArray();
|
|
483
536
|
if (points.length < 4)
|
|
484
537
|
return;
|
|
538
|
+
if (points instanceof GrowableXYZArray_1.GrowableXYZArray)
|
|
539
|
+
points = points.getPoint3dArray();
|
|
485
540
|
// if params and/or normals are needed, calculate them first
|
|
486
541
|
const needParams = this.options.needParams;
|
|
487
542
|
const needNormals = this.options.needNormals;
|
|
488
543
|
const needColors = this.options.needColors;
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
544
|
+
const param0 = PolyfaceBuilder._workUV0 = Point2dVector2d_1.Point2d.createZero(PolyfaceBuilder._workUV0);
|
|
545
|
+
const param1 = PolyfaceBuilder._workUV1 = Point2dVector2d_1.Point2d.createZero(PolyfaceBuilder._workUV1);
|
|
546
|
+
const param2 = PolyfaceBuilder._workUV2 = Point2dVector2d_1.Point2d.createZero(PolyfaceBuilder._workUV2);
|
|
547
|
+
const param3 = PolyfaceBuilder._workUV3 = Point2dVector2d_1.Point2d.createZero(PolyfaceBuilder._workUV3);
|
|
548
|
+
const normal0 = PolyfaceBuilder._workNormal0 = Point3dVector3d_1.Vector3d.createZero(PolyfaceBuilder._workNormal0);
|
|
549
|
+
const normal1 = PolyfaceBuilder._workNormal1 = Point3dVector3d_1.Vector3d.createZero(PolyfaceBuilder._workNormal1);
|
|
550
|
+
const normal2 = PolyfaceBuilder._workNormal2 = Point3dVector3d_1.Vector3d.createZero(PolyfaceBuilder._workNormal2);
|
|
551
|
+
const normal3 = PolyfaceBuilder._workNormal3 = Point3dVector3d_1.Vector3d.createZero(PolyfaceBuilder._workNormal3);
|
|
552
|
+
let color0 = 0, color1 = 0, color2 = 0, color3 = 0;
|
|
492
553
|
if (needParams) {
|
|
493
|
-
if (params
|
|
494
|
-
param0
|
|
495
|
-
param1
|
|
496
|
-
param2
|
|
497
|
-
param3
|
|
554
|
+
if (params && params.length > 3) {
|
|
555
|
+
param0.setFrom(params[0]);
|
|
556
|
+
param1.setFrom(params[1]);
|
|
557
|
+
param2.setFrom(params[2]);
|
|
558
|
+
param3.setFrom(params[3]);
|
|
498
559
|
}
|
|
499
560
|
else {
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
param2 = Point2dVector2d_1.Point2d.createFrom(paramTransform.multiplyPoint3d(points[2]));
|
|
508
|
-
param3 = Point2dVector2d_1.Point2d.createFrom(paramTransform.multiplyPoint3d(points[3]));
|
|
561
|
+
// skip points[2] when computing transform so that parallelogram common case gets param2 = (1,1)
|
|
562
|
+
const paramTransform = PolyfaceBuilder._workTransform = this.getUVTransformForTriangleFacet(points[0], points[1], points[3], PolyfaceBuilder._workTransform);
|
|
563
|
+
if (paramTransform) {
|
|
564
|
+
paramTransform.multiplyInversePoint3dAsPoint2d(points[0], param0);
|
|
565
|
+
paramTransform.multiplyInversePoint3dAsPoint2d(points[1], param1);
|
|
566
|
+
paramTransform.multiplyInversePoint3dAsPoint2d(points[2], param2);
|
|
567
|
+
paramTransform.multiplyInversePoint3dAsPoint2d(points[3], param3);
|
|
509
568
|
}
|
|
510
569
|
}
|
|
511
570
|
}
|
|
512
571
|
if (needNormals) {
|
|
513
|
-
if (normals
|
|
514
|
-
normal0
|
|
515
|
-
normal1
|
|
516
|
-
normal2
|
|
517
|
-
normal3
|
|
572
|
+
if (normals && normals.length > 3) {
|
|
573
|
+
normal0.setFrom(normals[0]);
|
|
574
|
+
normal1.setFrom(normals[1]);
|
|
575
|
+
normal2.setFrom(normals[2]);
|
|
576
|
+
normal3.setFrom(normals[3]);
|
|
518
577
|
}
|
|
519
|
-
else {
|
|
520
|
-
|
|
521
|
-
normal1
|
|
522
|
-
normal2
|
|
523
|
-
normal3
|
|
578
|
+
else { // same normal at each corner
|
|
579
|
+
this.getNormalForTriangularFacet(points[0], points[1], points[2], normal0);
|
|
580
|
+
normal1.setFrom(normal0);
|
|
581
|
+
normal2.setFrom(normal0);
|
|
582
|
+
normal3.setFrom(normal0);
|
|
524
583
|
}
|
|
525
584
|
}
|
|
526
585
|
if (needColors) {
|
|
527
|
-
if (colors
|
|
586
|
+
if (colors && colors.length > 3) {
|
|
528
587
|
color0 = colors[0];
|
|
529
588
|
color1 = colors[1];
|
|
530
589
|
color2 = colors[2];
|
|
@@ -533,10 +592,10 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
533
592
|
}
|
|
534
593
|
if (this._options.shouldTriangulate) {
|
|
535
594
|
// add as two triangles, with a diagonal along the shortest distance
|
|
536
|
-
const
|
|
537
|
-
const
|
|
538
|
-
//
|
|
539
|
-
if (
|
|
595
|
+
const magSquaredAC = points[0].distanceSquared(points[2]);
|
|
596
|
+
const magSquaredBD = points[1].distanceSquared(points[3]);
|
|
597
|
+
// use tiny tol to reduce chance of the odd flipped diagonal in a regular quad grid
|
|
598
|
+
if (magSquaredAC + Geometry_1.Geometry.smallFloatingPoint >= magSquaredBD) {
|
|
540
599
|
this.addTriangleFacet([points[0], points[1], points[2]], needParams ? [param0, param1, param2] : undefined, needNormals ? [normal0, normal1, normal2] : undefined, needColors ? [color0, color1, color2] : undefined);
|
|
541
600
|
this.addTriangleFacet([points[0], points[2], points[3]], needParams ? [param0, param2, param3] : undefined, needNormals ? [normal0, normal2, normal3] : undefined, needColors ? [color0, color2, color3] : undefined);
|
|
542
601
|
}
|
|
@@ -646,76 +705,74 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
646
705
|
this._polyface.addColorIndex(indexB0);
|
|
647
706
|
}
|
|
648
707
|
}
|
|
649
|
-
// ### TODO: Consider case where normals will be reversed and point through the other end of the facet.
|
|
650
708
|
/**
|
|
651
709
|
* Add a triangle to the polyface given its points in order around the edges.
|
|
652
710
|
* @param points array of at least three vertices.
|
|
653
|
-
* @param params (optional) array of at least three uv parameters
|
|
654
|
-
*
|
|
655
|
-
* @param normals (optional) array of at least three vectors
|
|
656
|
-
*
|
|
711
|
+
* @param params (optional) array of at least three uv parameters. If `undefined` or insufficiently sized
|
|
712
|
+
* or quad is degenerate, and params are needed, uv are calculated from `points`.
|
|
713
|
+
* @param normals (optional) array of at least three vectors. If `undefined` or insufficiently sized,
|
|
714
|
+
* and normals are needed, the normal is calculated from `points`.
|
|
715
|
+
* @param colors (optional) array of at least three colors. If `undefined` or insufficiently sized, and
|
|
716
|
+
* colors are needed, color 0 is used.
|
|
657
717
|
*/
|
|
658
718
|
addTriangleFacet(points, params, normals, colors) {
|
|
659
719
|
if (points.length < 3)
|
|
660
720
|
return;
|
|
721
|
+
if (points instanceof GrowableXYZArray_1.GrowableXYZArray)
|
|
722
|
+
points = points.getPoint3dArray();
|
|
661
723
|
let idx0;
|
|
662
724
|
let idx1;
|
|
663
725
|
let idx2;
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
point0 = points.getPoint3dAtCheckedPointIndex(0);
|
|
667
|
-
point1 = points.getPoint3dAtCheckedPointIndex(1);
|
|
668
|
-
point2 = points.getPoint3dAtCheckedPointIndex(2);
|
|
669
|
-
}
|
|
670
|
-
else {
|
|
671
|
-
point0 = points[0];
|
|
672
|
-
point1 = points[1];
|
|
673
|
-
point2 = points[2];
|
|
674
|
-
}
|
|
675
|
-
// add params if needed
|
|
676
|
-
if (this._options.needParams) {
|
|
677
|
-
if (params && params.length >= 3) { // params were given
|
|
726
|
+
if (this.options.needParams) {
|
|
727
|
+
if (params && params.length > 2) {
|
|
678
728
|
idx0 = this._polyface.addParam(params[0]);
|
|
679
729
|
idx1 = this._polyface.addParam(params[1]);
|
|
680
730
|
idx2 = this._polyface.addParam(params[2]);
|
|
681
731
|
}
|
|
682
|
-
else { // compute params
|
|
683
|
-
const
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
idx2 = this._polyface.addParam(
|
|
732
|
+
else { // compute uv params from points
|
|
733
|
+
const param = PolyfaceBuilder._workUV0 = Point2dVector2d_1.Point2d.createZero(PolyfaceBuilder._workUV0); // not used by caller
|
|
734
|
+
const paramTransform = PolyfaceBuilder._workTransform = this.getUVTransformForTriangleFacet(points[0], points[1], points[2], PolyfaceBuilder._workTransform);
|
|
735
|
+
paramTransform?.multiplyInversePoint3dAsPoint2d(points[0], param);
|
|
736
|
+
idx2 = idx1 = idx0 = this._polyface.addParam(param);
|
|
737
|
+
if (paramTransform) {
|
|
738
|
+
paramTransform.multiplyInversePoint3dAsPoint2d(points[1], param);
|
|
739
|
+
idx1 = this._polyface.addParam(param);
|
|
740
|
+
paramTransform.multiplyInversePoint3dAsPoint2d(points[2], param);
|
|
741
|
+
idx2 = this._polyface.addParam(param);
|
|
742
|
+
}
|
|
687
743
|
}
|
|
688
744
|
this.addIndexedTriangleParamIndexes(idx0, idx1, idx2);
|
|
689
745
|
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
if (normals !== undefined && normals.length > 2) { // normals were given
|
|
746
|
+
if (this.options.needNormals) {
|
|
747
|
+
if (normals && normals.length > 2) {
|
|
693
748
|
idx0 = this._polyface.addNormal(normals[0]);
|
|
694
749
|
idx1 = this._polyface.addNormal(normals[1]);
|
|
695
750
|
idx2 = this._polyface.addNormal(normals[2]);
|
|
696
751
|
}
|
|
697
|
-
else { // compute
|
|
698
|
-
const normal =
|
|
699
|
-
|
|
700
|
-
idx1 = this._polyface.addNormal(normal);
|
|
701
|
-
idx2 = this._polyface.addNormal(normal);
|
|
752
|
+
else { // compute the normal from points
|
|
753
|
+
const normal = PolyfaceBuilder._workNormal0 = Point3dVector3d_1.Vector3d.createZero(PolyfaceBuilder._workNormal0); // not used by caller
|
|
754
|
+
this.getNormalForTriangularFacet(points[0], points[1], points[2], normal);
|
|
755
|
+
idx2 = idx1 = idx0 = this._polyface.addNormal(normal);
|
|
702
756
|
}
|
|
703
757
|
this.addIndexedTriangleNormalIndexes(idx0, idx1, idx2);
|
|
704
758
|
}
|
|
705
759
|
// add colors if needed and provided
|
|
706
|
-
if (this.
|
|
707
|
-
if (colors
|
|
760
|
+
if (this.options.needColors) {
|
|
761
|
+
if (colors && colors.length > 2) {
|
|
708
762
|
idx0 = this._polyface.addColor(colors[0]);
|
|
709
763
|
idx1 = this._polyface.addColor(colors[1]);
|
|
710
764
|
idx2 = this._polyface.addColor(colors[2]);
|
|
711
|
-
this.addIndexedTriangleColorIndexes(idx0, idx1, idx2);
|
|
712
765
|
}
|
|
766
|
+
else {
|
|
767
|
+
idx2 = idx1 = idx0 = this._polyface.addColor(0);
|
|
768
|
+
}
|
|
769
|
+
this.addIndexedTriangleColorIndexes(idx0, idx1, idx2);
|
|
713
770
|
}
|
|
714
771
|
// add point and point indexes last (terminates the facet)
|
|
715
|
-
idx0 = this.addPoint(
|
|
716
|
-
idx1 = this.addPoint(
|
|
717
|
-
idx2 = this.addPoint(
|
|
718
|
-
this.addIndexedTrianglePointIndexes(idx0, idx1, idx2);
|
|
772
|
+
idx0 = this.addPoint(points[0]);
|
|
773
|
+
idx1 = this.addPoint(points[1]);
|
|
774
|
+
idx2 = this.addPoint(points[2]);
|
|
775
|
+
this.addIndexedTrianglePointIndexes(idx0, idx1, idx2, true);
|
|
719
776
|
}
|
|
720
777
|
/**
|
|
721
778
|
* Add a single triangular facet from existing points to the polyface.
|
|
@@ -859,24 +916,28 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
859
916
|
/**
|
|
860
917
|
* Add facets between lineStrings with matched point counts.
|
|
861
918
|
* * Indices of points, normals, and uv parameters are pre-stored in the linestrings.
|
|
919
|
+
* * `pointIndices`, `normalIndices`, and `paramIndices` (if used) for both linestrings must be defined and
|
|
920
|
+
* have the same length.
|
|
862
921
|
*/
|
|
863
922
|
addBetweenLineStringsWithStoredIndices(lineStringA, lineStringB) {
|
|
864
923
|
const pointA = lineStringA.pointIndices;
|
|
865
924
|
const pointB = lineStringB.pointIndices;
|
|
925
|
+
if (!pointA || !pointB || pointA.length < 2 || pointA.length !== pointB.length)
|
|
926
|
+
return;
|
|
927
|
+
const n = pointA.length;
|
|
866
928
|
let normalA = lineStringA.normalIndices;
|
|
867
929
|
let normalB = lineStringB.normalIndices;
|
|
868
|
-
if (!this._options.needNormals) {
|
|
930
|
+
if (!this._options.needNormals || (normalA && normalB && (normalA.length < n || normalB.length < n))) {
|
|
869
931
|
normalA = undefined;
|
|
870
932
|
normalB = undefined;
|
|
871
933
|
}
|
|
872
934
|
let paramA = lineStringA.paramIndices;
|
|
873
935
|
let paramB = lineStringB.paramIndices;
|
|
874
|
-
if (!this._options.needParams) {
|
|
936
|
+
if (!this._options.needParams || (paramA && paramB && (paramA.length < n || paramB.length < n))) {
|
|
875
937
|
paramA = undefined;
|
|
876
938
|
paramB = undefined;
|
|
877
939
|
}
|
|
878
|
-
|
|
879
|
-
for (let i = 1; i < numPoints; i++) {
|
|
940
|
+
for (let i = 1; i < n; i++) {
|
|
880
941
|
if (this.options.shouldTriangulate) {
|
|
881
942
|
if (distinctIndices(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i))) {
|
|
882
943
|
this.addIndexedTrianglePointIndexes(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i), false);
|
|
@@ -907,29 +968,30 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
907
968
|
}
|
|
908
969
|
}
|
|
909
970
|
/**
|
|
910
|
-
* Add facets between lineStrings
|
|
971
|
+
* Add facets between transformed lineStrings.
|
|
911
972
|
* * Facets are announced to addIndexedQuad.
|
|
912
973
|
* * addIndexedQuad is free to apply reversal or triangulation options.
|
|
913
974
|
*/
|
|
914
975
|
addBetweenTransformedLineStrings(curves, transformA, transformB, addClosure = false) {
|
|
915
976
|
if (curves instanceof LineString3d_1.LineString3d) {
|
|
916
|
-
const
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
977
|
+
const numPoints = curves.numPoints();
|
|
978
|
+
if (numPoints > 1) {
|
|
979
|
+
let indexA0 = this.findOrAddPointInLineStringUnchecked(curves, 0, transformA);
|
|
980
|
+
let indexB0 = this.findOrAddPointInLineStringUnchecked(curves, 0, transformB);
|
|
981
|
+
const indexA00 = indexA0;
|
|
982
|
+
const indexB00 = indexB0;
|
|
983
|
+
let indexA1 = 0;
|
|
984
|
+
let indexB1 = 0;
|
|
985
|
+
for (let i = 1; i < numPoints; i++) {
|
|
986
|
+
indexA1 = this.findOrAddPointInLineStringUnchecked(curves, i, transformA);
|
|
987
|
+
indexB1 = this.findOrAddPointInLineStringUnchecked(curves, i, transformB);
|
|
988
|
+
this.addIndexedQuadPointIndexes(indexA0, indexA1, indexB0, indexB1);
|
|
989
|
+
indexA0 = indexA1;
|
|
990
|
+
indexB0 = indexB1;
|
|
991
|
+
}
|
|
992
|
+
if (addClosure && numPoints > 2)
|
|
993
|
+
this.addIndexedQuadPointIndexes(indexA0, indexA00, indexB0, indexB00);
|
|
930
994
|
}
|
|
931
|
-
if (addClosure)
|
|
932
|
-
this.addIndexedQuadPointIndexes(indexA0, indexA00, indexB0, indexB00);
|
|
933
995
|
}
|
|
934
996
|
else {
|
|
935
997
|
const children = curves.children;
|
|
@@ -1005,8 +1067,8 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1005
1067
|
const sizes = surface.maxIsoParametricDistance();
|
|
1006
1068
|
this.addUVGridBody(surface, numU, numV, Segment1d_1.Segment1d.create(0, sizes.x), Segment1d_1.Segment1d.create(0, sizes.y));
|
|
1007
1069
|
this.toggleReversedFacetFlag();
|
|
1008
|
-
|
|
1009
|
-
|
|
1070
|
+
const centerFrame = surface.getConstructiveFrame();
|
|
1071
|
+
if (centerFrame && surface.capped && thetaFraction < 1.0) {
|
|
1010
1072
|
const minorRadius = surface.getMinorRadius();
|
|
1011
1073
|
const majorRadius = surface.getMajorRadius();
|
|
1012
1074
|
const a = 2 * minorRadius;
|
|
@@ -1052,7 +1114,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1052
1114
|
let indexB1 = 0;
|
|
1053
1115
|
const n = contour.numPoints();
|
|
1054
1116
|
for (let i = 0; i < n; i++) {
|
|
1055
|
-
pointA = contour.
|
|
1117
|
+
pointA = contour.pointAtUnchecked(i, pointA);
|
|
1056
1118
|
pointB = pointA.plus(vector, pointB);
|
|
1057
1119
|
indexA1 = this.addPoint(pointA);
|
|
1058
1120
|
indexB1 = this.addPoint(pointB);
|
|
@@ -1146,39 +1208,43 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1146
1208
|
}
|
|
1147
1209
|
createIndicesInLineString(ls, vParam, transform) {
|
|
1148
1210
|
const n = ls.numPoints();
|
|
1211
|
+
if (n < 1)
|
|
1212
|
+
return;
|
|
1149
1213
|
const pointIndices = ls.ensureEmptyPointIndices();
|
|
1150
|
-
const index0 = this.
|
|
1214
|
+
const index0 = this.findOrAddPointInLineStringUnchecked(ls, 0, transform);
|
|
1151
1215
|
pointIndices.push(index0);
|
|
1152
1216
|
if (n > 1) {
|
|
1153
1217
|
let indexA = index0;
|
|
1154
1218
|
let indexB;
|
|
1155
1219
|
for (let i = 1; i + 1 < n; i++) {
|
|
1156
|
-
indexB = this.
|
|
1220
|
+
indexB = this.findOrAddPointInLineStringUnchecked(ls, i, transform, indexA);
|
|
1157
1221
|
pointIndices.push(indexB);
|
|
1158
1222
|
indexA = indexB;
|
|
1159
1223
|
}
|
|
1160
1224
|
// assume last point can only repeat back to zero
|
|
1161
|
-
indexB = this.
|
|
1225
|
+
indexB = this.findOrAddPointInLineStringUnchecked(ls, n - 1, transform, index0);
|
|
1162
1226
|
pointIndices.push(indexB);
|
|
1163
1227
|
}
|
|
1164
|
-
if (this._options.needNormals && ls.packedSurfaceNormals
|
|
1228
|
+
if (this._options.needNormals && ls.packedSurfaceNormals && ls.packedSurfaceNormals.length >= n) {
|
|
1165
1229
|
const normalIndices = ls.ensureEmptyNormalIndices();
|
|
1166
1230
|
const normalIndex0 = this.findOrAddNormalInLineString(ls, 0, transform);
|
|
1231
|
+
(0, core_bentley_1.assert)(normalIndex0 !== undefined, "expect defined because ls has at least one normal");
|
|
1167
1232
|
normalIndices.push(normalIndex0);
|
|
1168
1233
|
if (n > 1) {
|
|
1169
1234
|
let normalIndexA = normalIndex0;
|
|
1170
1235
|
let normalIndexB;
|
|
1171
1236
|
for (let i = 1; i + 1 < n; i++) {
|
|
1172
1237
|
normalIndexB = this.findOrAddNormalInLineString(ls, i, transform, normalIndexA);
|
|
1238
|
+
(0, core_bentley_1.assert)(normalIndexB !== undefined, "expect defined because ls has normal at index i");
|
|
1173
1239
|
normalIndices.push(normalIndexB);
|
|
1174
1240
|
normalIndexA = normalIndexB;
|
|
1175
1241
|
}
|
|
1176
|
-
// assume last point can only repeat back to zero
|
|
1177
1242
|
normalIndexB = this.findOrAddNormalInLineString(ls, n - 1, transform, normalIndex0, normalIndexA);
|
|
1243
|
+
(0, core_bentley_1.assert)(normalIndexB !== undefined, "expect defined because ls has normal at index n-1");
|
|
1178
1244
|
normalIndices.push(normalIndexB);
|
|
1179
1245
|
}
|
|
1180
1246
|
}
|
|
1181
|
-
if (this._options.needParams
|
|
1247
|
+
if (this._options.needParams) { // u from ls.fractions, or computed
|
|
1182
1248
|
const uvIndices = ls.ensureEmptyUVIndices();
|
|
1183
1249
|
const uvIndex0 = this.findOrAddParamInLineString(ls, 0, vParam);
|
|
1184
1250
|
uvIndices.push(uvIndex0);
|
|
@@ -1190,7 +1256,6 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1190
1256
|
uvIndices.push(uvIndexB);
|
|
1191
1257
|
uvIndexA = uvIndexB;
|
|
1192
1258
|
}
|
|
1193
|
-
// assume last point can only repeat back to zero
|
|
1194
1259
|
uvIndexB = this.findOrAddParamInLineString(ls, n - 1, vParam, uvIndexA, uvIndex0);
|
|
1195
1260
|
uvIndices.push(uvIndexB);
|
|
1196
1261
|
}
|
|
@@ -1361,18 +1426,18 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1361
1426
|
addPolygonGrowableXYZArray(points) {
|
|
1362
1427
|
// don't use trailing points that match start point
|
|
1363
1428
|
let numPointsToUse = points.length;
|
|
1364
|
-
while (numPointsToUse > 2 && Geometry_1.Geometry.isSmallMetricDistance(points.
|
|
1429
|
+
while (numPointsToUse > 2 && Geometry_1.Geometry.isSmallMetricDistance(points.distanceUncheckedIndexIndex(0, numPointsToUse - 1)))
|
|
1365
1430
|
numPointsToUse--;
|
|
1366
1431
|
// strip trailing duplicates
|
|
1367
|
-
while (numPointsToUse > 2 && Geometry_1.Geometry.isSmallMetricDistance(points.
|
|
1432
|
+
while (numPointsToUse > 2 && Geometry_1.Geometry.isSmallMetricDistance(points.distanceUncheckedIndexIndex(numPointsToUse - 2, numPointsToUse - 1)))
|
|
1368
1433
|
numPointsToUse--;
|
|
1369
1434
|
// ignore triangles for which the height is less than smallMetricDistance times length.
|
|
1370
1435
|
// sum of edge lengths is twice the perimeter. If it is flat that's twice the largest base dimension.
|
|
1371
1436
|
// cross product magnitude is twice the area.
|
|
1372
1437
|
if (numPointsToUse === 3) {
|
|
1373
|
-
const cross = points.
|
|
1438
|
+
const cross = points.crossProductUncheckedIndexIndexIndex(0, 1, 2);
|
|
1374
1439
|
const q = cross.magnitude();
|
|
1375
|
-
const p = points.
|
|
1440
|
+
const p = points.distanceUncheckedIndexIndex(0, 1) + points.distanceUncheckedIndexIndex(0, 2) + points.distanceUncheckedIndexIndex(1, 2);
|
|
1376
1441
|
if (q < Geometry_1.Geometry.smallMetricDistance * p)
|
|
1377
1442
|
numPointsToUse = 0;
|
|
1378
1443
|
}
|
|
@@ -1380,13 +1445,13 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1380
1445
|
let index = 0;
|
|
1381
1446
|
if (!this._reversed) {
|
|
1382
1447
|
for (let i = 0; i < numPointsToUse; i++) {
|
|
1383
|
-
index = this.
|
|
1448
|
+
index = this.findOrAddPointInGrowableXYZArrayUnchecked(points, i);
|
|
1384
1449
|
this._polyface.addPointIndex(index);
|
|
1385
1450
|
}
|
|
1386
1451
|
}
|
|
1387
1452
|
else {
|
|
1388
1453
|
for (let i = numPointsToUse; --i >= 0;) {
|
|
1389
|
-
index = this.
|
|
1454
|
+
index = this.findOrAddPointInGrowableXYZArrayUnchecked(points, i);
|
|
1390
1455
|
this._polyface.addPointIndex(index);
|
|
1391
1456
|
}
|
|
1392
1457
|
}
|
|
@@ -1408,7 +1473,7 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1408
1473
|
addFacetFromGrowableArrays(points, normals, params, colors, edgeVisible) {
|
|
1409
1474
|
// don't use trailing points that match start point
|
|
1410
1475
|
let numPointsToUse = points.length;
|
|
1411
|
-
while (numPointsToUse > 1 && Geometry_1.Geometry.isSmallMetricDistance(points.
|
|
1476
|
+
while (numPointsToUse > 1 && Geometry_1.Geometry.isSmallMetricDistance(points.distanceUncheckedIndexIndex(0, numPointsToUse - 1)))
|
|
1412
1477
|
numPointsToUse--;
|
|
1413
1478
|
let index = 0;
|
|
1414
1479
|
if (normals && normals.length < numPointsToUse)
|
|
@@ -1421,14 +1486,14 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1421
1486
|
edgeVisible = undefined;
|
|
1422
1487
|
if (!this._reversed) {
|
|
1423
1488
|
for (let i = 0; i < numPointsToUse; i++) {
|
|
1424
|
-
index = this.
|
|
1489
|
+
index = this.findOrAddPointInGrowableXYZArrayUnchecked(points, i);
|
|
1425
1490
|
this._polyface.addPointIndex(index, edgeVisible ? edgeVisible[i] : true);
|
|
1426
1491
|
if (normals) {
|
|
1427
|
-
index = this.
|
|
1492
|
+
index = this.findOrAddNormalInGrowableXYZArrayUnchecked(normals, i);
|
|
1428
1493
|
this._polyface.addNormalIndex(index);
|
|
1429
1494
|
}
|
|
1430
1495
|
if (params) {
|
|
1431
|
-
index = this.
|
|
1496
|
+
index = this.addParamInGrowableXYArrayUnchecked(params, i);
|
|
1432
1497
|
this._polyface.addParamIndex(index);
|
|
1433
1498
|
}
|
|
1434
1499
|
if (colors) {
|
|
@@ -1439,14 +1504,14 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1439
1504
|
}
|
|
1440
1505
|
else {
|
|
1441
1506
|
for (let i = numPointsToUse; --i >= 0;) {
|
|
1442
|
-
index = this.
|
|
1507
|
+
index = this.findOrAddPointInGrowableXYZArrayUnchecked(points, i);
|
|
1443
1508
|
this._polyface.addPointIndex(index);
|
|
1444
1509
|
if (normals) {
|
|
1445
|
-
index = this.
|
|
1510
|
+
index = this.findOrAddNormalInGrowableXYZArrayUnchecked(normals, i);
|
|
1446
1511
|
this._polyface.addNormalIndex(index);
|
|
1447
1512
|
}
|
|
1448
1513
|
if (params) {
|
|
1449
|
-
index = this.
|
|
1514
|
+
index = this.addParamInGrowableXYArrayUnchecked(params, i);
|
|
1450
1515
|
this._polyface.addParamIndex(index);
|
|
1451
1516
|
}
|
|
1452
1517
|
if (colors) {
|
|
@@ -1653,6 +1718,8 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1653
1718
|
localToWorld = FrameBuilder_1.FrameBuilder.createFrameWithCCWPolygon(points);
|
|
1654
1719
|
if (localToWorld) {
|
|
1655
1720
|
const localPoints = localToWorld.multiplyInversePoint3dArray(points);
|
|
1721
|
+
if (!localPoints)
|
|
1722
|
+
return undefined; // should never happen, but go ahead and return undefined since it is in the return type union
|
|
1656
1723
|
const areaXY = PolygonOps_1.PolygonOps.areaXY(localPoints);
|
|
1657
1724
|
if (areaXY < 0.0)
|
|
1658
1725
|
localPoints.reverse();
|
|
@@ -1717,7 +1784,6 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1717
1784
|
paramIndex0 = new GrowableFloat64Array_1.GrowableFloat64Array(numU);
|
|
1718
1785
|
paramIndex1 = new GrowableFloat64Array_1.GrowableFloat64Array(numU);
|
|
1719
1786
|
}
|
|
1720
|
-
let indexSwap;
|
|
1721
1787
|
xyzIndex0.ensureCapacity(numU);
|
|
1722
1788
|
xyzIndex1.ensureCapacity(numU);
|
|
1723
1789
|
const uv = Point2dVector2d_1.Point2d.create();
|
|
@@ -1728,62 +1794,57 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1728
1794
|
for (let v = 0; v <= numV; v++) {
|
|
1729
1795
|
// evaluate new points
|
|
1730
1796
|
xyzIndex1.clear();
|
|
1731
|
-
if (
|
|
1797
|
+
if (normalIndex1)
|
|
1732
1798
|
normalIndex1.clear();
|
|
1733
|
-
if (
|
|
1799
|
+
if (paramIndex1)
|
|
1734
1800
|
paramIndex1.clear();
|
|
1735
1801
|
for (let u = 0; u <= numU; u++) {
|
|
1736
1802
|
const uFrac = u * du;
|
|
1737
1803
|
const vFrac = v * dv;
|
|
1738
1804
|
surface.uvFractionToPointAndTangents(uFrac, vFrac, plane);
|
|
1739
1805
|
xyzIndex1.push(this._polyface.addPoint(plane.origin));
|
|
1740
|
-
if (
|
|
1806
|
+
if (normalIndex1) {
|
|
1741
1807
|
plane.vectorU.crossProduct(plane.vectorV, normal);
|
|
1742
1808
|
normal.normalizeInPlace();
|
|
1743
1809
|
if (reverse)
|
|
1744
1810
|
normal.scaleInPlace(-1.0);
|
|
1745
1811
|
normalIndex1.push(this._polyface.addNormal(normal));
|
|
1746
1812
|
}
|
|
1747
|
-
if (
|
|
1813
|
+
if (paramIndex1) {
|
|
1748
1814
|
paramIndex1.push(this._polyface.addParam(Point2dVector2d_1.Point2d.create(uMap ? uMap.fractionToPoint(uFrac) : uFrac, vMap ? vMap.fractionToPoint(vFrac) : vFrac, uv)));
|
|
1815
|
+
}
|
|
1749
1816
|
}
|
|
1750
1817
|
if (v > 0) {
|
|
1751
1818
|
for (let u = 0; u < numU; u++) {
|
|
1752
1819
|
if (!this._options.shouldTriangulate) {
|
|
1753
1820
|
this.addIndexedQuadPointIndexes(xyzIndex0.atUncheckedIndex(u), xyzIndex0.atUncheckedIndex(u + 1), xyzIndex1.atUncheckedIndex(u), xyzIndex1.atUncheckedIndex(u + 1), false);
|
|
1754
|
-
if (needNormals)
|
|
1821
|
+
if (needNormals && normalIndex0 && normalIndex1)
|
|
1755
1822
|
this.addIndexedQuadNormalIndexes(normalIndex0.atUncheckedIndex(u), normalIndex0.atUncheckedIndex(u + 1), normalIndex1.atUncheckedIndex(u), normalIndex1.atUncheckedIndex(u + 1));
|
|
1756
|
-
if (needParams)
|
|
1823
|
+
if (needParams && paramIndex0 && paramIndex1)
|
|
1757
1824
|
this.addIndexedQuadParamIndexes(paramIndex0.atUncheckedIndex(u), paramIndex0.atUncheckedIndex(u + 1), paramIndex1.atUncheckedIndex(u), paramIndex1.atUncheckedIndex(u + 1));
|
|
1758
1825
|
this._polyface.terminateFacet();
|
|
1759
1826
|
}
|
|
1760
1827
|
else {
|
|
1761
1828
|
this.addIndexedTrianglePointIndexes(xyzIndex0.atUncheckedIndex(u), xyzIndex0.atUncheckedIndex(u + 1), xyzIndex1.atUncheckedIndex(u), false);
|
|
1762
|
-
if (
|
|
1829
|
+
if (normalIndex0 && normalIndex1)
|
|
1763
1830
|
this.addIndexedTriangleNormalIndexes(normalIndex0.atUncheckedIndex(u), normalIndex0.atUncheckedIndex(u + 1), normalIndex1.atUncheckedIndex(u));
|
|
1764
|
-
if (
|
|
1831
|
+
if (paramIndex0 && paramIndex1)
|
|
1765
1832
|
this.addIndexedTriangleParamIndexes(paramIndex0.atUncheckedIndex(u), paramIndex0.atUncheckedIndex(u + 1), paramIndex1.atUncheckedIndex(u));
|
|
1766
1833
|
this._polyface.terminateFacet();
|
|
1767
1834
|
this.addIndexedTrianglePointIndexes(xyzIndex1.atUncheckedIndex(u), xyzIndex0.atUncheckedIndex(u + 1), xyzIndex1.atUncheckedIndex(u + 1), false);
|
|
1768
|
-
if (
|
|
1835
|
+
if (normalIndex0 && normalIndex1)
|
|
1769
1836
|
this.addIndexedTriangleNormalIndexes(normalIndex1.atUncheckedIndex(u), normalIndex0.atUncheckedIndex(u + 1), normalIndex1.atUncheckedIndex(u + 1));
|
|
1770
|
-
if (
|
|
1837
|
+
if (paramIndex0 && paramIndex1)
|
|
1771
1838
|
this.addIndexedTriangleParamIndexes(paramIndex1.atUncheckedIndex(u), paramIndex0.atUncheckedIndex(u + 1), paramIndex1.atUncheckedIndex(u + 1));
|
|
1772
1839
|
this._polyface.terminateFacet();
|
|
1773
1840
|
}
|
|
1774
1841
|
}
|
|
1775
1842
|
}
|
|
1776
|
-
|
|
1777
|
-
xyzIndex1 = xyzIndex0;
|
|
1778
|
-
xyzIndex0 = indexSwap;
|
|
1843
|
+
[xyzIndex0, xyzIndex1] = [xyzIndex1, xyzIndex0];
|
|
1779
1844
|
if (needParams)
|
|
1780
|
-
|
|
1781
|
-
paramIndex1 = paramIndex0;
|
|
1782
|
-
paramIndex0 = indexSwap;
|
|
1845
|
+
[paramIndex0, paramIndex1] = [paramIndex1, paramIndex0];
|
|
1783
1846
|
if (needNormals)
|
|
1784
|
-
|
|
1785
|
-
normalIndex1 = normalIndex0;
|
|
1786
|
-
normalIndex0 = indexSwap;
|
|
1847
|
+
[normalIndex0, normalIndex1] = [normalIndex1, normalIndex0];
|
|
1787
1848
|
}
|
|
1788
1849
|
xyzIndex0.clear();
|
|
1789
1850
|
xyzIndex1.clear();
|
|
@@ -1897,17 +1958,16 @@ class PolyfaceBuilder extends GeometryHandler_1.NullGeometryHandler {
|
|
|
1897
1958
|
];
|
|
1898
1959
|
const vertices = [];
|
|
1899
1960
|
let colors; // try to re-use colors; missing normals and params will be computed if needed
|
|
1900
|
-
if (
|
|
1961
|
+
if (this.options.needColors && this._polyface.data.color && this._polyface.data.colorIndex)
|
|
1901
1962
|
colors = [];
|
|
1902
1963
|
for (let i = 0; i < 4; ++i) {
|
|
1903
|
-
const
|
|
1964
|
+
const index = indices[i];
|
|
1965
|
+
const xyz = this._polyface.data.getPoint(this._polyface.data.pointIndex[index]);
|
|
1904
1966
|
if (undefined === xyz)
|
|
1905
1967
|
return false;
|
|
1906
1968
|
vertices.push(xyz);
|
|
1907
|
-
if (
|
|
1908
|
-
const color = this._polyface.data.getColor(this._polyface.data.colorIndex[
|
|
1909
|
-
if (undefined === color)
|
|
1910
|
-
return false;
|
|
1969
|
+
if (colors && this._polyface.data.colorIndex && 0 <= index && index < this._polyface.data.colorIndex.length) {
|
|
1970
|
+
const color = this._polyface.data.getColor(this._polyface.data.colorIndex[index]); // unchecked
|
|
1911
1971
|
colors.push(color);
|
|
1912
1972
|
}
|
|
1913
1973
|
}
|