@itwin/core-geometry 4.6.0-dev.1 → 4.6.0-dev.13

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 CHANGED
@@ -1,6 +1,21 @@
1
1
  # Change Log - @itwin/core-geometry
2
2
 
3
- This log was last generated on Mon, 25 Mar 2024 22:24:35 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 15 Apr 2024 20:32:33 GMT and should not be manually modified.
4
+
5
+ ## 4.5.1
6
+ Wed, 03 Apr 2024 18:26:58 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 4.5.0
11
+ Tue, 02 Apr 2024 19:06:00 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 4.4.9
16
+ Mon, 15 Apr 2024 20:29:22 GMT
17
+
18
+ _Version update only_
4
19
 
5
20
  ## 4.4.8
6
21
  Mon, 25 Mar 2024 22:22:26 GMT
@@ -229,5 +229,6 @@ export * from "./topology/SpaceTriangulation";
229
229
  export * from "./serialization/IModelJsonSchema";
230
230
  export * from "./serialization/DeepCompare";
231
231
  export * from "./serialization/GeometrySamples";
232
+ export * from "./serialization/SerializationHelpers";
232
233
  export { BentleyGeometryFlatBuffer } from "./serialization/BentleyGeometryFlatBuffer";
233
234
  //# sourceMappingURL=core-geometry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-geometry.d.ts","sourceRoot":"","sources":["../../src/core-geometry.ts"],"names":[],"mappings":"AAKA;;GAEG;AASH;;;GAGG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;;;;GASG;AAGH;;;;;;;;GAQG;AAGH;;;;;;;;;;;;GAYG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;;;;;;;GAUG;AAEH;;;GAGG;AAEH;;;GAGG;AACH,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wCAAwC,CAAC;AACvD,c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ology/SpaceTriangulation"), exports);
265
265
  __exportStar(require("./serialization/IModelJsonSchema"), exports);
266
266
  __exportStar(require("./serialization/DeepCompare"), exports);
267
267
  __exportStar(require("./serialization/GeometrySamples"), exports);
268
+ __exportStar(require("./serialization/SerializationHelpers"), exports);
268
269
  var BentleyGeometryFlatBuffer_1 = require("./serialization/BentleyGeometryFlatBuffer");
269
270
  Object.defineProperty(exports, "BentleyGeometryFlatBuffer", { enumerable: true, get: function () { return BentleyGeometryFlatBuffer_1.BentleyGeometryFlatBuffer; } });
270
271
  //# sourceMappingURL=core-geometry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-geometry.js","sourceRoot":"","sources":["../../src/core-geometry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;AAE/F;;GAEG;AAEH,UAAU;AACV,+GAA+G;AAC/G,wDAAwD;AACxD,+FAA+F;AAC/F,6HAA6H;AAC7H,kEAAkE;AAElE;;;GAGG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,4CAA4C;AAC5C;;;;;;;;;GASG;AACH,8CAA8C;AAE9C;;;;;;;;GAQG;AACH,kCAAkC;AAElC;;;;;;;;;;;;GAYG;AACH,gCAAgC;AAChC;;;GAGG;AACH,mCAAmC;AACnC;;;GAGG;AACH,mCAAmC;AACnC;;;;GAIG;AACH,wCAAwC;AACxC;;;;;;;;;;GAUG;AACH,gCAAgC;AAChC;;;GAGG;AACH,mCAAmC;AACnC;;;GAGG;AACH,qDAAmC;AACnC,0DAAwC;AACxC,yEAAuD;AACvD,mEAAiD;AACjD,6DAA2C;AAC3C,yDAAuC;AACvC,4DAA0C;AAC1C,gEAA8C;AAC9C,+DAA6C;AAC7C,oEAAkD;AAClD,oEAAkD;AAClD,+DAA6C;AAC7C,gEAA8C;AAC9C,yEAAuD;AACvD,mEAAiD;AACjD,oEAAkD;AAClD,wDAAsC;AACtC,qEAAmD;AACnD,uDAAqC;AACrC,4EAA0D;AAC1D,y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yC;AACzC,yDAAuC;AACvC,4DAA0C;AAC1C,wDAAsC;AACtC,4DAA0C;AAC1C,2DAAyC;AACzC,iEAA+C;AAC/C,uDAAqC;AACrC,qDAAmC;AACnC,yDAAuC;AACvC,2DAAyC;AACzC,sDAAoC;AACpC,iEAA+C;AAC/C,oEAAkD;AAClD,+EAA6D;AAC7D,2FAAyE;AACzE,6DAA2C;AAC3C,0DAAwC;AACxC,2DAAyC;AACzC,0DAAwC;AACxC,oFAAkE;AAClE,oFAAkE;AAClE,gFAA8D;AAC9D,+DAA6C;AAC7C,gEAA8C;AAC9C,mEAAiD;AACjD,8DAA4C;AAC5C,kEAAgD;AAChD,uFAAsF;AAA7E,sIAAA,yBAAyB,OAAA","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Utility\n */\n\n// REMARK:\n// The docs-group-description comments are followed by empty classes with names corresponding to the doc-group.\n// Normally (in committed code) these are commented out.\n// The comments have distinctive strings so that simple search and replace can make the \"real\".\n// This is useful when working on the documentation: When the empty classes are present, VSCode will format the doc comments\n// for and display them when the mouse hovers over the class name.\n\n/**\n * @docs-package-description\n * The core-geometry package contains classes for working with geometry: points, vectors, curves, surfaces, and analytic solids\n */\n/**\n * @docs-group-description CartesianGeometry\n * Points, Vectors, Planes, and Transformations for x,y,z geometry.\n * * Fundamental cartesian geometry objects:\n * * Point2d, Point3d -- points with x,y,z coordinates\n * * Vector2d, Vector3d -- vectors with x,y,z coordinates\n * * Matrix3d -- 3x3 matrix\n * * * commonly used for pure rotations\n * * * scale and skew entries are also allowed.\n * * Transform -- an origin and axes.\n * * Range1d, Range2d, Range3d -- subsets of 1d, 2d, and 3d space bounded by low and high values.\n * * Ray3d -- a ray defined by origin and direction vector\n * * Plane3d -- an abstract base class extended by Plane3dByOriginAndNormal, Plane3dByOriginAndUnitNormal, Point4d, and ClipPlane\n * * Plane3dByOriginAndUnitNormal -- a plane defined by an origin and a single vector which is perpendicular to the plane\n * * plane3dByOriginAndVectors -- a plane defined by an origin and two vectors in the plane.\n * * Angles\n * * Angle -- a strongly typed angle object whose method names make it clear whether input and outputs are degrees or radians.\n * * AngleSweep -- an angular interval\n * * LatitudeLongitudeNumber -- carrier for position and altitude on sphere or ellipsoid\n * * YawPitchAndRollAngles -- 3 angles that define a rotated coordinate system.\n * * Utility classes\n * * FrameBuilder -- construction of coordinate frames from mixed data sources.\n * * ClipPlane -- a single plane\n * * ConvexClipPlaneSet -- an array of planes bounding a convex volume\n * * ClipPlaneSet -- an array of ConvexClipPlaneSet, defining the union of their volumes\n * * BilinearPatch -- twisted quadrilateral defined by 4 points\n * * BarycentricTriangle -- triangle defined by 3 points.\n * * Constant -- various numeric values exported as readonly constants\n */\n// doc:export class CartesianGeometryDoc { }\n/**\n * @docs-group-description ArraysAndInterfaces\n * These classes support array operations and inheritance-based algorithms.\n * * Arrays\n * * GrowableArray -- A carrier for a Float64Array, with methods that hide reallocation of the underlying array as contents are added.\n * * Point2dArray, Point3dArray, Point4dArray, Vector3dArray -- miscellaneous operations on arrays of 2d and 3d points.\n * * Interfaces\n * * GeometryHandler -- a double-dispatch protocol used for efficient implementation of algorithms that work on many geometry types.\n *\n */\n// doc:export class ArraysAndInterfacesDoc { }\n\n/**\n * @docs-group-description Bspline\n * A bspline curve or surface is used for curved freeform geometry defined by controls points (sometimes called poles).\n * * BSplineCurve -- a curve defined by control points (which are not on the curve)\n * * InterpolationCurve -- a curve defined by passthrough points, with \"good\" visual properties\n * * BSplineSurfaceXYZ -- a surface with XYZ\n * * BsplineSurfaceXYZW -- a surface with weighted (rational) XYZ coordinates\n * * KnotVector -- vector of breakpoints in bspline definitions.\n */\n// doc:export class BsplineDoc { }\n\n/**\n * @docs-group-description Curve\n * Curves in the GeometryQuery hierarchy: LineSegment3d, LineString3d, Arc3d, TransitionSpiral3d\n * * CurvePrimitive -- base class for parametric curves\n * * LineSegment3d -- a (bounded) portion of an unbounded line\n * * Arc3d -- a circular or elliptic arc\n * * LineString3d -- a sequence of points joined by line segments\n * * TransitionSpiral -- controlled transition between curvatures\n * * Support classes\n * * PointString3d -- a sequence of isolated points\n * * StrokeOptions -- tolerances to describe stroking accuracy\n * * RecursiveCurveProcessor, RecursiveCurveProcessorWithStack -- algorithmic support for trees with CurvePrimitives at the leaf level.\n */\n// doc:export class CurveDoc { }\n/**\n * @docs-group-description Numerics\n * The Numerics classes have geometric and numeric methods used during large algorithms in other classes.\n */\n// doc:export class NumericsDoc { }\n/**\n * @docs-group-description Polyface\n * A Polyface is a mesh structure with arrays of points that are shared among multiple incident facets.\n */\n// doc:export class PolyfaceDoc { }\n/**\n * @docs-group-description Serialization\n * These classes are related to serialization of geometry classes.\n * * IModelJson.Reader, IModelJson.Writer -- Conversion of in-memory geometry objects to json objects for persistence and transmission.\n */\n// doc:export class SerializationDoc { }\n/**\n * @docs-group-description Solid\n * Analytic Solids in the GeometryQuery hierarchy: Box, Sphere, Cone, TorusPipe, LinearSweep, RotationalSweep, RuledSweep\n * * Box -- a box solid. This is usually rectangular on all faces, but can in one directly like a view frustum\n * * Sphere -- a sphere\n * * Cone -- a cone or cylinder\n * * TorusPipe -- a pipe elbow\n * * LinearSweep -- a linear sweep of a base contour\n * * RotationalSweep -- a rotational sweep of a base contour\n * * RuledSweep -- two or more similarly structured contours joined by linear rule lines.\n */\n// doc:export class SolidDOc { }\n/**\n * @docs-group-description Topology\n * The Topology classes provide adjacency structures used in triangulations.\n */\n// doc:export class TopologyDoc { }\n/**\n * @docs-group-description RangeSearch\n * Support classes for searching collections of ranges.\n */\nexport * from \"./geometry3d/Angle\";\nexport * from \"./geometry3d/AngleSweep\";\nexport * from \"./geometry3d/LongitudeLatitudeAltitude\";\nexport * from \"./geometry3d/BarycentricTriangle\";\nexport * from \"./geometry3d/BilinearPatch\";\nexport * from \"./geometry3d/Ellipsoid\";\nexport * from \"./geometry3d/FrameBuilder\";\nexport * from \"./geometry3d/FrustumAnimation\";\nexport * from \"./geometry3d/GeometryHandler\";\nexport * from \"./geometry3d/GrowableBlockedArray\";\nexport * from \"./geometry3d/GrowableFloat64Array\";\nexport * from \"./geometry3d/GrowableXYArray\";\nexport * from \"./geometry3d/GrowableXYZArray\";\nexport * from \"./geometry3d/IndexedCollectionInterval\";\nexport * from \"./geometry3d/IndexedXYCollection\";\nexport * from \"./geometry3d/IndexedXYZCollection\";\nexport * from \"./geometry3d/Matrix3d\";\nexport * from \"./geometry3d/OrderedRotationAngles\";\nexport * from \"./geometry3d/Plane3d\";\nexport * from \"./geometry3d/Plane3dByOriginAndUnitNormal\";\nexport * from \"./geometry3d/Plane3dByOriginAndVectors\";\nexport * from \"./geometry3d/Point2dArrayCarrier\";\nexport * from \"./geometry3d/Point2dVector2d\";\nexport * from \"./geometry3d/Point3dVector3d\";\nexport * from \"./geometry3d/PointHelpers\";\nexport * from \"./geometry3d/Point3dArrayCarrier\";\nexport * from \"./geometry3d/PolylineOps\";\nexport * from \"./geometry3d/PolygonOps\";\nexport * from \"./geometry3d/Range\";\nexport * from \"./geometry3d/Ray2d\";\nexport * from \"./geometry3d/Ray3d\";\nexport * from \"./geometry3d/Segment1d\";\nexport * from \"./geometry3d/Transform\";\nexport * from \"./geometry3d/UVSurfaceOps\";\nexport * from \"./geometry3d/XYZProps\";\nexport * from \"./geometry3d/YawPitchRollAngles\";\n\nexport * from \"./Geometry\";\nexport * from \"./Constant\";\nexport * from \"./clipping/BooleanClipFactory\";\nexport * from \"./clipping/ClipPlane\";\nexport * from \"./clipping/ConvexClipPlaneSet\";\nexport * from \"./clipping/UnionOfConvexClipPlaneSets\";\nexport * from \"./clipping/ClipPrimitive\";\nexport * from \"./clipping/ClipVector\";\nexport * from \"./clipping/ClipUtils\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./geometry4d/PlaneByOriginAndVectors4d\";\nexport * from \"./geometry4d/Point4d\";\nexport * from \"./geometry4d/Matrix4d\";\nexport * from \"./geometry4d/Map4d\";\nexport * from \"./geometry4d/MomentData\";\nexport * from \"./numerics/BezierPolynomials\";\nexport * from \"./numerics/ClusterableArray\";\nexport * from \"./numerics/Complex\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./numerics/PascalCoefficients\";\nexport * from \"./numerics/Polynomials\";\nexport * from \"./numerics/Quadrature\";\nexport * from \"./numerics/Range1dArray\";\nexport * from \"./numerics/TriDiagonalSystem\";\n\nexport * from \"./curve/Arc3d\";\nexport * from \"./curve/ConstructCurveBetweenCurves\";\nexport * from \"./curve/CoordinateXYZ\";\nexport * from \"./curve/CurveTypes\";\nexport * from \"./curve/CurveChainWithDistanceIndex\";\nexport * from \"./curve/CurveExtendMode\";\nexport * from \"./curve/CurveCollection\";\nexport * from \"./curve/CurveCurve\";\nexport * from \"./curve/CurveLocationDetail\";\nexport * from \"./curve/CurveFactory\";\nexport * from \"./curve/CurveOps\";\nexport * from \"./curve/CurvePrimitive\";\nexport * from \"./curve/CurveProcessor\";\nexport * from \"./curve/GeometryQuery\";\nexport * from \"./curve/LineSegment3d\";\nexport * from \"./curve/LineString3d\";\nexport * from \"./curve/Loop\";\nexport * from \"./curve/OffsetOptions\";\nexport * from \"./curve/ParityRegion\";\nexport * from \"./curve/Path\";\nexport * from \"./curve/RegionMomentsXY\";\nexport * from \"./curve/RegionOps\";\nexport * from \"./curve/PointString3d\";\nexport * from \"./curve/ProxyCurve\";\nexport * from \"./curve/StrokeOptions\";\nexport * from \"./curve/spiral/TransitionSpiral3d\";\nexport * from \"./curve/spiral/IntegratedSpiral3d\";\nexport * from \"./curve/spiral/DirectSpiral3d\";\nexport * from \"./curve/UnionRegion\";\nexport * from \"./curve/Query/StrokeCountMap\";\nexport * from \"./solid/Box\";\nexport * from \"./solid/Cone\";\nexport * from \"./solid/LinearSweep\";\nexport * from \"./solid/RotationalSweep\";\nexport * from \"./solid/RuledSweep\";\nexport * from \"./solid/SolidPrimitive\";\nexport * from \"./solid/Sphere\";\nexport * from \"./solid/SweepContour\";\nexport * from \"./solid/TorusPipe\";\nexport * from \"./bspline/AkimaCurve3d\";\nexport * from \"./bspline/Bezier1dNd\";\nexport * from \"./bspline/BezierCurveBase\";\nexport * from \"./bspline/BezierCurve3d\";\nexport * from \"./bspline/BezierCurve3dH\";\nexport * from \"./bspline/BSplineCurve\";\nexport * from \"./bspline/BSplineCurveOps\";\nexport * from \"./bspline/BSpline1dNd\";\nexport * from \"./bspline/BSplineCurve3dH\";\nexport * from \"./bspline/BSplineSurface\";\nexport * from \"./bspline/InterpolationCurve3d\";\nexport * from \"./bspline/KnotVector\";\nexport * from \"./polyface/AuxData\";\nexport * from \"./polyface/BoxTopology\";\nexport * from \"./polyface/FacetFaceData\";\nexport * from \"./polyface/Polyface\";\nexport * from \"./polyface/FacetLocationDetail\";\nexport * from \"./polyface/IndexedPolyfaceVisitor\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSet\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSetWithOverflow\";\nexport * from \"./polyface/PolyfaceBuilder\";\nexport * from \"./polyface/PolyfaceData\";\nexport * from \"./polyface/PolyfaceQuery\";\nexport * from \"./polyface/PolyfaceClip\";\nexport * from \"./polyface/RangeTree/Point3dArrayRangeTreeContext\";\nexport * from \"./polyface/RangeTree/LineString3dRangeTreeContext\";\nexport * from \"./polyface/RangeTree/PolyfaceRangeTreeContext\";\nexport * from \"./polyface/TaggedNumericData\";\nexport * from \"./topology/SpaceTriangulation\";\nexport * from \"./serialization/IModelJsonSchema\";\nexport * from \"./serialization/DeepCompare\";\nexport * from \"./serialization/GeometrySamples\";\nexport { BentleyGeometryFlatBuffer } from \"./serialization/BentleyGeometryFlatBuffer\";\n"]}
1
+ {"version":3,"file":"core-geometry.js","sourceRoot":"","sources":["../../src/core-geometry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;AAE/F;;GAEG;AAEH,UAAU;AACV,+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C,gEAA8C;AAC9C,yDAAuC;AACvC,wDAAsC;AACtC,0DAAwC;AACxC,+DAA6C;AAE7C,gDAA8B;AAC9B,sEAAoD;AACpD,wDAAsC;AACtC,qDAAmC;AACnC,sEAAoD;AACpD,0DAAwC;AACxC,0DAAwC;AACxC,qDAAmC;AACnC,8DAA4C;AAC5C,uDAAqC;AACrC,mDAAiC;AACjC,yDAAuC;AACvC,yDAAuC;AACvC,wDAAsC;AACtC,wDAAsC;AACtC,uDAAqC;AACrC,+CAA6B;AAC7B,wDAAsC;AACtC,uDAAqC;AACrC,+CAA6B;AAC7B,0DAAwC;AACxC,oDAAkC;AAClC,wDAAsC;AACtC,qDAAmC;AACnC,wDAAsC;AACtC,oEAAkD;AAClD,oEAAkD;AAClD,gEAA8C;AAC9C,sDAAoC;AACpC,+DAA6C;AAC7C,8CAA4B;AAC5B,+CAA6B;AAC7B,sDAAoC;AACpC,0DAAwC;AACxC,qDAAmC;AACnC,yDAAuC;AACvC,iDAA+B;AAC/B,uDAAqC;AACrC,oDAAkC;AAClC,yDAAuC;AACvC,uDAAqC;AACrC,4DAA0C;AAC1C,0DAAwC;AACxC,2DAAyC;AACzC,yDAAuC;AACvC,4DAA0C;AAC1C,wDAAsC;AACtC,4DAA0C;AAC1C,2DAAyC;AACzC,iEAA+C;AAC/C,uDAAqC;AACrC,qDAAmC;AACnC,yDAAuC;AACvC,2DAAyC;AACzC,sDAAoC;AACpC,iEAA+C;AAC/C,oEAAkD;AAClD,+EAA6D;AAC7D,2FAAyE;AACzE,6DAA2C;AAC3C,0DAAwC;AACxC,2DAAyC;AACzC,0DAAwC;AACxC,oFAAkE;AAClE,oFAAkE;AAClE,gFAA8D;AAC9D,+DAA6C;AAC7C,gEAA8C;AAC9C,mEAAiD;AACjD,8DAA4C;AAC5C,kEAAgD;AAChD,uEAAqD;AACrD,uFAAsF;AAA7E,sIAAA,yBAAyB,OAAA","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Utility\n */\n\n// REMARK:\n// The docs-group-description comments are followed by empty classes with names corresponding to the doc-group.\n// Normally (in committed code) these are commented out.\n// The comments have distinctive strings so that simple search and replace can make the \"real\".\n// This is useful when working on the documentation: When the empty classes are present, VSCode will format the doc comments\n// for and display them when the mouse hovers over the class name.\n\n/**\n * @docs-package-description\n * The core-geometry package contains classes for working with geometry: points, vectors, curves, surfaces, and analytic solids\n */\n/**\n * @docs-group-description CartesianGeometry\n * Points, Vectors, Planes, and Transformations for x,y,z geometry.\n * * Fundamental cartesian geometry objects:\n * * Point2d, Point3d -- points with x,y,z coordinates\n * * Vector2d, Vector3d -- vectors with x,y,z coordinates\n * * Matrix3d -- 3x3 matrix\n * * * commonly used for pure rotations\n * * * scale and skew entries are also allowed.\n * * Transform -- an origin and axes.\n * * Range1d, Range2d, Range3d -- subsets of 1d, 2d, and 3d space bounded by low and high values.\n * * Ray3d -- a ray defined by origin and direction vector\n * * Plane3d -- an abstract base class extended by Plane3dByOriginAndNormal, Plane3dByOriginAndUnitNormal, Point4d, and ClipPlane\n * * Plane3dByOriginAndUnitNormal -- a plane defined by an origin and a single vector which is perpendicular to the plane\n * * plane3dByOriginAndVectors -- a plane defined by an origin and two vectors in the plane.\n * * Angles\n * * Angle -- a strongly typed angle object whose method names make it clear whether input and outputs are degrees or radians.\n * * AngleSweep -- an angular interval\n * * LatitudeLongitudeNumber -- carrier for position and altitude on sphere or ellipsoid\n * * YawPitchAndRollAngles -- 3 angles that define a rotated coordinate system.\n * * Utility classes\n * * FrameBuilder -- construction of coordinate frames from mixed data sources.\n * * ClipPlane -- a single plane\n * * ConvexClipPlaneSet -- an array of planes bounding a convex volume\n * * ClipPlaneSet -- an array of ConvexClipPlaneSet, defining the union of their volumes\n * * BilinearPatch -- twisted quadrilateral defined by 4 points\n * * BarycentricTriangle -- triangle defined by 3 points.\n * * Constant -- various numeric values exported as readonly constants\n */\n// doc:export class CartesianGeometryDoc { }\n/**\n * @docs-group-description ArraysAndInterfaces\n * These classes support array operations and inheritance-based algorithms.\n * * Arrays\n * * GrowableArray -- A carrier for a Float64Array, with methods that hide reallocation of the underlying array as contents are added.\n * * Point2dArray, Point3dArray, Point4dArray, Vector3dArray -- miscellaneous operations on arrays of 2d and 3d points.\n * * Interfaces\n * * GeometryHandler -- a double-dispatch protocol used for efficient implementation of algorithms that work on many geometry types.\n *\n */\n// doc:export class ArraysAndInterfacesDoc { }\n\n/**\n * @docs-group-description Bspline\n * A bspline curve or surface is used for curved freeform geometry defined by controls points (sometimes called poles).\n * * BSplineCurve -- a curve defined by control points (which are not on the curve)\n * * InterpolationCurve -- a curve defined by passthrough points, with \"good\" visual properties\n * * BSplineSurfaceXYZ -- a surface with XYZ\n * * BsplineSurfaceXYZW -- a surface with weighted (rational) XYZ coordinates\n * * KnotVector -- vector of breakpoints in bspline definitions.\n */\n// doc:export class BsplineDoc { }\n\n/**\n * @docs-group-description Curve\n * Curves in the GeometryQuery hierarchy: LineSegment3d, LineString3d, Arc3d, TransitionSpiral3d\n * * CurvePrimitive -- base class for parametric curves\n * * LineSegment3d -- a (bounded) portion of an unbounded line\n * * Arc3d -- a circular or elliptic arc\n * * LineString3d -- a sequence of points joined by line segments\n * * TransitionSpiral -- controlled transition between curvatures\n * * Support classes\n * * PointString3d -- a sequence of isolated points\n * * StrokeOptions -- tolerances to describe stroking accuracy\n * * RecursiveCurveProcessor, RecursiveCurveProcessorWithStack -- algorithmic support for trees with CurvePrimitives at the leaf level.\n */\n// doc:export class CurveDoc { }\n/**\n * @docs-group-description Numerics\n * The Numerics classes have geometric and numeric methods used during large algorithms in other classes.\n */\n// doc:export class NumericsDoc { }\n/**\n * @docs-group-description Polyface\n * A Polyface is a mesh structure with arrays of points that are shared among multiple incident facets.\n */\n// doc:export class PolyfaceDoc { }\n/**\n * @docs-group-description Serialization\n * These classes are related to serialization of geometry classes.\n * * IModelJson.Reader, IModelJson.Writer -- Conversion of in-memory geometry objects to json objects for persistence and transmission.\n */\n// doc:export class SerializationDoc { }\n/**\n * @docs-group-description Solid\n * Analytic Solids in the GeometryQuery hierarchy: Box, Sphere, Cone, TorusPipe, LinearSweep, RotationalSweep, RuledSweep\n * * Box -- a box solid. This is usually rectangular on all faces, but can in one directly like a view frustum\n * * Sphere -- a sphere\n * * Cone -- a cone or cylinder\n * * TorusPipe -- a pipe elbow\n * * LinearSweep -- a linear sweep of a base contour\n * * RotationalSweep -- a rotational sweep of a base contour\n * * RuledSweep -- two or more similarly structured contours joined by linear rule lines.\n */\n// doc:export class SolidDOc { }\n/**\n * @docs-group-description Topology\n * The Topology classes provide adjacency structures used in triangulations.\n */\n// doc:export class TopologyDoc { }\n/**\n * @docs-group-description RangeSearch\n * Support classes for searching collections of ranges.\n */\nexport * from \"./geometry3d/Angle\";\nexport * from \"./geometry3d/AngleSweep\";\nexport * from \"./geometry3d/LongitudeLatitudeAltitude\";\nexport * from \"./geometry3d/BarycentricTriangle\";\nexport * from \"./geometry3d/BilinearPatch\";\nexport * from \"./geometry3d/Ellipsoid\";\nexport * from \"./geometry3d/FrameBuilder\";\nexport * from \"./geometry3d/FrustumAnimation\";\nexport * from \"./geometry3d/GeometryHandler\";\nexport * from \"./geometry3d/GrowableBlockedArray\";\nexport * from \"./geometry3d/GrowableFloat64Array\";\nexport * from \"./geometry3d/GrowableXYArray\";\nexport * from \"./geometry3d/GrowableXYZArray\";\nexport * from \"./geometry3d/IndexedCollectionInterval\";\nexport * from \"./geometry3d/IndexedXYCollection\";\nexport * from \"./geometry3d/IndexedXYZCollection\";\nexport * from \"./geometry3d/Matrix3d\";\nexport * from \"./geometry3d/OrderedRotationAngles\";\nexport * from \"./geometry3d/Plane3d\";\nexport * from \"./geometry3d/Plane3dByOriginAndUnitNormal\";\nexport * from \"./geometry3d/Plane3dByOriginAndVectors\";\nexport * from \"./geometry3d/Point2dArrayCarrier\";\nexport * from \"./geometry3d/Point2dVector2d\";\nexport * from \"./geometry3d/Point3dVector3d\";\nexport * from \"./geometry3d/PointHelpers\";\nexport * from \"./geometry3d/Point3dArrayCarrier\";\nexport * from \"./geometry3d/PolylineOps\";\nexport * from \"./geometry3d/PolygonOps\";\nexport * from \"./geometry3d/Range\";\nexport * from \"./geometry3d/Ray2d\";\nexport * from \"./geometry3d/Ray3d\";\nexport * from \"./geometry3d/Segment1d\";\nexport * from \"./geometry3d/Transform\";\nexport * from \"./geometry3d/UVSurfaceOps\";\nexport * from \"./geometry3d/XYZProps\";\nexport * from \"./geometry3d/YawPitchRollAngles\";\n\nexport * from \"./Geometry\";\nexport * from \"./Constant\";\nexport * from \"./clipping/BooleanClipFactory\";\nexport * from \"./clipping/ClipPlane\";\nexport * from \"./clipping/ConvexClipPlaneSet\";\nexport * from \"./clipping/UnionOfConvexClipPlaneSets\";\nexport * from \"./clipping/ClipPrimitive\";\nexport * from \"./clipping/ClipVector\";\nexport * from \"./clipping/ClipUtils\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./geometry4d/PlaneByOriginAndVectors4d\";\nexport * from \"./geometry4d/Point4d\";\nexport * from \"./geometry4d/Matrix4d\";\nexport * from \"./geometry4d/Map4d\";\nexport * from \"./geometry4d/MomentData\";\nexport * from \"./numerics/BezierPolynomials\";\nexport * from \"./numerics/ClusterableArray\";\nexport * from \"./numerics/Complex\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./numerics/PascalCoefficients\";\nexport * from \"./numerics/Polynomials\";\nexport * from \"./numerics/Quadrature\";\nexport * from \"./numerics/Range1dArray\";\nexport * from \"./numerics/TriDiagonalSystem\";\n\nexport * from \"./curve/Arc3d\";\nexport * from \"./curve/ConstructCurveBetweenCurves\";\nexport * from \"./curve/CoordinateXYZ\";\nexport * from \"./curve/CurveTypes\";\nexport * from \"./curve/CurveChainWithDistanceIndex\";\nexport * from \"./curve/CurveExtendMode\";\nexport * from \"./curve/CurveCollection\";\nexport * from \"./curve/CurveCurve\";\nexport * from \"./curve/CurveLocationDetail\";\nexport * from \"./curve/CurveFactory\";\nexport * from \"./curve/CurveOps\";\nexport * from \"./curve/CurvePrimitive\";\nexport * from \"./curve/CurveProcessor\";\nexport * from \"./curve/GeometryQuery\";\nexport * from \"./curve/LineSegment3d\";\nexport * from \"./curve/LineString3d\";\nexport * from \"./curve/Loop\";\nexport * from \"./curve/OffsetOptions\";\nexport * from \"./curve/ParityRegion\";\nexport * from \"./curve/Path\";\nexport * from \"./curve/RegionMomentsXY\";\nexport * from \"./curve/RegionOps\";\nexport * from \"./curve/PointString3d\";\nexport * from \"./curve/ProxyCurve\";\nexport * from \"./curve/StrokeOptions\";\nexport * from \"./curve/spiral/TransitionSpiral3d\";\nexport * from \"./curve/spiral/IntegratedSpiral3d\";\nexport * from \"./curve/spiral/DirectSpiral3d\";\nexport * from \"./curve/UnionRegion\";\nexport * from \"./curve/Query/StrokeCountMap\";\nexport * from \"./solid/Box\";\nexport * from \"./solid/Cone\";\nexport * from \"./solid/LinearSweep\";\nexport * from \"./solid/RotationalSweep\";\nexport * from \"./solid/RuledSweep\";\nexport * from \"./solid/SolidPrimitive\";\nexport * from \"./solid/Sphere\";\nexport * from \"./solid/SweepContour\";\nexport * from \"./solid/TorusPipe\";\nexport * from \"./bspline/AkimaCurve3d\";\nexport * from \"./bspline/Bezier1dNd\";\nexport * from \"./bspline/BezierCurveBase\";\nexport * from \"./bspline/BezierCurve3d\";\nexport * from \"./bspline/BezierCurve3dH\";\nexport * from \"./bspline/BSplineCurve\";\nexport * from \"./bspline/BSplineCurveOps\";\nexport * from \"./bspline/BSpline1dNd\";\nexport * from \"./bspline/BSplineCurve3dH\";\nexport * from \"./bspline/BSplineSurface\";\nexport * from \"./bspline/InterpolationCurve3d\";\nexport * from \"./bspline/KnotVector\";\nexport * from \"./polyface/AuxData\";\nexport * from \"./polyface/BoxTopology\";\nexport * from \"./polyface/FacetFaceData\";\nexport * from \"./polyface/Polyface\";\nexport * from \"./polyface/FacetLocationDetail\";\nexport * from \"./polyface/IndexedPolyfaceVisitor\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSet\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSetWithOverflow\";\nexport * from \"./polyface/PolyfaceBuilder\";\nexport * from \"./polyface/PolyfaceData\";\nexport * from \"./polyface/PolyfaceQuery\";\nexport * from \"./polyface/PolyfaceClip\";\nexport * from \"./polyface/RangeTree/Point3dArrayRangeTreeContext\";\nexport * from \"./polyface/RangeTree/LineString3dRangeTreeContext\";\nexport * from \"./polyface/RangeTree/PolyfaceRangeTreeContext\";\nexport * from \"./polyface/TaggedNumericData\";\nexport * from \"./topology/SpaceTriangulation\";\nexport * from \"./serialization/IModelJsonSchema\";\nexport * from \"./serialization/DeepCompare\";\nexport * from \"./serialization/GeometrySamples\";\nexport * from \"./serialization/SerializationHelpers\";\nexport { BentleyGeometryFlatBuffer } from \"./serialization/BentleyGeometryFlatBuffer\";\n"]}
@@ -3,43 +3,65 @@
3
3
  */
4
4
  import { BSplineWrapMode } from "../bspline/KnotVector";
5
5
  /**
6
- * `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry.
7
- * @internal
6
+ * The `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry, such as B-spline curves and surfaces.
7
+ * @public
8
8
  */
9
9
  export declare namespace SerializationHelpers {
10
+ /** Interface for data common to B-spline curves and surfaces. */
10
11
  interface BSplineParams {
12
+ /** The number of control points, aka poles. */
11
13
  numPoles: number;
14
+ /** B-spline order, one more than the degree. */
12
15
  order: number;
16
+ /** Whether the B-spline is to be considered closed. */
13
17
  closed?: boolean;
18
+ /** Full knot vector. */
14
19
  knots: number[] | Float64Array;
20
+ /** Wrap mode, for data roundtrip. */
15
21
  wrapMode?: BSplineWrapMode;
16
22
  }
23
+ /** Interface for B-spline curve data. */
17
24
  interface BSplineCurveData {
25
+ /** Control points, aka poles. */
18
26
  poles: number[][] | Float64Array;
27
+ /** The number of coordinates per pole. This is the inner dimension of the poles number array. Possible values: 3, 4. Dimension 4 means the curve is rational, with poles of homogeneous form [wx,wy,wz,w]. */
19
28
  dim: number;
29
+ /** Weights for a rational curve that is specified by parallel arrays of poles and weights. If defined, dim is expected to be 3, and poles are of homogeneous form [wx,wy,wz]. */
20
30
  weights?: number[] | Float64Array;
31
+ /** Knots and other B-spline data. */
21
32
  params: BSplineParams;
22
33
  }
34
+ /** Interface for B-spline surface data. */
23
35
  interface BSplineSurfaceData {
36
+ /** Control points, aka poles in row-major order. */
24
37
  poles: number[][][] | Float64Array;
38
+ /** The number of coordinates per pole. This is the inner dimension of the poles number array. Possible values: 3, 4. Dimension 4 means the surface is rational, with poles of homogeneous form [wx,wy,wz,w]. */
25
39
  dim: number;
40
+ /** Weights for a rational surface that is specified by parallel arrays of poles and weights. If defined, dim is expected to be 3, and poles are of homogeneous form [wx,wy,wz]. */
26
41
  weights?: number[][] | Float64Array;
42
+ /** Knots and other B-spline data with respect to the surface u parameter. uParams.numPoles = # columns (middle dimension) of the poles array. */
27
43
  uParams: BSplineParams;
44
+ /** Knots and other B-spline data with respect to the surface v parameter. vParams.numPoles = # rows (outer dimension) of the poles array. */
28
45
  vParams: BSplineParams;
29
46
  }
47
+ /** Interface of options for import/export. */
30
48
  interface BSplineDataOptions {
49
+ /** Type of output pole/weight arrays. true: structured number array; false: Float64Array; undefined: either. */
31
50
  jsonPoles?: boolean;
51
+ /** Type of output knot arrays. true: number array; false: Float64Array; undefined: either. */
32
52
  jsonKnots?: boolean;
53
+ /** Extraneous knot handling during Import: true: remove them; false | undefined: leave them. Has no effect during Export, which always outputs the extraneous knots. */
33
54
  removeExtraKnots?: boolean;
34
55
  }
35
- /** Constructor with required data. Inputs are captured, not copied. */
56
+ /** Constructor for BSplineCurveData that populates the required data. Inputs are captured, not copied. */
36
57
  function createBSplineCurveData(poles: number[][] | Float64Array, dim: number, knots: number[] | Float64Array, numPoles: number, order: number): BSplineCurveData;
37
- /** Constructor with required data. Inputs are captured, not copied. */
58
+ /** Constructor for BSplineSurfaceData that populates the required data. Inputs are captured, not copied. */
38
59
  function createBSplineSurfaceData(poles: number[][][] | Float64Array, dim: number, uKnots: number[] | Float64Array, uNumPoles: number, uOrder: number, vKnots: number[] | Float64Array, vNumPoles: number, vOrder: number): BSplineSurfaceData;
39
- /** Clone curve data */
60
+ /** Clone B-spline curve data */
40
61
  function cloneBSplineCurveData(source: BSplineCurveData): BSplineCurveData;
41
- /** Clone surface data */
62
+ /** Clone B-spline surface data */
42
63
  function cloneBSplineSurfaceData(source: BSplineSurfaceData): BSplineSurfaceData;
64
+ /** Helper class for preparing geometry data for import. */
43
65
  class Import {
44
66
  /** copy knots, with options to control destination type and extraneous knot removal */
45
67
  private static copyKnots;
@@ -75,6 +97,7 @@ export declare namespace SerializationHelpers {
75
97
  */
76
98
  static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean;
77
99
  }
100
+ /** Helper class for preparing geometry data for export. */
78
101
  class Export {
79
102
  /**
80
103
  * Restore special legacy periodic B-spline knots opened via BSplineWrapMode.OpenByRemovingKnots logic.
@@ -1 +1 @@
1
- {"version":3,"file":"SerializationHelpers.d.ts","sourceRoot":"","sources":["../../../src/serialization/SerializationHelpers.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,eAAe,EAAc,MAAM,uBAAuB,CAAC;AAGpE;;;GAGG;AACH,yBAAiB,oBAAoB,CAAC;IACpC,UAAiB,aAAa;QAC5B,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;QAC/B,QAAQ,CAAC,EAAE,eAAe,CAAC;KAC5B;IACD,UAAiB,gBAAgB;QAC/B,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,YAAY,CAAC;QACjC,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,CAAC,E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;;;;;;;WAaG;QACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;QAmBtC;;;;;;WAMG;eACW,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;QA+CpG;;;;;;WAMG;eACW,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;KA0FzG;IAED,MAAa,MAAM;QACjB;;;;;;;;WAQG;QACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;QA0BvC;;;;;;;WAOG;eACW,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;QA6CpG;;;;;;;WAOG;eACW,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;KAgFzG;CACF"}
1
+ {"version":3,"file":"SerializationHelpers.d.ts","sourceRoot":"","sources":["../../../src/serialization/SerializationHelpers.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,eAAe,EAAc,MAAM,uBAAuB,CAAC;AAGpE;;;GAGG;AACH,yBAAiB,oBAAoB,CAAC;IACpC,iEAAiE;IACjE,UAAiB,aAAa;QAC5B,+CAA+C;QAC/C,QAAQ,EAAE,MAAM,CAAC;QACjB,gDAAgD;QAChD,KAAK,EAAE,MAAM,CAAC;QACd,uDAAuD;QACvD,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,wBAAwB;QACxB,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;QAC/B,qCAAqC;QACrC,QAAQ,CAAC,EAAE,eAAe,CAAC;KAC5B;IACD,yCAAyC;IACzC,UAAiB,gBAAgB;QAC/B,iCAAiC;QACjC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,YAAY,CAAC;QACjC,8MAA8M;QAC9M,GAAG,EAAE,MAAM,CAAC;QACZ,iLAAiL;QAC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G,gBAAgB,CAahF;IAED,kCAAkC;IAClC,SAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAoBtF;IAwKD,2DAA2D;IAC3D,MAAa,MAAM;QACjB,uFAAuF;QACvF,OAAO,CAAC,MAAM,CAAC,SAAS;QAkBxB;;;;;;;;;;;;;WAaG;QACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;QAmBtC;;;;;;WAMG;eACW,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;QA+CpG;;;;;;WAMG;eACW,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;KA0FzG;IAED,2DAA2D;IAC3D,MAAa,MAAM;QACjB;;;;;;;;WAQG;QACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;QA0BvC;;;;;;;WAOG;eACW,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;QA6CpG;;;;;;;WAOG;eACW,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;KAgFzG;CACF"}
@@ -11,22 +11,22 @@ exports.SerializationHelpers = void 0;
11
11
  const KnotVector_1 = require("../bspline/KnotVector");
12
12
  const PointHelpers_1 = require("../geometry3d/PointHelpers");
13
13
  /**
14
- * `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry.
15
- * @internal
14
+ * The `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry, such as B-spline curves and surfaces.
15
+ * @public
16
16
  */
17
17
  var SerializationHelpers;
18
18
  (function (SerializationHelpers) {
19
- /** Constructor with required data. Inputs are captured, not copied. */
19
+ /** Constructor for BSplineCurveData that populates the required data. Inputs are captured, not copied. */
20
20
  function createBSplineCurveData(poles, dim, knots, numPoles, order) {
21
21
  return { poles, dim, params: { numPoles, order, knots } };
22
22
  }
23
23
  SerializationHelpers.createBSplineCurveData = createBSplineCurveData;
24
- /** Constructor with required data. Inputs are captured, not copied. */
24
+ /** Constructor for BSplineSurfaceData that populates the required data. Inputs are captured, not copied. */
25
25
  function createBSplineSurfaceData(poles, dim, uKnots, uNumPoles, uOrder, vKnots, vNumPoles, vOrder) {
26
26
  return { poles, dim, uParams: { numPoles: uNumPoles, order: uOrder, knots: uKnots }, vParams: { numPoles: vNumPoles, order: vOrder, knots: vKnots } };
27
27
  }
28
28
  SerializationHelpers.createBSplineSurfaceData = createBSplineSurfaceData;
29
- /** Clone curve data */
29
+ /** Clone B-spline curve data */
30
30
  function cloneBSplineCurveData(source) {
31
31
  return {
32
32
  poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : PointHelpers_1.NumberArray.copy2d(source.poles),
@@ -42,7 +42,7 @@ var SerializationHelpers;
42
42
  };
43
43
  }
44
44
  SerializationHelpers.cloneBSplineCurveData = cloneBSplineCurveData;
45
- /** Clone surface data */
45
+ /** Clone B-spline surface data */
46
46
  function cloneBSplineSurfaceData(source) {
47
47
  return {
48
48
  poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : PointHelpers_1.NumberArray.copy3d(source.poles),
@@ -65,7 +65,7 @@ var SerializationHelpers;
65
65
  };
66
66
  }
67
67
  SerializationHelpers.cloneBSplineSurfaceData = cloneBSplineSurfaceData;
68
- /** Copy from source to dest */
68
+ /** Copy B-spline curve data from source to dest */
69
69
  function copyBSplineCurveDataPoles(source) {
70
70
  let nPole = 0;
71
71
  let nCoordPerPole = 0;
@@ -112,7 +112,7 @@ var SerializationHelpers;
112
112
  weights = PointHelpers_1.NumberArray.create(source.weights);
113
113
  return { poles, weights };
114
114
  }
115
- /** Copy from source to dest */
115
+ /** Copy B-spline surface data from source to dest */
116
116
  function copyBSplineSurfaceDataPoles(source) {
117
117
  let nPoleRow = 0;
118
118
  let nPolePerRow = 0;
@@ -171,7 +171,7 @@ var SerializationHelpers;
171
171
  }
172
172
  return { poles, weights };
173
173
  }
174
- /** Convert data arrays to the types specified by options. */
174
+ /** Convert B-spline curve data arrays to the types specified by options. */
175
175
  function convertBSplineCurveDataArrays(data, options) {
176
176
  if (undefined !== options?.jsonPoles) {
177
177
  const packedPoles = data.poles instanceof Float64Array;
@@ -195,7 +195,7 @@ var SerializationHelpers;
195
195
  data.params.knots = PointHelpers_1.NumberArray.pack(data.params.knots);
196
196
  }
197
197
  }
198
- /** Convert data arrays to the types specified by options. */
198
+ /** Convert B-spline surface data arrays to the types specified by options. */
199
199
  function convertBSplineSurfaceDataArrays(data, options) {
200
200
  if (undefined !== options?.jsonPoles) {
201
201
  const packedPoles = data.poles instanceof Float64Array;
@@ -224,6 +224,7 @@ var SerializationHelpers;
224
224
  data.vParams.knots = PointHelpers_1.NumberArray.pack(data.vParams.knots);
225
225
  }
226
226
  }
227
+ /** Helper class for preparing geometry data for import. */
227
228
  class Import {
228
229
  /** copy knots, with options to control destination type and extraneous knot removal */
229
230
  static copyKnots(knots, options, iStart, iEnd) {
@@ -420,6 +421,7 @@ var SerializationHelpers;
420
421
  }
421
422
  }
422
423
  SerializationHelpers.Import = Import;
424
+ /** Helper class for preparing geometry data for export. */
423
425
  class Export {
424
426
  /**
425
427
  * Restore special legacy periodic B-spline knots opened via BSplineWrapMode.OpenByRemovingKnots logic.
@@ -1 +1 @@
1
- {"version":3,"file":"SerializationHelpers.js","sourceRoot":"","sources":["../../../src/serialization/SerializationHelpers.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,sDAAoE;AACpE,6DAAyD;AAEzD;;;GAGG;AACH,IAAiB,oBAAoB,CAknBpC;AAlnBD,WAAiB,oBAAoB;IA2BnC,uEAAuE;IACvE,SAAgB,sBAAsB,CAAC,KAAgC,EAAE,GAAW,EAAE,KAA8B,EAAE,QAAgB,EAAE,KAAa;QACnJ,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,QAAQ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AAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAErH,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IAjLY,2BAAM,SAiLlB,CAAA;AACH,CAAC,EAlnBgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAknBpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Serialization\n */\nimport { BSplineWrapMode, KnotVector } from \"../bspline/KnotVector\";\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\n\n/**\n * `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry.\n * @internal\n */\nexport namespace SerializationHelpers {\n export interface BSplineParams {\n numPoles: number;\n order: number;\n closed?: boolean;\n knots: number[] | Float64Array;\n wrapMode?: BSplineWrapMode;\n }\n export interface BSplineCurveData {\n poles: number[][] | Float64Array;\n dim: number; // # coordinates per pole = inner dimension of poles array (3,4)\n weights?: number[] | Float64Array; // if defined, poles are assumed to be weighted and dim 3\n params: BSplineParams;\n }\n export interface BSplineSurfaceData {\n poles: number[][][] | Float64Array;\n dim: number; // # coordinates per pole = inner dimension of poles array (3,4)\n weights?: number[][] | Float64Array; // if defined, poles are assumed to be weighted and dim 3\n uParams: BSplineParams; // uParams.numPoles = # cols (middle dimension) of poles\n vParams: BSplineParams; // vParams.numPoles = # rows (outer dimension) of poles\n }\n export interface BSplineDataOptions {\n jsonPoles?: boolean; // type of output pole/weight arrays. true: structured number array; false: Float64Array; undefined: either\n jsonKnots?: boolean; // type of output knot arrays. true: number array; false: Float64Array; undefined: either\n removeExtraKnots?: boolean; // extraneous knot handling during Import: true: remove them; false | undefined: leave them. Has no effect during Export, which always outputs the extraneous knots.\n }\n\n /** Constructor with required data. Inputs are captured, not copied. */\n export function createBSplineCurveData(poles: number[][] | Float64Array, dim: number, knots: number[] | Float64Array, numPoles: number, order: number): BSplineCurveData {\n return { poles, dim, params: { numPoles, order, knots } };\n }\n\n /** Constructor with required data. Inputs are captured, not copied. */\n export function createBSplineSurfaceData(poles: number[][][] | Float64Array, dim: number, uKnots: number[] | Float64Array, uNumPoles: number, uOrder: number, vKnots: number[] | Float64Array, vNumPoles: number, vOrder: number): BSplineSurfaceData {\n return { poles, dim, uParams: { numPoles: uNumPoles, order: uOrder, knots: uKnots }, vParams: { numPoles: vNumPoles, order: vOrder, knots: vKnots } };\n }\n\n /** Clone curve data */\n export function cloneBSplineCurveData(source: BSplineCurveData): BSplineCurveData {\n return {\n poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy2d(source.poles),\n dim: source.dim,\n weights: source.weights ? source.weights.slice() : undefined,\n params: {\n numPoles: source.params.numPoles,\n order: source.params.order,\n closed: source.params.closed,\n knots: source.params.knots.slice(),\n wrapMode: source.params.wrapMode,\n },\n };\n }\n\n /** Clone surface data */\n export function cloneBSplineSurfaceData(source: BSplineSurfaceData): BSplineSurfaceData {\n return {\n poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy3d(source.poles),\n dim: source.dim,\n weights: source.weights ? ((source.weights instanceof Float64Array) ? source.weights.slice() : NumberArray.copy2d(source.weights)) : undefined,\n uParams: {\n numPoles: source.uParams.numPoles,\n order: source.uParams.order,\n closed: source.uParams.closed,\n knots: source.uParams.knots.slice(),\n wrapMode: source.uParams.wrapMode,\n },\n vParams: {\n numPoles: source.vParams.numPoles,\n order: source.vParams.order,\n closed: source.vParams.closed,\n knots: source.vParams.knots.slice(),\n wrapMode: source.vParams.wrapMode,\n },\n };\n }\n\n /** Copy from source to dest */\n function copyBSplineCurveDataPoles(source: BSplineCurveData): {poles?: number[][], weights?: number[]} {\n let nPole = 0;\n let nCoordPerPole = 0;\n let nPoleCoords = 0;\n let poleDimProduct = 0;\n if (source.poles instanceof Float64Array) {\n nPole = source.params.numPoles;\n nCoordPerPole = source.dim;\n nPoleCoords = source.poles.length;\n poleDimProduct = nPole * nCoordPerPole;\n } else {\n nPole = source.poles.length;\n if (nPole > 0)\n nCoordPerPole = source.poles[0].length;\n nPoleCoords = poleDimProduct = nPole * nCoordPerPole;\n }\n if (0 === poleDimProduct || poleDimProduct > nPoleCoords || nCoordPerPole !== source.dim)\n return {};\n\n let nWeight = 0;\n let nWeightCoords = 0;\n let weightDimProduct = 0;\n if (source.weights !== undefined) {\n if (source.weights instanceof Float64Array) {\n nWeight = source.params.numPoles;\n nWeightCoords = source.weights.length;\n weightDimProduct = nWeight;\n } else {\n nWeight = source.weights.length;\n nWeightCoords = weightDimProduct = nWeight;\n }\n if (0 === weightDimProduct || weightDimProduct > nWeightCoords || nWeight !== nPole)\n return {};\n }\n\n // convert variant source to structured number array\n let poles: number[][] | undefined;\n let weights: number[] | undefined;\n if (source.poles instanceof Float64Array)\n poles = NumberArray.unpack2d(source.poles, nCoordPerPole);\n else\n poles = NumberArray.copy2d(source.poles);\n if (poles && source.weights)\n weights = NumberArray.create(source.weights);\n return {poles, weights};\n }\n\n /** Copy from source to dest */\n function copyBSplineSurfaceDataPoles(source: BSplineSurfaceData): {poles?: number[][][], weights?: number[][]} {\n let nPoleRow = 0;\n let nPolePerRow = 0;\n let nCoordPerPole = 0;\n let nCoords = 0;\n let poleDimProduct = 0;\n if (source.poles instanceof Float64Array) {\n nPoleRow = source.vParams.numPoles;\n nPolePerRow = source.uParams.numPoles;\n nCoordPerPole = source.dim;\n nCoords = source.poles.length;\n poleDimProduct = nPoleRow * nPolePerRow * nCoordPerPole;\n } else {\n nPoleRow = source.poles.length;\n if (nPoleRow > 0)\n nPolePerRow = source.poles[0].length;\n if (nPolePerRow > 0)\n nCoordPerPole = source.poles[0][0].length;\n nCoords = poleDimProduct = nPoleRow * nPolePerRow * nCoordPerPole;\n }\n if (0 === poleDimProduct || poleDimProduct > nCoords || nCoordPerPole !== source.dim)\n return {};\n\n let nWeightRow = 0;\n let nWeightPerRow = 0;\n let nWeightCoords = 0;\n let weightDimProduct = 0;\n if (source.weights !== undefined) {\n if (source.weights instanceof Float64Array) {\n nWeightRow = source.vParams.numPoles;\n nWeightPerRow = source.uParams.numPoles;\n nWeightCoords = source.weights.length;\n weightDimProduct = nWeightRow * nWeightPerRow;\n } else {\n nWeightRow = source.weights.length;\n if (nWeightRow > 0)\n nWeightPerRow = source.weights[0].length;\n nWeightCoords = weightDimProduct = nWeightRow * nWeightPerRow;\n }\n if (0 === weightDimProduct || weightDimProduct > nWeightCoords || nWeightRow !== nPoleRow || nWeightPerRow !== nPolePerRow)\n return {};\n }\n\n // convert variant source to structured number array\n let poles: number[][][] | undefined;\n let weights: number[][] | undefined;\n if (source.poles instanceof Float64Array)\n poles = NumberArray.unpack3d(source.poles, nPolePerRow, nCoordPerPole);\n else\n poles = NumberArray.copy3d(source.poles);\n if (poles && source.weights) {\n if (source.weights instanceof Float64Array)\n weights = NumberArray.unpack2d(source.weights, nWeightPerRow);\n else\n weights = NumberArray.copy2d(source.weights);\n }\n return {poles, weights};\n }\n\n /** Convert data arrays to the types specified by options. */\n function convertBSplineCurveDataArrays(data: BSplineCurveData, options?: BSplineDataOptions) {\n if (undefined !== options?.jsonPoles) {\n const packedPoles = data.poles instanceof Float64Array;\n if (options.jsonPoles && packedPoles)\n data.poles = NumberArray.unpack2d(data.poles as Float64Array, data.dim)!;\n else if (!options.jsonPoles && !packedPoles)\n data.poles = NumberArray.pack(data.poles as number[][]);\n\n if (data.weights) {\n const packedWeights = data.weights instanceof Float64Array;\n if (options.jsonPoles && packedWeights)\n data.weights = NumberArray.create(data.weights);\n else if (!options.jsonPoles && !packedWeights)\n data.weights = NumberArray.pack(data.weights as number[]);\n }\n }\n if (undefined !== options?.jsonKnots) {\n const packedKnots = data.params.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnots)\n data.params.knots = NumberArray.create(data.params.knots);\n else if (!options.jsonKnots && !packedKnots)\n data.params.knots = NumberArray.pack(data.params.knots as number[]);\n }\n }\n\n /** Convert data arrays to the types specified by options. */\n function convertBSplineSurfaceDataArrays(data: BSplineSurfaceData, options?: BSplineDataOptions) {\n if (undefined !== options?.jsonPoles) {\n const packedPoles = data.poles instanceof Float64Array;\n if (options.jsonPoles && packedPoles)\n data.poles = NumberArray.unpack3d(data.poles as Float64Array, data.uParams.numPoles, data.dim)!;\n else if (!options.jsonPoles && !packedPoles)\n data.poles = NumberArray.pack(data.poles as number[][][]);\n\n if (data.weights) {\n const packedWeights = data.weights instanceof Float64Array;\n if (options.jsonPoles && packedWeights)\n data.weights = NumberArray.unpack2d(data.weights as Float64Array, data.uParams.numPoles);\n else if (!options.jsonPoles && !packedWeights)\n data.weights = NumberArray.pack(data.weights as number[][]);\n }\n }\n if (undefined !== options?.jsonKnots) {\n const packedKnotsU = data.uParams.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnotsU)\n data.uParams.knots = NumberArray.create(data.uParams.knots);\n else if (!options.jsonKnots && !packedKnotsU)\n data.uParams.knots = NumberArray.pack(data.uParams.knots as number[]);\n\n const packedKnotsV = data.vParams.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnotsV)\n data.vParams.knots = NumberArray.create(data.vParams.knots);\n else if (!options.jsonKnots && !packedKnotsV)\n data.vParams.knots = NumberArray.pack(data.vParams.knots as number[]);\n }\n }\n\n export class Import {\n /** copy knots, with options to control destination type and extraneous knot removal */\n private static copyKnots(knots: Float64Array | number[], options?: BSplineDataOptions, iStart?: number, iEnd?: number): Float64Array| number[] {\n if (undefined === iStart)\n iStart = 0;\n if (undefined === iEnd)\n iEnd = knots.length;\n if (options?.removeExtraKnots) {\n ++iStart; // ignore start knot\n --iEnd; // ignore end knot\n }\n let newNumKnots = iEnd - iStart;\n if (newNumKnots < 0)\n newNumKnots = 0;\n const newKnots = options?.jsonKnots ? new Array<number>(newNumKnots) : new Float64Array(newNumKnots);\n for (let i = iStart, k = 0; i < iEnd; i++, k++)\n newKnots[k] = knots[i];\n return newKnots;\n }\n\n /**\n * Recognize the special legacy periodic B-spline data of mode BSplineWrapMode.OpenByRemovingKnots, and return the corresponding modern open clamped knots.\n * * Note that the B-spline poles corresponding to the converted knots remain unchanged, but it is assumed that first and last poles are equal.\n * * Example: the legacy 7-point quadratic circle periodic knots {-1/3 0 0 0 1/3 1/3 2/3 2/3 1 1 1 4/3} are converted to open knots {0 0 1/3 1/3 2/3 2/3 1 1}.\n * * General form of knot vector (k = order, d = k-1 = degree, p = numPoles):\n * * * legacy input: {k/2 periodically extended knots} {start knot multiplicity k} {p-k interior knots} {end knot multiplicity k} {d/2 periodically extended knots}\n * * * converted output: {start knot multiplicity d} {p-k interior knots} {end knot multiplicity d}\n * @param knots classic knot vector to test\n * @param numPoles number of poles\n * @param order B-spline order\n * @param options for output type, extraneous knot removal\n * @returns open knots if legacy periodic B-spline input data is recognized; otherwise, undefined\n * @see Export.closeLegacyPeriodicKnots\n */\n private static openLegacyPeriodicKnots(knots: Float64Array | number[], numPoles: number, order: number, options?: BSplineDataOptions): Float64Array | number[] | undefined {\n const numKnots = knots.length;\n if (order < 2 || numPoles + 2 * order - 1 !== numKnots)\n return undefined; // not legacy periodic knots\n\n const startKnot = knots[order - 1];\n const endKnot = knots[numKnots - order];\n const iStart0 = Math.floor(order / 2); // index of first expected multiple of the start knot\n const iEnd0 = iStart0 + numPoles; // index of first expected multiple of the end knot\n const iEnd1 = iEnd0 + order; // one past index of last expected multiple of the end knot\n for (let i = 0; i < order; ++i) {\n if (Math.abs(knots[iStart0 + i] - startKnot) >= KnotVector.knotTolerance)\n return undefined; // start knot multiplicity too small\n if (Math.abs(knots[iEnd0 + i] - endKnot) >= KnotVector.knotTolerance)\n return undefined; // end knot multiplicity too small\n }\n return this.copyKnots(knots, options, iStart0, iEnd1);\n }\n\n /** Prepare imported B-spline curve data for eventual conversion to BSplineCurve3d | BSplineCurve3dH:\n * * Opens legacy \"fake\" periodic data by expanding knots\n * * Opens true periodic data by expanding poles and weights\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineCurveData(data: BSplineCurveData, options?: BSplineDataOptions): boolean {\n let polesExpanded: number[][] | undefined;\n let weightsExpanded: number[] | undefined;\n let knotsCorrected: number[] | Float64Array | undefined;\n data.params.wrapMode = undefined;\n\n if (true === data.params.closed) {\n knotsCorrected = this.openLegacyPeriodicKnots(data.params.knots, data.params.numPoles, data.params.order, options);\n if (undefined !== knotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.params.knots = knotsCorrected;\n data.params.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineCurveDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.params.order - 1; ++i) {\n const wraparoundPt = [];\n for (let j = 0; j < data.dim; ++j)\n wraparoundPt.push(polesExpanded[i][j]);\n polesExpanded.push(wraparoundPt); // append degree wraparound poles\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.params.order - 1; ++i)\n weightsExpanded.push(weightsExpanded[i]); // append degree wraparound weights\n }\n data.params.numPoles += data.params.order - 1;\n data.params.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (options?.removeExtraKnots) {\n if (!knotsCorrected)\n data.params.knots = this.copyKnots(data.params.knots, options);\n }\n\n data.params.closed = undefined; // we are open\n\n convertBSplineCurveDataArrays(data, options);\n return true;\n }\n\n /** Prepare imported B-spline surface data for eventual conversion to BSplineSurface3d | BSplineSurface3dH:\n * * Opens legacy \"fake\" periodic data by expanding knots\n * * Opens true periodic data by expanding poles and weights\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean {\n let polesExpanded: number[][][] | undefined;\n let weightsExpanded: number[][] | undefined;\n let uKnotsCorrected: number[] | Float64Array | undefined;\n let vKnotsCorrected: number[] | Float64Array | undefined;\n data.uParams.wrapMode = data.vParams.wrapMode = undefined;\n\n if (true === data.uParams.closed) {\n uKnotsCorrected = this.openLegacyPeriodicKnots(data.uParams.knots, data.uParams.numPoles, data.uParams.order, options);\n if (undefined !== uKnotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.uParams.knots = uKnotsCorrected;\n data.uParams.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.vParams.numPoles; ++i) { // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j) {\n const wraparoundPt = [];\n for (let k = 0; k < data.dim; ++k)\n wraparoundPt.push(polesExpanded[i][j][k]);\n polesExpanded[i].push(wraparoundPt); // append degreeU wraparound poles to each row\n }\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n weightsExpanded[i].push(weightsExpanded[i][j]); // append degreeU wraparound weights to each row\n }\n data.uParams.numPoles += data.uParams.order - 1;\n data.uParams.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (true === data.vParams.closed) {\n vKnotsCorrected = this.openLegacyPeriodicKnots(data.vParams.knots, data.vParams.numPoles, data.vParams.order, options);\n if (undefined !== vKnotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.vParams.knots = vKnotsCorrected;\n data.vParams.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.vParams.order - 1; ++i) {\n const wrapAroundRow = [];\n for (let j = 0; j < data.uParams.numPoles; ++j) { // #cols\n const wrapAroundPt = [];\n for (let k = 0; k < data.dim; ++k)\n wrapAroundPt.push(polesExpanded[i][j][k]);\n wrapAroundRow.push(wrapAroundPt);\n }\n polesExpanded.push(wrapAroundRow); // append degreeV wraparound rows of poles\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.vParams.order - 1; ++i) {\n const wrapAroundRow = [];\n for (let j = 0; j < data.uParams.numPoles; ++j) // #cols\n wrapAroundRow.push(weightsExpanded[i][j]);\n weightsExpanded.push(wrapAroundRow); // append degreeV wraparound rows of weights\n }\n }\n data.vParams.numPoles += data.vParams.order - 1;\n data.vParams.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (options?.removeExtraKnots) {\n if (!uKnotsCorrected)\n data.uParams.knots = this.copyKnots(data.uParams.knots, options);\n if (!vKnotsCorrected)\n data.vParams.knots = this.copyKnots(data.vParams.knots, options);\n }\n\n data.uParams.closed = data.vParams.closed = undefined; // we are open\n\n convertBSplineSurfaceDataArrays(data, options);\n return true;\n }\n }\n\n export class Export {\n /**\n * Restore special legacy periodic B-spline knots opened via BSplineWrapMode.OpenByRemovingKnots logic.\n * @param knots modern knot vector: {start knot multiplicity d} {p-k interior knots} {end knot multiplicity d}\n * @param order B-spline order\n * @param options for output type\n * @param wrapMode wrap mode of the knots\n * @returns legacy periodic knots (with classic extraneous start/end knot) if wrapMode recognized; otherwise, undefined\n * @see Import.openLegacyPeriodicKnots\n */\n private static closeLegacyPeriodicKnots(knots: Float64Array | number[], order: number, options?: BSplineDataOptions, wrapMode?: BSplineWrapMode): Float64Array | number[] | undefined {\n if (wrapMode === undefined || wrapMode !== BSplineWrapMode.OpenByRemovingKnots)\n return undefined;\n\n const degree = order - 1;\n const leftIndex = degree - 1;\n const rightIndex = knots.length - degree;\n const leftKnot = knots[leftIndex];\n const rightKnot = knots[rightIndex];\n const knotPeriod = rightKnot - leftKnot;\n const newNumKnots = knots.length + degree + 2;\n const newKnots = options?.jsonKnots ? new Array<number>(newNumKnots) : new Float64Array(newNumKnots);\n\n let k = 0;\n for (let i = Math.floor(order / 2); i > 0; --i)\n newKnots[k++] = knots[rightIndex - i] - knotPeriod;\n newKnots[k++] = leftKnot; // extraneous start knot\n for (const knot of knots)\n newKnots[k++] = knot;\n newKnots[k++] = rightKnot; // extraneous end knot\n for (let i = 1; i <= Math.floor(degree / 2); ++i)\n newKnots[k++] = knots[leftIndex + i] + knotPeriod;\n\n return newKnots;\n }\n\n /**\n * Prepare data from a B-spline curve for export.\n * * adds classic extraneous knot at start and end of knot vector\n * * re-closes periodic data based on BSplineWrapMode\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineCurveData(data: BSplineCurveData, options?: BSplineDataOptions): boolean {\n let polesTrimmed: number[][] | undefined;\n let weightsTrimmed: number[] | undefined;\n let knotsCorrected: number[] | Float64Array | undefined;\n data.params.closed = undefined;\n\n switch (data.params.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n knotsCorrected = this.closeLegacyPeriodicKnots(data.params.knots, data.params.order, options, data.params.wrapMode);\n if (undefined === knotsCorrected)\n return false; // invalid input\n data.params.knots = knotsCorrected;\n data.params.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineCurveDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.params.order - 1; ++i)\n polesTrimmed.pop(); // remove last degree poles\n if (weightsTrimmed) {\n for (let i = 0; i < data.params.order - 1; ++i)\n weightsTrimmed.pop(); // remove last degree weights\n }\n data.params.numPoles -= data.params.order - 1;\n data.params.closed = true;\n break;\n }\n }\n\n // always add extraneous knots\n if (!knotsCorrected)\n data.params.knots = KnotVector.copyKnots(data.params.knots, data.params.order - 1, true, data.params.wrapMode);\n\n convertBSplineCurveDataArrays(data, options);\n return true;\n }\n\n /**\n * Prepare data from a B-spline surface for export.\n * * adds classic extraneous knot at start and end of knot vectors\n * * re-closes periodic data based on BSplineWrapMode\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean {\n let polesTrimmed: number[][][] | undefined;\n let weightsTrimmed: number[][] | undefined;\n let uKnotsCorrected: number[] | Float64Array | undefined;\n let vKnotsCorrected: number[] | Float64Array | undefined;\n data.uParams.closed = data.vParams.closed = undefined;\n\n switch (data.uParams.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n uKnotsCorrected = this.closeLegacyPeriodicKnots(data.uParams.knots, data.uParams.order, options, data.uParams.wrapMode);\n if (undefined === uKnotsCorrected)\n return false; // invalid input\n data.uParams.knots = uKnotsCorrected;\n data.uParams.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n polesTrimmed[i].pop(); // remove last degreeU poles from each row\n if (weightsTrimmed) {\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n weightsTrimmed[i].pop(); // remove last degreeU weights from each row\n }\n data.uParams.numPoles -= data.uParams.order - 1;\n data.uParams.closed = true;\n break;\n }\n }\n\n switch (data.vParams.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n vKnotsCorrected = this.closeLegacyPeriodicKnots(data.vParams.knots, data.vParams.order, options, data.vParams.wrapMode);\n if (undefined === vKnotsCorrected)\n return false; // invalid input\n data.vParams.knots = vKnotsCorrected;\n data.vParams.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.vParams.order - 1; ++i)\n polesTrimmed.pop(); // remove last degreeV rows of poles\n if (weightsTrimmed) {\n for (let i = 0; i < data.vParams.order - 1; ++i)\n weightsTrimmed.pop(); // remove last degreeV rows of weights\n }\n data.vParams.numPoles -= data.vParams.order - 1;\n data.vParams.closed = true;\n break;\n }\n }\n\n // always add extraneous knots\n if (!uKnotsCorrected)\n data.uParams.knots = KnotVector.copyKnots(data.uParams.knots, data.uParams.order - 1, true, data.uParams.wrapMode);\n if (!vKnotsCorrected)\n data.vParams.knots = KnotVector.copyKnots(data.vParams.knots, data.vParams.order - 1, true, data.vParams.wrapMode);\n\n convertBSplineSurfaceDataArrays(data, options);\n return true;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"SerializationHelpers.js","sourceRoot":"","sources":["../../../src/serialization/SerializationHelpers.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,sDAAoE;AACpE,6DAAyD;AAEzD;;;GAGG;AACH,IAAiB,oBAAoB,CAyoBpC;AAzoBD,WA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AC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACrH,IAAI,CAAC,eAAe;gBAClB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAErH,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IAjLY,2BAAM,SAiLlB,CAAA;AACH,CAAC,EAzoBgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAyoBpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Serialization\n */\nimport { BSplineWrapMode, KnotVector } from \"../bspline/KnotVector\";\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\n\n/**\n * The `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry, such as B-spline curves and surfaces.\n * @public\n */\nexport namespace SerializationHelpers {\n /** Interface for data common to B-spline curves and surfaces. */\n export interface BSplineParams {\n /** The number of control points, aka poles. */\n numPoles: number;\n /** B-spline order, one more than the degree. */\n order: number;\n /** Whether the B-spline is to be considered closed. */\n closed?: boolean;\n /** Full knot vector. */\n knots: number[] | Float64Array;\n /** Wrap mode, for data roundtrip. */\n wrapMode?: BSplineWrapMode;\n }\n /** Interface for B-spline curve data. */\n export interface BSplineCurveData {\n /** Control points, aka poles. */\n poles: number[][] | Float64Array;\n /** The number of coordinates per pole. This is the inner dimension of the poles number array. Possible values: 3, 4. Dimension 4 means the curve is rational, with poles of homogeneous form [wx,wy,wz,w]. */\n dim: number;\n /** Weights for a rational curve that is specified by parallel arrays of poles and weights. If defined, dim is expected to be 3, and poles are of homogeneous form [wx,wy,wz]. */\n weights?: number[] | Float64Array;\n /** Knots and other B-spline data. */\n params: BSplineParams;\n }\n /** Interface for B-spline surface data. */\n export interface BSplineSurfaceData {\n /** Control points, aka poles in row-major order. */\n poles: number[][][] | Float64Array;\n /** The number of coordinates per pole. This is the inner dimension of the poles number array. Possible values: 3, 4. Dimension 4 means the surface is rational, with poles of homogeneous form [wx,wy,wz,w]. */\n dim: number;\n /** Weights for a rational surface that is specified by parallel arrays of poles and weights. If defined, dim is expected to be 3, and poles are of homogeneous form [wx,wy,wz]. */\n weights?: number[][] | Float64Array;\n /** Knots and other B-spline data with respect to the surface u parameter. uParams.numPoles = # columns (middle dimension) of the poles array. */\n uParams: BSplineParams;\n /** Knots and other B-spline data with respect to the surface v parameter. vParams.numPoles = # rows (outer dimension) of the poles array. */\n vParams: BSplineParams;\n }\n /** Interface of options for import/export. */\n export interface BSplineDataOptions {\n /** Type of output pole/weight arrays. true: structured number array; false: Float64Array; undefined: either. */\n jsonPoles?: boolean;\n /** Type of output knot arrays. true: number array; false: Float64Array; undefined: either. */\n jsonKnots?: boolean;\n /** Extraneous knot handling during Import: true: remove them; false | undefined: leave them. Has no effect during Export, which always outputs the extraneous knots. */\n removeExtraKnots?: boolean;\n }\n\n /** Constructor for BSplineCurveData that populates the required data. Inputs are captured, not copied. */\n export function createBSplineCurveData(poles: number[][] | Float64Array, dim: number, knots: number[] | Float64Array, numPoles: number, order: number): BSplineCurveData {\n return { poles, dim, params: { numPoles, order, knots } };\n }\n\n /** Constructor for BSplineSurfaceData that populates the required data. Inputs are captured, not copied. */\n export function createBSplineSurfaceData(poles: number[][][] | Float64Array, dim: number, uKnots: number[] | Float64Array, uNumPoles: number, uOrder: number, vKnots: number[] | Float64Array, vNumPoles: number, vOrder: number): BSplineSurfaceData {\n return { poles, dim, uParams: { numPoles: uNumPoles, order: uOrder, knots: uKnots }, vParams: { numPoles: vNumPoles, order: vOrder, knots: vKnots } };\n }\n\n /** Clone B-spline curve data */\n export function cloneBSplineCurveData(source: BSplineCurveData): BSplineCurveData {\n return {\n poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy2d(source.poles),\n dim: source.dim,\n weights: source.weights ? source.weights.slice() : undefined,\n params: {\n numPoles: source.params.numPoles,\n order: source.params.order,\n closed: source.params.closed,\n knots: source.params.knots.slice(),\n wrapMode: source.params.wrapMode,\n },\n };\n }\n\n /** Clone B-spline surface data */\n export function cloneBSplineSurfaceData(source: BSplineSurfaceData): BSplineSurfaceData {\n return {\n poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy3d(source.poles),\n dim: source.dim,\n weights: source.weights ? ((source.weights instanceof Float64Array) ? source.weights.slice() : NumberArray.copy2d(source.weights)) : undefined,\n uParams: {\n numPoles: source.uParams.numPoles,\n order: source.uParams.order,\n closed: source.uParams.closed,\n knots: source.uParams.knots.slice(),\n wrapMode: source.uParams.wrapMode,\n },\n vParams: {\n numPoles: source.vParams.numPoles,\n order: source.vParams.order,\n closed: source.vParams.closed,\n knots: source.vParams.knots.slice(),\n wrapMode: source.vParams.wrapMode,\n },\n };\n }\n\n /** Copy B-spline curve data from source to dest */\n function copyBSplineCurveDataPoles(source: BSplineCurveData): {poles?: number[][], weights?: number[]} {\n let nPole = 0;\n let nCoordPerPole = 0;\n let nPoleCoords = 0;\n let poleDimProduct = 0;\n if (source.poles instanceof Float64Array) {\n nPole = source.params.numPoles;\n nCoordPerPole = source.dim;\n nPoleCoords = source.poles.length;\n poleDimProduct = nPole * nCoordPerPole;\n } else {\n nPole = source.poles.length;\n if (nPole > 0)\n nCoordPerPole = source.poles[0].length;\n nPoleCoords = poleDimProduct = nPole * nCoordPerPole;\n }\n if (0 === poleDimProduct || poleDimProduct > nPoleCoords || nCoordPerPole !== source.dim)\n return {};\n\n let nWeight = 0;\n let nWeightCoords = 0;\n let weightDimProduct = 0;\n if (source.weights !== undefined) {\n if (source.weights instanceof Float64Array) {\n nWeight = source.params.numPoles;\n nWeightCoords = source.weights.length;\n weightDimProduct = nWeight;\n } else {\n nWeight = source.weights.length;\n nWeightCoords = weightDimProduct = nWeight;\n }\n if (0 === weightDimProduct || weightDimProduct > nWeightCoords || nWeight !== nPole)\n return {};\n }\n\n // convert variant source to structured number array\n let poles: number[][] | undefined;\n let weights: number[] | undefined;\n if (source.poles instanceof Float64Array)\n poles = NumberArray.unpack2d(source.poles, nCoordPerPole);\n else\n poles = NumberArray.copy2d(source.poles);\n if (poles && source.weights)\n weights = NumberArray.create(source.weights);\n return {poles, weights};\n }\n\n /** Copy B-spline surface data from source to dest */\n function copyBSplineSurfaceDataPoles(source: BSplineSurfaceData): {poles?: number[][][], weights?: number[][]} {\n let nPoleRow = 0;\n let nPolePerRow = 0;\n let nCoordPerPole = 0;\n let nCoords = 0;\n let poleDimProduct = 0;\n if (source.poles instanceof Float64Array) {\n nPoleRow = source.vParams.numPoles;\n nPolePerRow = source.uParams.numPoles;\n nCoordPerPole = source.dim;\n nCoords = source.poles.length;\n poleDimProduct = nPoleRow * nPolePerRow * nCoordPerPole;\n } else {\n nPoleRow = source.poles.length;\n if (nPoleRow > 0)\n nPolePerRow = source.poles[0].length;\n if (nPolePerRow > 0)\n nCoordPerPole = source.poles[0][0].length;\n nCoords = poleDimProduct = nPoleRow * nPolePerRow * nCoordPerPole;\n }\n if (0 === poleDimProduct || poleDimProduct > nCoords || nCoordPerPole !== source.dim)\n return {};\n\n let nWeightRow = 0;\n let nWeightPerRow = 0;\n let nWeightCoords = 0;\n let weightDimProduct = 0;\n if (source.weights !== undefined) {\n if (source.weights instanceof Float64Array) {\n nWeightRow = source.vParams.numPoles;\n nWeightPerRow = source.uParams.numPoles;\n nWeightCoords = source.weights.length;\n weightDimProduct = nWeightRow * nWeightPerRow;\n } else {\n nWeightRow = source.weights.length;\n if (nWeightRow > 0)\n nWeightPerRow = source.weights[0].length;\n nWeightCoords = weightDimProduct = nWeightRow * nWeightPerRow;\n }\n if (0 === weightDimProduct || weightDimProduct > nWeightCoords || nWeightRow !== nPoleRow || nWeightPerRow !== nPolePerRow)\n return {};\n }\n\n // convert variant source to structured number array\n let poles: number[][][] | undefined;\n let weights: number[][] | undefined;\n if (source.poles instanceof Float64Array)\n poles = NumberArray.unpack3d(source.poles, nPolePerRow, nCoordPerPole);\n else\n poles = NumberArray.copy3d(source.poles);\n if (poles && source.weights) {\n if (source.weights instanceof Float64Array)\n weights = NumberArray.unpack2d(source.weights, nWeightPerRow);\n else\n weights = NumberArray.copy2d(source.weights);\n }\n return {poles, weights};\n }\n\n /** Convert B-spline curve data arrays to the types specified by options. */\n function convertBSplineCurveDataArrays(data: BSplineCurveData, options?: BSplineDataOptions) {\n if (undefined !== options?.jsonPoles) {\n const packedPoles = data.poles instanceof Float64Array;\n if (options.jsonPoles && packedPoles)\n data.poles = NumberArray.unpack2d(data.poles as Float64Array, data.dim)!;\n else if (!options.jsonPoles && !packedPoles)\n data.poles = NumberArray.pack(data.poles as number[][]);\n\n if (data.weights) {\n const packedWeights = data.weights instanceof Float64Array;\n if (options.jsonPoles && packedWeights)\n data.weights = NumberArray.create(data.weights);\n else if (!options.jsonPoles && !packedWeights)\n data.weights = NumberArray.pack(data.weights as number[]);\n }\n }\n if (undefined !== options?.jsonKnots) {\n const packedKnots = data.params.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnots)\n data.params.knots = NumberArray.create(data.params.knots);\n else if (!options.jsonKnots && !packedKnots)\n data.params.knots = NumberArray.pack(data.params.knots as number[]);\n }\n }\n\n /** Convert B-spline surface data arrays to the types specified by options. */\n function convertBSplineSurfaceDataArrays(data: BSplineSurfaceData, options?: BSplineDataOptions) {\n if (undefined !== options?.jsonPoles) {\n const packedPoles = data.poles instanceof Float64Array;\n if (options.jsonPoles && packedPoles)\n data.poles = NumberArray.unpack3d(data.poles as Float64Array, data.uParams.numPoles, data.dim)!;\n else if (!options.jsonPoles && !packedPoles)\n data.poles = NumberArray.pack(data.poles as number[][][]);\n\n if (data.weights) {\n const packedWeights = data.weights instanceof Float64Array;\n if (options.jsonPoles && packedWeights)\n data.weights = NumberArray.unpack2d(data.weights as Float64Array, data.uParams.numPoles);\n else if (!options.jsonPoles && !packedWeights)\n data.weights = NumberArray.pack(data.weights as number[][]);\n }\n }\n if (undefined !== options?.jsonKnots) {\n const packedKnotsU = data.uParams.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnotsU)\n data.uParams.knots = NumberArray.create(data.uParams.knots);\n else if (!options.jsonKnots && !packedKnotsU)\n data.uParams.knots = NumberArray.pack(data.uParams.knots as number[]);\n\n const packedKnotsV = data.vParams.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnotsV)\n data.vParams.knots = NumberArray.create(data.vParams.knots);\n else if (!options.jsonKnots && !packedKnotsV)\n data.vParams.knots = NumberArray.pack(data.vParams.knots as number[]);\n }\n }\n\n /** Helper class for preparing geometry data for import. */\n export class Import {\n /** copy knots, with options to control destination type and extraneous knot removal */\n private static copyKnots(knots: Float64Array | number[], options?: BSplineDataOptions, iStart?: number, iEnd?: number): Float64Array| number[] {\n if (undefined === iStart)\n iStart = 0;\n if (undefined === iEnd)\n iEnd = knots.length;\n if (options?.removeExtraKnots) {\n ++iStart; // ignore start knot\n --iEnd; // ignore end knot\n }\n let newNumKnots = iEnd - iStart;\n if (newNumKnots < 0)\n newNumKnots = 0;\n const newKnots = options?.jsonKnots ? new Array<number>(newNumKnots) : new Float64Array(newNumKnots);\n for (let i = iStart, k = 0; i < iEnd; i++, k++)\n newKnots[k] = knots[i];\n return newKnots;\n }\n\n /**\n * Recognize the special legacy periodic B-spline data of mode BSplineWrapMode.OpenByRemovingKnots, and return the corresponding modern open clamped knots.\n * * Note that the B-spline poles corresponding to the converted knots remain unchanged, but it is assumed that first and last poles are equal.\n * * Example: the legacy 7-point quadratic circle periodic knots {-1/3 0 0 0 1/3 1/3 2/3 2/3 1 1 1 4/3} are converted to open knots {0 0 1/3 1/3 2/3 2/3 1 1}.\n * * General form of knot vector (k = order, d = k-1 = degree, p = numPoles):\n * * * legacy input: {k/2 periodically extended knots} {start knot multiplicity k} {p-k interior knots} {end knot multiplicity k} {d/2 periodically extended knots}\n * * * converted output: {start knot multiplicity d} {p-k interior knots} {end knot multiplicity d}\n * @param knots classic knot vector to test\n * @param numPoles number of poles\n * @param order B-spline order\n * @param options for output type, extraneous knot removal\n * @returns open knots if legacy periodic B-spline input data is recognized; otherwise, undefined\n * @see Export.closeLegacyPeriodicKnots\n */\n private static openLegacyPeriodicKnots(knots: Float64Array | number[], numPoles: number, order: number, options?: BSplineDataOptions): Float64Array | number[] | undefined {\n const numKnots = knots.length;\n if (order < 2 || numPoles + 2 * order - 1 !== numKnots)\n return undefined; // not legacy periodic knots\n\n const startKnot = knots[order - 1];\n const endKnot = knots[numKnots - order];\n const iStart0 = Math.floor(order / 2); // index of first expected multiple of the start knot\n const iEnd0 = iStart0 + numPoles; // index of first expected multiple of the end knot\n const iEnd1 = iEnd0 + order; // one past index of last expected multiple of the end knot\n for (let i = 0; i < order; ++i) {\n if (Math.abs(knots[iStart0 + i] - startKnot) >= KnotVector.knotTolerance)\n return undefined; // start knot multiplicity too small\n if (Math.abs(knots[iEnd0 + i] - endKnot) >= KnotVector.knotTolerance)\n return undefined; // end knot multiplicity too small\n }\n return this.copyKnots(knots, options, iStart0, iEnd1);\n }\n\n /** Prepare imported B-spline curve data for eventual conversion to BSplineCurve3d | BSplineCurve3dH:\n * * Opens legacy \"fake\" periodic data by expanding knots\n * * Opens true periodic data by expanding poles and weights\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineCurveData(data: BSplineCurveData, options?: BSplineDataOptions): boolean {\n let polesExpanded: number[][] | undefined;\n let weightsExpanded: number[] | undefined;\n let knotsCorrected: number[] | Float64Array | undefined;\n data.params.wrapMode = undefined;\n\n if (true === data.params.closed) {\n knotsCorrected = this.openLegacyPeriodicKnots(data.params.knots, data.params.numPoles, data.params.order, options);\n if (undefined !== knotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.params.knots = knotsCorrected;\n data.params.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineCurveDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.params.order - 1; ++i) {\n const wraparoundPt = [];\n for (let j = 0; j < data.dim; ++j)\n wraparoundPt.push(polesExpanded[i][j]);\n polesExpanded.push(wraparoundPt); // append degree wraparound poles\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.params.order - 1; ++i)\n weightsExpanded.push(weightsExpanded[i]); // append degree wraparound weights\n }\n data.params.numPoles += data.params.order - 1;\n data.params.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (options?.removeExtraKnots) {\n if (!knotsCorrected)\n data.params.knots = this.copyKnots(data.params.knots, options);\n }\n\n data.params.closed = undefined; // we are open\n\n convertBSplineCurveDataArrays(data, options);\n return true;\n }\n\n /** Prepare imported B-spline surface data for eventual conversion to BSplineSurface3d | BSplineSurface3dH:\n * * Opens legacy \"fake\" periodic data by expanding knots\n * * Opens true periodic data by expanding poles and weights\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean {\n let polesExpanded: number[][][] | undefined;\n let weightsExpanded: number[][] | undefined;\n let uKnotsCorrected: number[] | Float64Array | undefined;\n let vKnotsCorrected: number[] | Float64Array | undefined;\n data.uParams.wrapMode = data.vParams.wrapMode = undefined;\n\n if (true === data.uParams.closed) {\n uKnotsCorrected = this.openLegacyPeriodicKnots(data.uParams.knots, data.uParams.numPoles, data.uParams.order, options);\n if (undefined !== uKnotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.uParams.knots = uKnotsCorrected;\n data.uParams.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.vParams.numPoles; ++i) { // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j) {\n const wraparoundPt = [];\n for (let k = 0; k < data.dim; ++k)\n wraparoundPt.push(polesExpanded[i][j][k]);\n polesExpanded[i].push(wraparoundPt); // append degreeU wraparound poles to each row\n }\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n weightsExpanded[i].push(weightsExpanded[i][j]); // append degreeU wraparound weights to each row\n }\n data.uParams.numPoles += data.uParams.order - 1;\n data.uParams.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (true === data.vParams.closed) {\n vKnotsCorrected = this.openLegacyPeriodicKnots(data.vParams.knots, data.vParams.numPoles, data.vParams.order, options);\n if (undefined !== vKnotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.vParams.knots = vKnotsCorrected;\n data.vParams.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.vParams.order - 1; ++i) {\n const wrapAroundRow = [];\n for (let j = 0; j < data.uParams.numPoles; ++j) { // #cols\n const wrapAroundPt = [];\n for (let k = 0; k < data.dim; ++k)\n wrapAroundPt.push(polesExpanded[i][j][k]);\n wrapAroundRow.push(wrapAroundPt);\n }\n polesExpanded.push(wrapAroundRow); // append degreeV wraparound rows of poles\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.vParams.order - 1; ++i) {\n const wrapAroundRow = [];\n for (let j = 0; j < data.uParams.numPoles; ++j) // #cols\n wrapAroundRow.push(weightsExpanded[i][j]);\n weightsExpanded.push(wrapAroundRow); // append degreeV wraparound rows of weights\n }\n }\n data.vParams.numPoles += data.vParams.order - 1;\n data.vParams.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (options?.removeExtraKnots) {\n if (!uKnotsCorrected)\n data.uParams.knots = this.copyKnots(data.uParams.knots, options);\n if (!vKnotsCorrected)\n data.vParams.knots = this.copyKnots(data.vParams.knots, options);\n }\n\n data.uParams.closed = data.vParams.closed = undefined; // we are open\n\n convertBSplineSurfaceDataArrays(data, options);\n return true;\n }\n }\n\n /** Helper class for preparing geometry data for export. */\n export class Export {\n /**\n * Restore special legacy periodic B-spline knots opened via BSplineWrapMode.OpenByRemovingKnots logic.\n * @param knots modern knot vector: {start knot multiplicity d} {p-k interior knots} {end knot multiplicity d}\n * @param order B-spline order\n * @param options for output type\n * @param wrapMode wrap mode of the knots\n * @returns legacy periodic knots (with classic extraneous start/end knot) if wrapMode recognized; otherwise, undefined\n * @see Import.openLegacyPeriodicKnots\n */\n private static closeLegacyPeriodicKnots(knots: Float64Array | number[], order: number, options?: BSplineDataOptions, wrapMode?: BSplineWrapMode): Float64Array | number[] | undefined {\n if (wrapMode === undefined || wrapMode !== BSplineWrapMode.OpenByRemovingKnots)\n return undefined;\n\n const degree = order - 1;\n const leftIndex = degree - 1;\n const rightIndex = knots.length - degree;\n const leftKnot = knots[leftIndex];\n const rightKnot = knots[rightIndex];\n const knotPeriod = rightKnot - leftKnot;\n const newNumKnots = knots.length + degree + 2;\n const newKnots = options?.jsonKnots ? new Array<number>(newNumKnots) : new Float64Array(newNumKnots);\n\n let k = 0;\n for (let i = Math.floor(order / 2); i > 0; --i)\n newKnots[k++] = knots[rightIndex - i] - knotPeriod;\n newKnots[k++] = leftKnot; // extraneous start knot\n for (const knot of knots)\n newKnots[k++] = knot;\n newKnots[k++] = rightKnot; // extraneous end knot\n for (let i = 1; i <= Math.floor(degree / 2); ++i)\n newKnots[k++] = knots[leftIndex + i] + knotPeriod;\n\n return newKnots;\n }\n\n /**\n * Prepare data from a B-spline curve for export.\n * * adds classic extraneous knot at start and end of knot vector\n * * re-closes periodic data based on BSplineWrapMode\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineCurveData(data: BSplineCurveData, options?: BSplineDataOptions): boolean {\n let polesTrimmed: number[][] | undefined;\n let weightsTrimmed: number[] | undefined;\n let knotsCorrected: number[] | Float64Array | undefined;\n data.params.closed = undefined;\n\n switch (data.params.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n knotsCorrected = this.closeLegacyPeriodicKnots(data.params.knots, data.params.order, options, data.params.wrapMode);\n if (undefined === knotsCorrected)\n return false; // invalid input\n data.params.knots = knotsCorrected;\n data.params.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineCurveDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.params.order - 1; ++i)\n polesTrimmed.pop(); // remove last degree poles\n if (weightsTrimmed) {\n for (let i = 0; i < data.params.order - 1; ++i)\n weightsTrimmed.pop(); // remove last degree weights\n }\n data.params.numPoles -= data.params.order - 1;\n data.params.closed = true;\n break;\n }\n }\n\n // always add extraneous knots\n if (!knotsCorrected)\n data.params.knots = KnotVector.copyKnots(data.params.knots, data.params.order - 1, true, data.params.wrapMode);\n\n convertBSplineCurveDataArrays(data, options);\n return true;\n }\n\n /**\n * Prepare data from a B-spline surface for export.\n * * adds classic extraneous knot at start and end of knot vectors\n * * re-closes periodic data based on BSplineWrapMode\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean {\n let polesTrimmed: number[][][] | undefined;\n let weightsTrimmed: number[][] | undefined;\n let uKnotsCorrected: number[] | Float64Array | undefined;\n let vKnotsCorrected: number[] | Float64Array | undefined;\n data.uParams.closed = data.vParams.closed = undefined;\n\n switch (data.uParams.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n uKnotsCorrected = this.closeLegacyPeriodicKnots(data.uParams.knots, data.uParams.order, options, data.uParams.wrapMode);\n if (undefined === uKnotsCorrected)\n return false; // invalid input\n data.uParams.knots = uKnotsCorrected;\n data.uParams.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n polesTrimmed[i].pop(); // remove last degreeU poles from each row\n if (weightsTrimmed) {\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n weightsTrimmed[i].pop(); // remove last degreeU weights from each row\n }\n data.uParams.numPoles -= data.uParams.order - 1;\n data.uParams.closed = true;\n break;\n }\n }\n\n switch (data.vParams.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n vKnotsCorrected = this.closeLegacyPeriodicKnots(data.vParams.knots, data.vParams.order, options, data.vParams.wrapMode);\n if (undefined === vKnotsCorrected)\n return false; // invalid input\n data.vParams.knots = vKnotsCorrected;\n data.vParams.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.vParams.order - 1; ++i)\n polesTrimmed.pop(); // remove last degreeV rows of poles\n if (weightsTrimmed) {\n for (let i = 0; i < data.vParams.order - 1; ++i)\n weightsTrimmed.pop(); // remove last degreeV rows of weights\n }\n data.vParams.numPoles -= data.vParams.order - 1;\n data.vParams.closed = true;\n break;\n }\n }\n\n // always add extraneous knots\n if (!uKnotsCorrected)\n data.uParams.knots = KnotVector.copyKnots(data.uParams.knots, data.uParams.order - 1, true, data.uParams.wrapMode);\n if (!vKnotsCorrected)\n data.vParams.knots = KnotVector.copyKnots(data.vParams.knots, data.vParams.order - 1, true, data.vParams.wrapMode);\n\n convertBSplineSurfaceDataArrays(data, options);\n return true;\n }\n }\n}\n"]}
@@ -229,5 +229,6 @@ export * from "./topology/SpaceTriangulation";
229
229
  export * from "./serialization/IModelJsonSchema";
230
230
  export * from "./serialization/DeepCompare";
231
231
  export * from "./serialization/GeometrySamples";
232
+ export * from "./serialization/SerializationHelpers";
232
233
  export { BentleyGeometryFlatBuffer } from "./serialization/BentleyGeometryFlatBuffer";
233
234
  //# sourceMappingURL=core-geometry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-geometry.d.ts","sourceRoot":"","sources":["../../src/core-geometry.ts"],"names":[],"mappings":"AAKA;;GAEG;AASH;;;GAGG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;;;;GASG;AAGH;;;;;;;;GAQG;AAGH;;;;;;;;;;;;GAYG;AAEH;;;GAGG;AAEH;;;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Ac,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC"}
@@ -248,5 +248,6 @@ export * from "./topology/SpaceTriangulation";
248
248
  export * from "./serialization/IModelJsonSchema";
249
249
  export * from "./serialization/DeepCompare";
250
250
  export * from "./serialization/GeometrySamples";
251
+ export * from "./serialization/SerializationHelpers";
251
252
  export { BentleyGeometryFlatBuffer } from "./serialization/BentleyGeometryFlatBuffer";
252
253
  //# sourceMappingURL=core-geometry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-geometry.js","sourceRoot":"","sources":["../../src/core-geometry.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,UAAU;AACV,+GAA+G;AAC/G,wDAAwD;AACxD,+FAA+F;AAC/F,6HAA6H;AAC7H,kEAAkE;AAElE;;;GAGG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,4CAA4C;AAC5C;;;;;;;;;GASG;AACH,8CAA8C;AAE9C;;;;;;;;GAQG;AACH,kCAAkC;AAElC;;;;;;;;;;;;GAYG;AACH,gCAAgC;AAChC;;;GAGG;AACH,mCAAmC;AACnC;;;GAGG;AACH,mCAAmC;AACnC;;;;GAIG;AACH,wCAAwC;AACxC;;;;;;;;;;GAUG;AACH,gCAAgC;AAChC;;;GAGG;AACH,mCAAmC;AACnC;;;GAGG;AACH,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,C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AAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0DAA0D,CAAC;AACzE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mDAAmD,CAAC;AAClE,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Utility\n */\n\n// REMARK:\n// The docs-group-description comments are followed by empty classes with names corresponding to the doc-group.\n// Normally (in committed code) these are commented out.\n// The comments have distinctive strings so that simple search and replace can make the \"real\".\n// This is useful when working on the documentation: When the empty classes are present, VSCode will format the doc comments\n// for and display them when the mouse hovers over the class name.\n\n/**\n * @docs-package-description\n * The core-geometry package contains classes for working with geometry: points, vectors, curves, surfaces, and analytic solids\n */\n/**\n * @docs-group-description CartesianGeometry\n * Points, Vectors, Planes, and Transformations for x,y,z geometry.\n * * Fundamental cartesian geometry objects:\n * * Point2d, Point3d -- points with x,y,z coordinates\n * * Vector2d, Vector3d -- vectors with x,y,z coordinates\n * * Matrix3d -- 3x3 matrix\n * * * commonly used for pure rotations\n * * * scale and skew entries are also allowed.\n * * Transform -- an origin and axes.\n * * Range1d, Range2d, Range3d -- subsets of 1d, 2d, and 3d space bounded by low and high values.\n * * Ray3d -- a ray defined by origin and direction vector\n * * Plane3d -- an abstract base class extended by Plane3dByOriginAndNormal, Plane3dByOriginAndUnitNormal, Point4d, and ClipPlane\n * * Plane3dByOriginAndUnitNormal -- a plane defined by an origin and a single vector which is perpendicular to the plane\n * * plane3dByOriginAndVectors -- a plane defined by an origin and two vectors in the plane.\n * * Angles\n * * Angle -- a strongly typed angle object whose method names make it clear whether input and outputs are degrees or radians.\n * * AngleSweep -- an angular interval\n * * LatitudeLongitudeNumber -- carrier for position and altitude on sphere or ellipsoid\n * * YawPitchAndRollAngles -- 3 angles that define a rotated coordinate system.\n * * Utility classes\n * * FrameBuilder -- construction of coordinate frames from mixed data sources.\n * * ClipPlane -- a single plane\n * * ConvexClipPlaneSet -- an array of planes bounding a convex volume\n * * ClipPlaneSet -- an array of ConvexClipPlaneSet, defining the union of their volumes\n * * BilinearPatch -- twisted quadrilateral defined by 4 points\n * * BarycentricTriangle -- triangle defined by 3 points.\n * * Constant -- various numeric values exported as readonly constants\n */\n// doc:export class CartesianGeometryDoc { }\n/**\n * @docs-group-description ArraysAndInterfaces\n * These classes support array operations and inheritance-based algorithms.\n * * Arrays\n * * GrowableArray -- A carrier for a Float64Array, with methods that hide reallocation of the underlying array as contents are added.\n * * Point2dArray, Point3dArray, Point4dArray, Vector3dArray -- miscellaneous operations on arrays of 2d and 3d points.\n * * Interfaces\n * * GeometryHandler -- a double-dispatch protocol used for efficient implementation of algorithms that work on many geometry types.\n *\n */\n// doc:export class ArraysAndInterfacesDoc { }\n\n/**\n * @docs-group-description Bspline\n * A bspline curve or surface is used for curved freeform geometry defined by controls points (sometimes called poles).\n * * BSplineCurve -- a curve defined by control points (which are not on the curve)\n * * InterpolationCurve -- a curve defined by passthrough points, with \"good\" visual properties\n * * BSplineSurfaceXYZ -- a surface with XYZ\n * * BsplineSurfaceXYZW -- a surface with weighted (rational) XYZ coordinates\n * * KnotVector -- vector of breakpoints in bspline definitions.\n */\n// doc:export class BsplineDoc { }\n\n/**\n * @docs-group-description Curve\n * Curves in the GeometryQuery hierarchy: LineSegment3d, LineString3d, Arc3d, TransitionSpiral3d\n * * CurvePrimitive -- base class for parametric curves\n * * LineSegment3d -- a (bounded) portion of an unbounded line\n * * Arc3d -- a circular or elliptic arc\n * * LineString3d -- a sequence of points joined by line segments\n * * TransitionSpiral -- controlled transition between curvatures\n * * Support classes\n * * PointString3d -- a sequence of isolated points\n * * StrokeOptions -- tolerances to describe stroking accuracy\n * * RecursiveCurveProcessor, RecursiveCurveProcessorWithStack -- algorithmic support for trees with CurvePrimitives at the leaf level.\n */\n// doc:export class CurveDoc { }\n/**\n * @docs-group-description Numerics\n * The Numerics classes have geometric and numeric methods used during large algorithms in other classes.\n */\n// doc:export class NumericsDoc { }\n/**\n * @docs-group-description Polyface\n * A Polyface is a mesh structure with arrays of points that are shared among multiple incident facets.\n */\n// doc:export class PolyfaceDoc { }\n/**\n * @docs-group-description Serialization\n * These classes are related to serialization of geometry classes.\n * * IModelJson.Reader, IModelJson.Writer -- Conversion of in-memory geometry objects to json objects for persistence and transmission.\n */\n// doc:export class SerializationDoc { }\n/**\n * @docs-group-description Solid\n * Analytic Solids in the GeometryQuery hierarchy: Box, Sphere, Cone, TorusPipe, LinearSweep, RotationalSweep, RuledSweep\n * * Box -- a box solid. This is usually rectangular on all faces, but can in one directly like a view frustum\n * * Sphere -- a sphere\n * * Cone -- a cone or cylinder\n * * TorusPipe -- a pipe elbow\n * * LinearSweep -- a linear sweep of a base contour\n * * RotationalSweep -- a rotational sweep of a base contour\n * * RuledSweep -- two or more similarly structured contours joined by linear rule lines.\n */\n// doc:export class SolidDOc { }\n/**\n * @docs-group-description Topology\n * The Topology classes provide adjacency structures used in triangulations.\n */\n// doc:export class TopologyDoc { }\n/**\n * @docs-group-description RangeSearch\n * Support classes for searching collections of ranges.\n */\nexport * from \"./geometry3d/Angle\";\nexport * from \"./geometry3d/AngleSweep\";\nexport * from \"./geometry3d/LongitudeLatitudeAltitude\";\nexport * from \"./geometry3d/BarycentricTriangle\";\nexport * from \"./geometry3d/BilinearPatch\";\nexport * from \"./geometry3d/Ellipsoid\";\nexport * from \"./geometry3d/FrameBuilder\";\nexport * from \"./geometry3d/FrustumAnimation\";\nexport * from \"./geometry3d/GeometryHandler\";\nexport * from \"./geometry3d/GrowableBlockedArray\";\nexport * from \"./geometry3d/GrowableFloat64Array\";\nexport * from \"./geometry3d/GrowableXYArray\";\nexport * from \"./geometry3d/GrowableXYZArray\";\nexport * from \"./geometry3d/IndexedCollectionInterval\";\nexport * from \"./geometry3d/IndexedXYCollection\";\nexport * from \"./geometry3d/IndexedXYZCollection\";\nexport * from \"./geometry3d/Matrix3d\";\nexport * from \"./geometry3d/OrderedRotationAngles\";\nexport * from \"./geometry3d/Plane3d\";\nexport * from \"./geometry3d/Plane3dByOriginAndUnitNormal\";\nexport * from \"./geometry3d/Plane3dByOriginAndVectors\";\nexport * from \"./geometry3d/Point2dArrayCarrier\";\nexport * from \"./geometry3d/Point2dVector2d\";\nexport * from \"./geometry3d/Point3dVector3d\";\nexport * from \"./geometry3d/PointHelpers\";\nexport * from \"./geometry3d/Point3dArrayCarrier\";\nexport * from \"./geometry3d/PolylineOps\";\nexport * from \"./geometry3d/PolygonOps\";\nexport * from \"./geometry3d/Range\";\nexport * from \"./geometry3d/Ray2d\";\nexport * from \"./geometry3d/Ray3d\";\nexport * from \"./geometry3d/Segment1d\";\nexport * from \"./geometry3d/Transform\";\nexport * from \"./geometry3d/UVSurfaceOps\";\nexport * from \"./geometry3d/XYZProps\";\nexport * from \"./geometry3d/YawPitchRollAngles\";\n\nexport * from \"./Geometry\";\nexport * from \"./Constant\";\nexport * from \"./clipping/BooleanClipFactory\";\nexport * from \"./clipping/ClipPlane\";\nexport * from \"./clipping/ConvexClipPlaneSet\";\nexport * from \"./clipping/UnionOfConvexClipPlaneSets\";\nexport * from \"./clipping/ClipPrimitive\";\nexport * from \"./clipping/ClipVector\";\nexport * from \"./clipping/ClipUtils\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./geometry4d/PlaneByOriginAndVectors4d\";\nexport * from \"./geometry4d/Point4d\";\nexport * from \"./geometry4d/Matrix4d\";\nexport * from \"./geometry4d/Map4d\";\nexport * from \"./geometry4d/MomentData\";\nexport * from \"./numerics/BezierPolynomials\";\nexport * from \"./numerics/ClusterableArray\";\nexport * from \"./numerics/Complex\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./numerics/PascalCoefficients\";\nexport * from \"./numerics/Polynomials\";\nexport * from \"./numerics/Quadrature\";\nexport * from \"./numerics/Range1dArray\";\nexport * from \"./numerics/TriDiagonalSystem\";\n\nexport * from \"./curve/Arc3d\";\nexport * from \"./curve/ConstructCurveBetweenCurves\";\nexport * from \"./curve/CoordinateXYZ\";\nexport * from \"./curve/CurveTypes\";\nexport * from \"./curve/CurveChainWithDistanceIndex\";\nexport * from \"./curve/CurveExtendMode\";\nexport * from \"./curve/CurveCollection\";\nexport * from \"./curve/CurveCurve\";\nexport * from \"./curve/CurveLocationDetail\";\nexport * from \"./curve/CurveFactory\";\nexport * from \"./curve/CurveOps\";\nexport * from \"./curve/CurvePrimitive\";\nexport * from \"./curve/CurveProcessor\";\nexport * from \"./curve/GeometryQuery\";\nexport * from \"./curve/LineSegment3d\";\nexport * from \"./curve/LineString3d\";\nexport * from \"./curve/Loop\";\nexport * from \"./curve/OffsetOptions\";\nexport * from \"./curve/ParityRegion\";\nexport * from \"./curve/Path\";\nexport * from \"./curve/RegionMomentsXY\";\nexport * from \"./curve/RegionOps\";\nexport * from \"./curve/PointString3d\";\nexport * from \"./curve/ProxyCurve\";\nexport * from \"./curve/StrokeOptions\";\nexport * from \"./curve/spiral/TransitionSpiral3d\";\nexport * from \"./curve/spiral/IntegratedSpiral3d\";\nexport * from \"./curve/spiral/DirectSpiral3d\";\nexport * from \"./curve/UnionRegion\";\nexport * from \"./curve/Query/StrokeCountMap\";\nexport * from \"./solid/Box\";\nexport * from \"./solid/Cone\";\nexport * from \"./solid/LinearSweep\";\nexport * from \"./solid/RotationalSweep\";\nexport * from \"./solid/RuledSweep\";\nexport * from \"./solid/SolidPrimitive\";\nexport * from \"./solid/Sphere\";\nexport * from \"./solid/SweepContour\";\nexport * from \"./solid/TorusPipe\";\nexport * from \"./bspline/AkimaCurve3d\";\nexport * from \"./bspline/Bezier1dNd\";\nexport * from \"./bspline/BezierCurveBase\";\nexport * from \"./bspline/BezierCurve3d\";\nexport * from \"./bspline/BezierCurve3dH\";\nexport * from \"./bspline/BSplineCurve\";\nexport * from \"./bspline/BSplineCurveOps\";\nexport * from \"./bspline/BSpline1dNd\";\nexport * from \"./bspline/BSplineCurve3dH\";\nexport * from \"./bspline/BSplineSurface\";\nexport * from \"./bspline/InterpolationCurve3d\";\nexport * from \"./bspline/KnotVector\";\nexport * from \"./polyface/AuxData\";\nexport * from \"./polyface/BoxTopology\";\nexport * from \"./polyface/FacetFaceData\";\nexport * from \"./polyface/Polyface\";\nexport * from \"./polyface/FacetLocationDetail\";\nexport * from \"./polyface/IndexedPolyfaceVisitor\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSet\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSetWithOverflow\";\nexport * from \"./polyface/PolyfaceBuilder\";\nexport * from \"./polyface/PolyfaceData\";\nexport * from \"./polyface/PolyfaceQuery\";\nexport * from \"./polyface/PolyfaceClip\";\nexport * from \"./polyface/RangeTree/Point3dArrayRangeTreeContext\";\nexport * from \"./polyface/RangeTree/LineString3dRangeTreeContext\";\nexport * from \"./polyface/RangeTree/PolyfaceRangeTreeContext\";\nexport * from \"./polyface/TaggedNumericData\";\nexport * from \"./topology/SpaceTriangulation\";\nexport * from \"./serialization/IModelJsonSchema\";\nexport * from \"./serialization/DeepCompare\";\nexport * from \"./serialization/GeometrySamples\";\nexport { BentleyGeometryFlatBuffer } from \"./serialization/BentleyGeometryFlatBuffer\";\n"]}
1
+ {"version":3,"file":"core-geometry.js","sourceRoot":"","sources":["../../src/core-geometry.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,UAAU;AACV,+GAA+G;AAC/G,wDAAwD;AACxD,+FAA+F;AAC/F,6HAA6H;AAC7H,kEAAkE;AAElE;;;GAGG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,4CAA4C;AAC5C;;;;;;;;;GASG;AACH,8CAA8C;AAE9C;;;;;;;;GAQG;AACH,kCAAkC;AAElC;;;;;;;;;;;;GAYG;AACH,gCAAgC;AAChC;;;GAGG;AACH,mCAAmC;AACnC;;;GAGG;AACH,mCAAmC;AACnC;;;;GAIG;AACH,wCAAwC;AACxC;;;;;;;;;;GAUG;AACH,gCAAgC;AAChC;;;GAGG;AACH,mCAAmC;AACnC;;;GAGG;AACH,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,c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B,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0DAA0D,CAAC;AACzE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mDAAmD,CAAC;AAClE,cAAc,mDAAmD,CAAC;AAClE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Utility\n */\n\n// REMARK:\n// The docs-group-description comments are followed by empty classes with names corresponding to the doc-group.\n// Normally (in committed code) these are commented out.\n// The comments have distinctive strings so that simple search and replace can make the \"real\".\n// This is useful when working on the documentation: When the empty classes are present, VSCode will format the doc comments\n// for and display them when the mouse hovers over the class name.\n\n/**\n * @docs-package-description\n * The core-geometry package contains classes for working with geometry: points, vectors, curves, surfaces, and analytic solids\n */\n/**\n * @docs-group-description CartesianGeometry\n * Points, Vectors, Planes, and Transformations for x,y,z geometry.\n * * Fundamental cartesian geometry objects:\n * * Point2d, Point3d -- points with x,y,z coordinates\n * * Vector2d, Vector3d -- vectors with x,y,z coordinates\n * * Matrix3d -- 3x3 matrix\n * * * commonly used for pure rotations\n * * * scale and skew entries are also allowed.\n * * Transform -- an origin and axes.\n * * Range1d, Range2d, Range3d -- subsets of 1d, 2d, and 3d space bounded by low and high values.\n * * Ray3d -- a ray defined by origin and direction vector\n * * Plane3d -- an abstract base class extended by Plane3dByOriginAndNormal, Plane3dByOriginAndUnitNormal, Point4d, and ClipPlane\n * * Plane3dByOriginAndUnitNormal -- a plane defined by an origin and a single vector which is perpendicular to the plane\n * * plane3dByOriginAndVectors -- a plane defined by an origin and two vectors in the plane.\n * * Angles\n * * Angle -- a strongly typed angle object whose method names make it clear whether input and outputs are degrees or radians.\n * * AngleSweep -- an angular interval\n * * LatitudeLongitudeNumber -- carrier for position and altitude on sphere or ellipsoid\n * * YawPitchAndRollAngles -- 3 angles that define a rotated coordinate system.\n * * Utility classes\n * * FrameBuilder -- construction of coordinate frames from mixed data sources.\n * * ClipPlane -- a single plane\n * * ConvexClipPlaneSet -- an array of planes bounding a convex volume\n * * ClipPlaneSet -- an array of ConvexClipPlaneSet, defining the union of their volumes\n * * BilinearPatch -- twisted quadrilateral defined by 4 points\n * * BarycentricTriangle -- triangle defined by 3 points.\n * * Constant -- various numeric values exported as readonly constants\n */\n// doc:export class CartesianGeometryDoc { }\n/**\n * @docs-group-description ArraysAndInterfaces\n * These classes support array operations and inheritance-based algorithms.\n * * Arrays\n * * GrowableArray -- A carrier for a Float64Array, with methods that hide reallocation of the underlying array as contents are added.\n * * Point2dArray, Point3dArray, Point4dArray, Vector3dArray -- miscellaneous operations on arrays of 2d and 3d points.\n * * Interfaces\n * * GeometryHandler -- a double-dispatch protocol used for efficient implementation of algorithms that work on many geometry types.\n *\n */\n// doc:export class ArraysAndInterfacesDoc { }\n\n/**\n * @docs-group-description Bspline\n * A bspline curve or surface is used for curved freeform geometry defined by controls points (sometimes called poles).\n * * BSplineCurve -- a curve defined by control points (which are not on the curve)\n * * InterpolationCurve -- a curve defined by passthrough points, with \"good\" visual properties\n * * BSplineSurfaceXYZ -- a surface with XYZ\n * * BsplineSurfaceXYZW -- a surface with weighted (rational) XYZ coordinates\n * * KnotVector -- vector of breakpoints in bspline definitions.\n */\n// doc:export class BsplineDoc { }\n\n/**\n * @docs-group-description Curve\n * Curves in the GeometryQuery hierarchy: LineSegment3d, LineString3d, Arc3d, TransitionSpiral3d\n * * CurvePrimitive -- base class for parametric curves\n * * LineSegment3d -- a (bounded) portion of an unbounded line\n * * Arc3d -- a circular or elliptic arc\n * * LineString3d -- a sequence of points joined by line segments\n * * TransitionSpiral -- controlled transition between curvatures\n * * Support classes\n * * PointString3d -- a sequence of isolated points\n * * StrokeOptions -- tolerances to describe stroking accuracy\n * * RecursiveCurveProcessor, RecursiveCurveProcessorWithStack -- algorithmic support for trees with CurvePrimitives at the leaf level.\n */\n// doc:export class CurveDoc { }\n/**\n * @docs-group-description Numerics\n * The Numerics classes have geometric and numeric methods used during large algorithms in other classes.\n */\n// doc:export class NumericsDoc { }\n/**\n * @docs-group-description Polyface\n * A Polyface is a mesh structure with arrays of points that are shared among multiple incident facets.\n */\n// doc:export class PolyfaceDoc { }\n/**\n * @docs-group-description Serialization\n * These classes are related to serialization of geometry classes.\n * * IModelJson.Reader, IModelJson.Writer -- Conversion of in-memory geometry objects to json objects for persistence and transmission.\n */\n// doc:export class SerializationDoc { }\n/**\n * @docs-group-description Solid\n * Analytic Solids in the GeometryQuery hierarchy: Box, Sphere, Cone, TorusPipe, LinearSweep, RotationalSweep, RuledSweep\n * * Box -- a box solid. This is usually rectangular on all faces, but can in one directly like a view frustum\n * * Sphere -- a sphere\n * * Cone -- a cone or cylinder\n * * TorusPipe -- a pipe elbow\n * * LinearSweep -- a linear sweep of a base contour\n * * RotationalSweep -- a rotational sweep of a base contour\n * * RuledSweep -- two or more similarly structured contours joined by linear rule lines.\n */\n// doc:export class SolidDOc { }\n/**\n * @docs-group-description Topology\n * The Topology classes provide adjacency structures used in triangulations.\n */\n// doc:export class TopologyDoc { }\n/**\n * @docs-group-description RangeSearch\n * Support classes for searching collections of ranges.\n */\nexport * from \"./geometry3d/Angle\";\nexport * from \"./geometry3d/AngleSweep\";\nexport * from \"./geometry3d/LongitudeLatitudeAltitude\";\nexport * from \"./geometry3d/BarycentricTriangle\";\nexport * from \"./geometry3d/BilinearPatch\";\nexport * from \"./geometry3d/Ellipsoid\";\nexport * from \"./geometry3d/FrameBuilder\";\nexport * from \"./geometry3d/FrustumAnimation\";\nexport * from \"./geometry3d/GeometryHandler\";\nexport * from \"./geometry3d/GrowableBlockedArray\";\nexport * from \"./geometry3d/GrowableFloat64Array\";\nexport * from \"./geometry3d/GrowableXYArray\";\nexport * from \"./geometry3d/GrowableXYZArray\";\nexport * from \"./geometry3d/IndexedCollectionInterval\";\nexport * from \"./geometry3d/IndexedXYCollection\";\nexport * from \"./geometry3d/IndexedXYZCollection\";\nexport * from \"./geometry3d/Matrix3d\";\nexport * from \"./geometry3d/OrderedRotationAngles\";\nexport * from \"./geometry3d/Plane3d\";\nexport * from \"./geometry3d/Plane3dByOriginAndUnitNormal\";\nexport * from \"./geometry3d/Plane3dByOriginAndVectors\";\nexport * from \"./geometry3d/Point2dArrayCarrier\";\nexport * from \"./geometry3d/Point2dVector2d\";\nexport * from \"./geometry3d/Point3dVector3d\";\nexport * from \"./geometry3d/PointHelpers\";\nexport * from \"./geometry3d/Point3dArrayCarrier\";\nexport * from \"./geometry3d/PolylineOps\";\nexport * from \"./geometry3d/PolygonOps\";\nexport * from \"./geometry3d/Range\";\nexport * from \"./geometry3d/Ray2d\";\nexport * from \"./geometry3d/Ray3d\";\nexport * from \"./geometry3d/Segment1d\";\nexport * from \"./geometry3d/Transform\";\nexport * from \"./geometry3d/UVSurfaceOps\";\nexport * from \"./geometry3d/XYZProps\";\nexport * from \"./geometry3d/YawPitchRollAngles\";\n\nexport * from \"./Geometry\";\nexport * from \"./Constant\";\nexport * from \"./clipping/BooleanClipFactory\";\nexport * from \"./clipping/ClipPlane\";\nexport * from \"./clipping/ConvexClipPlaneSet\";\nexport * from \"./clipping/UnionOfConvexClipPlaneSets\";\nexport * from \"./clipping/ClipPrimitive\";\nexport * from \"./clipping/ClipVector\";\nexport * from \"./clipping/ClipUtils\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./geometry4d/PlaneByOriginAndVectors4d\";\nexport * from \"./geometry4d/Point4d\";\nexport * from \"./geometry4d/Matrix4d\";\nexport * from \"./geometry4d/Map4d\";\nexport * from \"./geometry4d/MomentData\";\nexport * from \"./numerics/BezierPolynomials\";\nexport * from \"./numerics/ClusterableArray\";\nexport * from \"./numerics/Complex\";\nexport * from \"./numerics/ConvexPolygon2d\";\nexport * from \"./numerics/PascalCoefficients\";\nexport * from \"./numerics/Polynomials\";\nexport * from \"./numerics/Quadrature\";\nexport * from \"./numerics/Range1dArray\";\nexport * from \"./numerics/TriDiagonalSystem\";\n\nexport * from \"./curve/Arc3d\";\nexport * from \"./curve/ConstructCurveBetweenCurves\";\nexport * from \"./curve/CoordinateXYZ\";\nexport * from \"./curve/CurveTypes\";\nexport * from \"./curve/CurveChainWithDistanceIndex\";\nexport * from \"./curve/CurveExtendMode\";\nexport * from \"./curve/CurveCollection\";\nexport * from \"./curve/CurveCurve\";\nexport * from \"./curve/CurveLocationDetail\";\nexport * from \"./curve/CurveFactory\";\nexport * from \"./curve/CurveOps\";\nexport * from \"./curve/CurvePrimitive\";\nexport * from \"./curve/CurveProcessor\";\nexport * from \"./curve/GeometryQuery\";\nexport * from \"./curve/LineSegment3d\";\nexport * from \"./curve/LineString3d\";\nexport * from \"./curve/Loop\";\nexport * from \"./curve/OffsetOptions\";\nexport * from \"./curve/ParityRegion\";\nexport * from \"./curve/Path\";\nexport * from \"./curve/RegionMomentsXY\";\nexport * from \"./curve/RegionOps\";\nexport * from \"./curve/PointString3d\";\nexport * from \"./curve/ProxyCurve\";\nexport * from \"./curve/StrokeOptions\";\nexport * from \"./curve/spiral/TransitionSpiral3d\";\nexport * from \"./curve/spiral/IntegratedSpiral3d\";\nexport * from \"./curve/spiral/DirectSpiral3d\";\nexport * from \"./curve/UnionRegion\";\nexport * from \"./curve/Query/StrokeCountMap\";\nexport * from \"./solid/Box\";\nexport * from \"./solid/Cone\";\nexport * from \"./solid/LinearSweep\";\nexport * from \"./solid/RotationalSweep\";\nexport * from \"./solid/RuledSweep\";\nexport * from \"./solid/SolidPrimitive\";\nexport * from \"./solid/Sphere\";\nexport * from \"./solid/SweepContour\";\nexport * from \"./solid/TorusPipe\";\nexport * from \"./bspline/AkimaCurve3d\";\nexport * from \"./bspline/Bezier1dNd\";\nexport * from \"./bspline/BezierCurveBase\";\nexport * from \"./bspline/BezierCurve3d\";\nexport * from \"./bspline/BezierCurve3dH\";\nexport * from \"./bspline/BSplineCurve\";\nexport * from \"./bspline/BSplineCurveOps\";\nexport * from \"./bspline/BSpline1dNd\";\nexport * from \"./bspline/BSplineCurve3dH\";\nexport * from \"./bspline/BSplineSurface\";\nexport * from \"./bspline/InterpolationCurve3d\";\nexport * from \"./bspline/KnotVector\";\nexport * from \"./polyface/AuxData\";\nexport * from \"./polyface/BoxTopology\";\nexport * from \"./polyface/FacetFaceData\";\nexport * from \"./polyface/Polyface\";\nexport * from \"./polyface/FacetLocationDetail\";\nexport * from \"./polyface/IndexedPolyfaceVisitor\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSet\";\nexport * from \"./polyface/multiclip/GriddedRaggedRange2dSetWithOverflow\";\nexport * from \"./polyface/PolyfaceBuilder\";\nexport * from \"./polyface/PolyfaceData\";\nexport * from \"./polyface/PolyfaceQuery\";\nexport * from \"./polyface/PolyfaceClip\";\nexport * from \"./polyface/RangeTree/Point3dArrayRangeTreeContext\";\nexport * from \"./polyface/RangeTree/LineString3dRangeTreeContext\";\nexport * from \"./polyface/RangeTree/PolyfaceRangeTreeContext\";\nexport * from \"./polyface/TaggedNumericData\";\nexport * from \"./topology/SpaceTriangulation\";\nexport * from \"./serialization/IModelJsonSchema\";\nexport * from \"./serialization/DeepCompare\";\nexport * from \"./serialization/GeometrySamples\";\nexport * from \"./serialization/SerializationHelpers\";\nexport { BentleyGeometryFlatBuffer } from \"./serialization/BentleyGeometryFlatBuffer\";\n"]}
@@ -3,43 +3,65 @@
3
3
  */
4
4
  import { BSplineWrapMode } from "../bspline/KnotVector";
5
5
  /**
6
- * `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry.
7
- * @internal
6
+ * The `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry, such as B-spline curves and surfaces.
7
+ * @public
8
8
  */
9
9
  export declare namespace SerializationHelpers {
10
+ /** Interface for data common to B-spline curves and surfaces. */
10
11
  interface BSplineParams {
12
+ /** The number of control points, aka poles. */
11
13
  numPoles: number;
14
+ /** B-spline order, one more than the degree. */
12
15
  order: number;
16
+ /** Whether the B-spline is to be considered closed. */
13
17
  closed?: boolean;
18
+ /** Full knot vector. */
14
19
  knots: number[] | Float64Array;
20
+ /** Wrap mode, for data roundtrip. */
15
21
  wrapMode?: BSplineWrapMode;
16
22
  }
23
+ /** Interface for B-spline curve data. */
17
24
  interface BSplineCurveData {
25
+ /** Control points, aka poles. */
18
26
  poles: number[][] | Float64Array;
27
+ /** The number of coordinates per pole. This is the inner dimension of the poles number array. Possible values: 3, 4. Dimension 4 means the curve is rational, with poles of homogeneous form [wx,wy,wz,w]. */
19
28
  dim: number;
29
+ /** Weights for a rational curve that is specified by parallel arrays of poles and weights. If defined, dim is expected to be 3, and poles are of homogeneous form [wx,wy,wz]. */
20
30
  weights?: number[] | Float64Array;
31
+ /** Knots and other B-spline data. */
21
32
  params: BSplineParams;
22
33
  }
34
+ /** Interface for B-spline surface data. */
23
35
  interface BSplineSurfaceData {
36
+ /** Control points, aka poles in row-major order. */
24
37
  poles: number[][][] | Float64Array;
38
+ /** The number of coordinates per pole. This is the inner dimension of the poles number array. Possible values: 3, 4. Dimension 4 means the surface is rational, with poles of homogeneous form [wx,wy,wz,w]. */
25
39
  dim: number;
40
+ /** Weights for a rational surface that is specified by parallel arrays of poles and weights. If defined, dim is expected to be 3, and poles are of homogeneous form [wx,wy,wz]. */
26
41
  weights?: number[][] | Float64Array;
42
+ /** Knots and other B-spline data with respect to the surface u parameter. uParams.numPoles = # columns (middle dimension) of the poles array. */
27
43
  uParams: BSplineParams;
44
+ /** Knots and other B-spline data with respect to the surface v parameter. vParams.numPoles = # rows (outer dimension) of the poles array. */
28
45
  vParams: BSplineParams;
29
46
  }
47
+ /** Interface of options for import/export. */
30
48
  interface BSplineDataOptions {
49
+ /** Type of output pole/weight arrays. true: structured number array; false: Float64Array; undefined: either. */
31
50
  jsonPoles?: boolean;
51
+ /** Type of output knot arrays. true: number array; false: Float64Array; undefined: either. */
32
52
  jsonKnots?: boolean;
53
+ /** Extraneous knot handling during Import: true: remove them; false | undefined: leave them. Has no effect during Export, which always outputs the extraneous knots. */
33
54
  removeExtraKnots?: boolean;
34
55
  }
35
- /** Constructor with required data. Inputs are captured, not copied. */
56
+ /** Constructor for BSplineCurveData that populates the required data. Inputs are captured, not copied. */
36
57
  function createBSplineCurveData(poles: number[][] | Float64Array, dim: number, knots: number[] | Float64Array, numPoles: number, order: number): BSplineCurveData;
37
- /** Constructor with required data. Inputs are captured, not copied. */
58
+ /** Constructor for BSplineSurfaceData that populates the required data. Inputs are captured, not copied. */
38
59
  function createBSplineSurfaceData(poles: number[][][] | Float64Array, dim: number, uKnots: number[] | Float64Array, uNumPoles: number, uOrder: number, vKnots: number[] | Float64Array, vNumPoles: number, vOrder: number): BSplineSurfaceData;
39
- /** Clone curve data */
60
+ /** Clone B-spline curve data */
40
61
  function cloneBSplineCurveData(source: BSplineCurveData): BSplineCurveData;
41
- /** Clone surface data */
62
+ /** Clone B-spline surface data */
42
63
  function cloneBSplineSurfaceData(source: BSplineSurfaceData): BSplineSurfaceData;
64
+ /** Helper class for preparing geometry data for import. */
43
65
  class Import {
44
66
  /** copy knots, with options to control destination type and extraneous knot removal */
45
67
  private static copyKnots;
@@ -75,6 +97,7 @@ export declare namespace SerializationHelpers {
75
97
  */
76
98
  static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean;
77
99
  }
100
+ /** Helper class for preparing geometry data for export. */
78
101
  class Export {
79
102
  /**
80
103
  * Restore special legacy periodic B-spline knots opened via BSplineWrapMode.OpenByRemovingKnots logic.
@@ -1 +1 @@
1
- {"version":3,"file":"SerializationHelpers.d.ts","sourceRoot":"","sources":["../../../src/serialization/SerializationHelpers.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,eAAe,EAAc,MAAM,uBAAuB,CAAC;AAGpE;;;GAGG;AACH,yBAAiB,oBAAoB,CAAC;IACpC,UAAiB,aAAa;QAC5B,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;QAC/B,QAAQ,CAAC,EAAE,eAAe,CAAC;KAC5B;IACD,UAAiB,gBAAgB;QAC/B,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,YAAY,CAAC;QACjC,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;QAClC,MAAM,EAAE,aAAa,CAAC;KACvB;IACD,UAAiB,kBAAkB;QACjC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,YAAY,CAAC;QACnC,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,YAAY,CAAC;QACpC,OAAO,EAAE,aAAa,CAAC;QACvB,OAAO,EAAE,aAAa,CAAC;KACxB;IACD,UAAiB,kBAAkB;QACjC,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC5B;IAED,uEAAuE;IACvE,SAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,E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version":3,"file":"SerializationHelpers.d.ts","sourceRoot":"","sources":["../../../src/serialization/SerializationHelpers.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAE,eAAe,EAAc,MAAM,uBAAuB,CAAC;AAGpE;;;GAGG;AACH,yBAAiB,oBAAoB,CAAC;IACpC,iEAAiE;IACjE,UAAiB,aAAa;QAC5B,+CAA+C;QAC/C,QAAQ,EAAE,MAAM,CAAC;QACjB,gDAAgD;QAChD,KAAK,EAAE,MAAM,CAAC;QACd,uDAAuD;QACvD,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,wBAAwB;QACxB,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;QAC/B,qCAAqC;QACrC,QAAQ,CAAC,EAAE,eAAe,CAAC;KAC5B;IACD,yCAAyC;IACzC,UAAiB,gBAAgB;QAC/B,iCAAiC;QACjC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,YAAY,CAAC;QACjC,8MAA8M;QAC9M,GAAG,EAAE,MAAM,CAAC;QACZ,iLAAiL;QACjL,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;QAClC,qCAAqC;QACrC,MAAM,EAAE,aAAa,CAAC;KACvB;IACD,2CAA2C;IAC3C,UAAiB,kBAAkB;QACjC,oDAAoD;QACpD,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,YAAY,CAAC;QACnC,gNAAgN;QAChN,GAAG,EAAE,MAAM,CAAC;QACZ,mLAAmL;QACnL,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,YAAY,CAAC;QACpC,iJAAiJ;QACjJ,OAAO,EAAE,aAAa,CAAC;QACvB,6IAA6I;QAC7I,OAAO,EAAE,aAAa,CAAC;KACxB;IACD,8CAA8C;IAC9C,UAAiB,kBAAkB;QACjC,gHAAgH;QAChH,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,8FAA8F;QAC9F,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,wKA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OG;eACW,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;QA6CpG;;;;;;;WAOG;eACW,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO;KAgFzG;CACF"}
@@ -8,22 +8,22 @@
8
8
  import { BSplineWrapMode, KnotVector } from "../bspline/KnotVector";
9
9
  import { NumberArray } from "../geometry3d/PointHelpers";
10
10
  /**
11
- * `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry.
12
- * @internal
11
+ * The `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry, such as B-spline curves and surfaces.
12
+ * @public
13
13
  */
14
14
  export var SerializationHelpers;
15
15
  (function (SerializationHelpers) {
16
- /** Constructor with required data. Inputs are captured, not copied. */
16
+ /** Constructor for BSplineCurveData that populates the required data. Inputs are captured, not copied. */
17
17
  function createBSplineCurveData(poles, dim, knots, numPoles, order) {
18
18
  return { poles, dim, params: { numPoles, order, knots } };
19
19
  }
20
20
  SerializationHelpers.createBSplineCurveData = createBSplineCurveData;
21
- /** Constructor with required data. Inputs are captured, not copied. */
21
+ /** Constructor for BSplineSurfaceData that populates the required data. Inputs are captured, not copied. */
22
22
  function createBSplineSurfaceData(poles, dim, uKnots, uNumPoles, uOrder, vKnots, vNumPoles, vOrder) {
23
23
  return { poles, dim, uParams: { numPoles: uNumPoles, order: uOrder, knots: uKnots }, vParams: { numPoles: vNumPoles, order: vOrder, knots: vKnots } };
24
24
  }
25
25
  SerializationHelpers.createBSplineSurfaceData = createBSplineSurfaceData;
26
- /** Clone curve data */
26
+ /** Clone B-spline curve data */
27
27
  function cloneBSplineCurveData(source) {
28
28
  return {
29
29
  poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy2d(source.poles),
@@ -39,7 +39,7 @@ export var SerializationHelpers;
39
39
  };
40
40
  }
41
41
  SerializationHelpers.cloneBSplineCurveData = cloneBSplineCurveData;
42
- /** Clone surface data */
42
+ /** Clone B-spline surface data */
43
43
  function cloneBSplineSurfaceData(source) {
44
44
  return {
45
45
  poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy3d(source.poles),
@@ -62,7 +62,7 @@ export var SerializationHelpers;
62
62
  };
63
63
  }
64
64
  SerializationHelpers.cloneBSplineSurfaceData = cloneBSplineSurfaceData;
65
- /** Copy from source to dest */
65
+ /** Copy B-spline curve data from source to dest */
66
66
  function copyBSplineCurveDataPoles(source) {
67
67
  let nPole = 0;
68
68
  let nCoordPerPole = 0;
@@ -109,7 +109,7 @@ export var SerializationHelpers;
109
109
  weights = NumberArray.create(source.weights);
110
110
  return { poles, weights };
111
111
  }
112
- /** Copy from source to dest */
112
+ /** Copy B-spline surface data from source to dest */
113
113
  function copyBSplineSurfaceDataPoles(source) {
114
114
  let nPoleRow = 0;
115
115
  let nPolePerRow = 0;
@@ -168,7 +168,7 @@ export var SerializationHelpers;
168
168
  }
169
169
  return { poles, weights };
170
170
  }
171
- /** Convert data arrays to the types specified by options. */
171
+ /** Convert B-spline curve data arrays to the types specified by options. */
172
172
  function convertBSplineCurveDataArrays(data, options) {
173
173
  if (undefined !== options?.jsonPoles) {
174
174
  const packedPoles = data.poles instanceof Float64Array;
@@ -192,7 +192,7 @@ export var SerializationHelpers;
192
192
  data.params.knots = NumberArray.pack(data.params.knots);
193
193
  }
194
194
  }
195
- /** Convert data arrays to the types specified by options. */
195
+ /** Convert B-spline surface data arrays to the types specified by options. */
196
196
  function convertBSplineSurfaceDataArrays(data, options) {
197
197
  if (undefined !== options?.jsonPoles) {
198
198
  const packedPoles = data.poles instanceof Float64Array;
@@ -221,6 +221,7 @@ export var SerializationHelpers;
221
221
  data.vParams.knots = NumberArray.pack(data.vParams.knots);
222
222
  }
223
223
  }
224
+ /** Helper class for preparing geometry data for import. */
224
225
  class Import {
225
226
  /** copy knots, with options to control destination type and extraneous knot removal */
226
227
  static copyKnots(knots, options, iStart, iEnd) {
@@ -417,6 +418,7 @@ export var SerializationHelpers;
417
418
  }
418
419
  }
419
420
  SerializationHelpers.Import = Import;
421
+ /** Helper class for preparing geometry data for export. */
420
422
  class Export {
421
423
  /**
422
424
  * Restore special legacy periodic B-spline knots opened via BSplineWrapMode.OpenByRemovingKnots logic.
@@ -1 +1 @@
1
- {"version":3,"file":"SerializationHelpers.js","sourceRoot":"","sources":["../../../src/serialization/SerializationHelpers.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;;GAGG;AACH,MAAM,KAAW,oBAAoB,CAknBpC;AAlnBD,WAAiB,oBAAoB;IA2BnC,uEAAuE;IACvE,SAAgB,sBAAsB,CAAC,KAAgC,EAAE,GAAW,EAAE,KAA8B,EAAE,QAAgB,EAAE,KAAa;QACnJ,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC;IAC5D,CAAC;IAFe,2CAAsB,yBAErC,CAAA;IAED,uEAAuE;IACvE,SAAgB,wBAAwB,CAAC,KAAkC,EAAE,GAAW,EAAE,MAA+B,EAAE,SAAiB,EAAE,MAAc,EAAE,MAA+B,EAAE,SAAiB,EAAE,MAAc;QAC9N,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC;IACxJ,CAAC;IAFe,6CAAwB,2BAEvC,CAAA;IAED,uBAAuB;IACvB,SAAgB,qBAAqB,CAAC,M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AAK,GAAG,CAAC,EAAE,EAAE,CAAC;4BAC7C,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC,sCAAsC;qBAC/D;oBACD,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;oBAChD,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;oBAC3B,MAAM;iBACP;aACF;YAED,8BAA8B;YAC9B,IAAI,CAAC,eAAe;gBAClB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACrH,IAAI,CAAC,eAAe;gBAClB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAErH,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IAjLY,2BAAM,SAiLlB,CAAA;AACH,CAAC,EAlnBgB,oBAAoB,KAApB,oBAAoB,QAknBpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Serialization\n */\nimport { BSplineWrapMode, KnotVector } from \"../bspline/KnotVector\";\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\n\n/**\n * `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry.\n * @internal\n */\nexport namespace SerializationHelpers {\n export interface BSplineParams {\n numPoles: number;\n order: number;\n closed?: boolean;\n knots: number[] | Float64Array;\n wrapMode?: BSplineWrapMode;\n }\n export interface BSplineCurveData {\n poles: number[][] | Float64Array;\n dim: number; // # coordinates per pole = inner dimension of poles array (3,4)\n weights?: number[] | Float64Array; // if defined, poles are assumed to be weighted and dim 3\n params: BSplineParams;\n }\n export interface BSplineSurfaceData {\n poles: number[][][] | Float64Array;\n dim: number; // # coordinates per pole = inner dimension of poles array (3,4)\n weights?: number[][] | Float64Array; // if defined, poles are assumed to be weighted and dim 3\n uParams: BSplineParams; // uParams.numPoles = # cols (middle dimension) of poles\n vParams: BSplineParams; // vParams.numPoles = # rows (outer dimension) of poles\n }\n export interface BSplineDataOptions {\n jsonPoles?: boolean; // type of output pole/weight arrays. true: structured number array; false: Float64Array; undefined: either\n jsonKnots?: boolean; // type of output knot arrays. true: number array; false: Float64Array; undefined: either\n removeExtraKnots?: boolean; // extraneous knot handling during Import: true: remove them; false | undefined: leave them. Has no effect during Export, which always outputs the extraneous knots.\n }\n\n /** Constructor with required data. Inputs are captured, not copied. */\n export function createBSplineCurveData(poles: number[][] | Float64Array, dim: number, knots: number[] | Float64Array, numPoles: number, order: number): BSplineCurveData {\n return { poles, dim, params: { numPoles, order, knots } };\n }\n\n /** Constructor with required data. Inputs are captured, not copied. */\n export function createBSplineSurfaceData(poles: number[][][] | Float64Array, dim: number, uKnots: number[] | Float64Array, uNumPoles: number, uOrder: number, vKnots: number[] | Float64Array, vNumPoles: number, vOrder: number): BSplineSurfaceData {\n return { poles, dim, uParams: { numPoles: uNumPoles, order: uOrder, knots: uKnots }, vParams: { numPoles: vNumPoles, order: vOrder, knots: vKnots } };\n }\n\n /** Clone curve data */\n export function cloneBSplineCurveData(source: BSplineCurveData): BSplineCurveData {\n return {\n poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy2d(source.poles),\n dim: source.dim,\n weights: source.weights ? source.weights.slice() : undefined,\n params: {\n numPoles: source.params.numPoles,\n order: source.params.order,\n closed: source.params.closed,\n knots: source.params.knots.slice(),\n wrapMode: source.params.wrapMode,\n },\n };\n }\n\n /** Clone surface data */\n export function cloneBSplineSurfaceData(source: BSplineSurfaceData): BSplineSurfaceData {\n return {\n poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy3d(source.poles),\n dim: source.dim,\n weights: source.weights ? ((source.weights instanceof Float64Array) ? source.weights.slice() : NumberArray.copy2d(source.weights)) : undefined,\n uParams: {\n numPoles: source.uParams.numPoles,\n order: source.uParams.order,\n closed: source.uParams.closed,\n knots: source.uParams.knots.slice(),\n wrapMode: source.uParams.wrapMode,\n },\n vParams: {\n numPoles: source.vParams.numPoles,\n order: source.vParams.order,\n closed: source.vParams.closed,\n knots: source.vParams.knots.slice(),\n wrapMode: source.vParams.wrapMode,\n },\n };\n }\n\n /** Copy from source to dest */\n function copyBSplineCurveDataPoles(source: BSplineCurveData): {poles?: number[][], weights?: number[]} {\n let nPole = 0;\n let nCoordPerPole = 0;\n let nPoleCoords = 0;\n let poleDimProduct = 0;\n if (source.poles instanceof Float64Array) {\n nPole = source.params.numPoles;\n nCoordPerPole = source.dim;\n nPoleCoords = source.poles.length;\n poleDimProduct = nPole * nCoordPerPole;\n } else {\n nPole = source.poles.length;\n if (nPole > 0)\n nCoordPerPole = source.poles[0].length;\n nPoleCoords = poleDimProduct = nPole * nCoordPerPole;\n }\n if (0 === poleDimProduct || poleDimProduct > nPoleCoords || nCoordPerPole !== source.dim)\n return {};\n\n let nWeight = 0;\n let nWeightCoords = 0;\n let weightDimProduct = 0;\n if (source.weights !== undefined) {\n if (source.weights instanceof Float64Array) {\n nWeight = source.params.numPoles;\n nWeightCoords = source.weights.length;\n weightDimProduct = nWeight;\n } else {\n nWeight = source.weights.length;\n nWeightCoords = weightDimProduct = nWeight;\n }\n if (0 === weightDimProduct || weightDimProduct > nWeightCoords || nWeight !== nPole)\n return {};\n }\n\n // convert variant source to structured number array\n let poles: number[][] | undefined;\n let weights: number[] | undefined;\n if (source.poles instanceof Float64Array)\n poles = NumberArray.unpack2d(source.poles, nCoordPerPole);\n else\n poles = NumberArray.copy2d(source.poles);\n if (poles && source.weights)\n weights = NumberArray.create(source.weights);\n return {poles, weights};\n }\n\n /** Copy from source to dest */\n function copyBSplineSurfaceDataPoles(source: BSplineSurfaceData): {poles?: number[][][], weights?: number[][]} {\n let nPoleRow = 0;\n let nPolePerRow = 0;\n let nCoordPerPole = 0;\n let nCoords = 0;\n let poleDimProduct = 0;\n if (source.poles instanceof Float64Array) {\n nPoleRow = source.vParams.numPoles;\n nPolePerRow = source.uParams.numPoles;\n nCoordPerPole = source.dim;\n nCoords = source.poles.length;\n poleDimProduct = nPoleRow * nPolePerRow * nCoordPerPole;\n } else {\n nPoleRow = source.poles.length;\n if (nPoleRow > 0)\n nPolePerRow = source.poles[0].length;\n if (nPolePerRow > 0)\n nCoordPerPole = source.poles[0][0].length;\n nCoords = poleDimProduct = nPoleRow * nPolePerRow * nCoordPerPole;\n }\n if (0 === poleDimProduct || poleDimProduct > nCoords || nCoordPerPole !== source.dim)\n return {};\n\n let nWeightRow = 0;\n let nWeightPerRow = 0;\n let nWeightCoords = 0;\n let weightDimProduct = 0;\n if (source.weights !== undefined) {\n if (source.weights instanceof Float64Array) {\n nWeightRow = source.vParams.numPoles;\n nWeightPerRow = source.uParams.numPoles;\n nWeightCoords = source.weights.length;\n weightDimProduct = nWeightRow * nWeightPerRow;\n } else {\n nWeightRow = source.weights.length;\n if (nWeightRow > 0)\n nWeightPerRow = source.weights[0].length;\n nWeightCoords = weightDimProduct = nWeightRow * nWeightPerRow;\n }\n if (0 === weightDimProduct || weightDimProduct > nWeightCoords || nWeightRow !== nPoleRow || nWeightPerRow !== nPolePerRow)\n return {};\n }\n\n // convert variant source to structured number array\n let poles: number[][][] | undefined;\n let weights: number[][] | undefined;\n if (source.poles instanceof Float64Array)\n poles = NumberArray.unpack3d(source.poles, nPolePerRow, nCoordPerPole);\n else\n poles = NumberArray.copy3d(source.poles);\n if (poles && source.weights) {\n if (source.weights instanceof Float64Array)\n weights = NumberArray.unpack2d(source.weights, nWeightPerRow);\n else\n weights = NumberArray.copy2d(source.weights);\n }\n return {poles, weights};\n }\n\n /** Convert data arrays to the types specified by options. */\n function convertBSplineCurveDataArrays(data: BSplineCurveData, options?: BSplineDataOptions) {\n if (undefined !== options?.jsonPoles) {\n const packedPoles = data.poles instanceof Float64Array;\n if (options.jsonPoles && packedPoles)\n data.poles = NumberArray.unpack2d(data.poles as Float64Array, data.dim)!;\n else if (!options.jsonPoles && !packedPoles)\n data.poles = NumberArray.pack(data.poles as number[][]);\n\n if (data.weights) {\n const packedWeights = data.weights instanceof Float64Array;\n if (options.jsonPoles && packedWeights)\n data.weights = NumberArray.create(data.weights);\n else if (!options.jsonPoles && !packedWeights)\n data.weights = NumberArray.pack(data.weights as number[]);\n }\n }\n if (undefined !== options?.jsonKnots) {\n const packedKnots = data.params.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnots)\n data.params.knots = NumberArray.create(data.params.knots);\n else if (!options.jsonKnots && !packedKnots)\n data.params.knots = NumberArray.pack(data.params.knots as number[]);\n }\n }\n\n /** Convert data arrays to the types specified by options. */\n function convertBSplineSurfaceDataArrays(data: BSplineSurfaceData, options?: BSplineDataOptions) {\n if (undefined !== options?.jsonPoles) {\n const packedPoles = data.poles instanceof Float64Array;\n if (options.jsonPoles && packedPoles)\n data.poles = NumberArray.unpack3d(data.poles as Float64Array, data.uParams.numPoles, data.dim)!;\n else if (!options.jsonPoles && !packedPoles)\n data.poles = NumberArray.pack(data.poles as number[][][]);\n\n if (data.weights) {\n const packedWeights = data.weights instanceof Float64Array;\n if (options.jsonPoles && packedWeights)\n data.weights = NumberArray.unpack2d(data.weights as Float64Array, data.uParams.numPoles);\n else if (!options.jsonPoles && !packedWeights)\n data.weights = NumberArray.pack(data.weights as number[][]);\n }\n }\n if (undefined !== options?.jsonKnots) {\n const packedKnotsU = data.uParams.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnotsU)\n data.uParams.knots = NumberArray.create(data.uParams.knots);\n else if (!options.jsonKnots && !packedKnotsU)\n data.uParams.knots = NumberArray.pack(data.uParams.knots as number[]);\n\n const packedKnotsV = data.vParams.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnotsV)\n data.vParams.knots = NumberArray.create(data.vParams.knots);\n else if (!options.jsonKnots && !packedKnotsV)\n data.vParams.knots = NumberArray.pack(data.vParams.knots as number[]);\n }\n }\n\n export class Import {\n /** copy knots, with options to control destination type and extraneous knot removal */\n private static copyKnots(knots: Float64Array | number[], options?: BSplineDataOptions, iStart?: number, iEnd?: number): Float64Array| number[] {\n if (undefined === iStart)\n iStart = 0;\n if (undefined === iEnd)\n iEnd = knots.length;\n if (options?.removeExtraKnots) {\n ++iStart; // ignore start knot\n --iEnd; // ignore end knot\n }\n let newNumKnots = iEnd - iStart;\n if (newNumKnots < 0)\n newNumKnots = 0;\n const newKnots = options?.jsonKnots ? new Array<number>(newNumKnots) : new Float64Array(newNumKnots);\n for (let i = iStart, k = 0; i < iEnd; i++, k++)\n newKnots[k] = knots[i];\n return newKnots;\n }\n\n /**\n * Recognize the special legacy periodic B-spline data of mode BSplineWrapMode.OpenByRemovingKnots, and return the corresponding modern open clamped knots.\n * * Note that the B-spline poles corresponding to the converted knots remain unchanged, but it is assumed that first and last poles are equal.\n * * Example: the legacy 7-point quadratic circle periodic knots {-1/3 0 0 0 1/3 1/3 2/3 2/3 1 1 1 4/3} are converted to open knots {0 0 1/3 1/3 2/3 2/3 1 1}.\n * * General form of knot vector (k = order, d = k-1 = degree, p = numPoles):\n * * * legacy input: {k/2 periodically extended knots} {start knot multiplicity k} {p-k interior knots} {end knot multiplicity k} {d/2 periodically extended knots}\n * * * converted output: {start knot multiplicity d} {p-k interior knots} {end knot multiplicity d}\n * @param knots classic knot vector to test\n * @param numPoles number of poles\n * @param order B-spline order\n * @param options for output type, extraneous knot removal\n * @returns open knots if legacy periodic B-spline input data is recognized; otherwise, undefined\n * @see Export.closeLegacyPeriodicKnots\n */\n private static openLegacyPeriodicKnots(knots: Float64Array | number[], numPoles: number, order: number, options?: BSplineDataOptions): Float64Array | number[] | undefined {\n const numKnots = knots.length;\n if (order < 2 || numPoles + 2 * order - 1 !== numKnots)\n return undefined; // not legacy periodic knots\n\n const startKnot = knots[order - 1];\n const endKnot = knots[numKnots - order];\n const iStart0 = Math.floor(order / 2); // index of first expected multiple of the start knot\n const iEnd0 = iStart0 + numPoles; // index of first expected multiple of the end knot\n const iEnd1 = iEnd0 + order; // one past index of last expected multiple of the end knot\n for (let i = 0; i < order; ++i) {\n if (Math.abs(knots[iStart0 + i] - startKnot) >= KnotVector.knotTolerance)\n return undefined; // start knot multiplicity too small\n if (Math.abs(knots[iEnd0 + i] - endKnot) >= KnotVector.knotTolerance)\n return undefined; // end knot multiplicity too small\n }\n return this.copyKnots(knots, options, iStart0, iEnd1);\n }\n\n /** Prepare imported B-spline curve data for eventual conversion to BSplineCurve3d | BSplineCurve3dH:\n * * Opens legacy \"fake\" periodic data by expanding knots\n * * Opens true periodic data by expanding poles and weights\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineCurveData(data: BSplineCurveData, options?: BSplineDataOptions): boolean {\n let polesExpanded: number[][] | undefined;\n let weightsExpanded: number[] | undefined;\n let knotsCorrected: number[] | Float64Array | undefined;\n data.params.wrapMode = undefined;\n\n if (true === data.params.closed) {\n knotsCorrected = this.openLegacyPeriodicKnots(data.params.knots, data.params.numPoles, data.params.order, options);\n if (undefined !== knotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.params.knots = knotsCorrected;\n data.params.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineCurveDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.params.order - 1; ++i) {\n const wraparoundPt = [];\n for (let j = 0; j < data.dim; ++j)\n wraparoundPt.push(polesExpanded[i][j]);\n polesExpanded.push(wraparoundPt); // append degree wraparound poles\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.params.order - 1; ++i)\n weightsExpanded.push(weightsExpanded[i]); // append degree wraparound weights\n }\n data.params.numPoles += data.params.order - 1;\n data.params.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (options?.removeExtraKnots) {\n if (!knotsCorrected)\n data.params.knots = this.copyKnots(data.params.knots, options);\n }\n\n data.params.closed = undefined; // we are open\n\n convertBSplineCurveDataArrays(data, options);\n return true;\n }\n\n /** Prepare imported B-spline surface data for eventual conversion to BSplineSurface3d | BSplineSurface3dH:\n * * Opens legacy \"fake\" periodic data by expanding knots\n * * Opens true periodic data by expanding poles and weights\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean {\n let polesExpanded: number[][][] | undefined;\n let weightsExpanded: number[][] | undefined;\n let uKnotsCorrected: number[] | Float64Array | undefined;\n let vKnotsCorrected: number[] | Float64Array | undefined;\n data.uParams.wrapMode = data.vParams.wrapMode = undefined;\n\n if (true === data.uParams.closed) {\n uKnotsCorrected = this.openLegacyPeriodicKnots(data.uParams.knots, data.uParams.numPoles, data.uParams.order, options);\n if (undefined !== uKnotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.uParams.knots = uKnotsCorrected;\n data.uParams.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.vParams.numPoles; ++i) { // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j) {\n const wraparoundPt = [];\n for (let k = 0; k < data.dim; ++k)\n wraparoundPt.push(polesExpanded[i][j][k]);\n polesExpanded[i].push(wraparoundPt); // append degreeU wraparound poles to each row\n }\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n weightsExpanded[i].push(weightsExpanded[i][j]); // append degreeU wraparound weights to each row\n }\n data.uParams.numPoles += data.uParams.order - 1;\n data.uParams.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (true === data.vParams.closed) {\n vKnotsCorrected = this.openLegacyPeriodicKnots(data.vParams.knots, data.vParams.numPoles, data.vParams.order, options);\n if (undefined !== vKnotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.vParams.knots = vKnotsCorrected;\n data.vParams.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.vParams.order - 1; ++i) {\n const wrapAroundRow = [];\n for (let j = 0; j < data.uParams.numPoles; ++j) { // #cols\n const wrapAroundPt = [];\n for (let k = 0; k < data.dim; ++k)\n wrapAroundPt.push(polesExpanded[i][j][k]);\n wrapAroundRow.push(wrapAroundPt);\n }\n polesExpanded.push(wrapAroundRow); // append degreeV wraparound rows of poles\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.vParams.order - 1; ++i) {\n const wrapAroundRow = [];\n for (let j = 0; j < data.uParams.numPoles; ++j) // #cols\n wrapAroundRow.push(weightsExpanded[i][j]);\n weightsExpanded.push(wrapAroundRow); // append degreeV wraparound rows of weights\n }\n }\n data.vParams.numPoles += data.vParams.order - 1;\n data.vParams.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (options?.removeExtraKnots) {\n if (!uKnotsCorrected)\n data.uParams.knots = this.copyKnots(data.uParams.knots, options);\n if (!vKnotsCorrected)\n data.vParams.knots = this.copyKnots(data.vParams.knots, options);\n }\n\n data.uParams.closed = data.vParams.closed = undefined; // we are open\n\n convertBSplineSurfaceDataArrays(data, options);\n return true;\n }\n }\n\n export class Export {\n /**\n * Restore special legacy periodic B-spline knots opened via BSplineWrapMode.OpenByRemovingKnots logic.\n * @param knots modern knot vector: {start knot multiplicity d} {p-k interior knots} {end knot multiplicity d}\n * @param order B-spline order\n * @param options for output type\n * @param wrapMode wrap mode of the knots\n * @returns legacy periodic knots (with classic extraneous start/end knot) if wrapMode recognized; otherwise, undefined\n * @see Import.openLegacyPeriodicKnots\n */\n private static closeLegacyPeriodicKnots(knots: Float64Array | number[], order: number, options?: BSplineDataOptions, wrapMode?: BSplineWrapMode): Float64Array | number[] | undefined {\n if (wrapMode === undefined || wrapMode !== BSplineWrapMode.OpenByRemovingKnots)\n return undefined;\n\n const degree = order - 1;\n const leftIndex = degree - 1;\n const rightIndex = knots.length - degree;\n const leftKnot = knots[leftIndex];\n const rightKnot = knots[rightIndex];\n const knotPeriod = rightKnot - leftKnot;\n const newNumKnots = knots.length + degree + 2;\n const newKnots = options?.jsonKnots ? new Array<number>(newNumKnots) : new Float64Array(newNumKnots);\n\n let k = 0;\n for (let i = Math.floor(order / 2); i > 0; --i)\n newKnots[k++] = knots[rightIndex - i] - knotPeriod;\n newKnots[k++] = leftKnot; // extraneous start knot\n for (const knot of knots)\n newKnots[k++] = knot;\n newKnots[k++] = rightKnot; // extraneous end knot\n for (let i = 1; i <= Math.floor(degree / 2); ++i)\n newKnots[k++] = knots[leftIndex + i] + knotPeriod;\n\n return newKnots;\n }\n\n /**\n * Prepare data from a B-spline curve for export.\n * * adds classic extraneous knot at start and end of knot vector\n * * re-closes periodic data based on BSplineWrapMode\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineCurveData(data: BSplineCurveData, options?: BSplineDataOptions): boolean {\n let polesTrimmed: number[][] | undefined;\n let weightsTrimmed: number[] | undefined;\n let knotsCorrected: number[] | Float64Array | undefined;\n data.params.closed = undefined;\n\n switch (data.params.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n knotsCorrected = this.closeLegacyPeriodicKnots(data.params.knots, data.params.order, options, data.params.wrapMode);\n if (undefined === knotsCorrected)\n return false; // invalid input\n data.params.knots = knotsCorrected;\n data.params.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineCurveDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.params.order - 1; ++i)\n polesTrimmed.pop(); // remove last degree poles\n if (weightsTrimmed) {\n for (let i = 0; i < data.params.order - 1; ++i)\n weightsTrimmed.pop(); // remove last degree weights\n }\n data.params.numPoles -= data.params.order - 1;\n data.params.closed = true;\n break;\n }\n }\n\n // always add extraneous knots\n if (!knotsCorrected)\n data.params.knots = KnotVector.copyKnots(data.params.knots, data.params.order - 1, true, data.params.wrapMode);\n\n convertBSplineCurveDataArrays(data, options);\n return true;\n }\n\n /**\n * Prepare data from a B-spline surface for export.\n * * adds classic extraneous knot at start and end of knot vectors\n * * re-closes periodic data based on BSplineWrapMode\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean {\n let polesTrimmed: number[][][] | undefined;\n let weightsTrimmed: number[][] | undefined;\n let uKnotsCorrected: number[] | Float64Array | undefined;\n let vKnotsCorrected: number[] | Float64Array | undefined;\n data.uParams.closed = data.vParams.closed = undefined;\n\n switch (data.uParams.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n uKnotsCorrected = this.closeLegacyPeriodicKnots(data.uParams.knots, data.uParams.order, options, data.uParams.wrapMode);\n if (undefined === uKnotsCorrected)\n return false; // invalid input\n data.uParams.knots = uKnotsCorrected;\n data.uParams.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n polesTrimmed[i].pop(); // remove last degreeU poles from each row\n if (weightsTrimmed) {\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n weightsTrimmed[i].pop(); // remove last degreeU weights from each row\n }\n data.uParams.numPoles -= data.uParams.order - 1;\n data.uParams.closed = true;\n break;\n }\n }\n\n switch (data.vParams.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n vKnotsCorrected = this.closeLegacyPeriodicKnots(data.vParams.knots, data.vParams.order, options, data.vParams.wrapMode);\n if (undefined === vKnotsCorrected)\n return false; // invalid input\n data.vParams.knots = vKnotsCorrected;\n data.vParams.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.vParams.order - 1; ++i)\n polesTrimmed.pop(); // remove last degreeV rows of poles\n if (weightsTrimmed) {\n for (let i = 0; i < data.vParams.order - 1; ++i)\n weightsTrimmed.pop(); // remove last degreeV rows of weights\n }\n data.vParams.numPoles -= data.vParams.order - 1;\n data.vParams.closed = true;\n break;\n }\n }\n\n // always add extraneous knots\n if (!uKnotsCorrected)\n data.uParams.knots = KnotVector.copyKnots(data.uParams.knots, data.uParams.order - 1, true, data.uParams.wrapMode);\n if (!vKnotsCorrected)\n data.vParams.knots = KnotVector.copyKnots(data.vParams.knots, data.vParams.order - 1, true, data.vParams.wrapMode);\n\n convertBSplineSurfaceDataArrays(data, options);\n return true;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"SerializationHelpers.js","sourceRoot":"","sources":["../../../src/serialization/SerializationHelpers.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;;GAGG;AACH,MAAM,KAAW,oBAAoB,CAyoBpC;AAzoBD,WAAiB,oBAAoB;IAgDnC,0GAA0G;IAC1G,SAAgB,sBAAsB,CAAC,KAAgC,EAAE,GAAW,EAAE,KAA8B,EAAE,QAAgB,EAAE,KAAa;QACnJ,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC;IAC5D,CAAC;IAFe,2CAAsB,yBAErC,CAAA;IAED,4GAA4G;IAC5G,SAAgB,wBAAwB,CAAC,KAAkC,EAAE,GAAW,EAAE,MAA+B,EAAE,SAAiB,EAAE,MAAc,EAAE,MAA+B,EAAE,SAAiB,EAAE,MAAc;QAC9N,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,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E,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,EAAE,CAAC;wBAC7C,YAAY,CAAC,GAAG,EAAE,CAAC,CAAE,oCAAoC;oBAC3D,IAAI,cAAc,EAAE;wBAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,EAAE,CAAC;4BAC7C,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC,sCAAsC;qBAC/D;oBACD,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;oBAChD,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;oBAC3B,MAAM;iBACP;aACF;YAED,8BAA8B;YAC9B,IAAI,CAAC,eAAe;gBAClB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YACrH,IAAI,CAAC,eAAe;gBAClB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAErH,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,CAAC;KACF;IAjLY,2BAAM,SAiLlB,CAAA;AACH,CAAC,EAzoBgB,oBAAoB,KAApB,oBAAoB,QAyoBpC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Serialization\n */\nimport { BSplineWrapMode, KnotVector } from \"../bspline/KnotVector\";\nimport { NumberArray } from \"../geometry3d/PointHelpers\";\n\n/**\n * The `SerializationHelpers` namespace has helper classes for serializing and deserializing geometry, such as B-spline curves and surfaces.\n * @public\n */\nexport namespace SerializationHelpers {\n /** Interface for data common to B-spline curves and surfaces. */\n export interface BSplineParams {\n /** The number of control points, aka poles. */\n numPoles: number;\n /** B-spline order, one more than the degree. */\n order: number;\n /** Whether the B-spline is to be considered closed. */\n closed?: boolean;\n /** Full knot vector. */\n knots: number[] | Float64Array;\n /** Wrap mode, for data roundtrip. */\n wrapMode?: BSplineWrapMode;\n }\n /** Interface for B-spline curve data. */\n export interface BSplineCurveData {\n /** Control points, aka poles. */\n poles: number[][] | Float64Array;\n /** The number of coordinates per pole. This is the inner dimension of the poles number array. Possible values: 3, 4. Dimension 4 means the curve is rational, with poles of homogeneous form [wx,wy,wz,w]. */\n dim: number;\n /** Weights for a rational curve that is specified by parallel arrays of poles and weights. If defined, dim is expected to be 3, and poles are of homogeneous form [wx,wy,wz]. */\n weights?: number[] | Float64Array;\n /** Knots and other B-spline data. */\n params: BSplineParams;\n }\n /** Interface for B-spline surface data. */\n export interface BSplineSurfaceData {\n /** Control points, aka poles in row-major order. */\n poles: number[][][] | Float64Array;\n /** The number of coordinates per pole. This is the inner dimension of the poles number array. Possible values: 3, 4. Dimension 4 means the surface is rational, with poles of homogeneous form [wx,wy,wz,w]. */\n dim: number;\n /** Weights for a rational surface that is specified by parallel arrays of poles and weights. If defined, dim is expected to be 3, and poles are of homogeneous form [wx,wy,wz]. */\n weights?: number[][] | Float64Array;\n /** Knots and other B-spline data with respect to the surface u parameter. uParams.numPoles = # columns (middle dimension) of the poles array. */\n uParams: BSplineParams;\n /** Knots and other B-spline data with respect to the surface v parameter. vParams.numPoles = # rows (outer dimension) of the poles array. */\n vParams: BSplineParams;\n }\n /** Interface of options for import/export. */\n export interface BSplineDataOptions {\n /** Type of output pole/weight arrays. true: structured number array; false: Float64Array; undefined: either. */\n jsonPoles?: boolean;\n /** Type of output knot arrays. true: number array; false: Float64Array; undefined: either. */\n jsonKnots?: boolean;\n /** Extraneous knot handling during Import: true: remove them; false | undefined: leave them. Has no effect during Export, which always outputs the extraneous knots. */\n removeExtraKnots?: boolean;\n }\n\n /** Constructor for BSplineCurveData that populates the required data. Inputs are captured, not copied. */\n export function createBSplineCurveData(poles: number[][] | Float64Array, dim: number, knots: number[] | Float64Array, numPoles: number, order: number): BSplineCurveData {\n return { poles, dim, params: { numPoles, order, knots } };\n }\n\n /** Constructor for BSplineSurfaceData that populates the required data. Inputs are captured, not copied. */\n export function createBSplineSurfaceData(poles: number[][][] | Float64Array, dim: number, uKnots: number[] | Float64Array, uNumPoles: number, uOrder: number, vKnots: number[] | Float64Array, vNumPoles: number, vOrder: number): BSplineSurfaceData {\n return { poles, dim, uParams: { numPoles: uNumPoles, order: uOrder, knots: uKnots }, vParams: { numPoles: vNumPoles, order: vOrder, knots: vKnots } };\n }\n\n /** Clone B-spline curve data */\n export function cloneBSplineCurveData(source: BSplineCurveData): BSplineCurveData {\n return {\n poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy2d(source.poles),\n dim: source.dim,\n weights: source.weights ? source.weights.slice() : undefined,\n params: {\n numPoles: source.params.numPoles,\n order: source.params.order,\n closed: source.params.closed,\n knots: source.params.knots.slice(),\n wrapMode: source.params.wrapMode,\n },\n };\n }\n\n /** Clone B-spline surface data */\n export function cloneBSplineSurfaceData(source: BSplineSurfaceData): BSplineSurfaceData {\n return {\n poles: (source.poles instanceof Float64Array) ? new Float64Array(source.poles) : NumberArray.copy3d(source.poles),\n dim: source.dim,\n weights: source.weights ? ((source.weights instanceof Float64Array) ? source.weights.slice() : NumberArray.copy2d(source.weights)) : undefined,\n uParams: {\n numPoles: source.uParams.numPoles,\n order: source.uParams.order,\n closed: source.uParams.closed,\n knots: source.uParams.knots.slice(),\n wrapMode: source.uParams.wrapMode,\n },\n vParams: {\n numPoles: source.vParams.numPoles,\n order: source.vParams.order,\n closed: source.vParams.closed,\n knots: source.vParams.knots.slice(),\n wrapMode: source.vParams.wrapMode,\n },\n };\n }\n\n /** Copy B-spline curve data from source to dest */\n function copyBSplineCurveDataPoles(source: BSplineCurveData): {poles?: number[][], weights?: number[]} {\n let nPole = 0;\n let nCoordPerPole = 0;\n let nPoleCoords = 0;\n let poleDimProduct = 0;\n if (source.poles instanceof Float64Array) {\n nPole = source.params.numPoles;\n nCoordPerPole = source.dim;\n nPoleCoords = source.poles.length;\n poleDimProduct = nPole * nCoordPerPole;\n } else {\n nPole = source.poles.length;\n if (nPole > 0)\n nCoordPerPole = source.poles[0].length;\n nPoleCoords = poleDimProduct = nPole * nCoordPerPole;\n }\n if (0 === poleDimProduct || poleDimProduct > nPoleCoords || nCoordPerPole !== source.dim)\n return {};\n\n let nWeight = 0;\n let nWeightCoords = 0;\n let weightDimProduct = 0;\n if (source.weights !== undefined) {\n if (source.weights instanceof Float64Array) {\n nWeight = source.params.numPoles;\n nWeightCoords = source.weights.length;\n weightDimProduct = nWeight;\n } else {\n nWeight = source.weights.length;\n nWeightCoords = weightDimProduct = nWeight;\n }\n if (0 === weightDimProduct || weightDimProduct > nWeightCoords || nWeight !== nPole)\n return {};\n }\n\n // convert variant source to structured number array\n let poles: number[][] | undefined;\n let weights: number[] | undefined;\n if (source.poles instanceof Float64Array)\n poles = NumberArray.unpack2d(source.poles, nCoordPerPole);\n else\n poles = NumberArray.copy2d(source.poles);\n if (poles && source.weights)\n weights = NumberArray.create(source.weights);\n return {poles, weights};\n }\n\n /** Copy B-spline surface data from source to dest */\n function copyBSplineSurfaceDataPoles(source: BSplineSurfaceData): {poles?: number[][][], weights?: number[][]} {\n let nPoleRow = 0;\n let nPolePerRow = 0;\n let nCoordPerPole = 0;\n let nCoords = 0;\n let poleDimProduct = 0;\n if (source.poles instanceof Float64Array) {\n nPoleRow = source.vParams.numPoles;\n nPolePerRow = source.uParams.numPoles;\n nCoordPerPole = source.dim;\n nCoords = source.poles.length;\n poleDimProduct = nPoleRow * nPolePerRow * nCoordPerPole;\n } else {\n nPoleRow = source.poles.length;\n if (nPoleRow > 0)\n nPolePerRow = source.poles[0].length;\n if (nPolePerRow > 0)\n nCoordPerPole = source.poles[0][0].length;\n nCoords = poleDimProduct = nPoleRow * nPolePerRow * nCoordPerPole;\n }\n if (0 === poleDimProduct || poleDimProduct > nCoords || nCoordPerPole !== source.dim)\n return {};\n\n let nWeightRow = 0;\n let nWeightPerRow = 0;\n let nWeightCoords = 0;\n let weightDimProduct = 0;\n if (source.weights !== undefined) {\n if (source.weights instanceof Float64Array) {\n nWeightRow = source.vParams.numPoles;\n nWeightPerRow = source.uParams.numPoles;\n nWeightCoords = source.weights.length;\n weightDimProduct = nWeightRow * nWeightPerRow;\n } else {\n nWeightRow = source.weights.length;\n if (nWeightRow > 0)\n nWeightPerRow = source.weights[0].length;\n nWeightCoords = weightDimProduct = nWeightRow * nWeightPerRow;\n }\n if (0 === weightDimProduct || weightDimProduct > nWeightCoords || nWeightRow !== nPoleRow || nWeightPerRow !== nPolePerRow)\n return {};\n }\n\n // convert variant source to structured number array\n let poles: number[][][] | undefined;\n let weights: number[][] | undefined;\n if (source.poles instanceof Float64Array)\n poles = NumberArray.unpack3d(source.poles, nPolePerRow, nCoordPerPole);\n else\n poles = NumberArray.copy3d(source.poles);\n if (poles && source.weights) {\n if (source.weights instanceof Float64Array)\n weights = NumberArray.unpack2d(source.weights, nWeightPerRow);\n else\n weights = NumberArray.copy2d(source.weights);\n }\n return {poles, weights};\n }\n\n /** Convert B-spline curve data arrays to the types specified by options. */\n function convertBSplineCurveDataArrays(data: BSplineCurveData, options?: BSplineDataOptions) {\n if (undefined !== options?.jsonPoles) {\n const packedPoles = data.poles instanceof Float64Array;\n if (options.jsonPoles && packedPoles)\n data.poles = NumberArray.unpack2d(data.poles as Float64Array, data.dim)!;\n else if (!options.jsonPoles && !packedPoles)\n data.poles = NumberArray.pack(data.poles as number[][]);\n\n if (data.weights) {\n const packedWeights = data.weights instanceof Float64Array;\n if (options.jsonPoles && packedWeights)\n data.weights = NumberArray.create(data.weights);\n else if (!options.jsonPoles && !packedWeights)\n data.weights = NumberArray.pack(data.weights as number[]);\n }\n }\n if (undefined !== options?.jsonKnots) {\n const packedKnots = data.params.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnots)\n data.params.knots = NumberArray.create(data.params.knots);\n else if (!options.jsonKnots && !packedKnots)\n data.params.knots = NumberArray.pack(data.params.knots as number[]);\n }\n }\n\n /** Convert B-spline surface data arrays to the types specified by options. */\n function convertBSplineSurfaceDataArrays(data: BSplineSurfaceData, options?: BSplineDataOptions) {\n if (undefined !== options?.jsonPoles) {\n const packedPoles = data.poles instanceof Float64Array;\n if (options.jsonPoles && packedPoles)\n data.poles = NumberArray.unpack3d(data.poles as Float64Array, data.uParams.numPoles, data.dim)!;\n else if (!options.jsonPoles && !packedPoles)\n data.poles = NumberArray.pack(data.poles as number[][][]);\n\n if (data.weights) {\n const packedWeights = data.weights instanceof Float64Array;\n if (options.jsonPoles && packedWeights)\n data.weights = NumberArray.unpack2d(data.weights as Float64Array, data.uParams.numPoles);\n else if (!options.jsonPoles && !packedWeights)\n data.weights = NumberArray.pack(data.weights as number[][]);\n }\n }\n if (undefined !== options?.jsonKnots) {\n const packedKnotsU = data.uParams.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnotsU)\n data.uParams.knots = NumberArray.create(data.uParams.knots);\n else if (!options.jsonKnots && !packedKnotsU)\n data.uParams.knots = NumberArray.pack(data.uParams.knots as number[]);\n\n const packedKnotsV = data.vParams.knots instanceof Float64Array;\n if (options.jsonKnots && packedKnotsV)\n data.vParams.knots = NumberArray.create(data.vParams.knots);\n else if (!options.jsonKnots && !packedKnotsV)\n data.vParams.knots = NumberArray.pack(data.vParams.knots as number[]);\n }\n }\n\n /** Helper class for preparing geometry data for import. */\n export class Import {\n /** copy knots, with options to control destination type and extraneous knot removal */\n private static copyKnots(knots: Float64Array | number[], options?: BSplineDataOptions, iStart?: number, iEnd?: number): Float64Array| number[] {\n if (undefined === iStart)\n iStart = 0;\n if (undefined === iEnd)\n iEnd = knots.length;\n if (options?.removeExtraKnots) {\n ++iStart; // ignore start knot\n --iEnd; // ignore end knot\n }\n let newNumKnots = iEnd - iStart;\n if (newNumKnots < 0)\n newNumKnots = 0;\n const newKnots = options?.jsonKnots ? new Array<number>(newNumKnots) : new Float64Array(newNumKnots);\n for (let i = iStart, k = 0; i < iEnd; i++, k++)\n newKnots[k] = knots[i];\n return newKnots;\n }\n\n /**\n * Recognize the special legacy periodic B-spline data of mode BSplineWrapMode.OpenByRemovingKnots, and return the corresponding modern open clamped knots.\n * * Note that the B-spline poles corresponding to the converted knots remain unchanged, but it is assumed that first and last poles are equal.\n * * Example: the legacy 7-point quadratic circle periodic knots {-1/3 0 0 0 1/3 1/3 2/3 2/3 1 1 1 4/3} are converted to open knots {0 0 1/3 1/3 2/3 2/3 1 1}.\n * * General form of knot vector (k = order, d = k-1 = degree, p = numPoles):\n * * * legacy input: {k/2 periodically extended knots} {start knot multiplicity k} {p-k interior knots} {end knot multiplicity k} {d/2 periodically extended knots}\n * * * converted output: {start knot multiplicity d} {p-k interior knots} {end knot multiplicity d}\n * @param knots classic knot vector to test\n * @param numPoles number of poles\n * @param order B-spline order\n * @param options for output type, extraneous knot removal\n * @returns open knots if legacy periodic B-spline input data is recognized; otherwise, undefined\n * @see Export.closeLegacyPeriodicKnots\n */\n private static openLegacyPeriodicKnots(knots: Float64Array | number[], numPoles: number, order: number, options?: BSplineDataOptions): Float64Array | number[] | undefined {\n const numKnots = knots.length;\n if (order < 2 || numPoles + 2 * order - 1 !== numKnots)\n return undefined; // not legacy periodic knots\n\n const startKnot = knots[order - 1];\n const endKnot = knots[numKnots - order];\n const iStart0 = Math.floor(order / 2); // index of first expected multiple of the start knot\n const iEnd0 = iStart0 + numPoles; // index of first expected multiple of the end knot\n const iEnd1 = iEnd0 + order; // one past index of last expected multiple of the end knot\n for (let i = 0; i < order; ++i) {\n if (Math.abs(knots[iStart0 + i] - startKnot) >= KnotVector.knotTolerance)\n return undefined; // start knot multiplicity too small\n if (Math.abs(knots[iEnd0 + i] - endKnot) >= KnotVector.knotTolerance)\n return undefined; // end knot multiplicity too small\n }\n return this.copyKnots(knots, options, iStart0, iEnd1);\n }\n\n /** Prepare imported B-spline curve data for eventual conversion to BSplineCurve3d | BSplineCurve3dH:\n * * Opens legacy \"fake\" periodic data by expanding knots\n * * Opens true periodic data by expanding poles and weights\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineCurveData(data: BSplineCurveData, options?: BSplineDataOptions): boolean {\n let polesExpanded: number[][] | undefined;\n let weightsExpanded: number[] | undefined;\n let knotsCorrected: number[] | Float64Array | undefined;\n data.params.wrapMode = undefined;\n\n if (true === data.params.closed) {\n knotsCorrected = this.openLegacyPeriodicKnots(data.params.knots, data.params.numPoles, data.params.order, options);\n if (undefined !== knotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.params.knots = knotsCorrected;\n data.params.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineCurveDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.params.order - 1; ++i) {\n const wraparoundPt = [];\n for (let j = 0; j < data.dim; ++j)\n wraparoundPt.push(polesExpanded[i][j]);\n polesExpanded.push(wraparoundPt); // append degree wraparound poles\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.params.order - 1; ++i)\n weightsExpanded.push(weightsExpanded[i]); // append degree wraparound weights\n }\n data.params.numPoles += data.params.order - 1;\n data.params.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (options?.removeExtraKnots) {\n if (!knotsCorrected)\n data.params.knots = this.copyKnots(data.params.knots, options);\n }\n\n data.params.closed = undefined; // we are open\n\n convertBSplineCurveDataArrays(data, options);\n return true;\n }\n\n /** Prepare imported B-spline surface data for eventual conversion to BSplineSurface3d | BSplineSurface3dH:\n * * Opens legacy \"fake\" periodic data by expanding knots\n * * Opens true periodic data by expanding poles and weights\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean {\n let polesExpanded: number[][][] | undefined;\n let weightsExpanded: number[][] | undefined;\n let uKnotsCorrected: number[] | Float64Array | undefined;\n let vKnotsCorrected: number[] | Float64Array | undefined;\n data.uParams.wrapMode = data.vParams.wrapMode = undefined;\n\n if (true === data.uParams.closed) {\n uKnotsCorrected = this.openLegacyPeriodicKnots(data.uParams.knots, data.uParams.numPoles, data.uParams.order, options);\n if (undefined !== uKnotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.uParams.knots = uKnotsCorrected;\n data.uParams.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.vParams.numPoles; ++i) { // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j) {\n const wraparoundPt = [];\n for (let k = 0; k < data.dim; ++k)\n wraparoundPt.push(polesExpanded[i][j][k]);\n polesExpanded[i].push(wraparoundPt); // append degreeU wraparound poles to each row\n }\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n weightsExpanded[i].push(weightsExpanded[i][j]); // append degreeU wraparound weights to each row\n }\n data.uParams.numPoles += data.uParams.order - 1;\n data.uParams.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (true === data.vParams.closed) {\n vKnotsCorrected = this.openLegacyPeriodicKnots(data.vParams.knots, data.vParams.numPoles, data.vParams.order, options);\n if (undefined !== vKnotsCorrected) {\n // legacy periodic knots removed, poles untouched\n data.vParams.knots = vKnotsCorrected;\n data.vParams.wrapMode = BSplineWrapMode.OpenByRemovingKnots;\n } else {\n // wrap poles, knots untouched\n if (!polesExpanded) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesExpanded = arrays.poles;\n data.weights = weightsExpanded = arrays.weights;\n }\n for (let i = 0; i < data.vParams.order - 1; ++i) {\n const wrapAroundRow = [];\n for (let j = 0; j < data.uParams.numPoles; ++j) { // #cols\n const wrapAroundPt = [];\n for (let k = 0; k < data.dim; ++k)\n wrapAroundPt.push(polesExpanded[i][j][k]);\n wrapAroundRow.push(wrapAroundPt);\n }\n polesExpanded.push(wrapAroundRow); // append degreeV wraparound rows of poles\n }\n if (weightsExpanded) {\n for (let i = 0; i < data.vParams.order - 1; ++i) {\n const wrapAroundRow = [];\n for (let j = 0; j < data.uParams.numPoles; ++j) // #cols\n wrapAroundRow.push(weightsExpanded[i][j]);\n weightsExpanded.push(wrapAroundRow); // append degreeV wraparound rows of weights\n }\n }\n data.vParams.numPoles += data.vParams.order - 1;\n data.vParams.wrapMode = BSplineWrapMode.OpenByAddingControlPoints;\n }\n }\n\n if (options?.removeExtraKnots) {\n if (!uKnotsCorrected)\n data.uParams.knots = this.copyKnots(data.uParams.knots, options);\n if (!vKnotsCorrected)\n data.vParams.knots = this.copyKnots(data.vParams.knots, options);\n }\n\n data.uParams.closed = data.vParams.closed = undefined; // we are open\n\n convertBSplineSurfaceDataArrays(data, options);\n return true;\n }\n }\n\n /** Helper class for preparing geometry data for export. */\n export class Export {\n /**\n * Restore special legacy periodic B-spline knots opened via BSplineWrapMode.OpenByRemovingKnots logic.\n * @param knots modern knot vector: {start knot multiplicity d} {p-k interior knots} {end knot multiplicity d}\n * @param order B-spline order\n * @param options for output type\n * @param wrapMode wrap mode of the knots\n * @returns legacy periodic knots (with classic extraneous start/end knot) if wrapMode recognized; otherwise, undefined\n * @see Import.openLegacyPeriodicKnots\n */\n private static closeLegacyPeriodicKnots(knots: Float64Array | number[], order: number, options?: BSplineDataOptions, wrapMode?: BSplineWrapMode): Float64Array | number[] | undefined {\n if (wrapMode === undefined || wrapMode !== BSplineWrapMode.OpenByRemovingKnots)\n return undefined;\n\n const degree = order - 1;\n const leftIndex = degree - 1;\n const rightIndex = knots.length - degree;\n const leftKnot = knots[leftIndex];\n const rightKnot = knots[rightIndex];\n const knotPeriod = rightKnot - leftKnot;\n const newNumKnots = knots.length + degree + 2;\n const newKnots = options?.jsonKnots ? new Array<number>(newNumKnots) : new Float64Array(newNumKnots);\n\n let k = 0;\n for (let i = Math.floor(order / 2); i > 0; --i)\n newKnots[k++] = knots[rightIndex - i] - knotPeriod;\n newKnots[k++] = leftKnot; // extraneous start knot\n for (const knot of knots)\n newKnots[k++] = knot;\n newKnots[k++] = rightKnot; // extraneous end knot\n for (let i = 1; i <= Math.floor(degree / 2); ++i)\n newKnots[k++] = knots[leftIndex + i] + knotPeriod;\n\n return newKnots;\n }\n\n /**\n * Prepare data from a B-spline curve for export.\n * * adds classic extraneous knot at start and end of knot vector\n * * re-closes periodic data based on BSplineWrapMode\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineCurveData(data: BSplineCurveData, options?: BSplineDataOptions): boolean {\n let polesTrimmed: number[][] | undefined;\n let weightsTrimmed: number[] | undefined;\n let knotsCorrected: number[] | Float64Array | undefined;\n data.params.closed = undefined;\n\n switch (data.params.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n knotsCorrected = this.closeLegacyPeriodicKnots(data.params.knots, data.params.order, options, data.params.wrapMode);\n if (undefined === knotsCorrected)\n return false; // invalid input\n data.params.knots = knotsCorrected;\n data.params.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineCurveDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.params.order - 1; ++i)\n polesTrimmed.pop(); // remove last degree poles\n if (weightsTrimmed) {\n for (let i = 0; i < data.params.order - 1; ++i)\n weightsTrimmed.pop(); // remove last degree weights\n }\n data.params.numPoles -= data.params.order - 1;\n data.params.closed = true;\n break;\n }\n }\n\n // always add extraneous knots\n if (!knotsCorrected)\n data.params.knots = KnotVector.copyKnots(data.params.knots, data.params.order - 1, true, data.params.wrapMode);\n\n convertBSplineCurveDataArrays(data, options);\n return true;\n }\n\n /**\n * Prepare data from a B-spline surface for export.\n * * adds classic extraneous knot at start and end of knot vectors\n * * re-closes periodic data based on BSplineWrapMode\n * @param data updated in place. If poles/weights/knots are updated, their respective arrays are reallocated.\n * @param options output specifications\n * @returns whether data was successfully prepared\n */\n public static prepareBSplineSurfaceData(data: BSplineSurfaceData, options?: BSplineDataOptions): boolean {\n let polesTrimmed: number[][][] | undefined;\n let weightsTrimmed: number[][] | undefined;\n let uKnotsCorrected: number[] | Float64Array | undefined;\n let vKnotsCorrected: number[] | Float64Array | undefined;\n data.uParams.closed = data.vParams.closed = undefined;\n\n switch (data.uParams.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n uKnotsCorrected = this.closeLegacyPeriodicKnots(data.uParams.knots, data.uParams.order, options, data.uParams.wrapMode);\n if (undefined === uKnotsCorrected)\n return false; // invalid input\n data.uParams.knots = uKnotsCorrected;\n data.uParams.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n polesTrimmed[i].pop(); // remove last degreeU poles from each row\n if (weightsTrimmed) {\n for (let i = 0; i < data.vParams.numPoles; ++i) // #rows\n for (let j = 0; j < data.uParams.order - 1; ++j)\n weightsTrimmed[i].pop(); // remove last degreeU weights from each row\n }\n data.uParams.numPoles -= data.uParams.order - 1;\n data.uParams.closed = true;\n break;\n }\n }\n\n switch (data.vParams.wrapMode) {\n case BSplineWrapMode.OpenByRemovingKnots: {\n // add legacy periodic and extraneous knots, poles untouched\n vKnotsCorrected = this.closeLegacyPeriodicKnots(data.vParams.knots, data.vParams.order, options, data.vParams.wrapMode);\n if (undefined === vKnotsCorrected)\n return false; // invalid input\n data.vParams.knots = vKnotsCorrected;\n data.vParams.closed = true;\n break;\n }\n case BSplineWrapMode.OpenByAddingControlPoints: {\n // unwrap poles, knots untouched\n if (!polesTrimmed) {\n const arrays = copyBSplineSurfaceDataPoles(data);\n if (undefined === arrays.poles)\n return false; // invalid input\n data.poles = polesTrimmed = arrays.poles;\n data.weights = weightsTrimmed = arrays.weights;\n }\n for (let i = 0; i < data.vParams.order - 1; ++i)\n polesTrimmed.pop(); // remove last degreeV rows of poles\n if (weightsTrimmed) {\n for (let i = 0; i < data.vParams.order - 1; ++i)\n weightsTrimmed.pop(); // remove last degreeV rows of weights\n }\n data.vParams.numPoles -= data.vParams.order - 1;\n data.vParams.closed = true;\n break;\n }\n }\n\n // always add extraneous knots\n if (!uKnotsCorrected)\n data.uParams.knots = KnotVector.copyKnots(data.uParams.knots, data.uParams.order - 1, true, data.uParams.wrapMode);\n if (!vKnotsCorrected)\n data.vParams.knots = KnotVector.copyKnots(data.vParams.knots, data.vParams.order - 1, true, data.vParams.wrapMode);\n\n convertBSplineSurfaceDataArrays(data, options);\n return true;\n }\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/core-geometry",
3
- "version": "4.6.0-dev.1",
3
+ "version": "4.6.0-dev.13",
4
4
  "description": "iTwin.js Core Geometry library",
5
5
  "main": "lib/cjs/core-geometry.js",
6
6
  "module": "lib/esm/core-geometry.js",
@@ -35,11 +35,11 @@
35
35
  "nyc": "^15.1.0",
36
36
  "rimraf": "^3.0.2",
37
37
  "typescript": "~5.0.2",
38
- "@itwin/build-tools": "4.6.0-dev.1"
38
+ "@itwin/build-tools": "4.6.0-dev.13"
39
39
  },
40
40
  "dependencies": {
41
41
  "flatbuffers": "~1.12.0",
42
- "@itwin/core-bentley": "4.6.0-dev.1"
42
+ "@itwin/core-bentley": "4.6.0-dev.13"
43
43
  },
44
44
  "nyc": {
45
45
  "extends": "./node_modules/@itwin/build-tools/.nycrc",