brepjs 20.12.14 → 20.13.0

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 (106) hide show
  1. package/dist/2d/blueprints/blueprintFns.d.ts +2 -0
  2. package/dist/2d.cjs +6 -6
  3. package/dist/2d.js +6 -6
  4. package/dist/{adjacencyFns-DyHi1paM.cjs → adjacencyFns-BXzEHSC5.cjs} +3 -3
  5. package/dist/{adjacencyFns-DT8YVOtE.js → adjacencyFns-BYjzMejn.js} +3 -3
  6. package/dist/{blueprint-CGBIm-Xk.cjs → blueprint-464KGkzc.cjs} +5 -5
  7. package/dist/{blueprint-BzgIBZly.js → blueprint-D-4-uTkr.js} +5 -5
  8. package/dist/{blueprintFns-Crktz0-W.cjs → blueprintFns-BdyFiuiC.cjs} +4 -5
  9. package/dist/{blueprintFns-CN6koAgD.js → blueprintFns-CE5RdX-E.js} +4 -5
  10. package/dist/{blueprintSketcher-C5Nn6Yi7.cjs → blueprintSketcher-C4XHzqTw.cjs} +3 -3
  11. package/dist/{blueprintSketcher-C28vnWYu.js → blueprintSketcher-CQ9LxcIl.js} +3 -3
  12. package/dist/{boolean2D-BRmFbYsb.cjs → boolean2D-CKE32vHV.cjs} +4 -4
  13. package/dist/{boolean2D-BWpQMVia.js → boolean2D-DwJvQ4p_.js} +4 -4
  14. package/dist/{booleanFns-Dcv_aMcv.js → booleanFns-CsTz48A3.js} +5 -5
  15. package/dist/{booleanFns-CvBttd1y.cjs → booleanFns-MkzdfjDv.cjs} +5 -5
  16. package/dist/brepjs.cjs +35 -41
  17. package/dist/brepjs.js +35 -41
  18. package/dist/{cameraFns-xIy84D75.js → cameraFns-BDl_D28X.js} +3 -3
  19. package/dist/{cameraFns-Ds_tNjP7.cjs → cameraFns-vHpapIZG.cjs} +3 -3
  20. package/dist/core/shapeTypes.d.ts +8 -4
  21. package/dist/core.cjs +2 -2
  22. package/dist/core.js +2 -2
  23. package/dist/{cornerFinder-BEUeERZd.js → cornerFinder-Dyk5sKEN.js} +1 -1
  24. package/dist/{cornerFinder-BUj9Ms_n.cjs → cornerFinder-adDN0_C4.cjs} +1 -1
  25. package/dist/{curveFns-Dneh4D9N.cjs → curveFns-HtjEh2W-.cjs} +1 -1
  26. package/dist/{curveFns-DR1JAITD.js → curveFns-RjNVzxNc.js} +1 -1
  27. package/dist/{drawFns-CkHnrB4o.cjs → drawFns-B5gZtD_P.cjs} +12 -12
  28. package/dist/{drawFns-BPskIgvL.js → drawFns-stc8-Gma.js} +12 -12
  29. package/dist/{faceFns-ClpZLuHU.cjs → faceFns-C7wBHMPv.cjs} +2 -2
  30. package/dist/{faceFns-Ek2vnYA8.js → faceFns-DaPoCzd-.js} +2 -2
  31. package/dist/{healingFns-CTPsDQkF.js → healingFns-C3Wq_hN3.js} +79 -31
  32. package/dist/{healingFns-CVGVC3-a.cjs → healingFns-zYCbT8vR.cjs} +79 -31
  33. package/dist/{helpers-ClWqvNl5.cjs → helpers-BdtYVyP5.cjs} +6 -6
  34. package/dist/{helpers-TeE5hIEo.js → helpers-CDzSlBi_.js} +6 -6
  35. package/dist/{importFns-1qi--R8S.cjs → importFns-CotbQ9l7.cjs} +5 -5
  36. package/dist/{importFns-DTyCvMc3.js → importFns-DR7Adv-W.js} +5 -5
  37. package/dist/io.cjs +2 -2
  38. package/dist/io.js +2 -2
  39. package/dist/kernel/interfaces/evolutionOps.d.ts +9 -0
  40. package/dist/kernel/interfaces/modifierOps.d.ts +17 -8
  41. package/dist/kernel/interfaces/transformOps.d.ts +7 -2
  42. package/dist/kernel/occt/transformOps.d.ts +1 -1
  43. package/dist/kernel/occtWasm/evolutionOps.d.ts +2 -0
  44. package/dist/kernel/occtWasm/helpers.d.ts +6 -0
  45. package/dist/kernel/occtWasm/modifierOps.d.ts +2 -8
  46. package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
  47. package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +3 -5
  48. package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
  49. package/dist/kernel/occtWasm/occtWasmTypes.d.ts +2 -0
  50. package/dist/{loftFns-BqA5gWFR.cjs → loftFns-C9k9UAKh.cjs} +19 -52
  51. package/dist/{loftFns-DbXEtPKz.js → loftFns-Cbnrz3p8.js} +19 -52
  52. package/dist/{measureFns-_Q-bggOu.cjs → measureFns-Bi62maOJ.cjs} +3 -3
  53. package/dist/{measureFns-NLCrquKi.js → measureFns-DivR02Xb.js} +3 -3
  54. package/dist/measurement.cjs +2 -2
  55. package/dist/measurement.js +2 -2
  56. package/dist/{meshFns-DmKYxmT_.cjs → meshFns-8MTf0Lo_.cjs} +4 -4
  57. package/dist/{meshFns-DBN_h_7v.js → meshFns-CcuY52tt.js} +4 -4
  58. package/dist/{occtWasmAdapter-Be-xZvbQ.js → occtWasmAdapter-1k4udeb3.js} +51 -7
  59. package/dist/{occtWasmAdapter-TX9M5rkb.cjs → occtWasmAdapter-BNOuP9DA.cjs} +51 -7
  60. package/dist/operations/instanceFns.d.ts +3 -2
  61. package/dist/operations/sweepFns.d.ts +15 -3
  62. package/dist/operations.cjs +2 -2
  63. package/dist/operations.js +2 -2
  64. package/dist/{primitiveFns-u5Vnoanh.cjs → primitiveFns-BifV4IGL.cjs} +5 -5
  65. package/dist/{primitiveFns-D53I6iYC.js → primitiveFns-uDvN1FH6.js} +5 -5
  66. package/dist/{principalBoxFns-Cs3z4CmX.cjs → principalBoxFns-DjxE8Rym.cjs} +3 -3
  67. package/dist/{principalBoxFns-B3NAkStp.js → principalBoxFns-ez0xXLyK.js} +3 -3
  68. package/dist/projection.cjs +1 -1
  69. package/dist/projection.js +1 -1
  70. package/dist/query.cjs +2 -2
  71. package/dist/query.js +2 -2
  72. package/dist/{refResolveFns-CEx0Xso0.cjs → refResolveFns-CTkAPUwM.cjs} +6 -6
  73. package/dist/{refResolveFns-LMvuE8em.js → refResolveFns-CuaYXFya.js} +6 -6
  74. package/dist/{shapeFns-24B0u4KE.js → shapeFns-DgpWLKra.js} +2 -2
  75. package/dist/{shapeFns-CahtmyZr.cjs → shapeFns-Rmgd4x9I.cjs} +2 -2
  76. package/dist/shapeRef.cjs +1 -1
  77. package/dist/shapeRef.js +1 -1
  78. package/dist/{shapeTypes-6tBG0xrR.cjs → shapeTypes-BjitsJRQ.cjs} +20 -18
  79. package/dist/{shapeTypes-DZGS7hgn.js → shapeTypes-DbPghQD3.js} +20 -18
  80. package/dist/sketching/compoundSketch.d.ts +3 -2
  81. package/dist/sketching/sketch.d.ts +5 -4
  82. package/dist/sketching/sketches.d.ts +3 -2
  83. package/dist/sketching.cjs +3 -3
  84. package/dist/sketching.js +3 -3
  85. package/dist/{solidBuilders-BHGa-BWa.js → solidBuilders-BUI_fGzR.js} +3 -3
  86. package/dist/{solidBuilders-Dl6d8fGZ.cjs → solidBuilders-Bs2NA3xl.cjs} +3 -3
  87. package/dist/{surfaceBuilders-BVyLEFoG.js → surfaceBuilders-CO_DKhWA.js} +3 -3
  88. package/dist/{surfaceBuilders-BtYpRGXh.cjs → surfaceBuilders-Cn1mkQ3j.cjs} +3 -3
  89. package/dist/text.cjs +2 -2
  90. package/dist/text.js +2 -2
  91. package/dist/{textBlueprints-CihV6AGR.js → textBlueprints-CT0Kbw1f.js} +8 -8
  92. package/dist/{textBlueprints-C1aPqvXX.cjs → textBlueprints-P_D0KUVx.cjs} +8 -8
  93. package/dist/{textMetrics-BhTII8oU.cjs → textMetrics-CVyX8GyL.cjs} +1 -1
  94. package/dist/{textMetrics-CTA6sIE_.js → textMetrics-CXKdzefS.js} +1 -1
  95. package/dist/{threadFns-BK2TDl2R.cjs → threadFns-BV4HLdPE.cjs} +7 -7
  96. package/dist/{threadFns-B2Foaws1.js → threadFns-COs6jmaf.js} +7 -7
  97. package/dist/topology/apiTypes.d.ts +12 -3
  98. package/dist/topology/chamferAngleFns.d.ts +18 -9
  99. package/dist/topology/wrapperFns.d.ts +11 -2
  100. package/dist/topology.cjs +9 -9
  101. package/dist/topology.js +9 -9
  102. package/dist/{topologyQueryFns-BRXpZFCi.js → topologyQueryFns-J2ae_Gvc.js} +1 -1
  103. package/dist/{topologyQueryFns-t8CbgIAS.cjs → topologyQueryFns-s0LddGkF.cjs} +1 -1
  104. package/dist/{validityTypes-CT2goK1c.cjs → validityTypes-BVZ0lSNi.cjs} +1 -1
  105. package/dist/{validityTypes-OSx482aJ.js → validityTypes-CD_Xz0vZ.js} +1 -1
  106. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { A as UnsupportedKernelOperationError, C as reverseCurve2d$2, D as tangentCurve2d, E as serializeCurve2d$2, N as EXACT_BREP_CAPABILITIES, O as translateCurve2d$2, P as OCCT_CAPABILITIES, S as offsetCurve2d$2, T as scaleCurve2d$2, _ as makeCircle2d$2, a as buildAsciiSTL, b as mirrorAcrossAxis, c as createBBox2d, d as deserializeCurve2d$2, f as evaluateCurve2d$2, g as makeBezier2d$2, h as makeArc2dThreePoints, i as DEFAULT_STL_TOLERANCE, j as isUnsupportedKernelOperationError, k as quickHull, l as curveBounds, m as makeArc2dTangent, o as buildBinarySTL, p as intersectCurves2dFn, r as DEFAULT_STL_ANGULAR_TOLERANCE, s as addCurveToBBox, t as OcctWasmAdapter, u as curveTypeName, v as makeEllipse2d$2, w as rotateCurve2d$2, x as mirrorAtPoint, y as makeLine2d$2 } from "./occtWasmAdapter-Be-xZvbQ.js";
1
+ import { A as UnsupportedKernelOperationError, C as reverseCurve2d$2, D as tangentCurve2d, E as serializeCurve2d$2, N as EXACT_BREP_CAPABILITIES, O as translateCurve2d$2, P as OCCT_CAPABILITIES, S as offsetCurve2d$2, T as scaleCurve2d$2, _ as makeCircle2d$2, a as buildAsciiSTL, b as mirrorAcrossAxis, c as createBBox2d, d as deserializeCurve2d$2, f as evaluateCurve2d$2, g as makeBezier2d$2, h as makeArc2dThreePoints, i as DEFAULT_STL_TOLERANCE, j as isUnsupportedKernelOperationError, k as quickHull, l as curveBounds, m as makeArc2dTangent, o as buildBinarySTL, p as intersectCurves2dFn, r as DEFAULT_STL_ANGULAR_TOLERANCE, s as addCurveToBBox, t as OcctWasmAdapter, u as curveTypeName, v as makeEllipse2d$2, w as rotateCurve2d$2, x as mirrorAtPoint, y as makeLine2d$2 } from "./occtWasmAdapter-1k4udeb3.js";
2
2
  import { i as wasmIndex, r as vec3At } from "./bug-ClMTAJhe.js";
3
3
  // src/kernel/quality.ts
4
4
  /**
@@ -2184,7 +2184,7 @@ function transformBatch$2(oc, entries) {
2184
2184
  return entries.map((e) => {
2185
2185
  switch (e.type) {
2186
2186
  case "translate": return translate$2(oc, e.shape, e.x, e.y, e.z);
2187
- case "rotate": return rotate$2(oc, e.shape, e.angle, [...e.axis], [...e.center]);
2187
+ case "rotate": return rotate$2(oc, e.shape, e.angle * Math.PI / 180, [...e.axis], [...e.center]);
2188
2188
  case "scale": return scale$2(oc, e.shape, [...e.center], e.factor);
2189
2189
  case "mirror": return mirror$2(oc, e.shape, [...e.origin], [...e.normal]);
2190
2190
  }
@@ -2229,7 +2229,7 @@ function translate$2(oc, shape, x, y, z) {
2229
2229
  return result;
2230
2230
  }
2231
2231
  /**
2232
- * Rotates a shape around an axis.
2232
+ * Rotates a shape by `angle` radians around an axis.
2233
2233
  */
2234
2234
  function rotate$2(oc, shape, angle, axis = [
2235
2235
  0,
@@ -2244,7 +2244,7 @@ function rotate$2(oc, shape, angle, axis = [
2244
2244
  const origin = new oc.gp_Pnt_3(...center);
2245
2245
  const dir = new oc.gp_Dir_5(...axis);
2246
2246
  const ax1 = new oc.gp_Ax1_2(origin, dir);
2247
- trsf.SetRotation_1(ax1, angle * Math.PI / 180);
2247
+ trsf.SetRotation_1(ax1, angle);
2248
2248
  const result = transform$3(oc, shape, trsf);
2249
2249
  trsf.delete();
2250
2250
  ax1.delete();
@@ -6199,7 +6199,7 @@ function translate$1(bk, shape, x, y, z) {
6199
6199
  return applyMatrix$1(bk, shape, translationMatrix$1(x, y, z));
6200
6200
  }
6201
6201
  function rotate$1(bk, shape, angle, axis, center) {
6202
- return applyMatrix$1(bk, shape, rotationMatrix$1(angle, axis, center));
6202
+ return applyMatrix$1(bk, shape, rotationMatrix$1(angle * 180 / Math.PI, axis, center));
6203
6203
  }
6204
6204
  function mirror$1(bk, shape, origin, normal) {
6205
6205
  const h = shape;
@@ -6223,7 +6223,7 @@ function positionOnCurve(bk, shape, spine, param) {
6223
6223
  const nx = tx / len, ny = ty / len;
6224
6224
  const dot = tz / len;
6225
6225
  let result = shape;
6226
- if (Math.abs(dot + 1) < 1e-10) result = rotate$1(bk, result, 180, [
6226
+ if (Math.abs(dot + 1) < 1e-10) result = rotate$1(bk, result, Math.PI, [
6227
6227
  1,
6228
6228
  0,
6229
6229
  0
@@ -6234,8 +6234,7 @@ function positionOnCurve(bk, shape, spine, param) {
6234
6234
  nx,
6235
6235
  0
6236
6236
  ];
6237
- const angleDeg = Math.acos(Math.max(-1, Math.min(1, dot))) * (180 / Math.PI);
6238
- result = rotate$1(bk, result, angleDeg, axis);
6237
+ result = rotate$1(bk, result, Math.acos(Math.max(-1, Math.min(1, dot))), axis);
6239
6238
  }
6240
6239
  return translate$1(bk, result, point[0], point[1], point[2]);
6241
6240
  }
@@ -6249,7 +6248,7 @@ function linearPattern$1(bk, shape, direction, spacing, count) {
6249
6248
  }
6250
6249
  function circularPattern$1(bk, shape, center, axis, angleStep, count) {
6251
6250
  const results = [shape];
6252
- for (let i = 1; i < count; i++) results.push(rotate$1(bk, shape, angleStep * i, axis, center));
6251
+ for (let i = 1; i < count; i++) results.push(rotate$1(bk, shape, angleStep * i * Math.PI / 180, axis, center));
6253
6252
  return results;
6254
6253
  }
6255
6254
  function gridPattern$1(bk, shape, directionX, directionY, spacingX, spacingY, countX, countY) {
@@ -6260,7 +6259,7 @@ function transformBatch$1(bk, entries) {
6260
6259
  return entries.map((e) => {
6261
6260
  switch (e.type) {
6262
6261
  case "translate": return translate$1(bk, e.shape, e.x, e.y, e.z);
6263
- case "rotate": return rotate$1(bk, e.shape, e.angle, e.axis, e.center);
6262
+ case "rotate": return rotate$1(bk, e.shape, e.angle * Math.PI / 180, e.axis, e.center);
6264
6263
  case "scale": return scale$1(bk, e.shape, e.center, e.factor);
6265
6264
  case "mirror": return mirror$1(bk, e.shape, e.origin, e.normal);
6266
6265
  }
@@ -6356,7 +6355,7 @@ function transformToPlacement(bk, shape, center, direction) {
6356
6355
  const nx = dx / len;
6357
6356
  const ny = dy / len;
6358
6357
  const dot = dz / len;
6359
- if (Math.abs(dot + 1) < 1e-10) result = rotate$1(bk, result, 180, [
6358
+ if (Math.abs(dot + 1) < 1e-10) result = rotate$1(bk, result, Math.PI, [
6360
6359
  1,
6361
6360
  0,
6362
6361
  0
@@ -6367,8 +6366,7 @@ function transformToPlacement(bk, shape, center, direction) {
6367
6366
  nx,
6368
6367
  0
6369
6368
  ];
6370
- const angleDeg = Math.acos(Math.max(-1, Math.min(1, dot))) * (180 / Math.PI);
6371
- result = rotate$1(bk, result, angleDeg, axis);
6369
+ result = rotate$1(bk, result, Math.acos(Math.max(-1, Math.min(1, dot))), axis);
6372
6370
  }
6373
6371
  }
6374
6372
  if (center && (center[0] !== 0 || center[1] !== 0 || center[2] !== 0)) result = translate$1(bk, result, center[0], center[1], center[2]);
@@ -8068,7 +8066,7 @@ function translateWithHistory(bk, shape, x, y, z, inputFaceHashes, hashUpperBoun
8068
8066
  return buildEvolution(bk, translate$1(bk, shape, x, y, z), inputFaceHashes, hashUpperBound, true);
8069
8067
  }
8070
8068
  function rotateWithHistory(bk, shape, angle, inputFaceHashes, hashUpperBound, axis, center) {
8071
- return buildEvolution(bk, rotate$1(bk, shape, angle * 180 / Math.PI, axis, center), inputFaceHashes, hashUpperBound, true);
8069
+ return buildEvolution(bk, rotate$1(bk, shape, angle, axis, center), inputFaceHashes, hashUpperBound, true);
8072
8070
  }
8073
8071
  function mirrorWithHistory(bk, shape, origin, normal, inputFaceHashes, hashUpperBound) {
8074
8072
  return buildEvolution(bk, mirror$1(bk, shape, origin, normal), inputFaceHashes, hashUpperBound, true);
@@ -16711,9 +16709,8 @@ function isShape1D(s) {
16711
16709
  *
16712
16710
  * **Note**: When `D` is `'2D'`, Shell/Solid/CompSolid are not valid members
16713
16711
  * of `AnyShape<'2D'>`. If the kernel shape happens to be one of these types,
16714
- * they will be cast unsoundly. Prefer {@link castShape3D} for shapes known
16715
- * to be 3D, and use the default `castShape()` (which defaults to `'3D'`)
16716
- * for normal usage.
16712
+ * they will be cast unsoundly. For normal usage, call `castShape()` without a
16713
+ * dimension (it defaults to `'3D'`) or {@link castShape3D}, which does the same.
16717
16714
  */
16718
16715
  function castShape(ocShape, dim) {
16719
16716
  const kernel = getKernel();
@@ -16728,7 +16725,12 @@ function castShape(ocShape, dim) {
16728
16725
  if (st === "compsolid") return createCompSolid(dc);
16729
16726
  return createCompound(dc, dim);
16730
16727
  }
16731
- /** Type-safe cast for shapes known to be 3D. */
16728
+ /**
16729
+ * Cast a raw kernel shape with the `'3D'` dimension brand, the same as
16730
+ * `castShape(ocShape)`. The 3D is the space the shape lives in, not its
16731
+ * topology: the result can be any kind from vertex to compound. Narrow it with
16732
+ * {@link isShape3D} to get a {@link Shape3D} (shell, solid, compsolid, or compound).
16733
+ */
16732
16734
  function castShape3D(ocShape) {
16733
16735
  return castShape(ocShape);
16734
16736
  }
@@ -2,7 +2,8 @@ import { default as Sketch, SketchInterface } from './sketch.js';
2
2
  import { PointInput } from '../core/types.js';
3
3
  import { ExtrusionProfile } from '../operations/extrudeUtils.js';
4
4
  import { LoftOptions } from '../operations/loftFns.js';
5
- import { Face, Shape3D } from '../core/shapeTypes.js';
5
+ import { OrientedFace, Shape3D } from '../core/shapeTypes.js';
6
+ import { PlanarFace } from '../core/validityTypes.js';
6
7
  /**
7
8
  * Represent a face with holes as a group of sketches (one outer + zero or more inner).
8
9
  *
@@ -37,7 +38,7 @@ export default class CompoundSketch implements SketchInterface {
37
38
  */
38
39
  get wires(): import('../core/shapeTypes.js').Compound;
39
40
  /** Build a face from the outer boundary with inner wires subtracted as holes. */
40
- face(): Face;
41
+ face(): OrientedFace & PlanarFace;
41
42
  /**
42
43
  * Extrude the compound face (with holes) along the default or given direction.
43
44
  *
@@ -2,11 +2,12 @@ import { Plane } from '../core/planeTypes.js';
2
2
  import { Vec3, PointInput } from '../core/types.js';
3
3
  import { ExtrusionProfile, SweepOptions } from '../operations/extrudeUtils.js';
4
4
  import { LoftOptions } from '../operations/loftFns.js';
5
- import { ClosedWire, Face, PlanarWire, Shape3D, Wire } from '../core/shapeTypes.js';
5
+ import { ClosedWire, Face, OrientedFace, PlanarWire, Shape3D, Wire } from '../core/shapeTypes.js';
6
+ import { PlanarFace } from '../core/validityTypes.js';
6
7
  /** Common interface for sketch-like objects that can be extruded, revolved, or lofted. */
7
8
  export interface SketchInterface {
8
9
  /** Transforms the lines into a face. The lines should be closed. */
9
- face(): Face;
10
+ face(): OrientedFace & PlanarFace;
10
11
  /**
11
12
  * Revolves the drawing on an axis (defined by its direction and an origin
12
13
  * (defaults to the sketch origin)
@@ -103,11 +104,11 @@ export default class Sketch implements SketchInterface {
103
104
  /** Set the default extrusion/normal direction. */
104
105
  set defaultDirection(newDirection: PointInput);
105
106
  /** Transforms the lines into a face. The lines should be closed. */
106
- face(): Face;
107
+ face(): OrientedFace & PlanarFace;
107
108
  /** Return a clone of the underlying wire. */
108
109
  wires(): Wire;
109
110
  /** Alias for {@link Sketch.face}. */
110
- faces(): Face;
111
+ faces(): OrientedFace & PlanarFace;
111
112
  /**
112
113
  * Revolves the drawing on an axis (defined by its direction and an origin
113
114
  * (defaults to the sketch origin)
@@ -2,7 +2,8 @@ import { PointInput, Vec3 } from '../core/types.js';
2
2
  import { ExtrusionProfile, SweepOptions } from '../operations/extrudeUtils.js';
3
3
  import { LoftOptions } from '../operations/loftFns.js';
4
4
  import { Plane } from '../core/planeTypes.js';
5
- import { Compound, Face, Shape3D } from '../core/shapeTypes.js';
5
+ import { Compound, OrientedFace, Shape3D } from '../core/shapeTypes.js';
6
+ import { PlanarFace } from '../core/validityTypes.js';
6
7
  import { default as CompoundSketch } from './compoundSketch.js';
7
8
  import { default as Sketch, SketchInterface } from './sketch.js';
8
9
  /**
@@ -30,7 +31,7 @@ export default class Sketches implements SketchInterface {
30
31
  /** Release the kernel resources of every contained sketch. */
31
32
  delete(): void;
32
33
  /** Build a face from the sole contained profile (see {@link Sketches.faces}). */
33
- face(): Face;
34
+ face(): OrientedFace & PlanarFace;
34
35
  /** Loft from the sole contained profile to one or more other sketches. */
35
36
  loftWith(otherSketches: SketchInterface | SketchInterface[], loftConfig?: LoftOptions, returnShell?: boolean): Shape3D;
36
37
  /** Sweep a profile along the sole contained sketch's wire. */
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_blueprintSketcher = require("./blueprintSketcher-C5Nn6Yi7.cjs");
3
- const require_drawFns = require("./drawFns-CkHnrB4o.cjs");
4
- const require_textBlueprints = require("./textBlueprints-C1aPqvXX.cjs");
2
+ const require_blueprintSketcher = require("./blueprintSketcher-C4XHzqTw.cjs");
3
+ const require_drawFns = require("./drawFns-B5gZtD_P.cjs");
4
+ const require_textBlueprints = require("./textBlueprints-P_D0KUVx.cjs");
5
5
  // src/sketching.ts
6
6
  /**
7
7
  * brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
package/dist/sketching.js CHANGED
@@ -1,6 +1,6 @@
1
- import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-C28vnWYu.js";
2
- import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-BPskIgvL.js";
3
- import { a as Sketches, c as compoundSketchFace, d as sketchExtrude, f as sketchFace, g as sketchWires, h as sketchSweep, l as compoundSketchLoft, m as sketchRevolve, o as Sketch, p as sketchLoft, s as compoundSketchExtrude, u as compoundSketchRevolve, y as CompoundSketch } from "./textBlueprints-CihV6AGR.js";
1
+ import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-CQ9LxcIl.js";
2
+ import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-stc8-Gma.js";
3
+ import { a as Sketches, c as compoundSketchFace, d as sketchExtrude, f as sketchFace, g as sketchWires, h as sketchSweep, l as compoundSketchLoft, m as sketchRevolve, o as Sketch, p as sketchLoft, s as compoundSketchExtrude, u as compoundSketchRevolve, y as CompoundSketch } from "./textBlueprints-CT0Kbw1f.js";
4
4
  // src/sketching.ts
5
5
  /**
6
6
  * brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
@@ -1,8 +1,8 @@
1
- import { C as isSolid, G as _usingCtx, S as isShell, d as createSolid, f as createVertex, h as disposeResultShape, n as castResultShape, q as getKernel, s as createCompound, x as isShape3D } from "./shapeTypes-DZGS7hgn.js";
1
+ import { C as isSolid, G as _usingCtx, S as isShell, d as createSolid, f as createVertex, h as disposeResultShape, n as castResultShape, q as getKernel, s as createCompound, x as isShape3D } from "./shapeTypes-DbPghQD3.js";
2
2
  import { E as ok, g as err, l as typeCastError, m as andThen } from "./errors-BTccWbtE.js";
3
- import { C as subShapeHashes, c as getFaces, l as getOrCreateCache, r as getCacheEntry } from "./topologyQueryFns-BRXpZFCi.js";
3
+ import { C as subShapeHashes, c as getFaces, l as getOrCreateCache, r as getCacheEntry } from "./topologyQueryFns-J2ae_Gvc.js";
4
4
  import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
5
- import { _ as cast, y as downcast } from "./faceFns-Ek2vnYA8.js";
5
+ import { _ as cast, y as downcast } from "./faceFns-DaPoCzd-.js";
6
6
  // src/topology/metadata/originTrackingFns.ts
7
7
  /**
8
8
  * Face origin tracking — tag faces with integer origins and propagate
@@ -1,8 +1,8 @@
1
- const require_shapeTypes = require("./shapeTypes-6tBG0xrR.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BjitsJRQ.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-t8CbgIAS.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-s0LddGkF.cjs");
4
4
  const require_constants = require("./constants-oee0S_x6.cjs");
5
- const require_faceFns = require("./faceFns-ClpZLuHU.cjs");
5
+ const require_faceFns = require("./faceFns-C7wBHMPv.cjs");
6
6
  // src/topology/metadata/originTrackingFns.ts
7
7
  /**
8
8
  * Face origin tracking — tag faces with integer origins and propagate
@@ -1,7 +1,7 @@
1
- import { G as _usingCtx, N as DisposalScope, c as createEdge, l as createFace, p as createWire, q as getKernel, y as isFace } from "./shapeTypes-DZGS7hgn.js";
1
+ import { G as _usingCtx, N as DisposalScope, c as createEdge, l as createFace, p as createWire, q as getKernel, y as isFace } from "./shapeTypes-DbPghQD3.js";
2
2
  import { E as ok, d as validationError, g as err, i as kernelError, m as andThen } from "./errors-BTccWbtE.js";
3
- import { a as isPlanarFace } from "./validityTypes-OSx482aJ.js";
4
- import { _ as cast, u as outerWire } from "./faceFns-Ek2vnYA8.js";
3
+ import { a as isPlanarFace } from "./validityTypes-CD_Xz0vZ.js";
4
+ import { _ as cast, u as outerWire } from "./faceFns-DaPoCzd-.js";
5
5
  // src/utils/range.ts
6
6
  /** Generate an array of integers `[0, 1, …, len - 1]`. */
7
7
  function range(len) {
@@ -1,7 +1,7 @@
1
- const require_shapeTypes = require("./shapeTypes-6tBG0xrR.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BjitsJRQ.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
- const require_validityTypes = require("./validityTypes-CT2goK1c.cjs");
4
- const require_faceFns = require("./faceFns-ClpZLuHU.cjs");
3
+ const require_validityTypes = require("./validityTypes-BVZ0lSNi.cjs");
4
+ const require_faceFns = require("./faceFns-C7wBHMPv.cjs");
5
5
  // src/utils/range.ts
6
6
  /** Generate an array of integers `[0, 1, …, len - 1]`. */
7
7
  function range(len) {
package/dist/text.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_textBlueprints = require("./textBlueprints-C1aPqvXX.cjs");
3
- const require_textMetrics = require("./textMetrics-BhTII8oU.cjs");
2
+ const require_textBlueprints = require("./textBlueprints-P_D0KUVx.cjs");
3
+ const require_textMetrics = require("./textMetrics-CVyX8GyL.cjs");
4
4
  exports.fontMetrics = require_textMetrics.fontMetrics;
5
5
  exports.getFont = require_textBlueprints.getFont;
6
6
  exports.loadFont = require_textBlueprints.loadFont;
package/dist/text.js CHANGED
@@ -1,3 +1,3 @@
1
- import { i as setFallbackFont, n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-CihV6AGR.js";
2
- import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-CTA6sIE_.js";
1
+ import { i as setFallbackFont, n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-CT0Kbw1f.js";
2
+ import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-CXKdzefS.js";
3
3
  export { fontMetrics, getFont, loadFont, setFallbackFont, sketchText, textBlueprints, textMetrics };
@@ -1,19 +1,19 @@
1
- import { d as createSolid, h as disposeResultShape, l as createFace, m as disposeDowncastSource, n as castResultShape, p as createWire, q as getKernel, x as isShape3D } from "./shapeTypes-DZGS7hgn.js";
1
+ import { d as createSolid, h as disposeResultShape, l as createFace, m as disposeDowncastSource, n as castResultShape, p as createWire, q as getKernel, x as isShape3D } from "./shapeTypes-DbPghQD3.js";
2
2
  import { n as bug } from "./bug-ClMTAJhe.js";
3
3
  import { E as ok, P as unwrap, d as validationError, g as err, i as kernelError, l as typeCastError, r as ioError, t as BrepErrorCode } from "./errors-BTccWbtE.js";
4
4
  import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
5
5
  import { r as toVec3 } from "./types-CKXsIm9-.js";
6
6
  import { c as vecLength, d as vecNormalize, h as vecScale, i as vecDistance, r as vecCross, t as vecAdd } from "./vecOps-S-m9H_fe.js";
7
7
  import { n as createPlane } from "./planeOps-D3yDuMux.js";
8
- import { v as copyShape } from "./faceFns-Ek2vnYA8.js";
9
- import { o as makeSolid, t as makeCompound } from "./solidBuilders-BHGa-BWa.js";
10
- import { i as cutAll } from "./booleanFns-Dcv_aMcv.js";
8
+ import { v as copyShape } from "./faceFns-DaPoCzd-.js";
9
+ import { o as makeSolid, t as makeCompound } from "./solidBuilders-BUI_fGzR.js";
10
+ import { i as cutAll } from "./booleanFns-CsTz48A3.js";
11
11
  import { i as setFaceRoles } from "./faceRoleFns-BPxzQF-n.js";
12
- import { l as curveStartPoint, u as curveTangentAt } from "./curveFns-DR1JAITD.js";
12
+ import { l as curveStartPoint, u as curveTangentAt } from "./curveFns-RjNVzxNc.js";
13
13
  import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
14
- import { i as makeNewFaceWithinFace, r as makeFace, t as addHolesInFace } from "./surfaceBuilders-BVyLEFoG.js";
15
- import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-C28vnWYu.js";
16
- import { c as twistExtrude, r as complexExtrude, s as sweep, t as loft } from "./loftFns-DbXEtPKz.js";
14
+ import { i as makeNewFaceWithinFace, r as makeFace, t as addHolesInFace } from "./surfaceBuilders-CO_DKhWA.js";
15
+ import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-CQ9LxcIl.js";
16
+ import { c as twistExtrude, r as complexExtrude, s as sweep, t as loft } from "./loftFns-Cbnrz3p8.js";
17
17
  import opentype from "opentype.js";
18
18
  // src/topology/shapeRef/extrudeRoleFns.ts
19
19
  /** Match tolerance as a fraction of the extrusion's size. */
@@ -1,20 +1,20 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-BW-eSwOZ.cjs");
2
- const require_shapeTypes = require("./shapeTypes-6tBG0xrR.cjs");
2
+ const require_shapeTypes = require("./shapeTypes-BjitsJRQ.cjs");
3
3
  const require_bug = require("./bug-CBcpIPuf.cjs");
4
4
  const require_errors = require("./errors-O_blYTWT.cjs");
5
5
  const require_constants = require("./constants-oee0S_x6.cjs");
6
6
  const require_types = require("./types-CjF9Rofr.cjs");
7
7
  const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
8
8
  const require_planeOps = require("./planeOps-DZfLToKZ.cjs");
9
- const require_faceFns = require("./faceFns-ClpZLuHU.cjs");
10
- const require_solidBuilders = require("./solidBuilders-Dl6d8fGZ.cjs");
11
- const require_booleanFns = require("./booleanFns-CvBttd1y.cjs");
9
+ const require_faceFns = require("./faceFns-C7wBHMPv.cjs");
10
+ const require_solidBuilders = require("./solidBuilders-Bs2NA3xl.cjs");
11
+ const require_booleanFns = require("./booleanFns-MkzdfjDv.cjs");
12
12
  const require_faceRoleFns = require("./faceRoleFns-Db5bYj4Q.cjs");
13
- const require_curveFns = require("./curveFns-Dneh4D9N.cjs");
13
+ const require_curveFns = require("./curveFns-HtjEh2W-.cjs");
14
14
  const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
15
- const require_surfaceBuilders = require("./surfaceBuilders-BtYpRGXh.cjs");
16
- const require_blueprintSketcher = require("./blueprintSketcher-C5Nn6Yi7.cjs");
17
- const require_loftFns = require("./loftFns-BqA5gWFR.cjs");
15
+ const require_surfaceBuilders = require("./surfaceBuilders-Cn1mkQ3j.cjs");
16
+ const require_blueprintSketcher = require("./blueprintSketcher-C4XHzqTw.cjs");
17
+ const require_loftFns = require("./loftFns-C9k9UAKh.cjs");
18
18
  let opentype_js = require("opentype.js");
19
19
  opentype_js = require_rolldown_runtime.__toESM(opentype_js, 1);
20
20
  // src/topology/shapeRef/extrudeRoleFns.ts
@@ -1,5 +1,5 @@
1
1
  const require_errors = require("./errors-O_blYTWT.cjs");
2
- const require_textBlueprints = require("./textBlueprints-C1aPqvXX.cjs");
2
+ const require_textBlueprints = require("./textBlueprints-P_D0KUVx.cjs");
3
3
  // src/text/sketchText.ts
4
4
  /**
5
5
  * Render text as 3D sketch outlines on a plane.
@@ -1,5 +1,5 @@
1
1
  import { E as ok, d as validationError, g as err, t as BrepErrorCode } from "./errors-BTccWbtE.js";
2
- import { _ as wrapSketchData, a as Sketches, n as getFont, t as textBlueprints, y as CompoundSketch } from "./textBlueprints-CihV6AGR.js";
2
+ import { _ as wrapSketchData, a as Sketches, n as getFont, t as textBlueprints, y as CompoundSketch } from "./textBlueprints-CT0Kbw1f.js";
3
3
  // src/text/sketchText.ts
4
4
  /**
5
5
  * Render text as 3D sketch outlines on a plane.
@@ -1,12 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-6tBG0xrR.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BjitsJRQ.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
3
  const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
4
- const require_faceFns = require("./faceFns-ClpZLuHU.cjs");
5
- const require_booleanFns = require("./booleanFns-CvBttd1y.cjs");
6
- const require_primitiveFns = require("./primitiveFns-u5Vnoanh.cjs");
7
- const require_shapeFns = require("./shapeFns-CahtmyZr.cjs");
8
- const require_loftFns = require("./loftFns-BqA5gWFR.cjs");
9
- const require_refResolveFns = require("./refResolveFns-CEx0Xso0.cjs");
4
+ const require_faceFns = require("./faceFns-C7wBHMPv.cjs");
5
+ const require_booleanFns = require("./booleanFns-MkzdfjDv.cjs");
6
+ const require_primitiveFns = require("./primitiveFns-BifV4IGL.cjs");
7
+ const require_shapeFns = require("./shapeFns-Rmgd4x9I.cjs");
8
+ const require_loftFns = require("./loftFns-C9k9UAKh.cjs");
9
+ const require_refResolveFns = require("./refResolveFns-CTkAPUwM.cjs");
10
10
  // src/utils/uuid.ts
11
11
  /** Generate a v4-style UUID string using `crypto.getRandomValues`. */
12
12
  function uuidv() {
@@ -1,12 +1,12 @@
1
- import { F as createKernelHandle, G as _usingCtx, N as DisposalScope, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-DZGS7hgn.js";
1
+ import { F as createKernelHandle, G as _usingCtx, N as DisposalScope, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-DbPghQD3.js";
2
2
  import { E as ok, d as validationError, g as err, n as computationError, r as ioError, t as BrepErrorCode, x as isOk } from "./errors-BTccWbtE.js";
3
3
  import { d as vecNormalize, s as vecIsZero } from "./vecOps-S-m9H_fe.js";
4
- import { b as fromBREP } from "./faceFns-Ek2vnYA8.js";
5
- import { o as fuseAll } from "./booleanFns-Dcv_aMcv.js";
6
- import { E as wire, h as line } from "./primitiveFns-D53I6iYC.js";
7
- import { s as toBREP, t as clone } from "./shapeFns-24B0u4KE.js";
8
- import { t as loft } from "./loftFns-DbXEtPKz.js";
9
- import { c as resolveRefParams } from "./refResolveFns-LMvuE8em.js";
4
+ import { b as fromBREP } from "./faceFns-DaPoCzd-.js";
5
+ import { o as fuseAll } from "./booleanFns-CsTz48A3.js";
6
+ import { E as wire, h as line } from "./primitiveFns-uDvN1FH6.js";
7
+ import { s as toBREP, t as clone } from "./shapeFns-DgpWLKra.js";
8
+ import { t as loft } from "./loftFns-Cbnrz3p8.js";
9
+ import { c as resolveRefParams } from "./refResolveFns-CuaYXFya.js";
10
10
  // src/utils/uuid.ts
11
11
  /** Generate a v4-style UUID string using `crypto.getRandomValues`. */
12
12
  function uuidv() {
@@ -22,7 +22,7 @@ export type FinderFn<T extends AnyShape<Dimension>> = (finder: FinderFor<T>) =>
22
22
  * - `[number, number]` — variable radius (start, end)
23
23
  * - callback — per-edge radius; return `null` to skip an edge
24
24
  */
25
- export type FilletRadius = number | [number, number] | ((edge: Edge<Dimension>) => number | [number, number] | null);
25
+ export type FilletRadius = number | [number, number] | ((edge: Edge) => number | [number, number] | null);
26
26
  /**
27
27
  * Chamfer distance specification.
28
28
  *
@@ -36,13 +36,22 @@ export type FilletRadius = number | [number, number] | ((edge: Edge<Dimension>)
36
36
  * get `{ distance, angle }`: mixing the two is an `INVALID_CHAMFER_DISTANCE` error.
37
37
  * Different `{ distance, angle }` values per edge need a kernel that chamfers each
38
38
  * edge by its own (occt-wasm 5.9.0+); elsewhere they are an `UNSUPPORTED_CAPABILITY` error.
39
+ * A callback's `{ distance, angle, face }` measures that edge's chamfer from `face`,
40
+ * which must be one of the two faces the edge joins (else `CHAMFER_ANGLE_FACE_NOT_ADJACENT`):
41
+ * the distance is set back on it and the angle taken from it. Without `face` the
42
+ * kernel picks it (the edge's first adjacent face on occt-wasm). A `face` needs the
43
+ * same per-edge kernel support. Edges of one tangent-continuous chain are chamfered
44
+ * as one, so they must state the same chamfer; occt-wasm 5.11.0+ also matches one
45
+ * stated from the face on the other side (e.g. `{ distance: d, angle: 45 }` from
46
+ * either face of a square edge).
39
47
  */
40
48
  export type ChamferDistance = number | [number, number] | {
41
49
  distance: number;
42
50
  angle: number;
43
- } | ((edge: Edge<Dimension>) => number | [number, number] | {
51
+ } | ((edge: Edge) => number | [number, number] | {
44
52
  distance: number;
45
53
  angle: number;
54
+ face?: Face | undefined;
46
55
  } | null);
47
56
  /**
48
57
  * Draft angle specification.
@@ -50,7 +59,7 @@ export type ChamferDistance = number | [number, number] | {
50
59
  * - `number` — constant angle in degrees for all selected faces
51
60
  * - callback — per-face angle; return `null` to skip a face
52
61
  */
53
- export type DraftAngle = number | ((face: Face<Dimension>) => number | null);
62
+ export type DraftAngle = number | ((face: Face) => number | null);
54
63
  /** Options for the draft() modifier. */
55
64
  export interface DraftOptions {
56
65
  /** Pull direction (mold opening direction). */
@@ -1,4 +1,4 @@
1
- import { Edge, Shape3D } from '../core/shapeTypes.js';
1
+ import { Edge, Face, Shape3D } from '../core/shapeTypes.js';
2
2
  import { Result } from '../core/result.js';
3
3
  /**
4
4
  * Chamfer edges of a shape using distance + angle.
@@ -24,20 +24,29 @@ export interface EdgeDistAngle {
24
24
  readonly distance: number;
25
25
  /** Angle from the reference face in degrees, in the range (0, 90). */
26
26
  readonly angle: number;
27
+ /**
28
+ * The reference face, one of the two faces `edge` joins. Omitted, the kernel
29
+ * picks it (the edge's first adjacent face on occt-wasm).
30
+ */
31
+ readonly face?: Face | undefined;
27
32
  }
28
33
  /**
29
34
  * Chamfer each edge by its own distance and angle, in one operation.
30
35
  *
31
- * Edges that all share one distance and angle go through
32
- * {@link chamferDistAngle}, which every kernel but brepkit provides. Different
33
- * values need a kernel with a per-edge distance-angle chamfer (occt-wasm 5.9.0
34
- * or later); on any other kernel the result is an `UNSUPPORTED_CAPABILITY` error. On
35
- * occt-wasm the edges of one tangent-continuous contour must share their
36
- * distance and angle, or the result is `CHAMFER_ANGLE_FAILED`.
36
+ * Edges that all share one distance and angle, with no reference face given,
37
+ * go through {@link chamferDistAngle}, which every kernel but brepkit provides.
38
+ * Different values, or any `face`, need a kernel with a per-edge distance-angle
39
+ * chamfer (occt-wasm 5.9.0 or later); on any other kernel the result is an
40
+ * `UNSUPPORTED_CAPABILITY` error. On occt-wasm the edges of one
41
+ * tangent-continuous contour must state the same chamfer, or the result is
42
+ * `CHAMFER_ANGLE_FAILED`; from 5.11.0 an edge may state it from the face on
43
+ * the other side of the contour.
37
44
  *
38
45
  * @param shape - The 3D shape to chamfer.
39
- * @param entries - Each edge with its distance and angle (must not be empty).
40
- * @returns Ok with the chamfered shape, or Err on invalid input, an unsupported
46
+ * @param entries - Each edge with its distance, angle and optional reference
47
+ * face (must not be empty).
48
+ * @returns Ok with the chamfered shape, or Err on invalid input (a `face` not
49
+ * adjacent to its edge is `CHAMFER_ANGLE_FACE_NOT_ADJACENT`), an unsupported
41
50
  * kernel, or kernel failure.
42
51
  */
43
52
  export declare function chamferDistAngles(shape: Shape3D, entries: ReadonlyArray<EdgeDistAngle>): Result<Shape3D>;
@@ -66,7 +66,13 @@ export interface Wrapped<T extends AnyShape> extends WrappedMarker<T> {
66
66
  heal(): Wrapped<T>;
67
67
  simplify(): Wrapped<T>;
68
68
  toBREP(): string;
69
+ apply<U extends Face>(fn: (shape: T) => U): WrappedFace<U>;
70
+ apply<U extends Shape3D>(fn: (shape: T) => U): Wrapped3D<U>;
71
+ apply<U extends Edge | Wire>(fn: (shape: T) => U): WrappedCurve<U>;
69
72
  apply<U extends AnyShape>(fn: (shape: T) => U): Wrapped<U>;
73
+ applyResult<U extends Face>(fn: (shape: T) => Result<U>): WrappedFace<U>;
74
+ applyResult<U extends Shape3D>(fn: (shape: T) => Result<U>): Wrapped3D<U>;
75
+ applyResult<U extends Edge | Wire>(fn: (shape: T) => Result<U>): WrappedCurve<U>;
70
76
  applyResult<U extends AnyShape>(fn: (shape: T) => Result<U>): Wrapped<U>;
71
77
  done(): T;
72
78
  }
@@ -124,8 +130,11 @@ export interface WrappedCurve<T extends Edge | Wire> extends Wrapped<T> {
124
130
  isClosed(): boolean;
125
131
  sweep(spine: Shapeable<Wire>, options?: SweepOptions): Wrapped3D<Shape3D>;
126
132
  }
127
- /** Face wrapper — face introspection + 2D→3D transitions. */
128
- export interface WrappedFace extends Wrapped<Face> {
133
+ /**
134
+ * Face wrapper: face introspection + 2D→3D transitions. `F` keeps the wrapped face's
135
+ * own type (an `OrientedFace & PlanarFace` from `apply()`, say) for `val` and `done()`.
136
+ */
137
+ export interface WrappedFace<F extends Face = Face> extends Wrapped<F> {
129
138
  area(): number;
130
139
  normalAt(point?: Vec3): Vec3;
131
140
  center(): Vec3;
package/dist/topology.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_topologyQueryFns = require("./topologyQueryFns-t8CbgIAS.cjs");
3
- const require_faceFns = require("./faceFns-ClpZLuHU.cjs");
4
- const require_booleanFns = require("./booleanFns-CvBttd1y.cjs");
5
- const require_primitiveFns = require("./primitiveFns-u5Vnoanh.cjs");
6
- const require_shapeFns = require("./shapeFns-CahtmyZr.cjs");
7
- const require_curveFns = require("./curveFns-Dneh4D9N.cjs");
8
- const require_meshFns = require("./meshFns-DmKYxmT_.cjs");
9
- const require_healingFns = require("./healingFns-CVGVC3-a.cjs");
10
- const require_adjacencyFns = require("./adjacencyFns-DyHi1paM.cjs");
2
+ const require_topologyQueryFns = require("./topologyQueryFns-s0LddGkF.cjs");
3
+ const require_faceFns = require("./faceFns-C7wBHMPv.cjs");
4
+ const require_booleanFns = require("./booleanFns-MkzdfjDv.cjs");
5
+ const require_primitiveFns = require("./primitiveFns-BifV4IGL.cjs");
6
+ const require_shapeFns = require("./shapeFns-Rmgd4x9I.cjs");
7
+ const require_curveFns = require("./curveFns-HtjEh2W-.cjs");
8
+ const require_meshFns = require("./meshFns-8MTf0Lo_.cjs");
9
+ const require_healingFns = require("./healingFns-zYCbT8vR.cjs");
10
+ const require_adjacencyFns = require("./adjacencyFns-BXzEHSC5.cjs");
11
11
  exports.addHoles = require_primitiveFns.addHoles;
12
12
  exports.adjacentFaces = require_adjacencyFns.adjacentFaces;
13
13
  exports.approximateCurve = require_curveFns.approximateCurve;
package/dist/topology.js CHANGED
@@ -1,10 +1,10 @@
1
- import { _ as iterFaces, b as iterVertices, c as getFaces, f as getVertices, g as iterEdges, m as invalidateShapeCache, n as getBounds, p as getWires, s as getEdges, w as vertexPosition, x as iterWires } from "./topologyQueryFns-BRXpZFCi.js";
2
- import { C as shapeType, S as iterTopo, _ as cast, a as faceOrientation, b as fromBREP, c as innerWires, d as pointOnSurface, f as projectPointOnFace, g as asTopo, h as uvCoordinates, i as faceGeomType, l as normalAt, m as uvBounds, n as faceAxis, o as flipFaceOrientation, r as faceCenter, s as getSurfaceType, t as classifyPointOnFace, u as outerWire, x as isCompSolid, y as downcast } from "./faceFns-Ek2vnYA8.js";
3
- import { i as cutAll, o as fuseAll } from "./booleanFns-Dcv_aMcv.js";
4
- import { C as threePointArc, D as wireLoop, E as wire, S as tangentArc, T as vertex, _ as polygon, a as circle, b as sphere, c as cylinder, d as ellipsoid, f as face, g as offsetFace, h as line, i as bsplineApprox, l as ellipse, m as helix, n as bezier, o as compound, p as filledFace, r as box, s as cone, t as addHoles, u as ellipseArc, v as sewShells, w as torus, x as subFace, y as solid } from "./primitiveFns-D53I6iYC.js";
5
- import { a as isSameShape, i as isEqualShape, n as getHashCode } from "./shapeFns-24B0u4KE.js";
6
- import { a as curveIsPeriodic, c as curvePointAt, d as flipOrientation, f as getCurveType, h as offsetWire2D, i as curveIsClosed, l as curveStartPoint, m as interpolateCurve, n as curveAxis, o as curveLength, p as getOrientation, r as curveEndPoint, s as curvePeriod, t as approximateCurve, u as curveTangentAt } from "./curveFns-DR1JAITD.js";
7
- import { f as clearMeshCache, n as exportSTEP, p as createMeshCache, r as exportSTL, t as exportIGES } from "./meshFns-DBN_h_7v.js";
8
- import { I as toLineGeometryData, M as toBufferGeometryData, N as toGroupedBufferGeometryData, S as chamferDistAngle, _ as checkBoolean, a as healFace, b as getNurbsCurveData, d as chamferWithEvolution, f as cutWithEvolution, g as shellWithEvolution, h as intersectWithEvolution, j as variableFillet, l as solidFromShell, m as fuseWithEvolution, n as fixSelfIntersection, o as healSolid, p as filletWithEvolution, r as fixShape, s as healWire, t as autoHeal, u as positionOnCurve, v as cutAllBisect, x as getNurbsSurfaceData, y as fuseAllBisect } from "./healingFns-CTPsDQkF.js";
9
- import { i as facesOfEdge, l as wiresOfFace, n as adjacentFaces, o as sharedEdges, r as edgesOfFace, s as verticesOfEdge } from "./adjacencyFns-DT8YVOtE.js";
1
+ import { _ as iterFaces, b as iterVertices, c as getFaces, f as getVertices, g as iterEdges, m as invalidateShapeCache, n as getBounds, p as getWires, s as getEdges, w as vertexPosition, x as iterWires } from "./topologyQueryFns-J2ae_Gvc.js";
2
+ import { C as shapeType, S as iterTopo, _ as cast, a as faceOrientation, b as fromBREP, c as innerWires, d as pointOnSurface, f as projectPointOnFace, g as asTopo, h as uvCoordinates, i as faceGeomType, l as normalAt, m as uvBounds, n as faceAxis, o as flipFaceOrientation, r as faceCenter, s as getSurfaceType, t as classifyPointOnFace, u as outerWire, x as isCompSolid, y as downcast } from "./faceFns-DaPoCzd-.js";
3
+ import { i as cutAll, o as fuseAll } from "./booleanFns-CsTz48A3.js";
4
+ import { C as threePointArc, D as wireLoop, E as wire, S as tangentArc, T as vertex, _ as polygon, a as circle, b as sphere, c as cylinder, d as ellipsoid, f as face, g as offsetFace, h as line, i as bsplineApprox, l as ellipse, m as helix, n as bezier, o as compound, p as filledFace, r as box, s as cone, t as addHoles, u as ellipseArc, v as sewShells, w as torus, x as subFace, y as solid } from "./primitiveFns-uDvN1FH6.js";
5
+ import { a as isSameShape, i as isEqualShape, n as getHashCode } from "./shapeFns-DgpWLKra.js";
6
+ import { a as curveIsPeriodic, c as curvePointAt, d as flipOrientation, f as getCurveType, h as offsetWire2D, i as curveIsClosed, l as curveStartPoint, m as interpolateCurve, n as curveAxis, o as curveLength, p as getOrientation, r as curveEndPoint, s as curvePeriod, t as approximateCurve, u as curveTangentAt } from "./curveFns-RjNVzxNc.js";
7
+ import { f as clearMeshCache, n as exportSTEP, p as createMeshCache, r as exportSTL, t as exportIGES } from "./meshFns-CcuY52tt.js";
8
+ import { I as toLineGeometryData, M as toBufferGeometryData, N as toGroupedBufferGeometryData, S as chamferDistAngle, _ as checkBoolean, a as healFace, b as getNurbsCurveData, d as chamferWithEvolution, f as cutWithEvolution, g as shellWithEvolution, h as intersectWithEvolution, j as variableFillet, l as solidFromShell, m as fuseWithEvolution, n as fixSelfIntersection, o as healSolid, p as filletWithEvolution, r as fixShape, s as healWire, t as autoHeal, u as positionOnCurve, v as cutAllBisect, x as getNurbsSurfaceData, y as fuseAllBisect } from "./healingFns-C3Wq_hN3.js";
9
+ import { i as facesOfEdge, l as wiresOfFace, n as adjacentFaces, o as sharedEdges, r as edgesOfFace, s as verticesOfEdge } from "./adjacencyFns-BYjzMejn.js";
10
10
  export { addHoles, adjacentFaces, approximateCurve, asTopo, autoHeal, bezier, box, bsplineApprox, cast, chamferDistAngle as chamferDistAngleShape, chamferWithEvolution, checkBoolean, circle, classifyPointOnFace, clearMeshCache, compound, cone, createMeshCache, curveAxis, curveEndPoint, curveIsClosed, curveIsPeriodic, curveLength, curvePeriod, curvePointAt, curveStartPoint, curveTangentAt, cutAll, cutAllBisect, cutWithEvolution, cylinder, fromBREP as deserializeShape, downcast, edgesOfFace, ellipse, ellipseArc, ellipsoid, exportIGES, exportSTEP, exportSTL, face, faceAxis, faceCenter, faceGeomType, faceOrientation, facesOfEdge, filledFace, filletWithEvolution, fixSelfIntersection, fixShape, flipFaceOrientation, flipOrientation, fuseAll, fuseAllBisect, fuseWithEvolution, getBounds, getCurveType, getEdges, getFaces, getHashCode, getNurbsCurveData, getNurbsSurfaceData, getOrientation, getSurfaceType, getVertices, getWires, healFace, healSolid, healWire, helix, innerWires, interpolateCurve, intersectWithEvolution, invalidateShapeCache, isCompSolid, isEqualShape, isSameShape, iterEdges, iterFaces, iterTopo, iterVertices, iterWires, line, normalAt, offsetFace, offsetWire2D, outerWire, pointOnSurface, polygon, positionOnCurve, projectPointOnFace, sewShells, shapeType, sharedEdges, shellWithEvolution, solid, solidFromShell, sphere, subFace, tangentArc, threePointArc, toBufferGeometryData, toGroupedBufferGeometryData, toLineGeometryData, torus, uvBounds, uvCoordinates, variableFillet, vertex, vertexPosition, verticesOfEdge, wire, wireLoop, wiresOfFace };
@@ -1,4 +1,4 @@
1
- import { G as _usingCtx, N as DisposalScope, O as getOrQueryType, n as castResultShape, q as getKernel, r as castResultShapeWithKnownType } from "./shapeTypes-DZGS7hgn.js";
1
+ import { G as _usingCtx, N as DisposalScope, O as getOrQueryType, n as castResultShape, q as getKernel, r as castResultShapeWithKnownType } from "./shapeTypes-DbPghQD3.js";
2
2
  import { E as ok, g as err } from "./errors-BTccWbtE.js";
3
3
  import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
4
4
  // src/core/kernelErrorTranslation.ts
@@ -1,4 +1,4 @@
1
- const require_shapeTypes = require("./shapeTypes-6tBG0xrR.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BjitsJRQ.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
3
  const require_constants = require("./constants-oee0S_x6.cjs");
4
4
  // src/core/kernelErrorTranslation.ts
@@ -1,4 +1,4 @@
1
- const require_shapeTypes = require("./shapeTypes-6tBG0xrR.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BjitsJRQ.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
3
  // src/core/validityTypes.ts
4
4
  /**