@itwin/core-geometry 4.1.0-dev.4 → 4.1.0-dev.40
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 +32 -1
- package/lib/cjs/Constant.js.map +1 -1
- 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.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.js.map +1 -1
- package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/cjs/bspline/KnotVector.js.map +1 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
- 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.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
- package/lib/cjs/clipping/ClipUtils.js.map +1 -1
- package/lib/cjs/clipping/ClipVector.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +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.d.ts +1 -0
- package/lib/cjs/core-geometry.d.ts.map +1 -1
- package/lib/cjs/core-geometry.js +4 -1
- package/lib/cjs/core-geometry.js.map +1 -1
- package/lib/cjs/curve/Arc3d.d.ts +71 -86
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +110 -96
- package/lib/cjs/curve/Arc3d.js.map +1 -1
- package/lib/cjs/curve/ChainCollectorContext.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/CurveChain.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +61 -41
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +69 -46
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCollection.d.ts +73 -46
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +100 -64
- package/lib/cjs/curve/CurveCollection.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +45 -46
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +39 -41
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +138 -92
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +115 -75
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/CurveProcessor.js.map +1 -1
- package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/cjs/curve/GeometryQuery.d.ts +26 -20
- package/lib/cjs/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/cjs/curve/GeometryQuery.js +11 -9
- package/lib/cjs/curve/GeometryQuery.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +38 -27
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +77 -39
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +70 -51
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +120 -71
- package/lib/cjs/curve/LineString3d.js.map +1 -1
- package/lib/cjs/curve/Loop.d.ts +7 -5
- package/lib/cjs/curve/Loop.d.ts.map +1 -1
- package/lib/cjs/curve/Loop.js +18 -6
- package/lib/cjs/curve/Loop.js.map +1 -1
- package/lib/cjs/curve/ParityRegion.d.ts +7 -7
- package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
- package/lib/cjs/curve/ParityRegion.js +19 -11
- package/lib/cjs/curve/ParityRegion.js.map +1 -1
- package/lib/cjs/curve/Path.d.ts +6 -6
- package/lib/cjs/curve/Path.d.ts.map +1 -1
- package/lib/cjs/curve/Path.js +15 -9
- package/lib/cjs/curve/Path.js.map +1 -1
- package/lib/cjs/curve/PointString3d.js.map +1 -1
- package/lib/cjs/curve/ProxyCurve.d.ts +4 -6
- package/lib/cjs/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/cjs/curve/ProxyCurve.js +7 -7
- 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.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.d.ts +14 -13
- package/lib/cjs/curve/Query/StrokeCountMap.d.ts.map +1 -1
- package/lib/cjs/curve/Query/StrokeCountMap.js +9 -8
- package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
- package/lib/cjs/curve/RegionOps.d.ts +69 -47
- package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
- package/lib/cjs/curve/RegionOps.js +70 -47
- package/lib/cjs/curve/RegionOps.js.map +1 -1
- package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/cjs/curve/StrokeOptions.d.ts +29 -21
- package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +50 -24
- package/lib/cjs/curve/StrokeOptions.js.map +1 -1
- package/lib/cjs/curve/UnionRegion.d.ts +6 -5
- package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
- package/lib/cjs/curve/UnionRegion.js +17 -8
- package/lib/cjs/curve/UnionRegion.js.map +1 -1
- package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.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/CurveLengthContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +4 -0
- package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/MultiChainCollector.js +5 -2
- 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.d.ts +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +56 -34
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +152 -87
- package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/SumLengthsContext.js +4 -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.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.map +1 -1
- package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
- 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.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.js.map +1 -1
- package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +2 -2
- package/lib/cjs/geometry3d/Matrix3d.js +2 -2
- package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
- 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.d.ts +36 -32
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +35 -32
- 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.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
- package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
- package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +133 -93
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +296 -144
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts.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.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.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.map +1 -1
- package/lib/cjs/numerics/PolarData.js.map +1 -1
- package/lib/cjs/numerics/Polynomials.js.map +1 -1
- package/lib/cjs/numerics/Quadrature.js.map +1 -1
- package/lib/cjs/numerics/Range1dArray.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.js.map +1 -1
- 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.map +1 -1
- package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/cjs/polyface/Polyface.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/RangeLengthData.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.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.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.js.map +1 -1
- package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/cjs/solid/Box.js.map +1 -1
- package/lib/cjs/solid/Cone.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
- package/lib/cjs/solid/Sphere.js.map +1 -1
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/cjs/solid/TorusPipe.js.map +1 -1
- package/lib/cjs/topology/ChainMerge.js.map +1 -1
- 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.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.map +1 -1
- package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
- package/lib/esm/Constant.js.map +1 -1
- 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.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.js.map +1 -1
- package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
- package/lib/esm/bspline/KnotVector.js.map +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
- package/lib/esm/clipping/ClipUtils.js.map +1 -1
- package/lib/esm/clipping/ClipVector.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +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.d.ts +1 -0
- package/lib/esm/core-geometry.d.ts.map +1 -1
- package/lib/esm/core-geometry.js +2 -0
- package/lib/esm/core-geometry.js.map +1 -1
- package/lib/esm/curve/Arc3d.d.ts +71 -86
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +110 -96
- package/lib/esm/curve/Arc3d.js.map +1 -1
- package/lib/esm/curve/ChainCollectorContext.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/CurveChain.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +61 -41
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +69 -46
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCollection.d.ts +73 -46
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +100 -64
- package/lib/esm/curve/CurveCollection.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/CurveExtendMode.js.map +1 -1
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +45 -46
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +39 -41
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +138 -92
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +115 -75
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/CurveProcessor.js.map +1 -1
- package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
- package/lib/esm/curve/GeometryQuery.d.ts +26 -20
- package/lib/esm/curve/GeometryQuery.d.ts.map +1 -1
- package/lib/esm/curve/GeometryQuery.js +11 -9
- package/lib/esm/curve/GeometryQuery.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +38 -27
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +77 -39
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +70 -51
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +120 -71
- package/lib/esm/curve/LineString3d.js.map +1 -1
- package/lib/esm/curve/Loop.d.ts +7 -5
- package/lib/esm/curve/Loop.d.ts.map +1 -1
- package/lib/esm/curve/Loop.js +18 -6
- package/lib/esm/curve/Loop.js.map +1 -1
- package/lib/esm/curve/ParityRegion.d.ts +7 -7
- package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
- package/lib/esm/curve/ParityRegion.js +19 -11
- package/lib/esm/curve/ParityRegion.js.map +1 -1
- package/lib/esm/curve/Path.d.ts +6 -6
- package/lib/esm/curve/Path.d.ts.map +1 -1
- package/lib/esm/curve/Path.js +15 -9
- package/lib/esm/curve/Path.js.map +1 -1
- package/lib/esm/curve/PointString3d.js.map +1 -1
- package/lib/esm/curve/ProxyCurve.d.ts +4 -6
- package/lib/esm/curve/ProxyCurve.d.ts.map +1 -1
- package/lib/esm/curve/ProxyCurve.js +7 -7
- 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.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.d.ts +14 -13
- package/lib/esm/curve/Query/StrokeCountMap.d.ts.map +1 -1
- package/lib/esm/curve/Query/StrokeCountMap.js +9 -8
- package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
- package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
- package/lib/esm/curve/RegionOps.d.ts +69 -47
- package/lib/esm/curve/RegionOps.d.ts.map +1 -1
- package/lib/esm/curve/RegionOps.js +70 -47
- package/lib/esm/curve/RegionOps.js.map +1 -1
- package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
- package/lib/esm/curve/StrokeOptions.d.ts +29 -21
- package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +50 -24
- package/lib/esm/curve/StrokeOptions.js.map +1 -1
- package/lib/esm/curve/UnionRegion.d.ts +6 -5
- package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
- package/lib/esm/curve/UnionRegion.js +17 -8
- package/lib/esm/curve/UnionRegion.js.map +1 -1
- package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.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/CurveLengthContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts +2 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/GapSearchContext.js +6 -2
- package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +4 -0
- package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/MultiChainCollector.js +5 -2
- 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.d.ts +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
- package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +56 -34
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +152 -87
- package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/SumLengthsContext.js +4 -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.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.map +1 -1
- package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
- 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.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.js.map +1 -1
- package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +2 -2
- package/lib/esm/geometry3d/Matrix3d.js +2 -2
- package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
- 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.d.ts +36 -32
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +35 -32
- 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.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
- package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
- package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
- package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +133 -93
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +296 -144
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts.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.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.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.map +1 -1
- package/lib/esm/numerics/PolarData.js.map +1 -1
- package/lib/esm/numerics/Polynomials.js.map +1 -1
- package/lib/esm/numerics/Quadrature.js.map +1 -1
- package/lib/esm/numerics/Range1dArray.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.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
- package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
- package/lib/esm/polyface/Polyface.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
- package/lib/esm/polyface/PolyfaceData.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/RangeLengthData.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.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.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.js.map +1 -1
- package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
- package/lib/esm/solid/Box.js.map +1 -1
- package/lib/esm/solid/Cone.js.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SolidPrimitive.js.map +1 -1
- package/lib/esm/solid/Sphere.js.map +1 -1
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/lib/esm/solid/TorusPipe.js.map +1 -1
- package/lib/esm/topology/ChainMerge.js.map +1 -1
- 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.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.map +1 -1
- package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
- package/package.json +3 -3
|
@@ -20,7 +20,7 @@ import { Path } from "../Path";
|
|
|
20
20
|
import { RegionOps } from "../RegionOps";
|
|
21
21
|
import { StrokeOptions } from "../StrokeOptions";
|
|
22
22
|
/**
|
|
23
|
-
* Classification of
|
|
23
|
+
* Classification of how the joint is constructed.
|
|
24
24
|
* @internal
|
|
25
25
|
*/
|
|
26
26
|
var JointMode;
|
|
@@ -33,26 +33,44 @@ var JointMode;
|
|
|
33
33
|
JointMode[JointMode["Gap"] = 4] = "Gap";
|
|
34
34
|
})(JointMode || (JointMode = {}));
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* *
|
|
39
|
-
*
|
|
40
|
-
* *
|
|
41
|
-
*
|
|
42
|
-
* *
|
|
36
|
+
* Control parameters for joint construction.
|
|
37
|
+
* * Define a "joint" as the common point between adjacent segments of the input curve.
|
|
38
|
+
* * Define the "turn angle" at a joint to be the angle in [0,pi] between the first derivatives (tangents) of
|
|
39
|
+
* the segments at the joint.
|
|
40
|
+
* * When creating offsets, if an offset needs to do an "outside" turn, the first applicable construction is applied:
|
|
41
|
+
* * If the turn angle is larger than `options.minArcDegrees`, a circular arc is constructed to offset the joint.
|
|
42
|
+
* * If the turn angle is less than or equal to `options.maxChamferTurnDegrees`, extend curves along tangent to
|
|
43
|
+
* single intersection point (to create a sharp corner).
|
|
44
|
+
* * If the turn angle is larger than `options.maxChamferDegrees`, the joint is offset with a line string whose edges:
|
|
45
|
+
* * lie outside the arc that would have been created by the first construction
|
|
46
|
+
* * have uniform turn angle less than `options.maxChamferDegrees`
|
|
47
|
+
* * touch the arc at their midpoint (except first and last edge).
|
|
43
48
|
* @public
|
|
44
49
|
*/
|
|
45
50
|
export class JointOptions {
|
|
46
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Construct JointOptions.
|
|
47
53
|
* * leftOffsetDistance is required
|
|
48
54
|
* * minArcDegrees and maxChamferDegrees are optional.
|
|
49
55
|
*/
|
|
50
|
-
constructor(leftOffsetDistance, minArcDegrees = 180, maxChamferDegrees = 90, preserveEllipticalArcs = false) {
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
56
|
+
constructor(leftOffsetDistance, minArcDegrees = 180, maxChamferDegrees = 90, preserveEllipticalArcs = false, allowSharpestCorners = false) {
|
|
57
|
+
/**
|
|
58
|
+
* Smallest arc to construct.
|
|
59
|
+
* * If this control angle is 180 degrees or more, arcs are never created.
|
|
53
60
|
*/
|
|
54
61
|
this.minArcDegrees = 180.0;
|
|
62
|
+
/** Largest turn angle at which to construct a sharp corner, or largest turn angle in a multi-segment chamfer. */
|
|
55
63
|
this.maxChamferTurnDegrees = 90;
|
|
64
|
+
/**
|
|
65
|
+
* Whether to remove the internal turn angle upper bound for sharp corner construction.
|
|
66
|
+
* * By default, a sharp corner is not created at a joint when the turn angle is too large, so as to avoid offsets whose
|
|
67
|
+
* ranges blow up. Internally, this is implemented by applying an upper bound of 120 degrees to `maxChamferTurnDegrees`.
|
|
68
|
+
* * When `allowSharpestCorners` is true, this internal upper bound is removed, allowing sharp corners for turn angles
|
|
69
|
+
* up to `maxChamferTurnDegrees`.
|
|
70
|
+
* * Thus, if you know your input turn angles are no greater than `maxChamferTurnDegrees`, you can create an offset
|
|
71
|
+
* with sharp corners at each joint by setting `minArcDegrees` to 180 and `allowSharpestCorners` to true.
|
|
72
|
+
*/
|
|
73
|
+
this.allowSharpestCorners = false;
|
|
56
74
|
/** Offset distance, positive to left of base curve. */
|
|
57
75
|
this.leftOffsetDistance = 0;
|
|
58
76
|
/** Whether to offset elliptical arcs as elliptical arcs (true) or as B-spline curves (false, default). */
|
|
@@ -61,10 +79,11 @@ export class JointOptions {
|
|
|
61
79
|
this.minArcDegrees = minArcDegrees;
|
|
62
80
|
this.maxChamferTurnDegrees = maxChamferDegrees;
|
|
63
81
|
this.preserveEllipticalArcs = preserveEllipticalArcs;
|
|
82
|
+
this.allowSharpestCorners = allowSharpestCorners;
|
|
64
83
|
}
|
|
65
84
|
/** Return a deep clone. */
|
|
66
85
|
clone() {
|
|
67
|
-
return new JointOptions(this.leftOffsetDistance, this.minArcDegrees, this.maxChamferTurnDegrees, this.preserveEllipticalArcs);
|
|
86
|
+
return new JointOptions(this.leftOffsetDistance, this.minArcDegrees, this.maxChamferTurnDegrees, this.preserveEllipticalArcs, this.allowSharpestCorners);
|
|
68
87
|
}
|
|
69
88
|
/** Copy values of input options */
|
|
70
89
|
setFrom(other) {
|
|
@@ -72,6 +91,7 @@ export class JointOptions {
|
|
|
72
91
|
this.minArcDegrees = other.minArcDegrees;
|
|
73
92
|
this.maxChamferTurnDegrees = other.maxChamferTurnDegrees;
|
|
74
93
|
this.preserveEllipticalArcs = other.preserveEllipticalArcs;
|
|
94
|
+
this.allowSharpestCorners = other.allowSharpestCorners;
|
|
75
95
|
}
|
|
76
96
|
/**
|
|
77
97
|
* Parse a number or JointOptions up to JointOptions:
|
|
@@ -82,17 +102,22 @@ export class JointOptions {
|
|
|
82
102
|
static create(leftOffsetDistanceOrOptions) {
|
|
83
103
|
if (leftOffsetDistanceOrOptions instanceof JointOptions)
|
|
84
104
|
return leftOffsetDistanceOrOptions;
|
|
85
|
-
// if (Number.isFinite(leftOffsetDistanceOrOptions))
|
|
86
105
|
return new JointOptions(leftOffsetDistanceOrOptions);
|
|
87
106
|
}
|
|
88
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
/** Return true if the options indicate this amount of turn should be handled with an arc. */
|
|
89
109
|
needArc(theta) {
|
|
90
110
|
return Math.abs(theta.degrees) >= this.minArcDegrees;
|
|
91
111
|
}
|
|
92
|
-
/**
|
|
112
|
+
/** Return the number of corners needed to chamfer the given turn angle. */
|
|
93
113
|
numChamferPoints(theta) {
|
|
94
114
|
const degrees = Math.abs(theta.degrees);
|
|
95
|
-
const
|
|
115
|
+
const minStepDegreesClamp = 10;
|
|
116
|
+
let maxStepDegreesClamp = 120;
|
|
117
|
+
if (this.allowSharpestCorners) {
|
|
118
|
+
maxStepDegreesClamp = this.maxChamferTurnDegrees;
|
|
119
|
+
}
|
|
120
|
+
const stepDegrees = Geometry.clamp(this.maxChamferTurnDegrees, minStepDegreesClamp, maxStepDegreesClamp);
|
|
96
121
|
if (degrees <= stepDegrees)
|
|
97
122
|
return 1;
|
|
98
123
|
return Math.ceil(degrees / stepDegrees);
|
|
@@ -108,17 +133,41 @@ export class OffsetOptions {
|
|
|
108
133
|
this.jointOptions = JointOptions.create(offsetDistanceOrOptions);
|
|
109
134
|
this.strokeOptions = (strokeOptions !== undefined) ? strokeOptions : StrokeOptions.createForCurves();
|
|
110
135
|
}
|
|
111
|
-
get minArcDegrees() {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
set
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
get
|
|
118
|
-
|
|
119
|
-
|
|
136
|
+
get minArcDegrees() {
|
|
137
|
+
return this.jointOptions.minArcDegrees;
|
|
138
|
+
}
|
|
139
|
+
set minArcDegrees(value) {
|
|
140
|
+
this.jointOptions.minArcDegrees = value;
|
|
141
|
+
}
|
|
142
|
+
get maxChamferTurnDegrees() {
|
|
143
|
+
return this.jointOptions.maxChamferTurnDegrees;
|
|
144
|
+
}
|
|
145
|
+
set maxChamferTurnDegrees(value) {
|
|
146
|
+
this.jointOptions.maxChamferTurnDegrees = value;
|
|
147
|
+
}
|
|
148
|
+
get allowSharpestCorners() {
|
|
149
|
+
return this.jointOptions.allowSharpestCorners;
|
|
150
|
+
}
|
|
151
|
+
set allowSharpestCorners(value) {
|
|
152
|
+
this.jointOptions.allowSharpestCorners = value;
|
|
153
|
+
}
|
|
154
|
+
get leftOffsetDistance() {
|
|
155
|
+
return this.jointOptions.leftOffsetDistance;
|
|
156
|
+
}
|
|
157
|
+
set leftOffsetDistance(value) {
|
|
158
|
+
this.jointOptions.leftOffsetDistance = value;
|
|
159
|
+
}
|
|
160
|
+
get preserveEllipticalArcs() {
|
|
161
|
+
return this.jointOptions.preserveEllipticalArcs;
|
|
162
|
+
}
|
|
163
|
+
set preserveEllipticalArcs(value) {
|
|
164
|
+
this.jointOptions.preserveEllipticalArcs = value;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Convert variant input into OffsetOptions.
|
|
120
168
|
* * If a JointOptions is provided, it is captured.
|
|
121
|
-
* * If an OffsetOptions is provided, a reference to it is returned.
|
|
169
|
+
* * If an OffsetOptions is provided, a reference to it is returned.
|
|
170
|
+
*/
|
|
122
171
|
static create(offsetDistanceOrOptions) {
|
|
123
172
|
if (offsetDistanceOrOptions instanceof OffsetOptions)
|
|
124
173
|
return offsetDistanceOrOptions;
|
|
@@ -147,7 +196,9 @@ class Joint {
|
|
|
147
196
|
this.swingPoint = swingPoint;
|
|
148
197
|
this.flexure = JointMode.Unknown;
|
|
149
198
|
}
|
|
150
|
-
/**
|
|
199
|
+
/**
|
|
200
|
+
* Try to construct an arc transition from ray0 to ray1 with given center.
|
|
201
|
+
*/
|
|
151
202
|
static constructArc(ray0, center, ray1) {
|
|
152
203
|
if (center !== undefined && Geometry.isSameCoordinate(ray0.origin.distance(center), ray1.origin.distance(center))) {
|
|
153
204
|
const angle = ray0.direction.angleToXY(ray1.direction);
|
|
@@ -192,6 +243,7 @@ class Joint {
|
|
|
192
243
|
destination.packedPoints.push(point);
|
|
193
244
|
}
|
|
194
245
|
}
|
|
246
|
+
/** Append stroke points along the offset curve defined by the Joint chain to the destination line string. */
|
|
195
247
|
static collectStrokesFromChain(start, destination, maxTest = 100) {
|
|
196
248
|
let numOut = -2 * maxTest; // allow extra things to happen
|
|
197
249
|
Joint.visitJointsOnChain(start, (joint) => {
|
|
@@ -203,7 +255,7 @@ class Joint {
|
|
|
203
255
|
if (fA === 0.0 && fB === 1.0)
|
|
204
256
|
curve1 = joint.curve1.clone();
|
|
205
257
|
else if (fA < fB)
|
|
206
|
-
curve1 = joint.curve1.clonePartialCurve(fA, fB);
|
|
258
|
+
curve1 = joint.curve1.clonePartialCurve(fA, fB); // trimming is done by clonePartialCurve
|
|
207
259
|
if (curve1) {
|
|
208
260
|
if (!joint.jointCurve) {
|
|
209
261
|
this.addPoint(destination, curve1.startPoint());
|
|
@@ -243,6 +295,7 @@ class Joint {
|
|
|
243
295
|
}
|
|
244
296
|
}
|
|
245
297
|
}
|
|
298
|
+
/** Append CurvePrimitives along the offset curve defined by the Joint chain to the destination array. */
|
|
246
299
|
static collectCurvesFromChain(start, destination, maxTest = 100) {
|
|
247
300
|
if (start === undefined)
|
|
248
301
|
return;
|
|
@@ -257,13 +310,13 @@ class Joint {
|
|
|
257
310
|
if (fA === 0.0 && fB === 1.0)
|
|
258
311
|
curve1 = joint.curve1.clone();
|
|
259
312
|
else if (fA < fB)
|
|
260
|
-
curve1 = joint.curve1.clonePartialCurve(fA, fB);
|
|
313
|
+
curve1 = joint.curve1.clonePartialCurve(fA, fB); // trimming is done by clonePartialCurve
|
|
261
314
|
this.collectPrimitive(destination, curve1);
|
|
262
315
|
}
|
|
263
316
|
return numOut++ < maxTest;
|
|
264
317
|
}, maxTest);
|
|
265
318
|
}
|
|
266
|
-
/** Execute `joint.annotateJointMode()` at all joints on the chain. */
|
|
319
|
+
/** Execute `joint.annotateJointMode()` at all joints on the chain to set some of the joints attributes. */
|
|
267
320
|
static annotateChain(start, options, maxTest = 100) {
|
|
268
321
|
if (start)
|
|
269
322
|
Joint.visitJointsOnChain(start, (joint) => { joint.annotateJointMode(options); return true; }, maxTest);
|
|
@@ -271,7 +324,7 @@ class Joint {
|
|
|
271
324
|
/**
|
|
272
325
|
* Visit joints on a chain.
|
|
273
326
|
* * terminate on `false` return from `callback`
|
|
274
|
-
* @param start first (and, for cyclic chain, final)
|
|
327
|
+
* @param start first (and, for cyclic chain, final) joint
|
|
275
328
|
* @param callback function to call with each Joint as a single parameter.
|
|
276
329
|
*/
|
|
277
330
|
static visitJointsOnChain(start, callback, maxTest = 100) {
|
|
@@ -279,7 +332,7 @@ class Joint {
|
|
|
279
332
|
if (joint) {
|
|
280
333
|
let numTest = 0;
|
|
281
334
|
while (joint !== undefined) {
|
|
282
|
-
if (numTest++ >= maxTest + 5)
|
|
335
|
+
if (numTest++ >= maxTest + 5) // allow extra things to happen
|
|
283
336
|
return true;
|
|
284
337
|
if (!callback(joint))
|
|
285
338
|
return false;
|
|
@@ -295,13 +348,13 @@ class Joint {
|
|
|
295
348
|
if (this.curve0 && this.curve1) {
|
|
296
349
|
const ray0 = this.curve0.fractionToPointAndDerivative(1.0);
|
|
297
350
|
const ray1 = this.curve1.fractionToPointAndDerivative(0.0);
|
|
298
|
-
const intersection = Ray3d.closestApproachRay3dRay3d(ray0, ray1);
|
|
351
|
+
const intersection = Ray3d.closestApproachRay3dRay3d(ray0, ray1); // intersection of the 2 ray lines
|
|
299
352
|
if (intersection.approachType === CurveCurveApproachType.Intersection) {
|
|
300
353
|
if (intersection.detailA.fraction >= 0.0 && intersection.detailB.fraction <= 0.0) {
|
|
301
354
|
this.fraction0 = 1.0;
|
|
302
355
|
this.fraction1 = 0.0;
|
|
303
356
|
this.flexure = JointMode.Extend;
|
|
304
|
-
const theta = ray0.getDirectionRef().angleToXY(ray1.getDirectionRef());
|
|
357
|
+
const theta = ray0.getDirectionRef().angleToXY(ray1.getDirectionRef()); // angle between the 2 ray lines
|
|
305
358
|
if (options.needArc(theta)) {
|
|
306
359
|
const arc = Joint.constructArc(ray0, this.curve0.baseCurveEnd, ray1);
|
|
307
360
|
if (arc) {
|
|
@@ -309,13 +362,12 @@ class Joint {
|
|
|
309
362
|
return;
|
|
310
363
|
}
|
|
311
364
|
}
|
|
312
|
-
const numChamferPoints = options.numChamferPoints(theta);
|
|
313
|
-
if (numChamferPoints <= 1) {
|
|
365
|
+
const numChamferPoints = options.numChamferPoints(theta); // how many interior points in the linestring
|
|
366
|
+
if (numChamferPoints <= 1) { // create sharp corner
|
|
314
367
|
this.jointCurve = LineString3d.create(ray0.origin, intersection.detailA.point, ray1.origin);
|
|
315
368
|
return;
|
|
316
369
|
}
|
|
317
|
-
if (numChamferPoints > 1) {
|
|
318
|
-
// A nontrivial linestring ...
|
|
370
|
+
if (numChamferPoints > 1) { // create chamfer corner (a line string)
|
|
319
371
|
const radians0 = theta.radians;
|
|
320
372
|
const numHalfStep = 2.0 * numChamferPoints;
|
|
321
373
|
const halfStepRadians = radians0 / numHalfStep;
|
|
@@ -335,19 +387,20 @@ class Joint {
|
|
|
335
387
|
}
|
|
336
388
|
}
|
|
337
389
|
}
|
|
338
|
-
//
|
|
390
|
+
// if there is no intersection between the 2 ray lines, fill the gap by a line segment
|
|
339
391
|
this.flexure = JointMode.Gap;
|
|
340
392
|
this.jointCurve = LineSegment3d.create(this.curve0.fractionToPoint(1.0), this.curve1.fractionToPoint(0.0));
|
|
341
393
|
this.fraction0 = 1.0;
|
|
342
394
|
this.fraction1 = 0.0;
|
|
343
395
|
}
|
|
344
396
|
}
|
|
345
|
-
|
|
397
|
+
/** Select the index at which summed fraction difference is smallest */
|
|
346
398
|
selectIntersectionIndexByFraction(fractionA, fractionB, intersections) {
|
|
347
399
|
let index = -1;
|
|
348
400
|
let aMin = Number.MAX_VALUE;
|
|
349
401
|
for (let i = 0; i < intersections.length; i++) {
|
|
350
|
-
const a = Math.abs(intersections[i].detailA.fraction - fractionA)
|
|
402
|
+
const a = Math.abs(intersections[i].detailA.fraction - fractionA)
|
|
403
|
+
+ Math.abs(intersections[i].detailB.fraction - fractionB);
|
|
351
404
|
if (a < aMin) {
|
|
352
405
|
aMin = a;
|
|
353
406
|
index = i;
|
|
@@ -356,42 +409,42 @@ class Joint {
|
|
|
356
409
|
return index;
|
|
357
410
|
}
|
|
358
411
|
/**
|
|
359
|
-
* Examine the adjacent geometry
|
|
360
|
-
* * set JointMode:
|
|
412
|
+
* Examine the adjacent geometry to set some of joint attributes:
|
|
413
|
+
* * set JointMode: one of Cap, Extend, or Trim
|
|
361
414
|
* * set fraction0 and fraction1 of intersection of curve0 and curve1
|
|
415
|
+
* * set joint curve
|
|
362
416
|
* * this REFERENCES curve0, curve1, fraction0, fraction1
|
|
363
417
|
* * this does not reference nextJoint and previousJoint
|
|
364
418
|
*/
|
|
365
419
|
annotateJointMode(options) {
|
|
366
|
-
if (this.curve0 &&
|
|
420
|
+
if (!this.curve0 && this.curve1) { // joint at the start of the chain
|
|
367
421
|
this.flexure = JointMode.Cap;
|
|
368
|
-
this.
|
|
422
|
+
this.fraction1 = 0.0;
|
|
369
423
|
}
|
|
370
|
-
else if (this.
|
|
424
|
+
else if (this.curve0 && !this.curve1) { // joint at the end of the chain
|
|
371
425
|
this.flexure = JointMode.Cap;
|
|
372
|
-
this.
|
|
426
|
+
this.fraction0 = 1.0;
|
|
373
427
|
}
|
|
374
|
-
else if (this.curve0 && this.curve1) {
|
|
375
|
-
|
|
376
|
-
if (this.curve0.endPoint().isAlmostEqual(this.curve1.startPoint())) {
|
|
428
|
+
else if (this.curve0 && this.curve1) { // joints at the middle of the chain
|
|
429
|
+
if (this.curve0.endPoint().isAlmostEqual(this.curve1.startPoint())) { // joint between colinear segments
|
|
377
430
|
this.fraction0 = 1.0;
|
|
378
431
|
this.fraction1 = 0.0;
|
|
379
432
|
this.flexure = JointMode.Trim;
|
|
380
433
|
}
|
|
381
|
-
else if (this.curve0 instanceof LineSegment3d && this.curve1 instanceof LineSegment3d) {
|
|
382
|
-
const ray0 = this.curve0.fractionToPointAndDerivative(0.0);
|
|
383
|
-
const ray1 = this.curve1.fractionToPointAndDerivative(0.0);
|
|
384
|
-
const intersection = Ray3d.closestApproachRay3dRay3d(ray0, ray1);
|
|
434
|
+
else if (this.curve0 instanceof LineSegment3d && this.curve1 instanceof LineSegment3d) { // pair of lines
|
|
435
|
+
const ray0 = this.curve0.fractionToPointAndDerivative(0.0);
|
|
436
|
+
const ray1 = this.curve1.fractionToPointAndDerivative(0.0);
|
|
437
|
+
const intersection = Ray3d.closestApproachRay3dRay3d(ray0, ray1); // intersection of the 2 ray lines
|
|
385
438
|
if (intersection.approachType === CurveCurveApproachType.Intersection) {
|
|
386
439
|
this.fraction0 = intersection.detailA.fraction;
|
|
387
440
|
this.fraction1 = intersection.detailB.fraction;
|
|
388
|
-
if (this.fraction0 >= 1.0 && this.fraction1 <= 0.0) {
|
|
441
|
+
if (this.fraction0 >= 1.0 && this.fraction1 <= 0.0) { // need to extend
|
|
389
442
|
this.annotateExtension(options);
|
|
390
443
|
}
|
|
391
|
-
else if (this.fraction0 < 1.0 && this.fraction1 > 0.0) {
|
|
444
|
+
else if (this.fraction0 < 1.0 && this.fraction1 > 0.0) { // need to trim
|
|
392
445
|
this.flexure = JointMode.Trim;
|
|
393
446
|
}
|
|
394
|
-
else if (this.fraction0 > 1.0 && this.fraction1 > 1.0) {
|
|
447
|
+
else if (this.fraction0 > 1.0 && this.fraction1 > 1.0) { // need to fill gap with a single line segment
|
|
395
448
|
this.flexure = JointMode.Gap;
|
|
396
449
|
this.jointCurve = LineSegment3d.create(this.curve0.fractionToPoint(1.0), this.curve1.fractionToPoint(0.0));
|
|
397
450
|
this.fraction0 = 1.0;
|
|
@@ -399,15 +452,15 @@ class Joint {
|
|
|
399
452
|
}
|
|
400
453
|
}
|
|
401
454
|
}
|
|
402
|
-
else { // generic pair of curves
|
|
455
|
+
else { // generic pair of curves
|
|
403
456
|
const intersections = CurveCurve.intersectionXYPairs(this.curve0, false, this.curve1, false);
|
|
404
457
|
const intersectionIndex = this.selectIntersectionIndexByFraction(1.0, 0.0, intersections);
|
|
405
|
-
if (intersectionIndex >= 0) {
|
|
458
|
+
if (intersectionIndex >= 0) { // need to trim
|
|
406
459
|
this.flexure = JointMode.Trim;
|
|
407
460
|
this.fraction0 = intersections[intersectionIndex].detailA.fraction;
|
|
408
461
|
this.fraction1 = intersections[intersectionIndex].detailB.fraction;
|
|
409
462
|
}
|
|
410
|
-
else {
|
|
463
|
+
else { // need to extend
|
|
411
464
|
this.annotateExtension(options);
|
|
412
465
|
}
|
|
413
466
|
}
|
|
@@ -415,7 +468,8 @@ class Joint {
|
|
|
415
468
|
}
|
|
416
469
|
/**
|
|
417
470
|
* * Examine the primitive trim fractions between each pair of joints.
|
|
418
|
-
* * If trim fractions indicate the primitive must disappear, replace the joint pair by a new joint pointing at
|
|
471
|
+
* * If trim fractions indicate the primitive must disappear, replace the joint pair by a new joint pointing at
|
|
472
|
+
* surrounding primitives
|
|
419
473
|
* @param start
|
|
420
474
|
*/
|
|
421
475
|
static removeDegeneratePrimitives(start, options, maxTest) {
|
|
@@ -450,8 +504,7 @@ class Joint {
|
|
|
450
504
|
}
|
|
451
505
|
*/
|
|
452
506
|
const eliminateF = f0 >= f1 || f0 > 1.0;
|
|
453
|
-
const eliminateG = (g0 !== undefined && g0 > 1.0)
|
|
454
|
-
|| (g0 !== undefined && g1 !== undefined && g0 >= g1);
|
|
507
|
+
const eliminateG = (g0 !== undefined && g0 > 1.0) || (g0 !== undefined && g1 !== undefined && g0 >= g1);
|
|
455
508
|
if (eliminateF && eliminateG) {
|
|
456
509
|
const jointC = jointB.nextJoint;
|
|
457
510
|
const newJoint = new Joint(jointA.curve0, jointC.curve1, undefined);
|
|
@@ -507,9 +560,8 @@ class Joint {
|
|
|
507
560
|
* @internal
|
|
508
561
|
*/
|
|
509
562
|
class PolygonWireOffsetContext {
|
|
510
|
-
/**
|
|
511
|
-
constructor() {
|
|
512
|
-
}
|
|
563
|
+
/** Construct a context. */
|
|
564
|
+
constructor() { }
|
|
513
565
|
// Construct a single offset from base points
|
|
514
566
|
static createOffsetSegment(basePointA, basePointB, distance) {
|
|
515
567
|
Vector3d.createStartEnd(basePointA, basePointB, this._unitAlong);
|
|
@@ -522,13 +574,25 @@ class PolygonWireOffsetContext {
|
|
|
522
574
|
return undefined;
|
|
523
575
|
}
|
|
524
576
|
/**
|
|
525
|
-
* Construct
|
|
526
|
-
*
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
*
|
|
577
|
+
* Construct a wire (not area) that is offset from given polyline or polygon (which must be in xy-plane or in
|
|
578
|
+
* a plane parallel to xy-plane).
|
|
579
|
+
* * This is a simple wire offset (in the form of a line string), not an area.
|
|
580
|
+
* * If offsetDistance is given as a number, default OffsetOptions are applied.
|
|
581
|
+
* * See [[JointOptions]] class doc for offset construction rules.
|
|
582
|
+
* @param points a single loop or path
|
|
583
|
+
* @param wrap true to offset the wraparound joint. Assumes first = last point.
|
|
584
|
+
* @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or JointOptions
|
|
585
|
+
* object.
|
|
530
586
|
*/
|
|
531
587
|
constructPolygonWireXYOffset(points, wrap, leftOffsetDistanceOrOptions) {
|
|
588
|
+
/**
|
|
589
|
+
* if "wrap = true", then first and last point in the points array must be close; otherwise
|
|
590
|
+
* generated offset will be invalid.
|
|
591
|
+
*/
|
|
592
|
+
if (wrap && !points[0].isAlmostEqual(points[points.length - 1])) {
|
|
593
|
+
wrap = false;
|
|
594
|
+
}
|
|
595
|
+
/** create raw offsets as a linked list (joint0) */
|
|
532
596
|
const options = JointOptions.create(leftOffsetDistanceOrOptions);
|
|
533
597
|
const numPoints = points.length;
|
|
534
598
|
let fragment0 = PolygonWireOffsetContext.createOffsetSegment(points[0], points[1], options.leftOffsetDistance);
|
|
@@ -548,7 +612,9 @@ class PolygonWireOffsetContext {
|
|
|
548
612
|
newJoint = new Joint(fragment0, undefined, points[numPoints - 1]);
|
|
549
613
|
Joint.link(previousJoint, newJoint);
|
|
550
614
|
}
|
|
615
|
+
/** annotateChain sets some of the joints attributes (including how to extend curves or fill the gap between curves) */
|
|
551
616
|
Joint.annotateChain(joint0, options, numPoints);
|
|
617
|
+
/** make limited passes through the Joint chain until no self-intersections are removed */
|
|
552
618
|
for (let pass = 0; pass++ < 5;) {
|
|
553
619
|
const state = Joint.removeDegeneratePrimitives(joint0, options, numPoints);
|
|
554
620
|
joint0 = state.newStart;
|
|
@@ -562,6 +628,7 @@ class PolygonWireOffsetContext {
|
|
|
562
628
|
*/
|
|
563
629
|
}
|
|
564
630
|
// Joint.collectPrimitivesFromChain(joint0, result, numPoints);
|
|
631
|
+
/** turn the Joint linked list into a CurveCollection (Loop or Path). trimming is done in collectStrokesFromChain */
|
|
565
632
|
const chain = LineString3d.create();
|
|
566
633
|
Joint.collectStrokesFromChain(joint0, chain, numPoints);
|
|
567
634
|
const n = chain.packedPoints.length;
|
|
@@ -585,14 +652,13 @@ export { PolygonWireOffsetContext };
|
|
|
585
652
|
*/
|
|
586
653
|
export class CurveChainWireOffsetContext {
|
|
587
654
|
/** construct a context. */
|
|
588
|
-
constructor() {
|
|
589
|
-
}
|
|
655
|
+
constructor() { }
|
|
590
656
|
/**
|
|
591
657
|
* Annotate a CurvePrimitive with properties `baseCurveStart` and `baseCurveEnd`.
|
|
592
|
-
*
|
|
593
|
-
* @param cp primitive to annotate
|
|
658
|
+
* @param cp curve primitive to annotate
|
|
594
659
|
* @param startPoint optional start point
|
|
595
660
|
* @param endPoint optional end point
|
|
661
|
+
* @return the input CurvePrimitive with annotations
|
|
596
662
|
*/
|
|
597
663
|
static applyBasePoints(cp, startPoint, endPoint) {
|
|
598
664
|
if (cp !== undefined) {
|
|
@@ -604,7 +670,7 @@ export class CurveChainWireOffsetContext {
|
|
|
604
670
|
return cp;
|
|
605
671
|
}
|
|
606
672
|
/**
|
|
607
|
-
* Create the offset of a single primitive.
|
|
673
|
+
* Create the offset of a single primitive as viewed in the xy-plane (ignoring z).
|
|
608
674
|
* * each primitive may be labeled (as an `any` object) with start or end point of base curve:
|
|
609
675
|
* * `(primitive as any).baseCurveStart: Point3d`
|
|
610
676
|
* * `(primitive as any).baseCurveEnd: Point3d`
|
|
@@ -628,15 +694,10 @@ export class CurveChainWireOffsetContext {
|
|
|
628
694
|
}
|
|
629
695
|
/**
|
|
630
696
|
* Construct curves that are offset from a Path or Loop as viewed in xy-plane (ignoring z).
|
|
631
|
-
* * The construction will remove "some" local effects of features smaller than the offset distance, but will
|
|
697
|
+
* * The construction will remove "some" local effects of features smaller than the offset distance, but will
|
|
698
|
+
* not detect self intersection among widely separated edges.
|
|
632
699
|
* * If offsetDistance is given as a number, default OffsetOptions are applied.
|
|
633
|
-
* *
|
|
634
|
-
* * If the turn is larger than `options.minArcDegrees`, a circular arc is constructed.
|
|
635
|
-
* * If the turn is less than or equal to `options.maxChamferTurnDegrees`, extend curves along tangent to single intersection point.
|
|
636
|
-
* * If the turn is larger than `options.maxChamferDegrees`, the turn is constructed as a sequence of straight lines that are:
|
|
637
|
-
* * outside the arc
|
|
638
|
-
* * have uniform turn angle less than `options.maxChamferDegrees`
|
|
639
|
-
* * each line segment (except first and last) touches the arc at its midpoint.
|
|
700
|
+
* * See [[JointOptions]] class doc for offset construction rules.
|
|
640
701
|
* @param curves base curves.
|
|
641
702
|
* @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
|
|
642
703
|
*/
|
|
@@ -644,14 +705,15 @@ export class CurveChainWireOffsetContext {
|
|
|
644
705
|
const wrap = curves instanceof Loop;
|
|
645
706
|
const offsetOptions = OffsetOptions.create(offsetDistanceOrOptions);
|
|
646
707
|
const simpleOffsets = [];
|
|
647
|
-
|
|
708
|
+
/** traverse primitives (children of curves) and create simple offsets of each primitive as an array */
|
|
648
709
|
for (const c of curves.children) {
|
|
649
710
|
const c1 = CurveChainWireOffsetContext.createSingleOffsetPrimitiveXY(c, offsetOptions);
|
|
650
711
|
if (c1 === undefined) {
|
|
651
712
|
// bad .. maybe arc to inside?
|
|
652
713
|
}
|
|
653
|
-
else if (c1 instanceof CurvePrimitive)
|
|
714
|
+
else if (c1 instanceof CurvePrimitive) {
|
|
654
715
|
simpleOffsets.push(c1);
|
|
716
|
+
}
|
|
655
717
|
else if (Array.isArray(c1)) {
|
|
656
718
|
for (const c2 of c1) {
|
|
657
719
|
if (c2 instanceof CurvePrimitive)
|
|
@@ -659,6 +721,7 @@ export class CurveChainWireOffsetContext {
|
|
|
659
721
|
}
|
|
660
722
|
}
|
|
661
723
|
}
|
|
724
|
+
/** create joints between array elements to make offsets as a linked list (joint0) */
|
|
662
725
|
let fragment0;
|
|
663
726
|
let newJoint;
|
|
664
727
|
let previousJoint;
|
|
@@ -677,8 +740,10 @@ export class CurveChainWireOffsetContext {
|
|
|
677
740
|
}
|
|
678
741
|
if (joint0 && previousJoint && curves instanceof Loop)
|
|
679
742
|
Joint.link(previousJoint, joint0);
|
|
743
|
+
/** annotateChain sets some of the joints attributes (including how to extend curves or fill the gap between curves) */
|
|
680
744
|
const numOffset = simpleOffsets.length;
|
|
681
745
|
Joint.annotateChain(joint0, offsetOptions.jointOptions, numOffset);
|
|
746
|
+
/** turn the Joint linked list into a CurveCollection. trimming is done in collectCurvesFromChain */
|
|
682
747
|
const outputCurves = [];
|
|
683
748
|
Joint.collectCurvesFromChain(joint0, outputCurves, numOffset);
|
|
684
749
|
return RegionOps.createLoopPathOrBagOfCurves(outputCurves, wrap, true);
|