@itwin/core-geometry 4.1.0-dev.6 → 4.1.0-dev.63
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 +62 -1
- package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/cjs/clipping/ClipPrimitive.js +2 -0
- package/lib/cjs/clipping/ClipPrimitive.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 +1 -0
- package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
- package/lib/cjs/curve/Arc3d.js +1 -0
- package/lib/cjs/curve/Arc3d.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 +36 -26
- package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCollection.js +46 -39
- 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/CurveFactory.d.ts +67 -3
- package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
- package/lib/cjs/curve/CurveFactory.js +75 -7
- package/lib/cjs/curve/CurveFactory.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +6 -6
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +9 -7
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +4 -3
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +4 -3
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/LineSegment3d.d.ts +6 -4
- package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineSegment3d.js +4 -4
- package/lib/cjs/curve/LineSegment3d.js.map +1 -1
- package/lib/cjs/curve/LineString3d.d.ts +1 -1
- package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
- package/lib/cjs/curve/LineString3d.js +1 -1
- 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/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/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/StrokeOptions.d.ts.map +1 -1
- package/lib/cjs/curve/StrokeOptions.js +6 -2
- 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/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/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 +153 -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/geometry3d/Angle.d.ts +9 -0
- package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Angle.js +13 -0
- package/lib/cjs/geometry3d/Angle.js.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.d.ts +43 -48
- package/lib/cjs/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/cjs/geometry3d/BilinearPatch.js +51 -55
- package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.d.ts +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js +1 -1
- package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/cjs/geometry3d/FrameBuilder.js +13 -11
- package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.d.ts +5 -5
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.d.ts +18 -0
- package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Matrix3d.js +27 -0
- package/lib/cjs/geometry3d/Matrix3d.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/Point3dVector3d.d.ts +8 -0
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +13 -0
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts +16 -1
- package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/cjs/geometry3d/PolylineOps.js +55 -0
- package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts +134 -94
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js +297 -145
- 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/Transform.d.ts +7 -0
- package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Transform.js +12 -0
- package/lib/cjs/geometry3d/Transform.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.d.ts +64 -6
- package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceQuery.js +104 -19
- package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +11 -0
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +79 -1
- package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts +11 -0
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +30 -0
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/cjs/solid/LinearSweep.d.ts +2 -1
- package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
- package/lib/cjs/solid/LinearSweep.js.map +1 -1
- package/lib/cjs/solid/RotationalSweep.d.ts +2 -1
- package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RotationalSweep.js.map +1 -1
- package/lib/cjs/solid/RuledSweep.d.ts +2 -1
- package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
- package/lib/cjs/solid/RuledSweep.js.map +1 -1
- package/lib/cjs/solid/SweepContour.d.ts +2 -2
- package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
- package/lib/cjs/solid/SweepContour.js +9 -0
- package/lib/cjs/solid/SweepContour.js.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
- package/lib/esm/clipping/ClipPrimitive.js +2 -0
- package/lib/esm/clipping/ClipPrimitive.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 +1 -0
- package/lib/esm/curve/Arc3d.d.ts.map +1 -1
- package/lib/esm/curve/Arc3d.js +1 -0
- package/lib/esm/curve/Arc3d.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 +36 -26
- package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
- package/lib/esm/curve/CurveCollection.js +46 -39
- 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/CurveFactory.d.ts +67 -3
- package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
- package/lib/esm/curve/CurveFactory.js +74 -6
- package/lib/esm/curve/CurveFactory.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +6 -6
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +9 -7
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +4 -3
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +4 -3
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/LineSegment3d.d.ts +6 -4
- package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
- package/lib/esm/curve/LineSegment3d.js +4 -4
- package/lib/esm/curve/LineSegment3d.js.map +1 -1
- package/lib/esm/curve/LineString3d.d.ts +1 -1
- package/lib/esm/curve/LineString3d.d.ts.map +1 -1
- package/lib/esm/curve/LineString3d.js +1 -1
- 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/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/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/StrokeOptions.d.ts.map +1 -1
- package/lib/esm/curve/StrokeOptions.js +6 -2
- 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/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/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 +153 -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/geometry3d/Angle.d.ts +9 -0
- package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
- package/lib/esm/geometry3d/Angle.js +13 -0
- package/lib/esm/geometry3d/Angle.js.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.d.ts +43 -48
- package/lib/esm/geometry3d/BilinearPatch.d.ts.map +1 -1
- package/lib/esm/geometry3d/BilinearPatch.js +51 -55
- package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
- package/lib/esm/geometry3d/Ellipsoid.d.ts +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js +1 -1
- package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
- package/lib/esm/geometry3d/FrameBuilder.js +13 -11
- package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.d.ts +5 -5
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.d.ts +18 -0
- package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Matrix3d.js +27 -0
- package/lib/esm/geometry3d/Matrix3d.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/Point3dVector3d.d.ts +8 -0
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +13 -0
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts +16 -1
- package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
- package/lib/esm/geometry3d/PolylineOps.js +56 -1
- package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts +134 -94
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js +297 -145
- 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/Transform.d.ts +7 -0
- package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
- package/lib/esm/geometry3d/Transform.js +12 -0
- package/lib/esm/geometry3d/Transform.js.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.d.ts +64 -6
- package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceQuery.js +103 -19
- package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +11 -0
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +78 -1
- package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts +11 -0
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +30 -0
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/solid/LinearSweep.d.ts +2 -1
- package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
- package/lib/esm/solid/LinearSweep.js.map +1 -1
- package/lib/esm/solid/RotationalSweep.d.ts +2 -1
- package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
- package/lib/esm/solid/RotationalSweep.js.map +1 -1
- package/lib/esm/solid/RuledSweep.d.ts +2 -1
- package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
- package/lib/esm/solid/RuledSweep.js.map +1 -1
- package/lib/esm/solid/SweepContour.d.ts +2 -2
- package/lib/esm/solid/SweepContour.d.ts.map +1 -1
- package/lib/esm/solid/SweepContour.js +9 -0
- package/lib/esm/solid/SweepContour.js.map +1 -1
- package/package.json +5 -5
|
@@ -9,32 +9,32 @@ import { Range3d } from "./Range";
|
|
|
9
9
|
import { Ray3d } from "./Ray3d";
|
|
10
10
|
import { Transform } from "./Transform";
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* *
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
12
|
+
* A bilinear patch is a surface defined by its 4 corner points.
|
|
13
|
+
* * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.
|
|
14
|
+
* ```
|
|
15
|
+
* equation
|
|
16
|
+
* \begin{matrix}
|
|
17
|
+
* v\text{-direction}\\
|
|
18
|
+
* \uparrow\\
|
|
19
|
+
* \text{point01} &\cdots &\text{A1} &\cdots &\text{point11}\\
|
|
20
|
+
* \vdots &&\vdots &&\vdots\\
|
|
21
|
+
* \text{B0} &\cdots &\text{X} &\cdots &\text{B1}\\
|
|
22
|
+
* \vdots &&\vdots &&\vdots\\
|
|
23
|
+
* \text{point00} &\cdots &\text{A0} &\cdots &\text{point10} &\rightarrow~u\text{-direction}
|
|
24
|
+
* \end{matrix}
|
|
25
|
+
* ```
|
|
26
|
+
* * To evaluate the point at (u,v), the following are equivalent:
|
|
27
|
+
* * interpolate first with u then with v:
|
|
27
28
|
* * A0 = interpolate between point00 and point10 at fraction u
|
|
28
29
|
* * A1 = interpolate between point01 and point11 at fraction u
|
|
29
30
|
* * X = interpolate between A0 and A1 at fraction v
|
|
30
|
-
* * interpolate first with v
|
|
31
|
+
* * interpolate first with v then with u:
|
|
31
32
|
* * B0 = interpolate between point00 and point01 at fraction v
|
|
32
33
|
* * B1 = interpolate between point10 and point11 at fraction v
|
|
33
34
|
* * X = interpolate between B0 and B1 at fraction u
|
|
34
|
-
* * sum all at once
|
|
35
|
-
* * X = (1-u)
|
|
36
|
-
*
|
|
37
|
-
* @internal
|
|
35
|
+
* * sum all at once:
|
|
36
|
+
* * X = (1-u)(1-v)point00 + (1-u)(v)point01 + (u)(1-v)point10 + (u)(v)point11
|
|
37
|
+
* @public
|
|
38
38
|
*/
|
|
39
39
|
export declare class BilinearPatch implements UVSurface {
|
|
40
40
|
/** corner at parametric coordinate (0,0) */
|
|
@@ -46,62 +46,57 @@ export declare class BilinearPatch implements UVSurface {
|
|
|
46
46
|
/** corner at parametric coordinate (1,1) */
|
|
47
47
|
point11: Point3d;
|
|
48
48
|
/**
|
|
49
|
-
* Capture (not clone)
|
|
49
|
+
* Capture (not clone) corners to create a new BilinearPatch.
|
|
50
50
|
* @param point00 Point at uv=0,0
|
|
51
51
|
* @param point10 Point at uv=1,0
|
|
52
52
|
* @param point10 Point at uv=0,1
|
|
53
|
-
* @param point11 Point at uv=
|
|
53
|
+
* @param point11 Point at uv=1,1
|
|
54
54
|
*/
|
|
55
55
|
constructor(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d);
|
|
56
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Clone (not capture) corners to create a new BilinearPatch.
|
|
57
58
|
* @param point00 Point at uv=0,0
|
|
58
59
|
* @param point10 Point at uv=1,0
|
|
59
60
|
* @param point10 Point at uv=0,1
|
|
60
|
-
* @param point11 Point at uv=
|
|
61
|
+
* @param point11 Point at uv=1,1
|
|
61
62
|
*/
|
|
62
63
|
static create(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d): BilinearPatch;
|
|
63
|
-
/**
|
|
64
|
-
*/
|
|
64
|
+
/** Create a patch from xyz values of the 4 corners. */
|
|
65
65
|
static createXYZ(x00: number, y00: number, z00: number, x10: number, y10: number, z10: number, x01: number, y01: number, z01: number, x11: number, y11: number, z11: number): BilinearPatch;
|
|
66
|
-
/**
|
|
66
|
+
/** Return a cloned patch. */
|
|
67
67
|
clone(): BilinearPatch;
|
|
68
|
-
/**
|
|
68
|
+
/** Test equality of the 4 points. */
|
|
69
69
|
isAlmostEqual(other: BilinearPatch): boolean;
|
|
70
|
-
/** Apply the transform to each point */
|
|
70
|
+
/** Apply the transform to each point. */
|
|
71
71
|
tryTransformInPlace(transform: Transform): boolean;
|
|
72
|
-
/**
|
|
73
|
-
* return a cloned and transformed patch.
|
|
74
|
-
* @param transform
|
|
75
|
-
*/
|
|
72
|
+
/** Return a cloned and transformed patch. */
|
|
76
73
|
cloneTransformed(transform: Transform): BilinearPatch | undefined;
|
|
77
|
-
/** Extend a range by the range of the(optionally transformed) patch
|
|
78
|
-
*/
|
|
74
|
+
/** Extend a range by the range of the (optionally transformed) patch. */
|
|
79
75
|
extendRange(range: Range3d, transform?: Transform): void;
|
|
80
|
-
/**
|
|
81
|
-
*
|
|
82
|
-
* @param
|
|
76
|
+
/**
|
|
77
|
+
* Convert fractional u and v coordinates to surface point
|
|
78
|
+
* @param u fractional coordinate in u direction
|
|
79
|
+
* @param v fractional coordinate in v direction
|
|
80
|
+
* @param result optional pre-allocated point
|
|
83
81
|
*/
|
|
84
82
|
uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d;
|
|
85
83
|
/** Evaluate as a uv surface, returning point and two derivative vectors.
|
|
86
|
-
* @param u fractional
|
|
87
|
-
* @param v fractional
|
|
84
|
+
* @param u fractional coordinate in u direction
|
|
85
|
+
* @param v fractional coordinate in v direction
|
|
86
|
+
* @param result optional pre-allocated carrier for point and vectors
|
|
88
87
|
*/
|
|
89
88
|
uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors;
|
|
90
|
-
/**
|
|
89
|
+
/** If data[iB][pivotColumn] is larger in absolute value than data[iA][pivotColumn], then swap rows iA and iB. */
|
|
91
90
|
private static conditionalPivot;
|
|
92
91
|
/**
|
|
93
|
-
* Compute the
|
|
92
|
+
* Compute the points of intersection with a ray.
|
|
94
93
|
* @param ray ray in space
|
|
95
94
|
* @returns 1 or 2 points if there are intersections, undefined if no intersections
|
|
96
95
|
*/
|
|
97
96
|
intersectRay(ray: Ray3d): CurveAndSurfaceLocationDetail[] | undefined;
|
|
98
|
-
/**
|
|
99
|
-
* Returns the larger of the u-direction edge lengths at v=0 and v=1
|
|
100
|
-
*/
|
|
97
|
+
/** Returns the larger of the u-direction edge lengths at v=0 and v=1. */
|
|
101
98
|
maxUEdgeLength(): number;
|
|
102
|
-
/**
|
|
103
|
-
* Returns the larger of the v-direction edge lengths at u=0 and u=1
|
|
104
|
-
*/
|
|
99
|
+
/** Returns the larger of the v-direction edge lengths at u=0 and u=1. */
|
|
105
100
|
maxVEdgeLength(): number;
|
|
106
101
|
}
|
|
107
102
|
//# sourceMappingURL=BilinearPatch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BilinearPatch.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAA2B,MAAM,kCAAkC,CAAC;AAI1G,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"BilinearPatch.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAA2B,MAAM,kCAAkC,CAAC;AAI1G,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,aAAc,YAAW,SAAS;IAC7C,4CAA4C;IACrC,OAAO,EAAE,OAAO,CAAC;IACxB,4CAA4C;IACrC,OAAO,EAAE,OAAO,CAAC;IACxB,4CAA4C;IACrC,OAAO,EAAE,OAAO,CAAC;IACxB,4CAA4C;IACrC,OAAO,EA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Y,CAAC,GAAG,EAAE,KAAK,GAAG,6BAA6B,EAAE,GAAG,SAAS;IAsC5E,yEAAyE;IAClE,cAAc,IAAI,MAAM;IAG/B,yEAAyE;IAClE,cAAc,IAAI,MAAM;CAGhC"}
|
|
@@ -11,41 +11,42 @@ import { Geometry } from "../Geometry";
|
|
|
11
11
|
import { SmallSystem } from "../numerics/Polynomials";
|
|
12
12
|
import { Plane3dByOriginAndVectors } from "./Plane3dByOriginAndVectors";
|
|
13
13
|
import { Point3d } from "./Point3dVector3d";
|
|
14
|
+
// cspell:word uparrow, rightarrow
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
-
* *
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
16
|
+
* A bilinear patch is a surface defined by its 4 corner points.
|
|
17
|
+
* * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.
|
|
18
|
+
* ```
|
|
19
|
+
* equation
|
|
20
|
+
* \begin{matrix}
|
|
21
|
+
* v\text{-direction}\\
|
|
22
|
+
* \uparrow\\
|
|
23
|
+
* \text{point01} &\cdots &\text{A1} &\cdots &\text{point11}\\
|
|
24
|
+
* \vdots &&\vdots &&\vdots\\
|
|
25
|
+
* \text{B0} &\cdots &\text{X} &\cdots &\text{B1}\\
|
|
26
|
+
* \vdots &&\vdots &&\vdots\\
|
|
27
|
+
* \text{point00} &\cdots &\text{A0} &\cdots &\text{point10} &\rightarrow~u\text{-direction}
|
|
28
|
+
* \end{matrix}
|
|
29
|
+
* ```
|
|
30
|
+
* * To evaluate the point at (u,v), the following are equivalent:
|
|
31
|
+
* * interpolate first with u then with v:
|
|
30
32
|
* * A0 = interpolate between point00 and point10 at fraction u
|
|
31
33
|
* * A1 = interpolate between point01 and point11 at fraction u
|
|
32
34
|
* * X = interpolate between A0 and A1 at fraction v
|
|
33
|
-
* * interpolate first with v
|
|
35
|
+
* * interpolate first with v then with u:
|
|
34
36
|
* * B0 = interpolate between point00 and point01 at fraction v
|
|
35
37
|
* * B1 = interpolate between point10 and point11 at fraction v
|
|
36
38
|
* * X = interpolate between B0 and B1 at fraction u
|
|
37
|
-
* * sum all at once
|
|
38
|
-
* * X = (1-u)
|
|
39
|
-
*
|
|
40
|
-
* @internal
|
|
39
|
+
* * sum all at once:
|
|
40
|
+
* * X = (1-u)(1-v)point00 + (1-u)(v)point01 + (u)(1-v)point10 + (u)(v)point11
|
|
41
|
+
* @public
|
|
41
42
|
*/
|
|
42
43
|
export class BilinearPatch {
|
|
43
44
|
/**
|
|
44
|
-
* Capture (not clone)
|
|
45
|
+
* Capture (not clone) corners to create a new BilinearPatch.
|
|
45
46
|
* @param point00 Point at uv=0,0
|
|
46
47
|
* @param point10 Point at uv=1,0
|
|
47
48
|
* @param point10 Point at uv=0,1
|
|
48
|
-
* @param point11 Point at uv=
|
|
49
|
+
* @param point11 Point at uv=1,1
|
|
49
50
|
*/
|
|
50
51
|
constructor(point00, point10, point01, point11) {
|
|
51
52
|
this.point00 = point00;
|
|
@@ -53,32 +54,32 @@ export class BilinearPatch {
|
|
|
53
54
|
this.point01 = point01;
|
|
54
55
|
this.point11 = point11;
|
|
55
56
|
}
|
|
56
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* Clone (not capture) corners to create a new BilinearPatch.
|
|
57
59
|
* @param point00 Point at uv=0,0
|
|
58
60
|
* @param point10 Point at uv=1,0
|
|
59
61
|
* @param point10 Point at uv=0,1
|
|
60
|
-
* @param point11 Point at uv=
|
|
62
|
+
* @param point11 Point at uv=1,1
|
|
61
63
|
*/
|
|
62
64
|
static create(point00, point10, point01, point11) {
|
|
63
65
|
return new BilinearPatch(point00.clone(), point10.clone(), point01.clone(), point11.clone());
|
|
64
66
|
}
|
|
65
|
-
/**
|
|
66
|
-
*/
|
|
67
|
+
/** Create a patch from xyz values of the 4 corners. */
|
|
67
68
|
static createXYZ(x00, y00, z00, x10, y10, z10, x01, y01, z01, x11, y11, z11) {
|
|
68
69
|
return new BilinearPatch(Point3d.create(x00, y00, z00), Point3d.create(x10, y10, z10), Point3d.create(x01, y01, z01), Point3d.create(x11, y11, z11));
|
|
69
70
|
}
|
|
70
|
-
/**
|
|
71
|
+
/** Return a cloned patch. */
|
|
71
72
|
clone() {
|
|
72
73
|
return new BilinearPatch(this.point00.clone(), this.point10.clone(), this.point01.clone(), this.point11.clone());
|
|
73
74
|
}
|
|
74
|
-
/**
|
|
75
|
+
/** Test equality of the 4 points. */
|
|
75
76
|
isAlmostEqual(other) {
|
|
76
77
|
return this.point00.isAlmostEqual(other.point00)
|
|
77
78
|
&& this.point10.isAlmostEqual(other.point10)
|
|
78
79
|
&& this.point01.isAlmostEqual(other.point01)
|
|
79
80
|
&& this.point11.isAlmostEqual(other.point11);
|
|
80
81
|
}
|
|
81
|
-
/** Apply the transform to each point */
|
|
82
|
+
/** Apply the transform to each point. */
|
|
82
83
|
tryTransformInPlace(transform) {
|
|
83
84
|
transform.multiplyPoint3d(this.point00, this.point00);
|
|
84
85
|
transform.multiplyPoint3d(this.point10, this.point10);
|
|
@@ -86,17 +87,13 @@ export class BilinearPatch {
|
|
|
86
87
|
transform.multiplyPoint3d(this.point11, this.point11);
|
|
87
88
|
return true;
|
|
88
89
|
}
|
|
89
|
-
/**
|
|
90
|
-
* return a cloned and transformed patch.
|
|
91
|
-
* @param transform
|
|
92
|
-
*/
|
|
90
|
+
/** Return a cloned and transformed patch. */
|
|
93
91
|
cloneTransformed(transform) {
|
|
94
92
|
const result = this.clone();
|
|
95
93
|
result.tryTransformInPlace(transform);
|
|
96
94
|
return result;
|
|
97
95
|
}
|
|
98
|
-
/** Extend a range by the range of the(optionally transformed) patch
|
|
99
|
-
*/
|
|
96
|
+
/** Extend a range by the range of the (optionally transformed) patch. */
|
|
100
97
|
extendRange(range, transform) {
|
|
101
98
|
if (transform) {
|
|
102
99
|
range.extendTransformedPoint(transform, this.point00);
|
|
@@ -111,9 +108,11 @@ export class BilinearPatch {
|
|
|
111
108
|
range.extendPoint(this.point11);
|
|
112
109
|
}
|
|
113
110
|
}
|
|
114
|
-
/**
|
|
115
|
-
*
|
|
116
|
-
* @param
|
|
111
|
+
/**
|
|
112
|
+
* Convert fractional u and v coordinates to surface point
|
|
113
|
+
* @param u fractional coordinate in u direction
|
|
114
|
+
* @param v fractional coordinate in v direction
|
|
115
|
+
* @param result optional pre-allocated point
|
|
117
116
|
*/
|
|
118
117
|
uvFractionToPoint(u, v, result) {
|
|
119
118
|
const f00 = (1.0 - u) * (1.0 - v);
|
|
@@ -123,8 +122,9 @@ export class BilinearPatch {
|
|
|
123
122
|
return Point3d.create(f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x, f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y, f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z, result);
|
|
124
123
|
}
|
|
125
124
|
/** Evaluate as a uv surface, returning point and two derivative vectors.
|
|
126
|
-
* @param u fractional
|
|
127
|
-
* @param v fractional
|
|
125
|
+
* @param u fractional coordinate in u direction
|
|
126
|
+
* @param v fractional coordinate in v direction
|
|
127
|
+
* @param result optional pre-allocated carrier for point and vectors
|
|
128
128
|
*/
|
|
129
129
|
uvFractionToPointAndTangents(u, v, result) {
|
|
130
130
|
const u0 = 1.0 - u;
|
|
@@ -139,7 +139,7 @@ export class BilinearPatch {
|
|
|
139
139
|
// v derivative ..
|
|
140
140
|
u0 * (this.point01.x - this.point00.x) + u * (this.point11.x - this.point10.x), u0 * (this.point01.y - this.point00.y) + u * (this.point11.y - this.point10.y), u0 * (this.point01.z - this.point00.z) + u * (this.point11.z - this.point10.z), result);
|
|
141
141
|
}
|
|
142
|
-
/**
|
|
142
|
+
/** If data[iB][pivotColumn] is larger in absolute value than data[iA][pivotColumn], then swap rows iA and iB. */
|
|
143
143
|
static conditionalPivot(pivotColumn, data, iA, iB) {
|
|
144
144
|
if (Math.abs(data[iB][pivotColumn]) > Math.abs(data[iA][pivotColumn])) {
|
|
145
145
|
const q = data[iA];
|
|
@@ -148,7 +148,7 @@ export class BilinearPatch {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
|
-
* Compute the
|
|
151
|
+
* Compute the points of intersection with a ray.
|
|
152
152
|
* @param ray ray in space
|
|
153
153
|
* @returns 1 or 2 points if there are intersections, undefined if no intersections
|
|
154
154
|
*/
|
|
@@ -157,17 +157,17 @@ export class BilinearPatch {
|
|
|
157
157
|
const vectorV = this.point01.minus(this.point00);
|
|
158
158
|
const vectorW = this.point11.minus(this.point10);
|
|
159
159
|
vectorW.subtractInPlace(vectorV);
|
|
160
|
-
//
|
|
161
|
-
// `ray.origin + t
|
|
162
|
-
//
|
|
163
|
-
// `0 = -ray.
|
|
164
|
-
//
|
|
160
|
+
// We seek t, u, v such that:
|
|
161
|
+
// `ray.origin + t*ray.direction = point00 + u*vectorU + v*vectorV + u*v*vectorW`
|
|
162
|
+
// For typical direction as x, the scalar equation with coefficient order for arrays is:
|
|
163
|
+
// `0 = -t*ray.direction.x + (point00.x - ray.origin.x) + u*vectorU.x + v*vectorV.x + u*v*vectorW.x`
|
|
164
|
+
// and this particular equation is invoked to compute t when u and v are known.
|
|
165
165
|
const coffs = [
|
|
166
166
|
new Float64Array([-ray.direction.x, this.point00.x - ray.origin.x, vectorU.x, vectorV.x, vectorW.x]),
|
|
167
167
|
new Float64Array([-ray.direction.y, this.point00.y - ray.origin.y, vectorU.y, vectorV.y, vectorW.y]),
|
|
168
|
-
new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z])
|
|
168
|
+
new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z]),
|
|
169
169
|
];
|
|
170
|
-
//
|
|
170
|
+
// swap rows so that the equation with largest ray.direction coefficient is first.
|
|
171
171
|
BilinearPatch.conditionalPivot(0, coffs, 0, 1);
|
|
172
172
|
BilinearPatch.conditionalPivot(0, coffs, 0, 2);
|
|
173
173
|
SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[1], -1.0);
|
|
@@ -184,15 +184,11 @@ export class BilinearPatch {
|
|
|
184
184
|
}
|
|
185
185
|
return undefined;
|
|
186
186
|
}
|
|
187
|
-
/**
|
|
188
|
-
* Returns the larger of the u-direction edge lengths at v=0 and v=1
|
|
189
|
-
*/
|
|
187
|
+
/** Returns the larger of the u-direction edge lengths at v=0 and v=1. */
|
|
190
188
|
maxUEdgeLength() {
|
|
191
189
|
return Geometry.maxXY(this.point00.distance(this.point10), this.point01.distance(this.point11));
|
|
192
190
|
}
|
|
193
|
-
/**
|
|
194
|
-
* Returns the larger of the v-direction edge lengths at u=0 and u=1
|
|
195
|
-
*/
|
|
191
|
+
/** Returns the larger of the v-direction edge lengths at u=0 and u=1. */
|
|
196
192
|
maxVEdgeLength() {
|
|
197
193
|
return Geometry.maxXY(this.point00.distance(this.point01), this.point10.distance(this.point11));
|
|
198
194
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BilinearPatch.js","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC1G,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAK5C;;;;;;;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AAI,OAAO,EAAE;gBACxB,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACxG,MAAM,KAAK,GAAG,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBACrC,MAAM,CAAC,IAAI,CAAC,IAAI,6BAA6B,CAC3C,mBAAmB,CAAC,sBAAsB,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,EACzD,uBAAuB,CAAC,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;aACnE;YACD,OAAO,MAAM,CAAC;SACf;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;OAEG;IACI,cAAc;QACnB,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;IACD;;OAEG;IACI,cAAc;QACnB,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;CACF","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 { CurveAndSurfaceLocationDetail, UVSurfaceLocationDetail } from \"../bspline/SurfaceLocationDetail\";\r\nimport { CurveLocationDetail } from \"../curve/CurveLocationDetail\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { SmallSystem } from \"../numerics/Polynomials\";\r\nimport { UVSurface } from \"./GeometryHandler\";\r\nimport { Plane3dByOriginAndVectors } from \"./Plane3dByOriginAndVectors\";\r\nimport { Point3d } from \"./Point3dVector3d\";\r\nimport { Range3d } from \"./Range\";\r\nimport { Ray3d } from \"./Ray3d\";\r\nimport { Transform } from \"./Transform\";\r\n\r\n/**\r\n * * A Bilinear patch is defined by its 4 corner points.\r\n * * the corner points do not have to be coplanar\r\n *\r\n * * v direction (up)\r\n * |\r\n * |\r\n * |\r\n * point01---A1-----------point11\r\n * | | |\r\n * B0----X------------B1\r\n * | | |\r\n * point00--A0-----------point10 -----------> u direction\r\n *\r\n * * To evaluate aa point at (u,v), the following are equivalent:\r\n * * interpolate with u to get both A0 and A1, viz\r\n * * A0 = interpolate between point00 and point10 at fraction u\r\n * * A1 = interpolate between point01 and point11 at fraction u\r\n * * X = interpolate between A0 and A1 at fraction v\r\n * * interpolate first with v to get B0 and B1, viz\r\n * * B0 = interpolate between point00 and point01 at fraction v\r\n * * B1 = interpolate between point10 and point11 at fraction v\r\n * * X = interpolate between B0 and B1 at fraction u\r\n * * sum all at once as\r\n * * X = (1-u)* (1-v) *point00 + (1-u)*v * point01 + u * (1-v) *point10 + u* v * point11\r\n *\r\n * @internal\r\n */\r\nexport class BilinearPatch implements UVSurface {\r\n /** corner at parametric coordinate (0,0) */\r\n public point00: Point3d;\r\n /** corner at parametric coordinate (1,0) */\r\n public point10: Point3d;\r\n /** corner at parametric coordinate (0,1) */\r\n public point01: Point3d;\r\n /** corner at parametric coordinate (1,1) */\r\n public point11: Point3d;\r\n /**\r\n * Capture (not clone) corner points, in u direction at v=0, then in same direction at v=1\r\n * @param point00 Point at uv=0,0\r\n * @param point10 Point at uv=1,0\r\n * @param point10 Point at uv=0,1\r\n * @param point11 Point at uv=11\r\n */\r\n public constructor(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\r\n this.point00 = point00;\r\n this.point10 = point10;\r\n this.point01 = point01;\r\n this.point11 = point11;\r\n }\r\n /** clone (not capture) corners to create a new BilinearPatch\r\n * @param point00 Point at uv=0,0\r\n * @param point10 Point at uv=1,0\r\n * @param point10 Point at uv=0,1\r\n * @param point11 Point at uv=11\r\n */\r\n public static create(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\r\n return new BilinearPatch(point00.clone(), point10.clone(), point01.clone(), point11.clone());\r\n }\r\n\r\n /** create a patch with from xyz values of the 4 corners\r\n */\r\n public static createXYZ(x00: number, y00: number, z00: number,\r\n x10: number, y10: number, z10: number,\r\n x01: number, y01: number, z01: number,\r\n x11: number, y11: number, z11: number) {\r\n return new BilinearPatch(Point3d.create(x00, y00, z00),\r\n Point3d.create(x10, y10, z10),\r\n Point3d.create(x01, y01, z01),\r\n Point3d.create(x11, y11, z11));\r\n }\r\n\r\n /** return a clone with same coordinates */\r\n public clone(): BilinearPatch {\r\n return new BilinearPatch(\r\n this.point00.clone(),\r\n this.point10.clone(),\r\n this.point01.clone(),\r\n this.point11.clone());\r\n }\r\n /** test equality of the 4 points */\r\n public isAlmostEqual(other: BilinearPatch): boolean {\r\n return this.point00.isAlmostEqual(other.point00)\r\n && this.point10.isAlmostEqual(other.point10)\r\n && this.point01.isAlmostEqual(other.point01)\r\n && this.point11.isAlmostEqual(other.point11);\r\n }\r\n /** Apply the transform to each point */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n transform.multiplyPoint3d(this.point00, this.point00);\r\n transform.multiplyPoint3d(this.point10, this.point10);\r\n transform.multiplyPoint3d(this.point01, this.point01);\r\n transform.multiplyPoint3d(this.point11, this.point11);\r\n return true;\r\n }\r\n /**\r\n * return a cloned and transformed patch.\r\n * @param transform\r\n */\r\n public cloneTransformed(transform: Transform): BilinearPatch | undefined {\r\n const result = this.clone();\r\n result.tryTransformInPlace(transform);\r\n return result;\r\n }\r\n /** Extend a range by the range of the(optionally transformed) patch\r\n */\r\n public extendRange(range: Range3d, transform?: Transform) {\r\n if (transform) {\r\n range.extendTransformedPoint(transform, this.point00);\r\n range.extendTransformedPoint(transform, this.point10);\r\n range.extendTransformedPoint(transform, this.point01);\r\n range.extendTransformedPoint(transform, this.point11);\r\n } else {\r\n range.extendPoint(this.point00);\r\n range.extendPoint(this.point10);\r\n range.extendPoint(this.point01);\r\n range.extendPoint(this.point11);\r\n }\r\n }\r\n /** Evaluate as a uv surface\r\n * @param u fractional position in minor (phi)\r\n * @param v fractional position on major (theta) arc\r\n */\r\n public uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d {\r\n const f00 = (1.0 - u) * (1.0 - v);\r\n const f10 = u * (1.0 - v);\r\n const f01 = (1.0 - u) * v;\r\n const f11 = u * v;\r\n return Point3d.create(\r\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\r\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\r\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\r\n result);\r\n }\r\n /** Evaluate as a uv surface, returning point and two derivative vectors.\r\n * @param u fractional position\r\n * @param v fractional position\r\n */\r\n public uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n const u0 = 1.0 - u;\r\n const v0 = 1.0 - v;\r\n const f00 = u0 * v0;\r\n const f10 = u * v0;\r\n const f01 = u0 * v;\r\n const f11 = u * v;\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\r\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\r\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\r\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\r\n // u derivative ..\r\n v0 * (this.point10.x - this.point00.x) + v * (this.point11.x - this.point01.x),\r\n v0 * (this.point10.y - this.point00.y) + v * (this.point11.y - this.point01.y),\r\n v0 * (this.point10.z - this.point00.z) + v * (this.point11.z - this.point01.z),\r\n // v derivative ..\r\n u0 * (this.point01.x - this.point00.x) + u * (this.point11.x - this.point10.x),\r\n u0 * (this.point01.y - this.point00.y) + u * (this.point11.y - this.point10.y),\r\n u0 * (this.point01.z - this.point00.z) + u * (this.point11.z - this.point10.z),\r\n result);\r\n }\r\n /** if data[ib][pivotColumn] is larger (abs) than data[ia][pivotColumn] swap the iA and iB arrays */\r\n private static conditionalPivot(pivotColumn: number, data: Float64Array[], iA: number, iB: number) {\r\n if (Math.abs(data[iB][pivotColumn]) > Math.abs(data[iA][pivotColumn])) {\r\n const q = data[iA];\r\n data[iA] = data[iB];\r\n data[iB] = q;\r\n }\r\n }\r\n /**\r\n * Compute the (points of) intersection with a ray.\r\n * @param ray ray in space\r\n * @returns 1 or 2 points if there are intersections, undefined if no intersections\r\n */\r\n public intersectRay(ray: Ray3d): CurveAndSurfaceLocationDetail[] | undefined {\r\n const vectorU = this.point10.minus(this.point00);\r\n const vectorV = this.point01.minus(this.point00);\r\n const vectorW = this.point11.minus(this.point10);\r\n vectorW.subtractInPlace(vectorV);\r\n // coefficients of (each component of)\r\n // `ray.origin + t * ray.direction = point00 + u * vectorU + v * vectorV + u*v*vectorW`\r\n // for x as typical direction as x, the scalar equation with coefficient order for arrays is\r\n // `0 = -ray.origin.x * t + (point00.x - ray.origin.x) + u * vectorU.x + v * vectorV.x + u * v * vectorW.x`\r\n // (and that particular equation is invoked to isolate t when uv is known)\r\n const coffs = [\r\n new Float64Array([-ray.direction.x, this.point00.x - ray.origin.x, vectorU.x, vectorV.x, vectorW.x]),\r\n new Float64Array([-ray.direction.y, this.point00.y - ray.origin.y, vectorU.y, vectorV.y, vectorW.y]),\r\n new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z])];\r\n // bring the largest ray.direction coefficient to the 0 equation.\r\n BilinearPatch.conditionalPivot(0, coffs, 0, 1);\r\n BilinearPatch.conditionalPivot(0, coffs, 0, 2);\r\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[1], -1.0);\r\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[2], -1.0);\r\n const uvArray = SmallSystem.solveBilinearPair(\r\n coffs[1][1], coffs[1][2], coffs[1][3], coffs[1][4],\r\n coffs[2][1], coffs[2][2], coffs[2][3], coffs[2][4]);\r\n if (uvArray) {\r\n const result: CurveAndSurfaceLocationDetail[] = [];\r\n for (const uv of uvArray) {\r\n const t = -(coffs[0][1] + coffs[0][2] * uv.x + (coffs[0][3] + coffs[0][4] * uv.x) * uv.y) / coffs[0][0];\r\n const point = ray.fractionToPoint(t);\r\n result.push(new CurveAndSurfaceLocationDetail(\r\n CurveLocationDetail.createRayFractionPoint(ray, t, point),\r\n UVSurfaceLocationDetail.createSurfaceUVPoint(this, uv, point)));\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Returns the larger of the u-direction edge lengths at v=0 and v=1\r\n */\r\n public maxUEdgeLength(): number {\r\n return Geometry.maxXY(this.point00.distance(this.point10), this.point01.distance(this.point11));\r\n }\r\n /**\r\n * Returns the larger of the v-direction edge lengths at u=0 and u=1\r\n */\r\n public maxVEdgeLength(): number {\r\n return Geometry.maxXY(this.point00.distance(this.point01), this.point10.distance(this.point11));\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"BilinearPatch.js","sourceRoot":"","sources":["../../../src/geometry3d/BilinearPatch.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,MA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CAAC,CAAC;IAClG,CAAC;IACD,yEAAyE;IAClE,cAAc;QACnB,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClG,CAAC;CACF","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 { CurveAndSurfaceLocationDetail, UVSurfaceLocationDetail } from \"../bspline/SurfaceLocationDetail\";\r\nimport { CurveLocationDetail } from \"../curve/CurveLocationDetail\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { SmallSystem } from \"../numerics/Polynomials\";\r\nimport { UVSurface } from \"./GeometryHandler\";\r\nimport { Plane3dByOriginAndVectors } from \"./Plane3dByOriginAndVectors\";\r\nimport { Point3d } from \"./Point3dVector3d\";\r\nimport { Range3d } from \"./Range\";\r\nimport { Ray3d } from \"./Ray3d\";\r\nimport { Transform } from \"./Transform\";\r\n\r\n// cspell:word uparrow, rightarrow\r\n\r\n/**\r\n * A bilinear patch is a surface defined by its 4 corner points.\r\n * * The corner points do not have to be coplanar, but if they are, the quadrilateral should be convex to avoid a self-intersecting surface.\r\n * ```\r\n * equation\r\n * \\begin{matrix}\r\n * v\\text{-direction}\\\\\r\n * \\uparrow\\\\\r\n * \\text{point01} &\\cdots &\\text{A1} &\\cdots &\\text{point11}\\\\\r\n * \\vdots &&\\vdots &&\\vdots\\\\\r\n * \\text{B0} &\\cdots &\\text{X} &\\cdots &\\text{B1}\\\\\r\n * \\vdots &&\\vdots &&\\vdots\\\\\r\n * \\text{point00} &\\cdots &\\text{A0} &\\cdots &\\text{point10} &\\rightarrow~u\\text{-direction}\r\n * \\end{matrix}\r\n * ```\r\n * * To evaluate the point at (u,v), the following are equivalent:\r\n * * interpolate first with u then with v:\r\n * * A0 = interpolate between point00 and point10 at fraction u\r\n * * A1 = interpolate between point01 and point11 at fraction u\r\n * * X = interpolate between A0 and A1 at fraction v\r\n * * interpolate first with v then with u:\r\n * * B0 = interpolate between point00 and point01 at fraction v\r\n * * B1 = interpolate between point10 and point11 at fraction v\r\n * * X = interpolate between B0 and B1 at fraction u\r\n * * sum all at once:\r\n * * X = (1-u)(1-v)point00 + (1-u)(v)point01 + (u)(1-v)point10 + (u)(v)point11\r\n * @public\r\n */\r\nexport class BilinearPatch implements UVSurface {\r\n /** corner at parametric coordinate (0,0) */\r\n public point00: Point3d;\r\n /** corner at parametric coordinate (1,0) */\r\n public point10: Point3d;\r\n /** corner at parametric coordinate (0,1) */\r\n public point01: Point3d;\r\n /** corner at parametric coordinate (1,1) */\r\n public point11: Point3d;\r\n /**\r\n * Capture (not clone) corners to create a new BilinearPatch.\r\n * @param point00 Point at uv=0,0\r\n * @param point10 Point at uv=1,0\r\n * @param point10 Point at uv=0,1\r\n * @param point11 Point at uv=1,1\r\n */\r\n public constructor(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\r\n this.point00 = point00;\r\n this.point10 = point10;\r\n this.point01 = point01;\r\n this.point11 = point11;\r\n }\r\n /**\r\n * Clone (not capture) corners to create a new BilinearPatch.\r\n * @param point00 Point at uv=0,0\r\n * @param point10 Point at uv=1,0\r\n * @param point10 Point at uv=0,1\r\n * @param point11 Point at uv=1,1\r\n */\r\n public static create(point00: Point3d, point10: Point3d, point01: Point3d, point11: Point3d) {\r\n return new BilinearPatch(point00.clone(), point10.clone(), point01.clone(), point11.clone());\r\n }\r\n /** Create a patch from xyz values of the 4 corners. */\r\n public static createXYZ(\r\n x00: number, y00: number, z00: number,\r\n x10: number, y10: number, z10: number,\r\n x01: number, y01: number, z01: number,\r\n x11: number, y11: number, z11: number\r\n ) {\r\n return new BilinearPatch(\r\n Point3d.create(x00, y00, z00),\r\n Point3d.create(x10, y10, z10),\r\n Point3d.create(x01, y01, z01),\r\n Point3d.create(x11, y11, z11)\r\n );\r\n }\r\n /** Return a cloned patch. */\r\n public clone(): BilinearPatch {\r\n return new BilinearPatch(\r\n this.point00.clone(),\r\n this.point10.clone(),\r\n this.point01.clone(),\r\n this.point11.clone()\r\n );\r\n }\r\n /** Test equality of the 4 points. */\r\n public isAlmostEqual(other: BilinearPatch): boolean {\r\n return this.point00.isAlmostEqual(other.point00)\r\n && this.point10.isAlmostEqual(other.point10)\r\n && this.point01.isAlmostEqual(other.point01)\r\n && this.point11.isAlmostEqual(other.point11);\r\n }\r\n /** Apply the transform to each point. */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n transform.multiplyPoint3d(this.point00, this.point00);\r\n transform.multiplyPoint3d(this.point10, this.point10);\r\n transform.multiplyPoint3d(this.point01, this.point01);\r\n transform.multiplyPoint3d(this.point11, this.point11);\r\n return true;\r\n }\r\n /** Return a cloned and transformed patch. */\r\n public cloneTransformed(transform: Transform): BilinearPatch | undefined {\r\n const result = this.clone();\r\n result.tryTransformInPlace(transform);\r\n return result;\r\n }\r\n /** Extend a range by the range of the (optionally transformed) patch. */\r\n public extendRange(range: Range3d, transform?: Transform) {\r\n if (transform) {\r\n range.extendTransformedPoint(transform, this.point00);\r\n range.extendTransformedPoint(transform, this.point10);\r\n range.extendTransformedPoint(transform, this.point01);\r\n range.extendTransformedPoint(transform, this.point11);\r\n } else {\r\n range.extendPoint(this.point00);\r\n range.extendPoint(this.point10);\r\n range.extendPoint(this.point01);\r\n range.extendPoint(this.point11);\r\n }\r\n }\r\n /**\r\n * Convert fractional u and v coordinates to surface point\r\n * @param u fractional coordinate in u direction\r\n * @param v fractional coordinate in v direction\r\n * @param result optional pre-allocated point\r\n */\r\n public uvFractionToPoint(u: number, v: number, result?: Point3d): Point3d {\r\n const f00 = (1.0 - u) * (1.0 - v);\r\n const f10 = u * (1.0 - v);\r\n const f01 = (1.0 - u) * v;\r\n const f11 = u * v;\r\n return Point3d.create(\r\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\r\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\r\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\r\n result\r\n );\r\n }\r\n /** Evaluate as a uv surface, returning point and two derivative vectors.\r\n * @param u fractional coordinate in u direction\r\n * @param v fractional coordinate in v direction\r\n * @param result optional pre-allocated carrier for point and vectors\r\n */\r\n public uvFractionToPointAndTangents(u: number, v: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\r\n const u0 = 1.0 - u;\r\n const v0 = 1.0 - v;\r\n const f00 = u0 * v0;\r\n const f10 = u * v0;\r\n const f01 = u0 * v;\r\n const f11 = u * v;\r\n return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(\r\n f00 * this.point00.x + f10 * this.point10.x + f01 * this.point01.x + f11 * this.point11.x,\r\n f00 * this.point00.y + f10 * this.point10.y + f01 * this.point01.y + f11 * this.point11.y,\r\n f00 * this.point00.z + f10 * this.point10.z + f01 * this.point01.z + f11 * this.point11.z,\r\n // u derivative ..\r\n v0 * (this.point10.x - this.point00.x) + v * (this.point11.x - this.point01.x),\r\n v0 * (this.point10.y - this.point00.y) + v * (this.point11.y - this.point01.y),\r\n v0 * (this.point10.z - this.point00.z) + v * (this.point11.z - this.point01.z),\r\n // v derivative ..\r\n u0 * (this.point01.x - this.point00.x) + u * (this.point11.x - this.point10.x),\r\n u0 * (this.point01.y - this.point00.y) + u * (this.point11.y - this.point10.y),\r\n u0 * (this.point01.z - this.point00.z) + u * (this.point11.z - this.point10.z),\r\n result\r\n );\r\n }\r\n /** If data[iB][pivotColumn] is larger in absolute value than data[iA][pivotColumn], then swap rows iA and iB. */\r\n private static conditionalPivot(pivotColumn: number, data: Float64Array[], iA: number, iB: number) {\r\n if (Math.abs(data[iB][pivotColumn]) > Math.abs(data[iA][pivotColumn])) {\r\n const q = data[iA];\r\n data[iA] = data[iB];\r\n data[iB] = q;\r\n }\r\n }\r\n /**\r\n * Compute the points of intersection with a ray.\r\n * @param ray ray in space\r\n * @returns 1 or 2 points if there are intersections, undefined if no intersections\r\n */\r\n public intersectRay(ray: Ray3d): CurveAndSurfaceLocationDetail[] | undefined {\r\n const vectorU = this.point10.minus(this.point00);\r\n const vectorV = this.point01.minus(this.point00);\r\n const vectorW = this.point11.minus(this.point10);\r\n vectorW.subtractInPlace(vectorV);\r\n // We seek t, u, v such that:\r\n // `ray.origin + t*ray.direction = point00 + u*vectorU + v*vectorV + u*v*vectorW`\r\n // For typical direction as x, the scalar equation with coefficient order for arrays is:\r\n // `0 = -t*ray.direction.x + (point00.x - ray.origin.x) + u*vectorU.x + v*vectorV.x + u*v*vectorW.x`\r\n // and this particular equation is invoked to compute t when u and v are known.\r\n const coffs = [\r\n new Float64Array([-ray.direction.x, this.point00.x - ray.origin.x, vectorU.x, vectorV.x, vectorW.x]),\r\n new Float64Array([-ray.direction.y, this.point00.y - ray.origin.y, vectorU.y, vectorV.y, vectorW.y]),\r\n new Float64Array([-ray.direction.z, this.point00.z - ray.origin.z, vectorU.z, vectorV.z, vectorW.z]),\r\n ];\r\n // swap rows so that the equation with largest ray.direction coefficient is first.\r\n BilinearPatch.conditionalPivot(0, coffs, 0, 1);\r\n BilinearPatch.conditionalPivot(0, coffs, 0, 2);\r\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[1], -1.0);\r\n SmallSystem.eliminateFromPivot(coffs[0], 0, coffs[2], -1.0);\r\n const uvArray = SmallSystem.solveBilinearPair(\r\n coffs[1][1], coffs[1][2], coffs[1][3], coffs[1][4],\r\n coffs[2][1], coffs[2][2], coffs[2][3], coffs[2][4]\r\n );\r\n if (uvArray) {\r\n const result: CurveAndSurfaceLocationDetail[] = [];\r\n for (const uv of uvArray) {\r\n const t = -(coffs[0][1] + coffs[0][2] * uv.x + (coffs[0][3] + coffs[0][4] * uv.x) * uv.y) / coffs[0][0];\r\n const point = ray.fractionToPoint(t);\r\n result.push(new CurveAndSurfaceLocationDetail(\r\n CurveLocationDetail.createRayFractionPoint(ray, t, point),\r\n UVSurfaceLocationDetail.createSurfaceUVPoint(this, uv, point))\r\n );\r\n }\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n /** Returns the larger of the u-direction edge lengths at v=0 and v=1. */\r\n public maxUEdgeLength(): number {\r\n return Geometry.maxXY(this.point00.distance(this.point10), this.point01.distance(this.point11));\r\n }\r\n /** Returns the larger of the v-direction edge lengths at u=0 and u=1. */\r\n public maxVEdgeLength(): number {\r\n return Geometry.maxXY(this.point00.distance(this.point01), this.point10.distance(this.point11));\r\n }\r\n}\r\n"]}
|
|
@@ -328,7 +328,7 @@ export declare class GeodesicPathPoint {
|
|
|
328
328
|
private static _vectorCross?;
|
|
329
329
|
/** Evaluate the newton function and derivatives:
|
|
330
330
|
* `(UAB cross UCB) dot d1cross`
|
|
331
|
-
* with as the central data, UAB = vector from pointA to pointB, UCB = vector from pointC to
|
|
331
|
+
* with as the central data, UAB = vector from pointA to pointB, UCB = vector from pointC to pointB.
|
|
332
332
|
* * Return order is:
|
|
333
333
|
* * values[0] = the function
|
|
334
334
|
* * values[1] = derivative wrt pointA.phi
|
|
@@ -876,7 +876,7 @@ export class GeodesicPathPoint {
|
|
|
876
876
|
}
|
|
877
877
|
/** Evaluate the newton function and derivatives:
|
|
878
878
|
* `(UAB cross UCB) dot d1cross`
|
|
879
|
-
* with as the central data, UAB = vector from pointA to pointB, UCB = vector from pointC to
|
|
879
|
+
* with as the central data, UAB = vector from pointA to pointB, UCB = vector from pointC to pointB.
|
|
880
880
|
* * Return order is:
|
|
881
881
|
* * values[0] = the function
|
|
882
882
|
* * values[1] = derivative wrt pointA.phi
|