@itwin/core-geometry 5.0.0-dev.3 → 5.0.0-dev.34
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/CHANGELOG.md +19 -1
- package/lib/cjs/Constant.js +17 -17
- package/lib/cjs/Constant.js.map +1 -1
- package/lib/cjs/Geometry.js +35 -35
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/cjs/bspline/BSplineCurveOps.js +18 -21
- package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
- package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
- package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/bspline/KnotVector.js +2 -2
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/cjs/clipping/AlternatingConvexClipTree.js +2 -2
- package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
- package/lib/cjs/clipping/ClipPlane.js +1 -1
- package/lib/cjs/clipping/ClipPlane.js.map +1 -1
- 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.js +1 -1
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +3 -3
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +40 -8
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +80 -22
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +4 -4
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +16 -2
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +33 -2
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.d.ts +87 -53
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +213 -135
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveOps.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveTypes.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +12 -8
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +34 -13
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.d.ts +12 -6
- package/lib/cjs/curve/Loop.d.ts.map +1 -1
- package/lib/cjs/curve/Loop.js +12 -6
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/OffsetOptions.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js.map +1 -1
- package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.d.ts +8 -6
- package/lib/cjs/curve/Query/CylindricalRange.d.ts.map +1 -1
- package/lib/cjs/curve/Query/CylindricalRange.js +13 -9
- package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
- package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +4 -4
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +1 -1
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -5
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +13 -13
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +5 -5
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +29 -23
- package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +4 -4
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +2 -2
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +16 -16
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts +1 -1
- package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +14 -8
- package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BarycentricTriangle.js +17 -8
- package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +4 -4
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +2 -0
- package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableFloat64Array.js +4 -0
- package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +32 -10
- package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYZArray.js +54 -16
- package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +13 -2
- package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/cjs/geometry3d/IndexedXYZCollection.js +24 -10
- package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +11 -8
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +36 -34
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- package/lib/cjs/geometry3d/OrderedRotationAngles.js +2 -2
- package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js +1 -1
- package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -6
- package/lib/cjs/geometry3d/Point3dVector3d.js +6 -6
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js +5 -5
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.d.ts +12 -6
- package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js +117 -70
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +3 -3
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +9 -5
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +9 -5
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.js +4 -4
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
- package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
- package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
- package/lib/cjs/geometry4d/MomentData.d.ts +72 -73
- package/lib/cjs/geometry4d/MomentData.d.ts.map +1 -1
- package/lib/cjs/geometry4d/MomentData.js +62 -64
- package/lib/cjs/geometry4d/MomentData.js.map +1 -1
- package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/cjs/numerics/BandedSystem.js.map +1 -1
- package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
- package/lib/cjs/numerics/ClusterableArray.js +13 -13
- package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
- package/lib/cjs/numerics/Complex.js.map +1 -1
- package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js +1 -1
- package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
- package/lib/cjs/numerics/PolarData.js +1 -1
- package/lib/cjs/numerics/PolarData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.d.ts +5 -5
- package/lib/cjs/numerics/Polynomials.js +32 -32
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js +20 -20
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/numerics/Range1dArray.js.map +1 -1
- package/lib/cjs/numerics/SmallSystem.js.map +1 -1
- package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/cjs/numerics/UnionFind.js.map +1 -1
- package/lib/cjs/numerics/UsageSums.js.map +1 -1
- package/lib/cjs/polyface/AuxData.d.ts +2 -2
- package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
- package/lib/cjs/polyface/AuxData.js +11 -3
- package/lib/cjs/polyface/AuxData.js.map +1 -1
- package/lib/cjs/polyface/BoxTopology.js +67 -67
- package/lib/cjs/polyface/BoxTopology.js.map +1 -1
- package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
- package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js +2 -2
- package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +27 -20
- package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js +56 -30
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +2 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/Polyface.d.ts +3 -5
- package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
- package/lib/cjs/polyface/Polyface.js +6 -13
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts +14 -7
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +59 -64
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.d.ts +13 -3
- package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js +26 -9
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +2 -2
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +11 -10
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
- package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
- package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/cjs/polyface/multiclip/RangeSearch.js +5 -5
- package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
- package/lib/cjs/serialization/BGFBReader.js +22 -22
- package/lib/cjs/serialization/BGFBReader.js.map +1 -1
- package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
- package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/cjs/serialization/DeepCompare.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +5 -5
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +112 -112
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
- package/lib/cjs/solid/Box.d.ts +9 -3
- package/lib/cjs/solid/Box.d.ts.map +1 -1
- package/lib/cjs/solid/Box.js +10 -5
- 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 +3 -3
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +9 -3
- package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
- package/lib/cjs/solid/LinearSweep.js +9 -4
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +15 -4
- package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js +20 -7
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +35 -26
- package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RuledSweep.js +41 -28
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.d.ts +12 -11
- package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js +8 -5
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.d.ts +17 -7
- package/lib/cjs/solid/Sphere.d.ts.map +1 -1
- package/lib/cjs/solid/Sphere.js +22 -16
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +25 -16
- package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
- package/lib/cjs/solid/SweepContour.js +25 -16
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.d.ts +8 -2
- package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
- package/lib/cjs/solid/TorusPipe.js +9 -5
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js +4 -4
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- package/lib/cjs/topology/Graph.js +5 -5
- package/lib/cjs/topology/Graph.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +2 -2
- package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/cjs/topology/MaskManager.js.map +1 -1
- package/lib/cjs/topology/Merging.js.map +1 -1
- package/lib/cjs/topology/RegularizeFace.js.map +1 -1
- package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
- package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
- package/lib/cjs/topology/Triangulation.js +11 -11
- package/lib/cjs/topology/Triangulation.js.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js +17 -17
- package/lib/esm/Constant.js.map +1 -1
- package/lib/esm/Geometry.js +35 -35
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
- package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve.js.map +1 -1
- package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
- package/lib/esm/bspline/BSplineCurveOps.js +18 -21
- package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
- package/lib/esm/bspline/BSplineSurface.js.map +1 -1
- package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
- package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
- package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/bspline/KnotVector.js +2 -2
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/esm/clipping/AlternatingConvexClipTree.js +2 -2
- package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
- package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
- package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
- package/lib/esm/clipping/ClipPlane.js +1 -1
- package/lib/esm/clipping/ClipPlane.js.map +1 -1
- 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.js +1 -1
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +3 -3
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +40 -8
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +80 -22
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
- package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +4 -4
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +16 -2
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +33 -2
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveFactory.d.ts +87 -53
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +213 -135
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveOps.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveTypes.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +12 -8
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +34 -13
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.d.ts +12 -6
- package/lib/esm/curve/Loop.d.ts.map +1 -1
- package/lib/esm/curve/Loop.js +12 -6
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/OffsetOptions.js.map +1 -1
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.js.map +1 -1
- package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
- package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.d.ts +8 -6
- package/lib/esm/curve/Query/CylindricalRange.d.ts.map +1 -1
- package/lib/esm/curve/Query/CylindricalRange.js +13 -9
- package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
- package/lib/esm/curve/Query/InOutTests.js.map +1 -1
- package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +4 -4
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +1 -1
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -5
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +13 -13
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +5 -5
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +29 -23
- package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
- package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +4 -4
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +2 -2
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
- package/lib/esm/geometry3d/Angle.js +16 -16
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts +1 -1
- package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js +1 -1
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts +14 -8
- package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
- package/lib/esm/geometry3d/BarycentricTriangle.js +17 -8
- package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +4 -4
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +2 -0
- package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableFloat64Array.js +4 -0
- package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts +32 -10
- package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
- package/lib/esm/geometry3d/GrowableXYZArray.js +54 -16
- package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
- package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +13 -2
- package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
- package/lib/esm/geometry3d/IndexedXYZCollection.js +24 -10
- package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +11 -8
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +36 -34
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- package/lib/esm/geometry3d/OrderedRotationAngles.js +2 -2
- package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
- package/lib/esm/geometry3d/Plane3d.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
- package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js +1 -1
- package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -6
- package/lib/esm/geometry3d/Point3dVector3d.js +6 -6
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js +5 -5
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.d.ts +12 -6
- package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js +117 -70
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +3 -3
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +9 -5
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +9 -5
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.js +4 -4
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray2d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
- package/lib/esm/geometry3d/Segment1d.js.map +1 -1
- package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
- package/lib/esm/geometry3d/XYZProps.js.map +1 -1
- package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
- package/lib/esm/geometry4d/MomentData.d.ts +72 -73
- package/lib/esm/geometry4d/MomentData.d.ts.map +1 -1
- package/lib/esm/geometry4d/MomentData.js +62 -64
- package/lib/esm/geometry4d/MomentData.js.map +1 -1
- package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/numerics/BandedSystem.js.map +1 -1
- package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
- package/lib/esm/numerics/ClusterableArray.js +13 -13
- package/lib/esm/numerics/ClusterableArray.js.map +1 -1
- package/lib/esm/numerics/Complex.js.map +1 -1
- package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/lib/esm/numerics/PascalCoefficients.js +1 -1
- package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
- package/lib/esm/numerics/PolarData.js +1 -1
- package/lib/esm/numerics/PolarData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.d.ts +5 -5
- package/lib/esm/numerics/Polynomials.js +32 -32
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js +20 -20
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/numerics/Range1dArray.js.map +1 -1
- package/lib/esm/numerics/SmallSystem.js.map +1 -1
- package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
- package/lib/esm/numerics/UnionFind.js.map +1 -1
- package/lib/esm/numerics/UsageSums.js.map +1 -1
- package/lib/esm/polyface/AuxData.d.ts +2 -2
- package/lib/esm/polyface/AuxData.d.ts.map +1 -1
- package/lib/esm/polyface/AuxData.js +11 -3
- package/lib/esm/polyface/AuxData.js.map +1 -1
- package/lib/esm/polyface/BoxTopology.js +67 -67
- package/lib/esm/polyface/BoxTopology.js.map +1 -1
- package/lib/esm/polyface/FacetFaceData.js.map +1 -1
- package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
- package/lib/esm/polyface/FacetOrientation.js.map +1 -1
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js +2 -2
- package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +27 -20
- package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js +56 -30
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js +2 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/Polyface.d.ts +3 -5
- package/lib/esm/polyface/Polyface.d.ts.map +1 -1
- package/lib/esm/polyface/Polyface.js +6 -13
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts +14 -7
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +60 -65
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.d.ts +13 -3
- package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js +26 -9
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +2 -2
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +11 -10
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeLengthData.js.map +1 -1
- package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
- package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
- package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
- package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
- package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
- package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
- package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
- package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
- package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
- package/lib/esm/polyface/multiclip/RangeSearch.js +5 -5
- package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
- package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
- package/lib/esm/serialization/BGFBReader.js +22 -22
- package/lib/esm/serialization/BGFBReader.js.map +1 -1
- package/lib/esm/serialization/BGFBWriter.js.map +1 -1
- package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
- package/lib/esm/serialization/DeepCompare.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +5 -5
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +112 -112
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
- package/lib/esm/solid/Box.d.ts +9 -3
- package/lib/esm/solid/Box.d.ts.map +1 -1
- package/lib/esm/solid/Box.js +10 -5
- 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 +3 -3
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +9 -3
- package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
- package/lib/esm/solid/LinearSweep.js +9 -4
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +15 -4
- package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/esm/solid/RotationalSweep.js +20 -7
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +35 -26
- package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
- package/lib/esm/solid/RuledSweep.js +41 -28
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.d.ts +12 -11
- package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js +8 -5
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.d.ts +17 -7
- package/lib/esm/solid/Sphere.d.ts.map +1 -1
- package/lib/esm/solid/Sphere.js +22 -16
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +25 -16
- package/lib/esm/solid/SweepContour.d.ts.map +1 -1
- package/lib/esm/solid/SweepContour.js +25 -16
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.d.ts +8 -2
- package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
- package/lib/esm/solid/TorusPipe.js +9 -5
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js +4 -4
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- package/lib/esm/topology/Graph.js +5 -5
- package/lib/esm/topology/Graph.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js +2 -2
- package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
- package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
- package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
- package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
- package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
- package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
- package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
- package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
- package/lib/esm/topology/MaskManager.js.map +1 -1
- package/lib/esm/topology/Merging.js.map +1 -1
- package/lib/esm/topology/RegularizeFace.js.map +1 -1
- package/lib/esm/topology/SignedDataSummary.js.map +1 -1
- package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
- package/lib/esm/topology/Triangulation.js +11 -11
- package/lib/esm/topology/Triangulation.js.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +5 -5
|
@@ -13,19 +13,19 @@ import { SolidPrimitive } from "./SolidPrimitive";
|
|
|
13
13
|
import { SweepContour } from "./SweepContour";
|
|
14
14
|
/**
|
|
15
15
|
* A ruled sweep (surface) is a collection of 2 or more contours.
|
|
16
|
-
* * All contours must have identical number and type of geometry. (paths, loops, parity regions, lines, arcs, other curves)
|
|
16
|
+
* * All contours must have identical number and type of geometry. (paths, loops, parity regions, lines, arcs, other curves).
|
|
17
17
|
* @public
|
|
18
18
|
*/
|
|
19
19
|
export class RuledSweep extends SolidPrimitive {
|
|
20
20
|
constructor(contours, capped) {
|
|
21
21
|
super(capped);
|
|
22
|
-
/** String name for schema properties */
|
|
22
|
+
/** String name for schema properties. */
|
|
23
23
|
this.solidPrimitiveType = "ruledSweep";
|
|
24
24
|
this._contours = contours;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Create a ruled sweep from an array of contours.
|
|
28
|
-
* *
|
|
28
|
+
* * The contours are CAPTURED (not cloned).
|
|
29
29
|
*/
|
|
30
30
|
static create(contours, capped) {
|
|
31
31
|
const sweepContours = [];
|
|
@@ -38,9 +38,12 @@ export class RuledSweep extends SolidPrimitive {
|
|
|
38
38
|
return new RuledSweep(sweepContours, capped);
|
|
39
39
|
}
|
|
40
40
|
/** Return a reference to the array of SweepContour. */
|
|
41
|
-
sweepContoursRef() {
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
sweepContoursRef() {
|
|
42
|
+
return this._contours;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Return clones of the sweep contours.
|
|
46
|
+
* * See also [[cloneContours]], which returns the contours without their local coordinate system definitions.
|
|
44
47
|
*/
|
|
45
48
|
cloneSweepContours() {
|
|
46
49
|
const result = [];
|
|
@@ -49,8 +52,9 @@ export class RuledSweep extends SolidPrimitive {
|
|
|
49
52
|
}
|
|
50
53
|
return result;
|
|
51
54
|
}
|
|
52
|
-
/**
|
|
53
|
-
*
|
|
55
|
+
/**
|
|
56
|
+
* Return clones of the sweep contours, each as a [[CurveCollection]].
|
|
57
|
+
* * See also [[cloneSweepContours]], which returns the contours with their local coordinate system definitions.
|
|
54
58
|
*/
|
|
55
59
|
cloneContours() {
|
|
56
60
|
const result = [];
|
|
@@ -59,38 +63,47 @@ export class RuledSweep extends SolidPrimitive {
|
|
|
59
63
|
}
|
|
60
64
|
return result;
|
|
61
65
|
}
|
|
62
|
-
/** Return a deep clone */
|
|
66
|
+
/** Return a deep clone. */
|
|
63
67
|
clone() {
|
|
64
68
|
return new RuledSweep(this.cloneSweepContours(), this.capped);
|
|
65
69
|
}
|
|
66
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Transform all contours in place.
|
|
72
|
+
* * This fails if the transformation is singular.
|
|
73
|
+
*/
|
|
67
74
|
tryTransformInPlace(transform) {
|
|
68
75
|
if (transform.matrix.isSingular())
|
|
69
76
|
return false;
|
|
70
77
|
for (const contour of this._contours) {
|
|
71
|
-
contour.tryTransformInPlace(transform)
|
|
78
|
+
if (!contour.tryTransformInPlace(transform))
|
|
79
|
+
return false;
|
|
72
80
|
}
|
|
73
81
|
return true;
|
|
74
82
|
}
|
|
75
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* Return a transformed clone.
|
|
85
|
+
* * This fails if the transformation is singular.
|
|
86
|
+
*/
|
|
76
87
|
cloneTransformed(transform) {
|
|
77
88
|
const result = this.clone();
|
|
78
|
-
result.tryTransformInPlace(transform);
|
|
79
|
-
return result;
|
|
89
|
+
return result.tryTransformInPlace(transform) ? result : undefined;
|
|
80
90
|
}
|
|
81
|
-
/**
|
|
82
|
-
*
|
|
91
|
+
/**
|
|
92
|
+
* Return a coordinate frame (right handed unit vectors)
|
|
93
|
+
* * origin on base contour.
|
|
83
94
|
* * x, y directions from base contour.
|
|
84
|
-
* * z direction perpendicular
|
|
95
|
+
* * z direction perpendicular.
|
|
85
96
|
*/
|
|
86
97
|
getConstructiveFrame() {
|
|
87
98
|
if (this._contours.length === 0)
|
|
88
99
|
return undefined;
|
|
89
100
|
return this._contours[0].localToWorld.cloneRigid();
|
|
90
101
|
}
|
|
91
|
-
/** Test if `other` is an instance of a `RuledSweep
|
|
92
|
-
isSameGeometryClass(other) {
|
|
93
|
-
|
|
102
|
+
/** Test if `other` is an instance of a `RuledSweep`. */
|
|
103
|
+
isSameGeometryClass(other) {
|
|
104
|
+
return other instanceof RuledSweep;
|
|
105
|
+
}
|
|
106
|
+
/** Test for near equality of two RuledSweeps. */
|
|
94
107
|
isAlmostEqual(other) {
|
|
95
108
|
if (other instanceof RuledSweep) {
|
|
96
109
|
if (this.capped !== other.capped)
|
|
@@ -105,13 +118,13 @@ export class RuledSweep extends SolidPrimitive {
|
|
|
105
118
|
}
|
|
106
119
|
return false;
|
|
107
120
|
}
|
|
108
|
-
/**
|
|
121
|
+
/** Dispatch to strongly typed `handler.handleRuledSweep(this)`. */
|
|
109
122
|
dispatchToGeometryHandler(handler) {
|
|
110
123
|
return handler.handleRuledSweep(this);
|
|
111
124
|
}
|
|
112
125
|
/**
|
|
113
|
-
* Return the section curves at a fraction of the sweep
|
|
114
|
-
* @param vFraction fractional position along the sweep direction
|
|
126
|
+
* Return the section curves at a fraction of the sweep.
|
|
127
|
+
* @param vFraction fractional position along the sweep direction.
|
|
115
128
|
*/
|
|
116
129
|
constantVSection(vFraction) {
|
|
117
130
|
const numSection = this._contours.length;
|
|
@@ -134,12 +147,14 @@ export class RuledSweep extends SolidPrimitive {
|
|
|
134
147
|
return undefined;
|
|
135
148
|
});
|
|
136
149
|
}
|
|
137
|
-
/** Pass each contour to `extendRange
|
|
150
|
+
/** Pass each contour to `extendRange`. */
|
|
138
151
|
extendRange(rangeToExtend, transform) {
|
|
139
152
|
for (const contour of this._contours)
|
|
140
153
|
contour.curves.extendRange(rangeToExtend, transform);
|
|
141
154
|
}
|
|
142
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Construct a CurveCollection with the same structure as collectionA and collectionB, with primitives constructed
|
|
157
|
+
* by the caller-supplied primitiveMutator function.
|
|
143
158
|
* @returns Returns undefined if there is any type mismatch between the two collections.
|
|
144
159
|
*/
|
|
145
160
|
static mutatePartners(collectionA, collectionB, primitiveMutator) {
|
|
@@ -190,9 +205,7 @@ export class RuledSweep extends SolidPrimitive {
|
|
|
190
205
|
return undefined;
|
|
191
206
|
}
|
|
192
207
|
/**
|
|
193
|
-
*
|
|
194
|
-
* * cap flag
|
|
195
|
-
* identical first and last contours.
|
|
208
|
+
* @return true if this is a closed volume.
|
|
196
209
|
*/
|
|
197
210
|
get isClosedVolume() {
|
|
198
211
|
const n = this._contours.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuledSweep.js","sourceRoot":"","sources":["../../../src/solid/RuledSweep.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,cAAc;IAK5C,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C,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1F,CAAC;CAEF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Solid\r\n */\r\n\r\nimport { ConstructCurveBetweenCurves } from \"../curve/ConstructCurveBetweenCurves\";\r\nimport { AnyCurve } from \"../curve/CurveTypes\";\r\nimport { CurveChain, CurveCollection } from \"../curve/CurveCollection\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { SolidPrimitive } from \"./SolidPrimitive\";\r\nimport { SweepContour } from \"./SweepContour\";\r\n\r\n/**\r\n * * type for a function argument taking 2 curves and returning another curve or failing with undefined.\r\n * * This is used (for instance) by `RuleSweep.mutatePartners`\r\n * @public\r\n */\r\nexport type CurvePrimitiveMutator = (primitiveA: CurvePrimitive, primitiveB: CurvePrimitive) => CurvePrimitive | undefined;\r\n/**\r\n * A ruled sweep (surface) is a collection of 2 or more contours.\r\n * * All contours must have identical number and type of geometry. (paths, loops, parity regions, lines, arcs, other curves)\r\n * @public\r\n */\r\nexport class RuledSweep extends SolidPrimitive {\r\n /** String name for schema properties */\r\n public readonly solidPrimitiveType = \"ruledSweep\";\r\n\r\n private _contours: SweepContour[];\r\n private constructor(contours: SweepContour[], capped: boolean) {\r\n super(capped);\r\n this._contours = contours;\r\n }\r\n /**\r\n * Create a ruled sweep from an array of contours.\r\n * * the contours are CAPTURED (not cloned)\r\n */\r\n public static create(contours: AnyCurve[], capped: boolean): RuledSweep | undefined {\r\n const sweepContours = [];\r\n for (const contour of contours) {\r\n const sweepable = SweepContour.createForLinearSweep(contour);\r\n if (sweepable === undefined) return undefined;\r\n sweepContours.push(sweepable);\r\n }\r\n return new RuledSweep(sweepContours, capped);\r\n }\r\n /** Return a reference to the array of SweepContour. */\r\n public sweepContoursRef(): SweepContour[] { return this._contours; }\r\n /** Return clones of all the sweep contours\r\n * * See also cloneContours, which returns the spatial contours without their local coordinate system definitions)\r\n */\r\n public cloneSweepContours(): SweepContour[] {\r\n const result = [];\r\n for (const sweepable of this._contours) {\r\n result.push(sweepable.clone());\r\n }\r\n return result;\r\n }\r\n /** Return clones of all the contours\r\n * * See also cloneContours, which returns the contours in their local coordinate systems\r\n */\r\n public cloneContours(): CurveCollection[] {\r\n const result = [];\r\n for (const sweepable of this._contours) {\r\n result.push(sweepable.curves.clone());\r\n }\r\n return result;\r\n }\r\n /** Return a deep clone */\r\n public clone(): RuledSweep {\r\n return new RuledSweep(this.cloneSweepContours(), this.capped);\r\n }\r\n /** Transform all contours in place. */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n if (transform.matrix.isSingular())\r\n return false;\r\n for (const contour of this._contours) {\r\n contour.tryTransformInPlace(transform);\r\n }\r\n return true;\r\n }\r\n /** Return a cloned transform. */\r\n public cloneTransformed(transform: Transform): RuledSweep {\r\n const result = this.clone();\r\n result.tryTransformInPlace(transform);\r\n return result;\r\n }\r\n /** Return a coordinate frame (right handed unit vectors)\r\n * * origin on base contour\r\n * * x, y directions from base contour.\r\n * * z direction perpendicular\r\n */\r\n public getConstructiveFrame(): Transform | undefined {\r\n if (this._contours.length === 0) return undefined;\r\n return this._contours[0].localToWorld.cloneRigid();\r\n }\r\n /** Test if `other` is an instance of a `RuledSweep` */\r\n public isSameGeometryClass(other: any): boolean { return other instanceof RuledSweep; }\r\n /** test same contour geometry and capping. */\r\n public override isAlmostEqual(other: GeometryQuery): boolean {\r\n if (other instanceof RuledSweep) {\r\n if (this.capped !== other.capped) return false;\r\n if (this._contours.length !== other._contours.length) return false;\r\n for (let i = 0; i < this._contours.length; i++) {\r\n if (!this._contours[i].isAlmostEqual(other._contours[i]))\r\n return false;\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** dispatch to strongly typed `handler.handleRuledSweep(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleRuledSweep(this);\r\n }\r\n /**\r\n * Return the section curves at a fraction of the sweep\r\n * @param vFraction fractional position along the sweep direction\r\n */\r\n public constantVSection(vFraction: number): CurveCollection | undefined {\r\n const numSection = this._contours.length;\r\n if (numSection < 2)\r\n return undefined;\r\n const q = vFraction * numSection;\r\n let section0 = 0;\r\n if (vFraction >= 1.0)\r\n section0 = numSection - 1;\r\n else\r\n section0 = Math.floor(q);\r\n if (section0 + 1 >= numSection)\r\n section0 = numSection - 2;\r\n const section1 = section0 + 1;\r\n const localFraction = Geometry.clampToStartEnd(q - section0, 0, 1);\r\n return RuledSweep.mutatePartners(this._contours[section0].curves, this._contours[section1].curves,\r\n (primitive0: CurvePrimitive, primitive1: CurvePrimitive): CurvePrimitive | undefined => {\r\n const newPrimitive = ConstructCurveBetweenCurves.interpolateBetween(primitive0, localFraction, primitive1);\r\n if (newPrimitive instanceof CurvePrimitive) return newPrimitive;\r\n return undefined;\r\n });\r\n }\r\n /** Pass each contour to `extendRange` */\r\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\r\n for (const contour of this._contours)\r\n contour.curves.extendRange(rangeToExtend, transform);\r\n }\r\n\r\n /** Construct a CurveCollection with the same structure as collectionA and collectionB, with primitives constructed by the caller-supplied primitiveMutator function.\r\n * @returns Returns undefined if there is any type mismatch between the two collections.\r\n */\r\n public static mutatePartners(collectionA: CurveCollection, collectionB: CurveCollection, primitiveMutator: CurvePrimitiveMutator): CurveCollection | undefined {\r\n if (!collectionA.isSameGeometryClass(collectionB))\r\n return undefined;\r\n if (collectionA instanceof CurveChain && collectionB instanceof CurveChain) {\r\n const chainA = collectionA;\r\n const chainB = collectionB;\r\n const chainC = chainA.cloneEmptyPeer() as CurveChain;\r\n const childrenA = chainA.children;\r\n const childrenB = chainB.children;\r\n if (childrenA.length !== childrenB.length)\r\n return undefined;\r\n for (let i = 0; i < childrenA.length; i++) {\r\n const newChild = primitiveMutator(childrenA[i], childrenB[i]);\r\n if (!newChild)\r\n return undefined;\r\n chainC.children.push(newChild);\r\n }\r\n return chainC;\r\n } else if (collectionA instanceof CurveCollection && collectionB instanceof CurveCollection) {\r\n const collectionC = collectionA.cloneEmptyPeer();\r\n const childrenA = collectionA.children;\r\n const childrenB = collectionB.children;\r\n const childrenC = collectionC.children;\r\n if (childrenA === undefined || childrenB === undefined || childrenC === undefined || childrenA.length !== childrenB.length)\r\n return undefined;\r\n for (let i = 0; i < childrenA.length; i++) {\r\n const childA = childrenA[i];\r\n const childB = childrenB[i];\r\n if (childA instanceof CurvePrimitive && childB instanceof CurvePrimitive) {\r\n const newPrimitive = primitiveMutator(childA, childB);\r\n if (!newPrimitive)\r\n return undefined;\r\n childrenC.push(newPrimitive);\r\n } else if (childA instanceof CurveCollection && childB instanceof CurveCollection) {\r\n const newChild = this.mutatePartners(childA, childB, primitiveMutator);\r\n if (!newChild)\r\n return undefined;\r\n if (newChild instanceof CurveCollection)\r\n childrenC.push(newChild);\r\n }\r\n }\r\n return collectionC;\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Return true if this is a closed volume, as observed by\r\n * * cap flag\r\n * identical first and last contours.\r\n */\r\n public get isClosedVolume(): boolean {\r\n const n = this._contours.length;\r\n return n > 1 && (this.capped || this._contours[0].isAlmostEqual(this._contours[n - 1]));\r\n }\r\n\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"RuledSweep.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;wBACf,OAAO,SAAS,CAAC;oBACnB,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAC/B,CAAC;qBAAM,IAAI,MAAM,YAAY,eAAe,IAAI,MAAM,YAAY,eAAe,EAAE,CAAC;oBAClF,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;oBACvE,IAAI,CAAC,QAAQ;wBACX,OAAO,SAAS,CAAC;oBACnB,IAAI,QAAQ,YAAY,eAAe;wBACrC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC7B,CAAC;YACH,CAAC;YACD,OAAO,WAAW,CAAC;QACrB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;OAEG;IACH,IAAW,cAAc;QACvB,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1F,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { ConstructCurveBetweenCurves } from \"../curve/ConstructCurveBetweenCurves\";\nimport { AnyCurve } from \"../curve/CurveTypes\";\nimport { CurveChain, CurveCollection } from \"../curve/CurveCollection\";\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { SolidPrimitive } from \"./SolidPrimitive\";\nimport { SweepContour } from \"./SweepContour\";\n\n/**\n * Type for a function argument taking 2 curves and returning another curve or failing with undefined.\n * * This is used (for instance) by `RuleSweep.mutatePartners`.\n * @public\n */\nexport type CurvePrimitiveMutator = (primitiveA: CurvePrimitive, primitiveB: CurvePrimitive) => CurvePrimitive | undefined;\n/**\n * A ruled sweep (surface) is a collection of 2 or more contours.\n * * All contours must have identical number and type of geometry. (paths, loops, parity regions, lines, arcs, other curves).\n * @public\n */\nexport class RuledSweep extends SolidPrimitive {\n /** String name for schema properties. */\n public readonly solidPrimitiveType = \"ruledSweep\";\n\n private _contours: SweepContour[];\n private constructor(contours: SweepContour[], capped: boolean) {\n super(capped);\n this._contours = contours;\n }\n /**\n * Create a ruled sweep from an array of contours.\n * * The contours are CAPTURED (not cloned).\n */\n public static create(contours: AnyCurve[], capped: boolean): RuledSweep | undefined {\n const sweepContours = [];\n for (const contour of contours) {\n const sweepable = SweepContour.createForLinearSweep(contour);\n if (sweepable === undefined)\n return undefined;\n sweepContours.push(sweepable);\n }\n return new RuledSweep(sweepContours, capped);\n }\n /** Return a reference to the array of SweepContour. */\n public sweepContoursRef(): SweepContour[] {\n return this._contours;\n }\n /**\n * Return clones of the sweep contours.\n * * See also [[cloneContours]], which returns the contours without their local coordinate system definitions.\n */\n public cloneSweepContours(): SweepContour[] {\n const result = [];\n for (const sweepable of this._contours) {\n result.push(sweepable.clone());\n }\n return result;\n }\n /**\n * Return clones of the sweep contours, each as a [[CurveCollection]].\n * * See also [[cloneSweepContours]], which returns the contours with their local coordinate system definitions.\n */\n public cloneContours(): CurveCollection[] {\n const result = [];\n for (const sweepable of this._contours) {\n result.push(sweepable.curves.clone());\n }\n return result;\n }\n /** Return a deep clone. */\n public clone(): RuledSweep {\n return new RuledSweep(this.cloneSweepContours(), this.capped);\n }\n /**\n * Transform all contours in place.\n * * This fails if the transformation is singular.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (transform.matrix.isSingular())\n return false;\n for (const contour of this._contours) {\n if (!contour.tryTransformInPlace(transform))\n return false;\n }\n return true;\n }\n /**\n * Return a transformed clone.\n * * This fails if the transformation is singular.\n */\n public cloneTransformed(transform: Transform): RuledSweep | undefined {\n const result = this.clone();\n return result.tryTransformInPlace(transform) ? result : undefined;\n }\n /**\n * Return a coordinate frame (right handed unit vectors)\n * * origin on base contour.\n * * x, y directions from base contour.\n * * z direction perpendicular.\n */\n public getConstructiveFrame(): Transform | undefined {\n if (this._contours.length === 0)\n return undefined;\n return this._contours[0].localToWorld.cloneRigid();\n }\n /** Test if `other` is an instance of a `RuledSweep`. */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof RuledSweep;\n }\n /** Test for near equality of two RuledSweeps. */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof RuledSweep) {\n if (this.capped !== other.capped)\n return false;\n if (this._contours.length !== other._contours.length)\n return false;\n for (let i = 0; i < this._contours.length; i++) {\n if (!this._contours[i].isAlmostEqual(other._contours[i]))\n return false;\n }\n return true;\n }\n return false;\n }\n /** Dispatch to strongly typed `handler.handleRuledSweep(this)`. */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleRuledSweep(this);\n }\n /**\n * Return the section curves at a fraction of the sweep.\n * @param vFraction fractional position along the sweep direction.\n */\n public constantVSection(vFraction: number): CurveCollection | undefined {\n const numSection = this._contours.length;\n if (numSection < 2)\n return undefined;\n const q = vFraction * numSection;\n let section0 = 0;\n if (vFraction >= 1.0)\n section0 = numSection - 1;\n else\n section0 = Math.floor(q);\n if (section0 + 1 >= numSection)\n section0 = numSection - 2;\n const section1 = section0 + 1;\n const localFraction = Geometry.clampToStartEnd(q - section0, 0, 1);\n return RuledSweep.mutatePartners(\n this._contours[section0].curves,\n this._contours[section1].curves,\n (primitive0: CurvePrimitive, primitive1: CurvePrimitive): CurvePrimitive | undefined => {\n const newPrimitive = ConstructCurveBetweenCurves.interpolateBetween(primitive0, localFraction, primitive1);\n if (newPrimitive instanceof CurvePrimitive) return newPrimitive;\n return undefined;\n },\n );\n }\n /** Pass each contour to `extendRange`. */\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\n for (const contour of this._contours)\n contour.curves.extendRange(rangeToExtend, transform);\n }\n\n /**\n * Construct a CurveCollection with the same structure as collectionA and collectionB, with primitives constructed\n * by the caller-supplied primitiveMutator function.\n * @returns Returns undefined if there is any type mismatch between the two collections.\n */\n public static mutatePartners(\n collectionA: CurveCollection, collectionB: CurveCollection, primitiveMutator: CurvePrimitiveMutator,\n ): CurveCollection | undefined {\n if (!collectionA.isSameGeometryClass(collectionB))\n return undefined;\n if (collectionA instanceof CurveChain && collectionB instanceof CurveChain) {\n const chainA = collectionA;\n const chainB = collectionB;\n const chainC = chainA.cloneEmptyPeer() as CurveChain;\n const childrenA = chainA.children;\n const childrenB = chainB.children;\n if (childrenA.length !== childrenB.length)\n return undefined;\n for (let i = 0; i < childrenA.length; i++) {\n const newChild = primitiveMutator(childrenA[i], childrenB[i]);\n if (!newChild)\n return undefined;\n chainC.children.push(newChild);\n }\n return chainC;\n } else if (collectionA instanceof CurveCollection && collectionB instanceof CurveCollection) {\n const collectionC = collectionA.cloneEmptyPeer();\n const childrenA = collectionA.children;\n const childrenB = collectionB.children;\n const childrenC = collectionC.children;\n if (childrenA === undefined || childrenB === undefined || childrenC === undefined || childrenA.length !== childrenB.length)\n return undefined;\n for (let i = 0; i < childrenA.length; i++) {\n const childA = childrenA[i];\n const childB = childrenB[i];\n if (childA instanceof CurvePrimitive && childB instanceof CurvePrimitive) {\n const newPrimitive = primitiveMutator(childA, childB);\n if (!newPrimitive)\n return undefined;\n childrenC.push(newPrimitive);\n } else if (childA instanceof CurveCollection && childB instanceof CurveCollection) {\n const newChild = this.mutatePartners(childA, childB, primitiveMutator);\n if (!newChild)\n return undefined;\n if (newChild instanceof CurveCollection)\n childrenC.push(newChild);\n }\n }\n return collectionC;\n }\n return undefined;\n }\n /**\n * @return true if this is a closed volume.\n */\n public get isClosedVolume(): boolean {\n const n = this._contours.length;\n return n > 1 && (this.capped || this._contours[0].isAlmostEqual(this._contours[n - 1]));\n }\n}\n"]}
|
|
@@ -11,8 +11,9 @@ import { RotationalSweep } from "./RotationalSweep";
|
|
|
11
11
|
import { RuledSweep } from "./RuledSweep";
|
|
12
12
|
import { Sphere } from "./Sphere";
|
|
13
13
|
import { TorusPipe } from "./TorusPipe";
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
14
|
+
/**
|
|
15
|
+
* Describes the concrete type of a [[SolidPrimitive]]. Each type name maps to a specific subclass and can be used for
|
|
16
|
+
* type-switching in conditional statements.
|
|
16
17
|
* - "box" => [[Box]]
|
|
17
18
|
* - "cone" => [[Cone]]
|
|
18
19
|
* - "sphere" => [[Sphere]]
|
|
@@ -20,39 +21,39 @@ import { TorusPipe } from "./TorusPipe";
|
|
|
20
21
|
* - "rotationalSweep" => [[RotationalSweep]]
|
|
21
22
|
* - "ruledSweep" => [[RuledSweep]]
|
|
22
23
|
* - "torusPipe" => [[TorusPipe]]
|
|
23
|
-
*
|
|
24
24
|
* @public
|
|
25
25
|
*/
|
|
26
26
|
export type SolidPrimitiveType = "box" | "cone" | "sphere" | "linearSweep" | "rotationalSweep" | "ruledSweep" | "torusPipe";
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Union type of all subclasses of [[SolidPrimitive]].
|
|
28
29
|
* @public
|
|
29
30
|
*/
|
|
30
31
|
export type AnySolidPrimitive = Box | Cone | Sphere | LinearSweep | RotationalSweep | RuledSweep | TorusPipe;
|
|
31
32
|
/**
|
|
32
33
|
* Base class for SolidPrimitive variants.
|
|
33
|
-
*
|
|
34
34
|
* * The base class holds capped flag for all derived classes.
|
|
35
35
|
* @public
|
|
36
36
|
*/
|
|
37
37
|
export declare abstract class SolidPrimitive extends GeometryQuery {
|
|
38
|
-
/** String name for schema properties */
|
|
38
|
+
/** String name for schema properties. */
|
|
39
39
|
readonly geometryCategory = "solid";
|
|
40
|
-
/** String name for schema properties */
|
|
40
|
+
/** String name for schema properties. */
|
|
41
41
|
abstract readonly solidPrimitiveType: SolidPrimitiveType;
|
|
42
|
-
/**
|
|
42
|
+
/** Flag indicating whether cap region is considered closed (i.e. a planar region, rather than just a wire in space). */
|
|
43
43
|
protected _capped: boolean;
|
|
44
44
|
protected constructor(capped: boolean);
|
|
45
|
-
/** Whether this is a capped solid */
|
|
45
|
+
/** Whether this is a capped solid. */
|
|
46
46
|
get capped(): boolean;
|
|
47
47
|
set capped(capped: boolean);
|
|
48
48
|
/** Return a cross section at specified vFraction. */
|
|
49
49
|
abstract constantVSection(_vFraction: number): CurveCollection | undefined;
|
|
50
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Return a Transform from the local system of the solid to world.
|
|
51
52
|
* * The particulars of origin and orientation are specific to each SolidPrimitive type.
|
|
52
53
|
*/
|
|
53
54
|
abstract getConstructiveFrame(): Transform | undefined;
|
|
54
55
|
/**
|
|
55
|
-
*
|
|
56
|
+
* Return true if this is a closed volume
|
|
56
57
|
* * LinearSweep, Box, Cone only depend on capped.
|
|
57
58
|
* * Sphere affected by capped and latitude sweep
|
|
58
59
|
* * TorusPipe and RotationalSweep affected by capped and sweep
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidPrimitive.d.ts","sourceRoot":"","sources":["../../../src/solid/SolidPrimitive.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EA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AAe,SAAQ,aAAa;IACxD,yCAAyC;IACzC,SAAgB,gBAAgB,WAAW;IAC3C,yCAAyC;IACzC,kBAAyB,kBAAkB,EAAE,kBAAkB,CAAC;IAChE,wHAAwH;IACxH,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC;IAC3B,SAAS,aAAa,MAAM,EAAE,OAAO;IAIrC,sCAAsC;IACtC,IAAW,MAAM,IAAI,OAAO,CAE3B;IACD,IAAW,MAAM,CAAC,MAAM,EAAE,OAAO,EAEhC;IACD,qDAAqD;aACrC,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IACjF;;;OAGG;aACa,oBAAoB,IAAI,SAAS,GAAG,SAAS;IAC7D;;;;;;OAMG;IACH,aAAoB,cAAc,IAAI,OAAO,CAAC;CAC/C"}
|
|
@@ -5,19 +5,22 @@
|
|
|
5
5
|
import { GeometryQuery } from "../curve/GeometryQuery";
|
|
6
6
|
/**
|
|
7
7
|
* Base class for SolidPrimitive variants.
|
|
8
|
-
*
|
|
9
8
|
* * The base class holds capped flag for all derived classes.
|
|
10
9
|
* @public
|
|
11
10
|
*/
|
|
12
11
|
export class SolidPrimitive extends GeometryQuery {
|
|
13
12
|
constructor(capped) {
|
|
14
13
|
super();
|
|
15
|
-
/** String name for schema properties */
|
|
14
|
+
/** String name for schema properties. */
|
|
16
15
|
this.geometryCategory = "solid";
|
|
17
16
|
this._capped = capped;
|
|
18
17
|
}
|
|
19
|
-
/** Whether this is a capped solid */
|
|
20
|
-
get capped() {
|
|
21
|
-
|
|
18
|
+
/** Whether this is a capped solid. */
|
|
19
|
+
get capped() {
|
|
20
|
+
return this._capped;
|
|
21
|
+
}
|
|
22
|
+
set capped(capped) {
|
|
23
|
+
this._capped = capped;
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
//# sourceMappingURL=SolidPrimitive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidPrimitive.js","sourceRoot":"","sources":["../../../src/solid/SolidPrimitive.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidPrimitive.js","sourceRoot":"","sources":["../../../src/solid/SolidPrimitive.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA8BvD;;;;GAIG;AACH,MAAM,OAAgB,cAAe,SAAQ,aAAa;IAOxD,YAAsB,MAAe;QACnC,KAAK,EAAE,CAAC;QAPV,yCAAyC;QACzB,qBAAgB,GAAG,OAAO,CAAC;QAOzC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,sCAAsC;IACtC,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,IAAW,MAAM,CAAC,MAAe;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CAgBF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { CurveCollection } from \"../curve/CurveCollection\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { Box } from \"./Box\";\nimport { Cone } from \"./Cone\";\nimport { LinearSweep } from \"./LinearSweep\";\nimport { RotationalSweep } from \"./RotationalSweep\";\nimport { RuledSweep } from \"./RuledSweep\";\nimport { Sphere } from \"./Sphere\";\nimport { TorusPipe } from \"./TorusPipe\";\n\n/**\n * Describes the concrete type of a [[SolidPrimitive]]. Each type name maps to a specific subclass and can be used for\n * type-switching in conditional statements.\n * - \"box\" => [[Box]]\n * - \"cone\" => [[Cone]]\n * - \"sphere\" => [[Sphere]]\n * - \"linearSweep\" => [[LinearSweep]]\n * - \"rotationalSweep\" => [[RotationalSweep]]\n * - \"ruledSweep\" => [[RuledSweep]]\n * - \"torusPipe\" => [[TorusPipe]]\n * @public\n */\nexport type SolidPrimitiveType = \"box\" | \"cone\" | \"sphere\" | \"linearSweep\" | \"rotationalSweep\" | \"ruledSweep\" | \"torusPipe\";\n\n/**\n * Union type of all subclasses of [[SolidPrimitive]].\n * @public\n */\nexport type AnySolidPrimitive = Box | Cone | Sphere | LinearSweep | RotationalSweep | RuledSweep | TorusPipe;\n\n/**\n * Base class for SolidPrimitive variants.\n * * The base class holds capped flag for all derived classes.\n * @public\n */\nexport abstract class SolidPrimitive extends GeometryQuery {\n /** String name for schema properties. */\n public readonly geometryCategory = \"solid\";\n /** String name for schema properties. */\n public abstract readonly solidPrimitiveType: SolidPrimitiveType;\n /** Flag indicating whether cap region is considered closed (i.e. a planar region, rather than just a wire in space). */\n protected _capped: boolean;\n protected constructor(capped: boolean) {\n super();\n this._capped = capped;\n }\n /** Whether this is a capped solid. */\n public get capped(): boolean {\n return this._capped;\n }\n public set capped(capped: boolean) {\n this._capped = capped;\n }\n /** Return a cross section at specified vFraction. */\n public abstract constantVSection(_vFraction: number): CurveCollection | undefined;\n /**\n * Return a Transform from the local system of the solid to world.\n * * The particulars of origin and orientation are specific to each SolidPrimitive type.\n */\n public abstract getConstructiveFrame(): Transform | undefined;\n /**\n * Return true if this is a closed volume\n * * LinearSweep, Box, Cone only depend on capped.\n * * Sphere affected by capped and latitude sweep\n * * TorusPipe and RotationalSweep affected by capped and sweep\n * * RuledSweep is affected by capped and match of first, last contour\n */\n public abstract get isClosedVolume(): boolean;\n}\n"]}
|
|
@@ -32,11 +32,15 @@ export declare class Sphere extends SolidPrimitive implements UVSurface {
|
|
|
32
32
|
private constructor();
|
|
33
33
|
/** return a deep clone */
|
|
34
34
|
clone(): Sphere;
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Transform the sphere in place.
|
|
36
37
|
* * Fails if the transform is singular.
|
|
37
38
|
*/
|
|
38
39
|
tryTransformInPlace(transform: Transform): boolean;
|
|
39
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Return a transformed clone.
|
|
42
|
+
* * Fails if the transform is singular.
|
|
43
|
+
*/
|
|
40
44
|
cloneTransformed(transform: Transform): Sphere | undefined;
|
|
41
45
|
/** Return a coordinate frame (right handed, unit axes)
|
|
42
46
|
* * origin at sphere center
|
|
@@ -79,12 +83,18 @@ export declare class Sphere extends SolidPrimitive implements UVSurface {
|
|
|
79
83
|
/** Test for same geometry in `other` */
|
|
80
84
|
isAlmostEqual(other: GeometryQuery): boolean;
|
|
81
85
|
/**
|
|
82
|
-
*
|
|
83
|
-
* *
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
+
* Return strokes for the elliptical arc cross-section at latitude sweep fraction v.
|
|
87
|
+
* * Optional inputs control the number of strokes along the cross-section:
|
|
88
|
+
* * If `fixedStrokeCount` is supplied, it is taken as the cross-section stroke count.
|
|
89
|
+
* * If `fixedStrokeCount` is undefined, stroke count is computed by applying `options` to the cross-section.
|
|
90
|
+
* * If neither input is supplied, the stroke count default is 16.
|
|
91
|
+
* * In any case, stroke count is clamped to the interval [4,64].
|
|
92
|
+
* @param v fractional position along the sphere axis
|
|
93
|
+
* @param fixedStrokeCount optional stroke count in u-direction
|
|
94
|
+
* @param options optional stroke options in u-direction
|
|
95
|
+
* @return strokes as line string
|
|
86
96
|
*/
|
|
87
|
-
strokeConstantVSection(v: number, fixedStrokeCount
|
|
97
|
+
strokeConstantVSection(v: number, fixedStrokeCount?: number, options?: StrokeOptions): LineString3d;
|
|
88
98
|
/** Second step of double dispatch: call `handler.handleSphere(this)` */
|
|
89
99
|
dispatchToGeometryHandler(handler: GeometryHandler): any;
|
|
90
100
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sphere.d.ts","sourceRoot":"","sources":["../../../src/solid/Sphere.ts"],"names":[],"mappings":"AAUA,OAA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AAE,gBAAgB,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,YAAY;IAqD1G,yEAAyE;IAClE,yBAAyB,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG;IAG/D;;;OAGG;IACI,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAUvE,6CAA6C;IACtC,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI;IAiB/D;;;OAGG;IACI,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAUzF;;;OAGG;IACI,4BAA4B,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB,GAAG,yBAAyB;IAexI;;;;;OAKG;IACH,IAAW,cAAc,IAAI,OAAO,CAEnC;IACD;;;;OAIG;IACI,wBAAwB,IAAI,QAAQ;CAa5C"}
|
package/lib/esm/solid/Sphere.js
CHANGED
|
@@ -40,32 +40,32 @@ export class Sphere extends SolidPrimitive {
|
|
|
40
40
|
/** String name for schema properties */
|
|
41
41
|
this.solidPrimitiveType = "sphere";
|
|
42
42
|
this._localToWorld = localToWorld;
|
|
43
|
-
this._latitudeSweep = latitudeSweep
|
|
43
|
+
this._latitudeSweep = latitudeSweep;
|
|
44
44
|
this._latitudeSweep.capLatitudeInPlace();
|
|
45
45
|
}
|
|
46
46
|
/** return a deep clone */
|
|
47
47
|
clone() {
|
|
48
48
|
return new Sphere(this._localToWorld.clone(), this._latitudeSweep.clone(), this.capped);
|
|
49
49
|
}
|
|
50
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Transform the sphere in place.
|
|
51
52
|
* * Fails if the transform is singular.
|
|
52
53
|
*/
|
|
53
54
|
tryTransformInPlace(transform) {
|
|
54
55
|
if (transform.matrix.isSingular())
|
|
55
56
|
return false;
|
|
56
57
|
transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);
|
|
58
|
+
if (transform.matrix.determinant() < 0.0)
|
|
59
|
+
this._latitudeSweep.reverseInPlace();
|
|
57
60
|
return true;
|
|
58
61
|
}
|
|
59
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Return a transformed clone.
|
|
64
|
+
* * Fails if the transform is singular.
|
|
65
|
+
*/
|
|
60
66
|
cloneTransformed(transform) {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
if (transform.matrix.determinant() < 0.0) {
|
|
64
|
-
if (sphere1._latitudeSweep !== undefined) {
|
|
65
|
-
sphere1._latitudeSweep.reverseInPlace();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return sphere1;
|
|
67
|
+
const result = this.clone();
|
|
68
|
+
return result.tryTransformInPlace(transform) ? result : undefined;
|
|
69
69
|
}
|
|
70
70
|
/** Return a coordinate frame (right handed, unit axes)
|
|
71
71
|
* * origin at sphere center
|
|
@@ -147,10 +147,16 @@ export class Sphere extends SolidPrimitive {
|
|
|
147
147
|
return false;
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
|
-
*
|
|
151
|
-
* *
|
|
152
|
-
*
|
|
153
|
-
*
|
|
150
|
+
* Return strokes for the elliptical arc cross-section at latitude sweep fraction v.
|
|
151
|
+
* * Optional inputs control the number of strokes along the cross-section:
|
|
152
|
+
* * If `fixedStrokeCount` is supplied, it is taken as the cross-section stroke count.
|
|
153
|
+
* * If `fixedStrokeCount` is undefined, stroke count is computed by applying `options` to the cross-section.
|
|
154
|
+
* * If neither input is supplied, the stroke count default is 16.
|
|
155
|
+
* * In any case, stroke count is clamped to the interval [4,64].
|
|
156
|
+
* @param v fractional position along the sphere axis
|
|
157
|
+
* @param fixedStrokeCount optional stroke count in u-direction
|
|
158
|
+
* @param options optional stroke options in u-direction
|
|
159
|
+
* @return strokes as line string
|
|
154
160
|
*/
|
|
155
161
|
strokeConstantVSection(v, fixedStrokeCount, options) {
|
|
156
162
|
let strokeCount = 16;
|
|
@@ -166,7 +172,7 @@ export class Sphere extends SolidPrimitive {
|
|
|
166
172
|
const c1 = Math.cos(phi);
|
|
167
173
|
const s1 = Math.sin(phi);
|
|
168
174
|
let c0, s0;
|
|
169
|
-
const result = LineString3d.createForStrokes(
|
|
175
|
+
const result = LineString3d.createForStrokes(strokeCount, options);
|
|
170
176
|
const deltaRadians = Math.PI * 2.0 / strokeCount;
|
|
171
177
|
const fractions = result.fractions; // possibly undefined !!!
|
|
172
178
|
const derivatives = result.packedDerivatives; // possibly undefined !!!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sphere.js","sourceRoot":"","sources":["../../../src/solid/Sphere.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAW,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,OAAO,MAAO,SAAQ,cAAc;IAMxC,yDAAyD;IAClD,kBAAkB,CAAC,CAAS;QACjC,OAAO,IAAI,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["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Solid\r\n */\r\n\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { Loop } from \"../curve/Loop\";\r\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { AngleSweep } from \"../geometry3d/AngleSweep\";\r\nimport { GeometryHandler, UVSurface } from \"../geometry3d/GeometryHandler\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\r\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { SolidPrimitive } from \"./SolidPrimitive\";\r\n\r\n/**\r\n * A Sphere is\r\n *\r\n * * A unit sphere (but read on ....)\r\n * * mapped by an arbitrary (possibly skewed, non-uniform scaled) transform\r\n * * hence possibly the final geometry is ellipsoidal\r\n * @public\r\n */\r\nexport class Sphere extends SolidPrimitive implements UVSurface {\r\n /** String name for schema properties */\r\n public readonly solidPrimitiveType = \"sphere\";\r\n\r\n private _localToWorld: Transform; // unit sphere maps to world through the transform0 part of this map.\r\n private _latitudeSweep: AngleSweep;\r\n /** Return the latitude (in radians) all fractional v. */\r\n public vFractionToRadians(v: number): number {\r\n return this._latitudeSweep.fractionToRadians(v);\r\n }\r\n /** Return the longitude (in radians) all fractional u. */\r\n public uFractionToRadians(u: number): number {\r\n return u * Math.PI * 2.0;\r\n }\r\n\r\n /** Constructor CAPTURES inputs */\r\n private constructor(localToWorld: Transform, latitudeSweep: AngleSweep, capped: boolean) {\r\n super(capped);\r\n this._localToWorld = localToWorld;\r\n this._latitudeSweep = latitudeSweep ? latitudeSweep : AngleSweep.createFullLatitude();\r\n this._latitudeSweep.capLatitudeInPlace();\r\n }\r\n /** return a deep clone */\r\n public clone(): Sphere {\r\n return new Sphere(this._localToWorld.clone(), this._latitudeSweep.clone(), this.capped);\r\n }\r\n /** Transform the sphere in place.\r\n * * Fails if the transform is singular.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n if (transform.matrix.isSingular())\r\n return false;\r\n transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);\r\n return true;\r\n }\r\n /** Return a transformed clone. */\r\n public cloneTransformed(transform: Transform): Sphere | undefined {\r\n const sphere1 = this.clone();\r\n transform.multiplyTransformTransform(sphere1._localToWorld, sphere1._localToWorld);\r\n if (transform.matrix.determinant() < 0.0) {\r\n if (sphere1._latitudeSweep !== undefined) {\r\n sphere1._latitudeSweep.reverseInPlace();\r\n }\r\n }\r\n return sphere1;\r\n }\r\n /** Return a coordinate frame (right handed, unit axes)\r\n * * origin at sphere center\r\n * * equator in xy plane\r\n * * z axis perpendicular\r\n */\r\n public getConstructiveFrame(): Transform | undefined {\r\n return this._localToWorld.cloneRigid();\r\n }\r\n /** Return the latitude sweep as fraction of south pole to north pole. */\r\n public get latitudeSweepFraction(): number { return this._latitudeSweep.sweepRadians / Math.PI; }\r\n /** Create from center and radius, with optional restricted latitudes. */\r\n public static createCenterRadius(center: Point3d, radius: number, latitudeSweep?: AngleSweep): Sphere {\r\n const localToWorld = Transform.createOriginAndMatrix(center, Matrix3d.createUniformScale(radius));\r\n return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : AngleSweep.createFullLatitude(), false);\r\n }\r\n /** Create an ellipsoid which is a unit sphere mapped to position by an (arbitrary, possibly skewed and scaled) transform. */\r\n public static createEllipsoid(localToWorld: Transform, latitudeSweep: AngleSweep, capped: boolean): Sphere | undefined {\r\n return new Sphere(localToWorld.clone(), latitudeSweep.clone(), capped);\r\n }\r\n\r\n /** Create a sphere from the typical parameters of the Dgn file */\r\n public static createDgnSphere(center: Point3d, vectorX: Vector3d, vectorZ: Vector3d, radiusXY: number, radiusZ: number,\r\n latitudeSweep: AngleSweep,\r\n capped: boolean): Sphere | undefined {\r\n const vectorY = vectorX.rotate90Around(vectorZ);\r\n if (vectorY && !vectorX.isParallelTo(vectorZ)) {\r\n const matrix = Matrix3d.createColumns(vectorX, vectorY, vectorZ);\r\n matrix.scaleColumns(radiusXY, radiusXY, radiusZ, matrix);\r\n const frame = Transform.createOriginAndMatrix(center, matrix);\r\n return new Sphere(frame, latitudeSweep.clone(), capped);\r\n }\r\n return undefined;\r\n }\r\n\r\n /** Create a sphere from the typical parameters of the Dgn file */\r\n public static createFromAxesAndScales(center: Point3d, axes: undefined | Matrix3d, radiusX: number, radiusY: number, radiusZ: number,\r\n latitudeSweep: AngleSweep | undefined,\r\n capped: boolean): Sphere | undefined {\r\n const localToWorld = Transform.createOriginAndMatrix(center, axes);\r\n localToWorld.matrix.scaleColumnsInPlace(radiusX, radiusY, radiusZ);\r\n return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : AngleSweep.createFullLatitude(), capped);\r\n }\r\n\r\n /** return (copy of) sphere center */\r\n public cloneCenter(): Point3d { return this._localToWorld.getOrigin(); }\r\n /** return the (full length, i.e. scaled by radius) X vector from the sphere transform */\r\n public cloneVectorX(): Vector3d { return this._localToWorld.matrix.columnX(); }\r\n /** return the (full length, i.e. scaled by radius) Y vector from the sphere transform */\r\n public cloneVectorY(): Vector3d { return this._localToWorld.matrix.columnY(); }\r\n /** return the (full length, i.e. scaled by radius) Z vector from the sphere transform */\r\n public cloneVectorZ(): Vector3d { return this._localToWorld.matrix.columnZ(); }\r\n /** return (a copy of) the sphere's angle sweep. */\r\n public cloneLatitudeSweep(): AngleSweep { return this._latitudeSweep.clone(); }\r\n /** Test if the geometry is a true sphere taking the transform (which might have nonuniform scaling) is applied. */\r\n public trueSphereRadius(): number | undefined {\r\n const factors = this._localToWorld.matrix.factorRigidWithSignedScale();\r\n if (!factors) return undefined;\r\n if (factors && factors.scale > 0) // why do we rule out mirror?\r\n return factors.scale;\r\n return undefined;\r\n }\r\n /**\r\n * Return the largest of the primary xyz axis radii\r\n */\r\n public maxAxisRadius(): number {\r\n const matrix = this._localToWorld.matrix;\r\n return Geometry.maxXYZ(matrix.columnXMagnitude(), matrix.columnYMagnitude(), matrix.columnZMagnitude());\r\n }\r\n /**\r\n * Return a (clone of) the sphere's local to world transformation.\r\n */\r\n public cloneLocalToWorld(): Transform { return this._localToWorld.clone(); }\r\n /** Test if `other` is a `Sphere` */\r\n public isSameGeometryClass(other: any): boolean { return other instanceof Sphere; }\r\n /** Test for same geometry in `other` */\r\n public override isAlmostEqual(other: GeometryQuery): boolean {\r\n if (other instanceof Sphere) {\r\n if (this.capped !== other.capped) return false;\r\n if (!this._localToWorld.isAlmostEqual(other._localToWorld)) return false;\r\n return true;\r\n }\r\n return false;\r\n }\r\n /**\r\n * return strokes for a cross-section (elliptic arc) at specified fraction v along the axis.\r\n * * if strokeOptions is supplied, it is applied to the equator radii.\r\n * @param v fractional position along the cone axis\r\n * @param strokes stroke count or options.\r\n */\r\n public strokeConstantVSection(v: number, fixedStrokeCount: number | undefined,\r\n options?: StrokeOptions): LineString3d {\r\n let strokeCount = 16;\r\n if (fixedStrokeCount !== undefined && Number.isFinite(fixedStrokeCount)) {\r\n strokeCount = fixedStrokeCount;\r\n } else if (options instanceof StrokeOptions) {\r\n strokeCount = options.applyTolerancesToArc(Geometry.maxXY(this._localToWorld.matrix.columnXMagnitude(), this._localToWorld.matrix.columnYMagnitude()));\r\n }\r\n strokeCount = Geometry.clampToStartEnd(strokeCount, 4, 64);\r\n const transform = this._localToWorld;\r\n const phi = this.vFractionToRadians(v);\r\n const c1 = Math.cos(phi);\r\n const s1 = Math.sin(phi);\r\n let c0, s0;\r\n const result = LineString3d.createForStrokes(fixedStrokeCount, options);\r\n const deltaRadians = Math.PI * 2.0 / strokeCount;\r\n const fractions = result.fractions; // possibly undefined !!!\r\n const derivatives = result.packedDerivatives; // possibly undefined !!!\r\n const uvParams = result.packedUVParams; // possibly undefined !!\r\n const surfaceNormals = result.packedSurfaceNormals;\r\n const dXdu = Vector3d.create();\r\n const dXdv = Vector3d.create();\r\n const normal = Vector3d.create();\r\n let radians = 0;\r\n for (let i = 0; i <= strokeCount; i++) {\r\n if (i * 2 <= strokeCount)\r\n radians = i * deltaRadians;\r\n else\r\n radians = (i - strokeCount) * deltaRadians;\r\n c0 = Math.cos(radians);\r\n s0 = Math.sin(radians);\r\n const xyz = transform.multiplyXYZ(c1 * c0, c1 * s0, s1);\r\n result.addPoint(xyz);\r\n\r\n if (fractions)\r\n fractions.push(i / strokeCount);\r\n\r\n if (derivatives) {\r\n transform.matrix.multiplyXYZ(-c1 * s0, c1 * c0, 0.0, dXdu);\r\n derivatives.push(dXdu);\r\n }\r\n if (uvParams) {\r\n uvParams.pushXY(i / strokeCount, v);\r\n }\r\n if (surfaceNormals) {\r\n transform.matrix.multiplyXYZ(-s0, c0, 0, dXdu);\r\n transform.matrix.multiplyXYZ(-s1 * c0, -s1 * s0, c1, dXdv);\r\n dXdu.unitCrossProduct(dXdv, normal);\r\n surfaceNormals.push(normal);\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n /** Second step of double dispatch: call `handler.handleSphere(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleSphere(this);\r\n }\r\n /**\r\n * Return the Arc3d section at vFraction. For the sphere, this is a latitude circle.\r\n * @param vFraction fractional position along the sweep direction\r\n */\r\n public constantVSection(vFraction: number): CurveCollection | undefined {\r\n const phi = this._latitudeSweep.fractionToRadians(vFraction);\r\n const s1 = Math.sin(phi);\r\n const c1 = Math.cos(phi);\r\n const transform = this._localToWorld;\r\n const center = transform.multiplyXYZ(0, 0, s1);\r\n const vector0 = transform.matrix.multiplyXYZ(c1, 0, 0);\r\n const vector90 = transform.matrix.multiplyXYZ(0, c1, 0);\r\n return Loop.create(Arc3d.create(center, vector0, vector90));\r\n }\r\n /** Extend a range to contain this sphere. */\r\n public extendRange(range: Range3d, transform?: Transform): void {\r\n let placement = this._localToWorld;\r\n if (transform) {\r\n placement = transform.multiplyTransformTransform(placement);\r\n }\r\n\r\n range.extendTransformedXYZ(placement, -1, -1, -1);\r\n range.extendTransformedXYZ(placement, 1, -1, -1);\r\n range.extendTransformedXYZ(placement, -1, 1, -1);\r\n range.extendTransformedXYZ(placement, 1, 1, -1);\r\n\r\n range.extendTransformedXYZ(placement, -1, -1, 1);\r\n range.extendTransformedXYZ(placement, 1, -1, 1);\r\n range.extendTransformedXYZ(placement, -1, 1, 1);\r\n range.extendTransformedXYZ(placement, 1, 1, 1);\r\n\r\n }\r\n /** Evaluate as a uv surface\r\n * @param uFraction fractional position on minor arc (theta, longitude)\r\n * @param vFraction fractional position on major arc (phi, latitude)\r\n */\r\n public uvFractionToPoint(uFraction: number, vFraction: number, result?: Point3d): Point3d {\r\n // sphere with radius 1 . . .\r\n const thetaRadians = this.uFractionToRadians(uFraction);\r\n const phiRadians = this.vFractionToRadians(vFraction);\r\n const cosTheta = Math.cos(thetaRadians);\r\n const sinTheta = Math.sin(thetaRadians);\r\n const sinPhi = Math.sin(phiRadians);\r\n const cosPhi = Math.cos(phiRadians);\r\n return this._localToWorld.multiplyXYZ(cosTheta * cosPhi, sinTheta * cosPhi, sinPhi, result);\r\n }\r\n /** Evaluate as a uv surface, returning point and two vectors.\r\n * @param uFraction fractional position on minor arc (theta, longitude)\r\n * @param vFraction fractional position on major arc (phi, latitude)\r\n */\r\n public uvFractionToPointAndTangents(uFraction: number, vFraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n const thetaRadians = this.uFractionToRadians(uFraction);\r\n const phiRadians = this.vFractionToRadians(vFraction);\r\n const fTheta = Math.PI * 2.0;\r\n const fPhi = this._latitudeSweep.sweepRadians;\r\n const cosTheta = Math.cos(thetaRadians);\r\n const sinTheta = Math.sin(thetaRadians);\r\n const sinPhi = Math.sin(phiRadians);\r\n const cosPhi = Math.cos(phiRadians);\r\n return Plane3dByOriginAndVectors.createOriginAndVectors(\r\n this._localToWorld.multiplyXYZ(cosTheta * cosPhi, sinTheta * cosPhi, sinPhi),\r\n this._localToWorld.matrix.multiplyXYZ(-fTheta * sinTheta, fTheta * cosTheta, 0), // !!! note cosTheta term is omitted -- scale is wrong, but remains non-zero at poles.\r\n this._localToWorld.matrix.multiplyXYZ(-fPhi * cosTheta * sinPhi, -fPhi * sinTheta * sinPhi, fPhi * cosPhi),\r\n result);\r\n }\r\n /**\r\n * * A sphere is can be closed two ways:\r\n * * full sphere (no caps needed for closure)\r\n * * incomplete but with caps\r\n * @return true if this is a closed volume.\r\n */\r\n public get isClosedVolume(): boolean {\r\n return this.capped || this._latitudeSweep.isFullLatitudeSweep;\r\n }\r\n /**\r\n * Directional distance query\r\n * * u direction is around latitude circle at maximum distance from axis.\r\n * * v direction is on a line of longitude between the latitude limits.\r\n */\r\n public maxIsoParametricDistance(): Vector2d {\r\n // approximate radius at equator .. if elliptic, this is not exact . . .\r\n const rX = this._localToWorld.matrix.columnXMagnitude();\r\n const rY = this._localToWorld.matrix.columnYMagnitude();\r\n const rZ = this._localToWorld.matrix.columnZMagnitude();\r\n const rMaxU = Math.max(rX, rY);\r\n let dMaxU = Math.PI * 2.0 * rMaxU;\r\n if (!this._latitudeSweep.isRadiansInSweep(0.0))\r\n dMaxU *= Math.max(Math.cos(Math.abs(this._latitudeSweep.startRadians)), Math.cos(Math.abs(this._latitudeSweep.endRadians)));\r\n const dMaxV = Math.max(rMaxU, rZ) * Math.abs(this._latitudeSweep.sweepRadians);\r\n\r\n return Vector2d.create(dMaxU, dMaxV);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Sphere.js","sourceRoot":"","sources":["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CAAC;QAC/B,IAAI,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,KAAK,CAAC;QAClC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,GAAG,CAAC;YAC5C,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9H,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;QAE/E,OAAO,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Solid\n */\n\nimport { Arc3d } from \"../curve/Arc3d\";\nimport { CurveCollection } from \"../curve/CurveCollection\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { LineString3d } from \"../curve/LineString3d\";\nimport { Loop } from \"../curve/Loop\";\nimport { StrokeOptions } from \"../curve/StrokeOptions\";\nimport { Geometry } from \"../Geometry\";\nimport { AngleSweep } from \"../geometry3d/AngleSweep\";\nimport { GeometryHandler, UVSurface } from \"../geometry3d/GeometryHandler\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { SolidPrimitive } from \"./SolidPrimitive\";\n\n/**\n * A Sphere is\n *\n * * A unit sphere (but read on ....)\n * * mapped by an arbitrary (possibly skewed, non-uniform scaled) transform\n * * hence possibly the final geometry is ellipsoidal\n * @public\n */\nexport class Sphere extends SolidPrimitive implements UVSurface {\n /** String name for schema properties */\n public readonly solidPrimitiveType = \"sphere\";\n\n private _localToWorld: Transform; // local coordinates = unit sphere at origin\n private _latitudeSweep: AngleSweep;\n /** Return the latitude (in radians) all fractional v. */\n public vFractionToRadians(v: number): number {\n return this._latitudeSweep.fractionToRadians(v);\n }\n /** Return the longitude (in radians) all fractional u. */\n public uFractionToRadians(u: number): number {\n return u * Math.PI * 2.0;\n }\n\n /** Constructor CAPTURES inputs */\n private constructor(localToWorld: Transform, latitudeSweep: AngleSweep, capped: boolean) {\n super(capped);\n this._localToWorld = localToWorld;\n this._latitudeSweep = latitudeSweep;\n this._latitudeSweep.capLatitudeInPlace();\n }\n /** return a deep clone */\n public clone(): Sphere {\n return new Sphere(this._localToWorld.clone(), this._latitudeSweep.clone(), this.capped);\n }\n /**\n * Transform the sphere in place.\n * * Fails if the transform is singular.\n */\n public tryTransformInPlace(transform: Transform): boolean {\n if (transform.matrix.isSingular())\n return false;\n transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);\n if (transform.matrix.determinant() < 0.0)\n this._latitudeSweep.reverseInPlace();\n return true;\n }\n /**\n * Return a transformed clone.\n * * Fails if the transform is singular.\n */\n public cloneTransformed(transform: Transform): Sphere | undefined {\n const result = this.clone();\n return result.tryTransformInPlace(transform) ? result : undefined;\n }\n /** Return a coordinate frame (right handed, unit axes)\n * * origin at sphere center\n * * equator in xy plane\n * * z axis perpendicular\n */\n public getConstructiveFrame(): Transform | undefined {\n return this._localToWorld.cloneRigid();\n }\n /** Return the latitude sweep as fraction of south pole to north pole. */\n public get latitudeSweepFraction(): number { return this._latitudeSweep.sweepRadians / Math.PI; }\n /** Create from center and radius, with optional restricted latitudes. */\n public static createCenterRadius(center: Point3d, radius: number, latitudeSweep?: AngleSweep): Sphere {\n const localToWorld = Transform.createOriginAndMatrix(center, Matrix3d.createUniformScale(radius));\n return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : AngleSweep.createFullLatitude(), false);\n }\n /** Create an ellipsoid which is a unit sphere mapped to position by an (arbitrary, possibly skewed and scaled) transform. */\n public static createEllipsoid(localToWorld: Transform, latitudeSweep: AngleSweep, capped: boolean): Sphere | undefined {\n return new Sphere(localToWorld.clone(), latitudeSweep.clone(), capped);\n }\n\n /** Create a sphere from the typical parameters of the Dgn file */\n public static createDgnSphere(center: Point3d, vectorX: Vector3d, vectorZ: Vector3d, radiusXY: number, radiusZ: number,\n latitudeSweep: AngleSweep,\n capped: boolean): Sphere | undefined {\n const vectorY = vectorX.rotate90Around(vectorZ);\n if (vectorY && !vectorX.isParallelTo(vectorZ)) {\n const matrix = Matrix3d.createColumns(vectorX, vectorY, vectorZ);\n matrix.scaleColumns(radiusXY, radiusXY, radiusZ, matrix);\n const frame = Transform.createOriginAndMatrix(center, matrix);\n return new Sphere(frame, latitudeSweep.clone(), capped);\n }\n return undefined;\n }\n\n /** Create a sphere from the typical parameters of the Dgn file */\n public static createFromAxesAndScales(center: Point3d, axes: undefined | Matrix3d, radiusX: number, radiusY: number, radiusZ: number,\n latitudeSweep: AngleSweep | undefined,\n capped: boolean): Sphere | undefined {\n const localToWorld = Transform.createOriginAndMatrix(center, axes);\n localToWorld.matrix.scaleColumnsInPlace(radiusX, radiusY, radiusZ);\n return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : AngleSweep.createFullLatitude(), capped);\n }\n\n /** return (copy of) sphere center */\n public cloneCenter(): Point3d { return this._localToWorld.getOrigin(); }\n /** return the (full length, i.e. scaled by radius) X vector from the sphere transform */\n public cloneVectorX(): Vector3d { return this._localToWorld.matrix.columnX(); }\n /** return the (full length, i.e. scaled by radius) Y vector from the sphere transform */\n public cloneVectorY(): Vector3d { return this._localToWorld.matrix.columnY(); }\n /** return the (full length, i.e. scaled by radius) Z vector from the sphere transform */\n public cloneVectorZ(): Vector3d { return this._localToWorld.matrix.columnZ(); }\n /** return (a copy of) the sphere's angle sweep. */\n public cloneLatitudeSweep(): AngleSweep { return this._latitudeSweep.clone(); }\n /** Test if the geometry is a true sphere taking the transform (which might have nonuniform scaling) is applied. */\n public trueSphereRadius(): number | undefined {\n const factors = this._localToWorld.matrix.factorRigidWithSignedScale();\n if (!factors) return undefined;\n if (factors && factors.scale > 0) // why do we rule out mirror?\n return factors.scale;\n return undefined;\n }\n /**\n * Return the largest of the primary xyz axis radii\n */\n public maxAxisRadius(): number {\n const matrix = this._localToWorld.matrix;\n return Geometry.maxXYZ(matrix.columnXMagnitude(), matrix.columnYMagnitude(), matrix.columnZMagnitude());\n }\n /**\n * Return a (clone of) the sphere's local to world transformation.\n */\n public cloneLocalToWorld(): Transform { return this._localToWorld.clone(); }\n /** Test if `other` is a `Sphere` */\n public isSameGeometryClass(other: any): boolean { return other instanceof Sphere; }\n /** Test for same geometry in `other` */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof Sphere) {\n if (this.capped !== other.capped) return false;\n if (!this._localToWorld.isAlmostEqual(other._localToWorld)) return false;\n return true;\n }\n return false;\n }\n /**\n * Return strokes for the elliptical arc cross-section at latitude sweep fraction v.\n * * Optional inputs control the number of strokes along the cross-section:\n * * If `fixedStrokeCount` is supplied, it is taken as the cross-section stroke count.\n * * If `fixedStrokeCount` is undefined, stroke count is computed by applying `options` to the cross-section.\n * * If neither input is supplied, the stroke count default is 16.\n * * In any case, stroke count is clamped to the interval [4,64].\n * @param v fractional position along the sphere axis\n * @param fixedStrokeCount optional stroke count in u-direction\n * @param options optional stroke options in u-direction\n * @return strokes as line string\n */\n public strokeConstantVSection(v: number, fixedStrokeCount?: number, options?: StrokeOptions): LineString3d {\n let strokeCount = 16;\n if (fixedStrokeCount !== undefined && Number.isFinite(fixedStrokeCount)) {\n strokeCount = fixedStrokeCount;\n } else if (options instanceof StrokeOptions) {\n strokeCount = options.applyTolerancesToArc(Geometry.maxXY(this._localToWorld.matrix.columnXMagnitude(), this._localToWorld.matrix.columnYMagnitude()));\n }\n strokeCount = Geometry.clampToStartEnd(strokeCount, 4, 64);\n const transform = this._localToWorld;\n const phi = this.vFractionToRadians(v);\n const c1 = Math.cos(phi);\n const s1 = Math.sin(phi);\n let c0, s0;\n const result = LineString3d.createForStrokes(strokeCount, options);\n const deltaRadians = Math.PI * 2.0 / strokeCount;\n const fractions = result.fractions; // possibly undefined !!!\n const derivatives = result.packedDerivatives; // possibly undefined !!!\n const uvParams = result.packedUVParams; // possibly undefined !!\n const surfaceNormals = result.packedSurfaceNormals;\n const dXdu = Vector3d.create();\n const dXdv = Vector3d.create();\n const normal = Vector3d.create();\n let radians = 0;\n for (let i = 0; i <= strokeCount; i++) {\n if (i * 2 <= strokeCount)\n radians = i * deltaRadians;\n else\n radians = (i - strokeCount) * deltaRadians;\n c0 = Math.cos(radians);\n s0 = Math.sin(radians);\n const xyz = transform.multiplyXYZ(c1 * c0, c1 * s0, s1);\n result.addPoint(xyz);\n\n if (fractions)\n fractions.push(i / strokeCount);\n\n if (derivatives) {\n transform.matrix.multiplyXYZ(-c1 * s0, c1 * c0, 0.0, dXdu);\n derivatives.push(dXdu);\n }\n if (uvParams) {\n uvParams.pushXY(i / strokeCount, v);\n }\n if (surfaceNormals) {\n transform.matrix.multiplyXYZ(-s0, c0, 0, dXdu);\n transform.matrix.multiplyXYZ(-s1 * c0, -s1 * s0, c1, dXdv);\n dXdu.unitCrossProduct(dXdv, normal);\n surfaceNormals.push(normal);\n }\n }\n return result;\n }\n\n /** Second step of double dispatch: call `handler.handleSphere(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleSphere(this);\n }\n /**\n * Return the Arc3d section at vFraction. For the sphere, this is a latitude circle.\n * @param vFraction fractional position along the sweep direction\n */\n public constantVSection(vFraction: number): CurveCollection | undefined {\n const phi = this._latitudeSweep.fractionToRadians(vFraction);\n const s1 = Math.sin(phi);\n const c1 = Math.cos(phi);\n const transform = this._localToWorld;\n const center = transform.multiplyXYZ(0, 0, s1);\n const vector0 = transform.matrix.multiplyXYZ(c1, 0, 0);\n const vector90 = transform.matrix.multiplyXYZ(0, c1, 0);\n return Loop.create(Arc3d.create(center, vector0, vector90));\n }\n /** Extend a range to contain this sphere. */\n public extendRange(range: Range3d, transform?: Transform): void {\n let placement = this._localToWorld;\n if (transform) {\n placement = transform.multiplyTransformTransform(placement);\n }\n\n range.extendTransformedXYZ(placement, -1, -1, -1);\n range.extendTransformedXYZ(placement, 1, -1, -1);\n range.extendTransformedXYZ(placement, -1, 1, -1);\n range.extendTransformedXYZ(placement, 1, 1, -1);\n\n range.extendTransformedXYZ(placement, -1, -1, 1);\n range.extendTransformedXYZ(placement, 1, -1, 1);\n range.extendTransformedXYZ(placement, -1, 1, 1);\n range.extendTransformedXYZ(placement, 1, 1, 1);\n\n }\n /** Evaluate as a uv surface\n * @param uFraction fractional position on minor arc (theta, longitude)\n * @param vFraction fractional position on major arc (phi, latitude)\n */\n public uvFractionToPoint(uFraction: number, vFraction: number, result?: Point3d): Point3d {\n // sphere with radius 1 . . .\n const thetaRadians = this.uFractionToRadians(uFraction);\n const phiRadians = this.vFractionToRadians(vFraction);\n const cosTheta = Math.cos(thetaRadians);\n const sinTheta = Math.sin(thetaRadians);\n const sinPhi = Math.sin(phiRadians);\n const cosPhi = Math.cos(phiRadians);\n return this._localToWorld.multiplyXYZ(cosTheta * cosPhi, sinTheta * cosPhi, sinPhi, result);\n }\n /** Evaluate as a uv surface, returning point and two vectors.\n * @param uFraction fractional position on minor arc (theta, longitude)\n * @param vFraction fractional position on major arc (phi, latitude)\n */\n public uvFractionToPointAndTangents(uFraction: number, vFraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n const thetaRadians = this.uFractionToRadians(uFraction);\n const phiRadians = this.vFractionToRadians(vFraction);\n const fTheta = Math.PI * 2.0;\n const fPhi = this._latitudeSweep.sweepRadians;\n const cosTheta = Math.cos(thetaRadians);\n const sinTheta = Math.sin(thetaRadians);\n const sinPhi = Math.sin(phiRadians);\n const cosPhi = Math.cos(phiRadians);\n return Plane3dByOriginAndVectors.createOriginAndVectors(\n this._localToWorld.multiplyXYZ(cosTheta * cosPhi, sinTheta * cosPhi, sinPhi),\n this._localToWorld.matrix.multiplyXYZ(-fTheta * sinTheta, fTheta * cosTheta, 0), // !!! note cosTheta term is omitted -- scale is wrong, but remains non-zero at poles.\n this._localToWorld.matrix.multiplyXYZ(-fPhi * cosTheta * sinPhi, -fPhi * sinTheta * sinPhi, fPhi * cosPhi),\n result);\n }\n /**\n * * A sphere is can be closed two ways:\n * * full sphere (no caps needed for closure)\n * * incomplete but with caps\n * @return true if this is a closed volume.\n */\n public get isClosedVolume(): boolean {\n return this.capped || this._latitudeSweep.isFullLatitudeSweep;\n }\n /**\n * Directional distance query\n * * u direction is around latitude circle at maximum distance from axis.\n * * v direction is on a line of longitude between the latitude limits.\n */\n public maxIsoParametricDistance(): Vector2d {\n // approximate radius at equator .. if elliptic, this is not exact . . .\n const rX = this._localToWorld.matrix.columnXMagnitude();\n const rY = this._localToWorld.matrix.columnYMagnitude();\n const rZ = this._localToWorld.matrix.columnZMagnitude();\n const rMaxU = Math.max(rX, rY);\n let dMaxU = Math.PI * 2.0 * rMaxU;\n if (!this._latitudeSweep.isRadiansInSweep(0.0))\n dMaxU *= Math.max(Math.cos(Math.abs(this._latitudeSweep.startRadians)), Math.cos(Math.abs(this._latitudeSweep.endRadians)));\n const dMaxV = Math.max(rMaxU, rZ) * Math.abs(this._latitudeSweep.sweepRadians);\n\n return Vector2d.create(dMaxU, dMaxV);\n }\n}\n"]}
|