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