brepjs 7.5.0 → 8.0.1

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.
Files changed (62) hide show
  1. package/dist/2d/blueprints/blueprintFns.d.ts +0 -22
  2. package/dist/2d/blueprints/blueprintFns.d.ts.map +1 -1
  3. package/dist/2d/blueprints/boolean2D.d.ts +3 -3
  4. package/dist/2d.cjs +1 -57
  5. package/dist/2d.d.ts +1 -2
  6. package/dist/2d.d.ts.map +1 -1
  7. package/dist/2d.js +5 -62
  8. package/dist/{boolean2D-BnuJdfDv.cjs → boolean2D-BdZATaHs.cjs} +3 -3
  9. package/dist/{boolean2D-Ba8TcVzC.js → boolean2D-hOw5Qay5.js} +3 -3
  10. package/dist/brepjs.cjs +18 -37
  11. package/dist/brepjs.js +21 -40
  12. package/dist/{drawFns-D9qkvHgY.js → drawFns-921SkhDL.js} +2 -2
  13. package/dist/{drawFns-DWOskIp7.cjs → drawFns-CUyx50gi.cjs} +2 -2
  14. package/dist/index.d.ts +8 -10
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/io.cjs +1 -1
  17. package/dist/io.js +1 -1
  18. package/dist/{meshFns-BY1fMF48.js → meshFns-AqAjTTVl.js} +4 -4
  19. package/dist/{meshFns-Dbj_k5gq.cjs → meshFns-BhrZGi6w.cjs} +4 -4
  20. package/dist/operations/api.d.ts +2 -4
  21. package/dist/operations/api.d.ts.map +1 -1
  22. package/dist/operations/exporterFns.d.ts +0 -2
  23. package/dist/operations/exporterFns.d.ts.map +1 -1
  24. package/dist/operations/extrude.d.ts +0 -2
  25. package/dist/operations/extrude.d.ts.map +1 -1
  26. package/dist/operations/extrudeFns.d.ts +1 -1
  27. package/dist/operations/extrudeFns.d.ts.map +1 -1
  28. package/dist/operations/extrudeUtils.d.ts +0 -2
  29. package/dist/operations/extrudeUtils.d.ts.map +1 -1
  30. package/dist/operations/loftFns.d.ts +0 -2
  31. package/dist/operations/loftFns.d.ts.map +1 -1
  32. package/dist/operations.d.ts +3 -3
  33. package/dist/operations.d.ts.map +1 -1
  34. package/dist/sketching/sketcherlib.d.ts +2 -4
  35. package/dist/sketching/sketcherlib.d.ts.map +1 -1
  36. package/dist/sketching.cjs +2 -2
  37. package/dist/sketching.d.ts +2 -2
  38. package/dist/sketching.d.ts.map +1 -1
  39. package/dist/sketching.js +2 -2
  40. package/dist/topology/api.d.ts +0 -4
  41. package/dist/topology/api.d.ts.map +1 -1
  42. package/dist/topology/apiTypes.d.ts +0 -2
  43. package/dist/topology/apiTypes.d.ts.map +1 -1
  44. package/dist/topology/index.d.ts +1 -1
  45. package/dist/topology/index.d.ts.map +1 -1
  46. package/dist/topology/meshCache.d.ts +2 -4
  47. package/dist/topology/meshCache.d.ts.map +1 -1
  48. package/dist/topology/primitiveFns.d.ts +0 -8
  49. package/dist/topology/primitiveFns.d.ts.map +1 -1
  50. package/dist/topology/shapeModifiers.d.ts +0 -2
  51. package/dist/topology/shapeModifiers.d.ts.map +1 -1
  52. package/dist/topology/wrapperFns.d.ts +3 -3
  53. package/dist/topology/wrapperFns.d.ts.map +1 -1
  54. package/dist/{topology-DoNKAKMt.cjs → topology-CIooytHH.cjs} +1 -1
  55. package/dist/{topology-CJKeDGUb.js → topology-tFzqSrGH.js} +1 -1
  56. package/dist/topology.cjs +2 -2
  57. package/dist/topology.js +2 -2
  58. package/package.json +3 -3
  59. package/dist/2d/blueprints/boolean2dFns.d.ts +0 -46
  60. package/dist/2d/blueprints/boolean2dFns.d.ts.map +0 -1
  61. package/dist/core/geometry.d.ts +0 -26
  62. package/dist/core/geometry.d.ts.map +0 -1
@@ -32,26 +32,4 @@ export declare function stretch2D(bp: Blueprint, ratio: number, direction: Point
32
32
  export declare function sketch2DOnPlane(bp: Blueprint, inputPlane?: PlaneName | Plane, origin?: PointInput | number): any;
33
33
  /** Map a blueprint onto a 3D face's UV surface, producing sketch data. */
34
34
  export declare function sketch2DOnFace(bp: Blueprint, face: Face, scaleMode?: ScaleMode): any;
35
- /** @deprecated Use getBounds2D instead. Will be removed in v8.0.0. */
36
- export declare function blueprintBoundingBox(bp: Blueprint): BoundingBox2d;
37
- /** @deprecated Use getOrientation2D instead. Will be removed in v8.0.0. */
38
- export declare function blueprintOrientation(bp: Blueprint): 'clockwise' | 'counterClockwise';
39
- /** @deprecated Use translate2D instead. Will be removed in v8.0.0. */
40
- export declare function translateBlueprint(bp: Blueprint, dx: number, dy: number): Blueprint;
41
- /** @deprecated Use rotate2D instead. Will be removed in v8.0.0. */
42
- export declare function rotateBlueprint(bp: Blueprint, angle: number, center?: Point2D): Blueprint;
43
- /** @deprecated Use scale2D instead. Will be removed in v8.0.0. */
44
- export declare function scaleBlueprint(bp: Blueprint, factor: number, center?: Point2D): Blueprint;
45
- /** @deprecated Use mirror2D instead. Will be removed in v8.0.0. */
46
- export declare function mirrorBlueprint(bp: Blueprint, centerOrDirection: Point2D, origin?: Point2D, mode?: 'center' | 'plane'): Blueprint;
47
- /** @deprecated Use stretch2D instead. Will be removed in v8.0.0. */
48
- export declare function stretchBlueprint(bp: Blueprint, ratio: number, direction: Point2D, origin?: Point2D): Blueprint;
49
- /** @deprecated Use toSVGPathD instead. Will be removed in v8.0.0. */
50
- export declare function blueprintToSVGPathD(bp: Blueprint): string;
51
- /** @deprecated Use isInside2D instead. Will be removed in v8.0.0. */
52
- export declare function blueprintIsInside(bp: Blueprint, point: Point2D): boolean;
53
- /** @deprecated Use sketch2DOnPlane instead. Will be removed in v8.0.0. */
54
- export declare function sketchBlueprintOnPlane(bp: Blueprint, inputPlane?: PlaneName | Plane, origin?: PointInput | number): any;
55
- /** @deprecated Use sketch2DOnFace instead. Will be removed in v8.0.0. */
56
- export declare function sketchBlueprintOnFace(bp: Blueprint, face: Face, scaleMode?: ScaleMode): any;
57
35
  //# sourceMappingURL=blueprintFns.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"blueprintFns.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/blueprintFns.ts"],"names":[],"m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K,EAC9B,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,GAE3B,GAAG,CAEL;AAED,0EAA0E;AAC1E,wBAAgB,cAAc,CAC5B,EAAE,EAAE,SAAS,EACb,IAAI,EAAE,IAAI,EACV,SAAS,CAAC,EAAE,SAAS,GAEpB,GAAG,CAEL"}
@@ -24,7 +24,7 @@ export type Shape2D = Blueprint | Blueprints | CompoundBlueprint | null;
24
24
  * const union = fuse2D(circleBlueprint, squareBlueprint);
25
25
  * ```
26
26
  *
27
- * @see {@link fuseBlueprint2D} for the functional API wrapper.
27
+ * @see {@link fuse2D} for the functional API.
28
28
  */
29
29
  export declare const fuse2D: (first: Shape2D, second: Shape2D) => Blueprint | Blueprints | CompoundBlueprint | null;
30
30
  /**
@@ -43,7 +43,7 @@ export declare const fuse2D: (first: Shape2D, second: Shape2D) => Blueprint | Bl
43
43
  * const withHole = cut2D(outerRect, innerCircle);
44
44
  * ```
45
45
  *
46
- * @see {@link cutBlueprint2D} for the functional API wrapper.
46
+ * @see {@link cut2D} for the functional API.
47
47
  */
48
48
  export declare const cut2D: (first: Shape2D, second: Shape2D) => Blueprint | Blueprints | CompoundBlueprint | null;
49
49
  /**
@@ -62,7 +62,7 @@ export declare const cut2D: (first: Shape2D, second: Shape2D) => Blueprint | Blu
62
62
  * const overlap = intersect2D(circle, rectangle);
63
63
  * ```
64
64
  *
65
- * @see {@link intersectBlueprint2D} for the functional API wrapper.
65
+ * @see {@link intersect2D} for the functional API.
66
66
  */
67
67
  export declare function intersect2D(first: Shape2D, second: Shape2D): Blueprint | Blueprints | CompoundBlueprint | null;
68
68
  //# sourceMappingURL=boolean2D.d.ts.map
package/dist/2d.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const Blueprint = require("./Blueprint-CVctc41Z.cjs");
4
- const boolean2D = require("./boolean2D-BnuJdfDv.cjs");
4
+ const boolean2D = require("./boolean2D-BdZATaHs.cjs");
5
5
  function reverseCurve(curve) {
6
6
  const cloned = curve.clone();
7
7
  cloned.reverse();
@@ -67,48 +67,6 @@ function sketch2DOnPlane(bp, inputPlane, origin) {
67
67
  function sketch2DOnFace(bp, face, scaleMode) {
68
68
  return bp.sketchOnFace(face, scaleMode);
69
69
  }
70
- function blueprintBoundingBox(bp) {
71
- return getBounds2D(bp);
72
- }
73
- function blueprintOrientation(bp) {
74
- return getOrientation2D(bp);
75
- }
76
- function translateBlueprint(bp, dx, dy) {
77
- return translate2D(bp, dx, dy);
78
- }
79
- function rotateBlueprint(bp, angle, center) {
80
- return rotate2D(bp, angle, center);
81
- }
82
- function scaleBlueprint(bp, factor, center) {
83
- return scale2D(bp, factor, center);
84
- }
85
- function mirrorBlueprint(bp, centerOrDirection, origin, mode) {
86
- return mirror2D(bp, centerOrDirection, origin, mode);
87
- }
88
- function stretchBlueprint(bp, ratio, direction, origin) {
89
- return stretch2D(bp, ratio, direction, origin);
90
- }
91
- function blueprintToSVGPathD(bp) {
92
- return toSVGPathD(bp);
93
- }
94
- function blueprintIsInside(bp, point) {
95
- return isInside2D(bp, point);
96
- }
97
- function sketchBlueprintOnPlane(bp, inputPlane, origin) {
98
- return sketch2DOnPlane(bp, inputPlane, origin);
99
- }
100
- function sketchBlueprintOnFace(bp, face, scaleMode) {
101
- return sketch2DOnFace(bp, face, scaleMode);
102
- }
103
- function fuseBlueprint2D(a, b) {
104
- return boolean2D.fuse2D(a, b);
105
- }
106
- function cutBlueprint2D(base, tool) {
107
- return boolean2D.cut2D(base, tool);
108
- }
109
- function intersectBlueprint2D(a, b) {
110
- return boolean2D.intersect2D(a, b);
111
- }
112
70
  exports.Blueprint = Blueprint.Blueprint;
113
71
  exports.BoundingBox2d = Blueprint.BoundingBox2d;
114
72
  exports.Curve2D = Blueprint.Curve2D;
@@ -124,10 +82,6 @@ exports.intersectBlueprints = boolean2D.intersectBlueprints;
124
82
  exports.organiseBlueprints = boolean2D.organiseBlueprints;
125
83
  exports.polysidesBlueprint = boolean2D.polysidesBlueprint;
126
84
  exports.roundedRectangleBlueprint = boolean2D.roundedRectangleBlueprint;
127
- exports.blueprintBoundingBox = blueprintBoundingBox;
128
- exports.blueprintIsInside = blueprintIsInside;
129
- exports.blueprintOrientation = blueprintOrientation;
130
- exports.blueprintToSVGPathD = blueprintToSVGPathD;
131
85
  exports.createBlueprint = createBlueprint;
132
86
  exports.curve2dBoundingBox = curve2dBoundingBox;
133
87
  exports.curve2dDistanceFrom = curve2dDistanceFrom;
@@ -137,25 +91,15 @@ exports.curve2dLastPoint = curve2dLastPoint;
137
91
  exports.curve2dParameter = curve2dParameter;
138
92
  exports.curve2dSplitAt = curve2dSplitAt;
139
93
  exports.curve2dTangentAt = curve2dTangentAt;
140
- exports.cutBlueprint2D = cutBlueprint2D;
141
- exports.fuseBlueprint2D = fuseBlueprint2D;
142
94
  exports.getBounds2D = getBounds2D;
143
95
  exports.getOrientation2D = getOrientation2D;
144
- exports.intersectBlueprint2D = intersectBlueprint2D;
145
96
  exports.isInside2D = isInside2D;
146
97
  exports.mirror2D = mirror2D;
147
- exports.mirrorBlueprint = mirrorBlueprint;
148
98
  exports.reverseCurve = reverseCurve;
149
99
  exports.rotate2D = rotate2D;
150
- exports.rotateBlueprint = rotateBlueprint;
151
100
  exports.scale2D = scale2D;
152
- exports.scaleBlueprint = scaleBlueprint;
153
101
  exports.sketch2DOnFace = sketch2DOnFace;
154
102
  exports.sketch2DOnPlane = sketch2DOnPlane;
155
- exports.sketchBlueprintOnFace = sketchBlueprintOnFace;
156
- exports.sketchBlueprintOnPlane = sketchBlueprintOnPlane;
157
103
  exports.stretch2D = stretch2D;
158
- exports.stretchBlueprint = stretchBlueprint;
159
104
  exports.toSVGPathD = toSVGPathD;
160
105
  exports.translate2D = translate2D;
161
- exports.translateBlueprint = translateBlueprint;
package/dist/2d.d.ts CHANGED
@@ -13,8 +13,7 @@
13
13
  export { default as Blueprint } from './2d/blueprints/Blueprint.js';
14
14
  export { default as CompoundBlueprint } from './2d/blueprints/CompoundBlueprint.js';
15
15
  export { default as Blueprints } from './2d/blueprints/Blueprints.js';
16
- export { createBlueprint, getBounds2D, getOrientation2D, isInside2D, toSVGPathD, translate2D, rotate2D, scale2D, mirror2D, stretch2D, sketch2DOnPlane, sketch2DOnFace, blueprintBoundingBox, blueprintOrientation, translateBlueprint, rotateBlueprint, scaleBlueprint, mirrorBlueprint, stretchBlueprint, blueprintToSVGPathD, blueprintIsInside, sketchBlueprintOnPlane, sketchBlueprintOnFace, } from './2d/blueprints/blueprintFns.js';
17
- export { fuseBlueprint2D, cutBlueprint2D, intersectBlueprint2D, } from './2d/blueprints/boolean2dFns.js';
16
+ export { createBlueprint, getBounds2D, getOrientation2D, isInside2D, toSVGPathD, translate2D, rotate2D, scale2D, mirror2D, stretch2D, sketch2DOnPlane, sketch2DOnFace, } from './2d/blueprints/blueprintFns.js';
18
17
  export { fuseBlueprints, cutBlueprints, intersectBlueprints, } from './2d/blueprints/booleanOperations.js';
19
18
  export { fuse2D, cut2D, intersect2D, type Shape2D } from './2d/blueprints/boolean2D.js';
20
19
  export { reverseCurve, curve2dBoundingBox, curve2dFirstPoint, curve2dLastPoint, curve2dSplitAt, curve2dParameter, curve2dTangentAt, curve2dIsOnCurve, curve2dDistanceFrom, } from './2d/lib/curve2dFns.js';
package/dist/2d.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"2d.d.ts","sourceRoot":"","sources":["../src/2d.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAItE,OAAO,EACL,eAAe,EAEf,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ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gB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,SAAS,EACT,eAAe,EACf,cAAc,GACf,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EACL,cAAc,EACd,aAAa,EACb,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAIxF,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAE,KAAK,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AACpG,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
package/dist/2d.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { B as Blueprint } from "./Blueprint-D3JfGJTz.js";
2
2
  import { a, C, b } from "./Blueprint-D3JfGJTz.js";
3
- import { c as cut2D, f as fuse2D, i as intersect2D } from "./boolean2D-Ba8TcVzC.js";
4
- import { b as b2, C as C2, d, e, g, o, p, r } from "./boolean2D-Ba8TcVzC.js";
3
+ import { b as b2, C as C2, c, d, f, e, i, g, o, p, r } from "./boolean2D-hOw5Qay5.js";
5
4
  function reverseCurve(curve) {
6
5
  const cloned = curve.clone();
7
6
  cloned.reverse();
@@ -67,48 +66,6 @@ function sketch2DOnPlane(bp, inputPlane, origin) {
67
66
  function sketch2DOnFace(bp, face, scaleMode) {
68
67
  return bp.sketchOnFace(face, scaleMode);
69
68
  }
70
- function blueprintBoundingBox(bp) {
71
- return getBounds2D(bp);
72
- }
73
- function blueprintOrientation(bp) {
74
- return getOrientation2D(bp);
75
- }
76
- function translateBlueprint(bp, dx, dy) {
77
- return translate2D(bp, dx, dy);
78
- }
79
- function rotateBlueprint(bp, angle, center) {
80
- return rotate2D(bp, angle, center);
81
- }
82
- function scaleBlueprint(bp, factor, center) {
83
- return scale2D(bp, factor, center);
84
- }
85
- function mirrorBlueprint(bp, centerOrDirection, origin, mode) {
86
- return mirror2D(bp, centerOrDirection, origin, mode);
87
- }
88
- function stretchBlueprint(bp, ratio, direction, origin) {
89
- return stretch2D(bp, ratio, direction, origin);
90
- }
91
- function blueprintToSVGPathD(bp) {
92
- return toSVGPathD(bp);
93
- }
94
- function blueprintIsInside(bp, point) {
95
- return isInside2D(bp, point);
96
- }
97
- function sketchBlueprintOnPlane(bp, inputPlane, origin) {
98
- return sketch2DOnPlane(bp, inputPlane, origin);
99
- }
100
- function sketchBlueprintOnFace(bp, face, scaleMode) {
101
- return sketch2DOnFace(bp, face, scaleMode);
102
- }
103
- function fuseBlueprint2D(a2, b3) {
104
- return fuse2D(a2, b3);
105
- }
106
- function cutBlueprint2D(base, tool) {
107
- return cut2D(base, tool);
108
- }
109
- function intersectBlueprint2D(a2, b3) {
110
- return intersect2D(a2, b3);
111
- }
112
69
  export {
113
70
  Blueprint,
114
71
  b2 as Blueprints,
@@ -116,10 +73,6 @@ export {
116
73
  C2 as CompoundBlueprint,
117
74
  C as Curve2D,
118
75
  b as axis2d,
119
- blueprintBoundingBox,
120
- blueprintIsInside,
121
- blueprintOrientation,
122
- blueprintToSVGPathD,
123
76
  createBlueprint,
124
77
  curve2dBoundingBox,
125
78
  curve2dDistanceFrom,
@@ -129,35 +82,25 @@ export {
129
82
  curve2dParameter,
130
83
  curve2dSplitAt,
131
84
  curve2dTangentAt,
132
- cut2D,
133
- cutBlueprint2D,
85
+ c as cut2D,
134
86
  d as cutBlueprints,
135
- fuse2D,
136
- fuseBlueprint2D,
87
+ f as fuse2D,
137
88
  e as fuseBlueprints,
138
89
  getBounds2D,
139
90
  getOrientation2D,
140
- intersect2D,
141
- intersectBlueprint2D,
91
+ i as intersect2D,
142
92
  g as intersectBlueprints,
143
93
  isInside2D,
144
94
  mirror2D,
145
- mirrorBlueprint,
146
95
  o as organiseBlueprints,
147
96
  p as polysidesBlueprint,
148
97
  reverseCurve,
149
98
  rotate2D,
150
- rotateBlueprint,
151
99
  r as roundedRectangleBlueprint,
152
100
  scale2D,
153
- scaleBlueprint,
154
101
  sketch2DOnFace,
155
102
  sketch2DOnPlane,
156
- sketchBlueprintOnFace,
157
- sketchBlueprintOnPlane,
158
103
  stretch2D,
159
- stretchBlueprint,
160
104
  toSVGPathD,
161
- translate2D,
162
- translateBlueprint
105
+ translate2D
163
106
  };
@@ -1113,7 +1113,7 @@ class Sketch {
1113
1113
  }
1114
1114
  }
1115
1115
  const isTangent = (c) => c === "symmetric" || typeof c === "number" || Array.isArray(c) && c.length === 2;
1116
- const defaultsSplineConfig = (config) => {
1116
+ const defaultsSplineOptions = (config) => {
1117
1117
  let conf;
1118
1118
  if (!config) conf = { endTangent: [1, 0] };
1119
1119
  else if (isTangent(config)) {
@@ -1518,7 +1518,7 @@ class BaseSketcher2d {
1518
1518
  }
1519
1519
  /** Draw a smooth cubic Bezier spline to an absolute end point, blending tangent with the previous curve. */
1520
1520
  smoothSplineTo(end, config) {
1521
- const { endTangent, startTangent, startFactor, endFactor } = defaultsSplineConfig(config);
1521
+ const { endTangent, startTangent, startFactor, endFactor } = defaultsSplineOptions(config);
1522
1522
  const previousCurve = this.pendingCurves.length ? this.pendingCurves[this.pendingCurves.length - 1] : null;
1523
1523
  const defaultDistance = query.distance2d(this.pointer, end) * 0.25;
1524
1524
  let startPoleDirection;
@@ -2366,7 +2366,7 @@ exports.chamferCurves = chamferCurves;
2366
2366
  exports.convertSvgEllipseParams = convertSvgEllipseParams;
2367
2367
  exports.cut2D = cut2D;
2368
2368
  exports.cutBlueprints = cutBlueprints;
2369
- exports.defaultsSplineConfig = defaultsSplineConfig;
2369
+ exports.defaultsSplineOptions = defaultsSplineOptions;
2370
2370
  exports.filletCurves = filletCurves;
2371
2371
  exports.fuse2D = fuse2D;
2372
2372
  exports.fuseBlueprints = fuseBlueprints;
@@ -1112,7 +1112,7 @@ class Sketch {
1112
1112
  }
1113
1113
  }
1114
1114
  const isTangent = (c) => c === "symmetric" || typeof c === "number" || Array.isArray(c) && c.length === 2;
1115
- const defaultsSplineConfig = (config) => {
1115
+ const defaultsSplineOptions = (config) => {
1116
1116
  let conf;
1117
1117
  if (!config) conf = { endTangent: [1, 0] };
1118
1118
  else if (isTangent(config)) {
@@ -1517,7 +1517,7 @@ class BaseSketcher2d {
1517
1517
  }
1518
1518
  /** Draw a smooth cubic Bezier spline to an absolute end point, blending tangent with the previous curve. */
1519
1519
  smoothSplineTo(end, config) {
1520
- const { endTangent, startTangent, startFactor, endFactor } = defaultsSplineConfig(config);
1520
+ const { endTangent, startTangent, startFactor, endFactor } = defaultsSplineOptions(config);
1521
1521
  const previousCurve = this.pendingCurves.length ? this.pendingCurves[this.pendingCurves.length - 1] : null;
1522
1522
  const defaultDistance = distance2d(this.pointer, end) * 0.25;
1523
1523
  let startPoleDirection;
@@ -2369,7 +2369,7 @@ export {
2369
2369
  Flatbush as h,
2370
2370
  intersect2D as i,
2371
2371
  convertSvgEllipseParams as j,
2372
- defaultsSplineConfig as k,
2372
+ defaultsSplineOptions as k,
2373
2373
  intersectCurves as l,
2374
2374
  make2dOffset as m,
2375
2375
  filletCurves as n,
package/dist/brepjs.cjs CHANGED
@@ -8,16 +8,16 @@ const Blueprint = require("./Blueprint-CVctc41Z.cjs");
8
8
  const curveFns = require("./curveFns-BilyYL_s.cjs");
9
9
  const loft$2 = require("./loft-BzWFokmC.cjs");
10
10
  const operations = require("./operations-BP1wVDw0.cjs");
11
- const boolean2D = require("./boolean2D-BnuJdfDv.cjs");
11
+ const boolean2D = require("./boolean2D-BdZATaHs.cjs");
12
12
  const _2d = require("./2d.cjs");
13
13
  const query = require("./query-hMSmOWJP.cjs");
14
14
  const io = require("./io.cjs");
15
- const drawFns = require("./drawFns-DWOskIp7.cjs");
15
+ const drawFns = require("./drawFns-CUyx50gi.cjs");
16
16
  const vectors = require("./vectors-ChWEZPwy.cjs");
17
17
  const shapeFns = require("./shapeFns-BvOndshS.cjs");
18
- const topology = require("./topology-DoNKAKMt.cjs");
18
+ const topology = require("./topology-CIooytHH.cjs");
19
19
  const faceFns = require("./faceFns-BwK7FP7N.cjs");
20
- const meshFns = require("./meshFns-Dbj_k5gq.cjs");
20
+ const meshFns = require("./meshFns-BhrZGi6w.cjs");
21
21
  const booleanFns = require("./booleanFns-BBSVKhL2.cjs");
22
22
  const measurement = require("./measurement-fxm_pW7x.cjs");
23
23
  const shapeHelpers = require("./shapeHelpers-B2SXz1p4.cjs");
@@ -52,11 +52,6 @@ function kernelCallRaw(fn, code, message, kind = "OCCT_OPERATION") {
52
52
  return errors.err(errorFactories[kind](code, `${message}: ${translatedMessage}`, e));
53
53
  }
54
54
  }
55
- function isPoint(p) {
56
- if (Array.isArray(p)) return p.length === 3 || p.length === 2;
57
- else if (p && typeof p?.XYZ === "function") return true;
58
- return false;
59
- }
60
55
  function isNumber(r) {
61
56
  return typeof r === "number";
62
57
  }
@@ -127,12 +122,13 @@ function box(width, depth, height, options) {
127
122
  const maker = r(new oc.BRepPrimAPI_MakeBox_2(width, depth, height));
128
123
  let solid2 = shapeTypes.createSolid(maker.Solid());
129
124
  gc();
130
- const at = options?.at ?? (options?.center !== void 0 && options.center !== true ? options.center : void 0);
131
- const centered = options?.centered ?? options?.center === true;
132
- if (at) {
133
- solid2 = shapeFns.translate(solid2, [at[0] - width / 2, at[1] - depth / 2, at[2] - height / 2]);
134
- } else if (centered) {
135
- solid2 = shapeFns.translate(solid2, [-width / 2, -depth / 2, -height / 2]);
125
+ const center = options?.at ?? (options?.centered ? [0, 0, 0] : void 0);
126
+ if (center) {
127
+ solid2 = shapeFns.translate(solid2, [
128
+ center[0] - width / 2,
129
+ center[1] - depth / 2,
130
+ center[2] - height / 2
131
+ ]);
136
132
  }
137
133
  return solid2;
138
134
  }
@@ -185,11 +181,11 @@ function line(from, to) {
185
181
  return shapeHelpers.makeLine(from, to);
186
182
  }
187
183
  function circle(radius, options) {
188
- const axisDir = options?.axis ?? options?.normal ?? [0, 0, 1];
184
+ const axisDir = options?.axis ?? [0, 0, 1];
189
185
  return shapeHelpers.makeCircle(radius, options?.at ?? [0, 0, 0], axisDir);
190
186
  }
191
187
  function ellipse(majorRadius, minorRadius, options) {
192
- const axisDir = options?.axis ?? options?.normal ?? [0, 0, 1];
188
+ const axisDir = options?.axis ?? [0, 0, 1];
193
189
  return shapeHelpers.makeEllipse(majorRadius, minorRadius, options?.at ?? [0, 0, 0], axisDir, options?.xDir);
194
190
  }
195
191
  function helix(pitch, height, radius, options) {
@@ -206,7 +202,7 @@ function threePointArc(p1, p2, p3) {
206
202
  return shapeHelpers.makeThreePointArc(p1, p2, p3);
207
203
  }
208
204
  function ellipseArc(majorRadius, minorRadius, startAngle, endAngle, options) {
209
- const axisDir = options?.axis ?? options?.normal ?? [0, 0, 1];
205
+ const axisDir = options?.axis ?? [0, 0, 1];
210
206
  return shapeHelpers.makeEllipseArc(
211
207
  majorRadius,
212
208
  minorRadius,
@@ -448,11 +444,11 @@ function translate(shape2, v) {
448
444
  return shapeFns.translate(resolve(shape2), v);
449
445
  }
450
446
  function rotate(shape2, angle, options) {
451
- const pivotPoint = options?.at ?? options?.around;
447
+ const pivotPoint = options?.at;
452
448
  return shapeFns.rotate(resolve(shape2), angle, pivotPoint, options?.axis);
453
449
  }
454
450
  function mirror(shape2, options) {
455
- const planeOrigin = options?.at ?? options?.origin;
451
+ const planeOrigin = options?.at;
456
452
  return shapeFns.mirror(resolve(shape2), options?.normal ?? [1, 0, 0], planeOrigin);
457
453
  }
458
454
  function scale(shape2, factor, options) {
@@ -627,7 +623,7 @@ function extrude(face2, height) {
627
623
  return operations.extrude(f, vec);
628
624
  }
629
625
  function revolve(face2, options) {
630
- const pivotPoint = options?.at ?? options?.around ?? [0, 0, 0];
626
+ const pivotPoint = options?.at ?? [0, 0, 0];
631
627
  return operations.revolve(
632
628
  resolve(face2),
633
629
  pivotPoint,
@@ -733,7 +729,7 @@ function boss(shape2, options) {
733
729
  function mirrorJoin(shape2, options) {
734
730
  const s = resolve(shape2);
735
731
  const normal = options?.normal ?? [1, 0, 0];
736
- const planeOrigin = options?.at ?? options?.origin;
732
+ const planeOrigin = options?.at;
737
733
  const mirrored = shapeFns.mirror(s, normal, planeOrigin);
738
734
  return booleanFns.fuse(s, mirrored);
739
735
  }
@@ -1084,10 +1080,6 @@ exports.intersectBlueprints = boolean2D.intersectBlueprints;
1084
1080
  exports.organiseBlueprints = boolean2D.organiseBlueprints;
1085
1081
  exports.polysidesBlueprint = boolean2D.polysidesBlueprint;
1086
1082
  exports.roundedRectangleBlueprint = boolean2D.roundedRectangleBlueprint;
1087
- exports.blueprintBoundingBox = _2d.blueprintBoundingBox;
1088
- exports.blueprintIsInside = _2d.blueprintIsInside;
1089
- exports.blueprintOrientation = _2d.blueprintOrientation;
1090
- exports.blueprintToSVGPathD = _2d.blueprintToSVGPathD;
1091
1083
  exports.createBlueprint = _2d.createBlueprint;
1092
1084
  exports.curve2dBoundingBox = _2d.curve2dBoundingBox;
1093
1085
  exports.curve2dDistanceFrom = _2d.curve2dDistanceFrom;
@@ -1097,28 +1089,18 @@ exports.curve2dLastPoint = _2d.curve2dLastPoint;
1097
1089
  exports.curve2dParameter = _2d.curve2dParameter;
1098
1090
  exports.curve2dSplitAt = _2d.curve2dSplitAt;
1099
1091
  exports.curve2dTangentAt = _2d.curve2dTangentAt;
1100
- exports.cutBlueprint2D = _2d.cutBlueprint2D;
1101
- exports.fuseBlueprint2D = _2d.fuseBlueprint2D;
1102
1092
  exports.getBounds2D = _2d.getBounds2D;
1103
1093
  exports.getOrientation2D = _2d.getOrientation2D;
1104
- exports.intersectBlueprint2D = _2d.intersectBlueprint2D;
1105
1094
  exports.isInside2D = _2d.isInside2D;
1106
1095
  exports.mirror2D = _2d.mirror2D;
1107
- exports.mirrorBlueprint = _2d.mirrorBlueprint;
1108
1096
  exports.reverseCurve = _2d.reverseCurve;
1109
1097
  exports.rotate2D = _2d.rotate2D;
1110
- exports.rotateBlueprint = _2d.rotateBlueprint;
1111
1098
  exports.scale2D = _2d.scale2D;
1112
- exports.scaleBlueprint = _2d.scaleBlueprint;
1113
1099
  exports.sketch2DOnFace = _2d.sketch2DOnFace;
1114
1100
  exports.sketch2DOnPlane = _2d.sketch2DOnPlane;
1115
- exports.sketchBlueprintOnFace = _2d.sketchBlueprintOnFace;
1116
- exports.sketchBlueprintOnPlane = _2d.sketchBlueprintOnPlane;
1117
1101
  exports.stretch2D = _2d.stretch2D;
1118
- exports.stretchBlueprint = _2d.stretchBlueprint;
1119
1102
  exports.toSVGPathD = _2d.toSVGPathD;
1120
1103
  exports.translate2D = _2d.translate2D;
1121
- exports.translateBlueprint = _2d.translateBlueprint;
1122
1104
  exports.cornerFinder = query.cornerFinder;
1123
1105
  exports.edgeFinder = query.edgeFinder;
1124
1106
  exports.faceFinder = query.faceFinder;
@@ -1315,7 +1297,6 @@ exports.isChamferRadius = isChamferRadius;
1315
1297
  exports.isEmpty = isEmpty;
1316
1298
  exports.isFilletRadius = isFilletRadius;
1317
1299
  exports.isNumber = isNumber;
1318
- exports.isPoint = isPoint;
1319
1300
  exports.isValid = isValid;
1320
1301
  exports.kernelCall = kernelCall;
1321
1302
  exports.kernelCallRaw = kernelCallRaw;