brepjs 8.4.0 → 8.7.4

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 (114) hide show
  1. package/dist/2d.cjs +2 -2
  2. package/dist/2d.js +13 -13
  3. package/dist/{Blueprint-zgFe_5Qj.cjs → Blueprint-BcbOBF-9.cjs} +11 -99
  4. package/dist/{Blueprint-Bp45tnh0.js → Blueprint-Cmh8lKc4.js} +29 -117
  5. package/dist/{boolean2D-CfEbRMPF.cjs → boolean2D-CqacqjME.cjs} +24 -25
  6. package/dist/{boolean2D-DN6ETTCq.js → boolean2D-D94Axs3i.js} +23 -24
  7. package/dist/{booleanFns-C-M6qqvB.js → booleanFns-DdjtpcM6.js} +306 -12
  8. package/dist/{booleanFns-5dDG0jpA.cjs → booleanFns-NtKxkiXn.cjs} +299 -5
  9. package/dist/brepjs.cjs +1619 -71
  10. package/dist/brepjs.js +1880 -333
  11. package/dist/core/errors.d.ts +18 -0
  12. package/dist/core/errors.d.ts.map +1 -1
  13. package/dist/core.cjs +4 -4
  14. package/dist/core.js +4 -4
  15. package/dist/{cornerFinder-CC_MunIh.js → cornerFinder-BBOYfsXl.js} +1 -1
  16. package/dist/{cornerFinder-BQ-_VJx0.cjs → cornerFinder-Bqy8Lw2p.cjs} +1 -1
  17. package/dist/{curveFns-ZuQUBZvd.js → curveFns-B85Glnfo.js} +19 -17
  18. package/dist/{curveFns-VMxgfkqw.cjs → curveFns-BXCbASW-.cjs} +6 -4
  19. package/dist/{drawFns-BbhX1IUq.js → drawFns-B-gJ2WUc.js} +47 -21
  20. package/dist/{drawFns-CKaHgGSK.cjs → drawFns-CAmFEqd1.cjs} +63 -37
  21. package/dist/{errors-CSYOlCCR.js → errors-Coh_5_19.js} +26 -1
  22. package/dist/{errors-D13q2HCk.cjs → errors-eRQu29oc.cjs} +26 -1
  23. package/dist/{faceFns-CfJIbHY3.js → faceFns-CltrEfOo.js} +109 -12
  24. package/dist/{faceFns-es3GENII.cjs → faceFns-DcndPHWm.cjs} +103 -6
  25. package/dist/{helpers-C0q_FVxq.cjs → helpers-CC21GeAr.cjs} +8 -9
  26. package/dist/{helpers-CmVkMubc.js → helpers-SksQIreB.js} +16 -17
  27. package/dist/index.d.ts +18 -3
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/io/dxfImportFns.d.ts +17 -0
  30. package/dist/io/dxfImportFns.d.ts.map +1 -0
  31. package/dist/io/objImportFns.d.ts +19 -0
  32. package/dist/io/objImportFns.d.ts.map +1 -0
  33. package/dist/io/threemfImportFns.d.ts +19 -0
  34. package/dist/io/threemfImportFns.d.ts.map +1 -0
  35. package/dist/io.cjs +5 -5
  36. package/dist/io.js +5 -5
  37. package/dist/kernel/hullOps.d.ts +1 -0
  38. package/dist/kernel/hullOps.d.ts.map +1 -1
  39. package/dist/kernel/occtAdapter.d.ts +5 -0
  40. package/dist/kernel/occtAdapter.d.ts.map +1 -1
  41. package/dist/kernel/solverAdapter.d.ts +39 -0
  42. package/dist/kernel/solverAdapter.d.ts.map +1 -0
  43. package/dist/kernel/types.d.ts +5 -0
  44. package/dist/kernel/types.d.ts.map +1 -1
  45. package/dist/{loft-B-UCPW9P.cjs → loft-BcyyvWCj.cjs} +28 -28
  46. package/dist/{loft-oJq2OD3A.js → loft-CJMPx1NQ.js} +16 -16
  47. package/dist/{measurement-Cf_SoIiR.js → measurement-ByOztLxb.js} +3 -3
  48. package/dist/{measurement-CYmT-C77.cjs → measurement-DU3ry-0Q.cjs} +3 -3
  49. package/dist/measurement.cjs +1 -1
  50. package/dist/measurement.js +1 -1
  51. package/dist/{meshFns-CqNwW0PO.js → meshFns-D2gLyLFt.js} +3 -3
  52. package/dist/{meshFns-DDC_2U81.cjs → meshFns-DawUwI3W.cjs} +3 -3
  53. package/dist/{occtBoundary-D_gjqgzo.js → occtBoundary-CWzWqBCm.js} +17 -5
  54. package/dist/{occtBoundary-CocN2VKx.cjs → occtBoundary-DH2VO-rq.cjs} +12 -0
  55. package/dist/operations/assemblyFns.d.ts +1 -0
  56. package/dist/operations/assemblyFns.d.ts.map +1 -1
  57. package/dist/operations/guidedSweepFns.d.ts +25 -0
  58. package/dist/operations/guidedSweepFns.d.ts.map +1 -0
  59. package/dist/operations/mateFns.d.ts +50 -0
  60. package/dist/operations/mateFns.d.ts.map +1 -0
  61. package/dist/operations/multiSweepFns.d.ts +32 -0
  62. package/dist/operations/multiSweepFns.d.ts.map +1 -0
  63. package/dist/operations/roofFns.d.ts +16 -0
  64. package/dist/operations/roofFns.d.ts.map +1 -0
  65. package/dist/operations/straightSkeleton.d.ts +28 -0
  66. package/dist/operations/straightSkeleton.d.ts.map +1 -0
  67. package/dist/{operations-BQeW_DSM.cjs → operations-CdELWxgv.cjs} +7 -7
  68. package/dist/{operations-6hdpuYmY.js → operations-DiXo_4t9.js} +15 -15
  69. package/dist/operations.cjs +2 -2
  70. package/dist/operations.js +13 -13
  71. package/dist/query.cjs +5 -5
  72. package/dist/query.js +7 -7
  73. package/dist/result.cjs +1 -1
  74. package/dist/result.js +1 -1
  75. package/dist/{shapeFns-B0zSdO9c.cjs → shapeFns-3RYtsUVY.cjs} +54 -21
  76. package/dist/{shapeFns-k1YHFwmB.js → shapeFns-4ioRrhih.js} +52 -19
  77. package/dist/{shapeTypes-BxVxLdiD.cjs → shapeTypes-CMjrTv36.cjs} +1 -1
  78. package/dist/{shapeTypes-c-_pgYCx.js → shapeTypes-D0vfRxWb.js} +13 -13
  79. package/dist/sketching.cjs +2 -2
  80. package/dist/sketching.js +2 -2
  81. package/dist/{curveBuilders-BREwqvuc.js → surfaceBuilders-B7Jxob8g.js} +106 -13
  82. package/dist/{curveBuilders-BkEJ-RVn.cjs → surfaceBuilders-Xx9DRRxs.cjs} +96 -3
  83. package/dist/text/textBlueprints.d.ts +38 -0
  84. package/dist/text/textBlueprints.d.ts.map +1 -1
  85. package/dist/topology/api.d.ts +5 -0
  86. package/dist/topology/api.d.ts.map +1 -1
  87. package/dist/topology/booleanFns.d.ts +10 -1
  88. package/dist/topology/booleanFns.d.ts.map +1 -1
  89. package/dist/topology/colorFns.d.ts +38 -0
  90. package/dist/topology/colorFns.d.ts.map +1 -0
  91. package/dist/topology/curveFns.d.ts +1 -1
  92. package/dist/topology/curveFns.d.ts.map +1 -1
  93. package/dist/topology/faceTagFns.d.ts +44 -0
  94. package/dist/topology/faceTagFns.d.ts.map +1 -0
  95. package/dist/topology/modifierFns.d.ts.map +1 -1
  96. package/dist/topology/polyhedronFns.d.ts +8 -0
  97. package/dist/topology/polyhedronFns.d.ts.map +1 -0
  98. package/dist/topology/shapeFns.d.ts +4 -0
  99. package/dist/topology/shapeFns.d.ts.map +1 -1
  100. package/dist/topology/surfaceBuilders.d.ts +7 -0
  101. package/dist/topology/surfaceBuilders.d.ts.map +1 -1
  102. package/dist/topology/surfaceFns.d.ts +38 -0
  103. package/dist/topology/surfaceFns.d.ts.map +1 -0
  104. package/dist/{topology-CycEc6Oe.cjs → topology-D-nGjCzV.cjs} +19 -20
  105. package/dist/{topology-tMKHJgw2.js → topology-DRP9zreU.js} +8 -9
  106. package/dist/topology.cjs +13 -14
  107. package/dist/topology.js +51 -52
  108. package/dist/{vectors-DE0XriuQ.js → vectors-CZV4ZrTz.js} +2 -2
  109. package/dist/{vectors-DVmHF4zt.cjs → vectors-DwFeX0Ja.cjs} +2 -2
  110. package/dist/vectors.cjs +2 -2
  111. package/dist/vectors.js +2 -2
  112. package/package.json +4 -3
  113. package/dist/cast-CPNOTNFm.cjs +0 -102
  114. package/dist/cast-Cerqtxtb.js +0 -103
package/dist/topology.cjs CHANGED
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const shapeFns = require("./shapeFns-B0zSdO9c.cjs");
4
- const booleanFns = require("./booleanFns-5dDG0jpA.cjs");
5
- const topology = require("./topology-CycEc6Oe.cjs");
6
- const curveFns = require("./curveFns-VMxgfkqw.cjs");
7
- const faceFns = require("./faceFns-es3GENII.cjs");
8
- const meshFns = require("./meshFns-DDC_2U81.cjs");
9
- const cast = require("./cast-CPNOTNFm.cjs");
3
+ const shapeFns = require("./shapeFns-3RYtsUVY.cjs");
4
+ const booleanFns = require("./booleanFns-NtKxkiXn.cjs");
5
+ const topology = require("./topology-D-nGjCzV.cjs");
6
+ const curveFns = require("./curveFns-BXCbASW-.cjs");
7
+ const faceFns = require("./faceFns-DcndPHWm.cjs");
8
+ const meshFns = require("./meshFns-DawUwI3W.cjs");
10
9
  exports.getBounds = shapeFns.getBounds;
11
10
  exports.getEdges = shapeFns.getEdges;
12
11
  exports.getFaces = shapeFns.getFaces;
@@ -50,17 +49,24 @@ exports.getCurveType = curveFns.getCurveType;
50
49
  exports.getOrientation = curveFns.getOrientation;
51
50
  exports.interpolateCurve = curveFns.interpolateCurve;
52
51
  exports.offsetWire2D = curveFns.offsetWire2D;
52
+ exports.asTopo = faceFns.asTopo;
53
+ exports.cast = faceFns.cast;
53
54
  exports.classifyPointOnFace = faceFns.classifyPointOnFace;
55
+ exports.deserializeShape = faceFns.fromBREP;
56
+ exports.downcast = faceFns.downcast;
54
57
  exports.faceCenter = faceFns.faceCenter;
55
58
  exports.faceGeomType = faceFns.faceGeomType;
56
59
  exports.faceOrientation = faceFns.faceOrientation;
57
60
  exports.flipFaceOrientation = faceFns.flipFaceOrientation;
58
61
  exports.getSurfaceType = faceFns.getSurfaceType;
59
62
  exports.innerWires = faceFns.innerWires;
63
+ exports.isCompSolid = faceFns.isCompSolid;
64
+ exports.iterTopo = faceFns.iterTopo;
60
65
  exports.normalAt = faceFns.normalAt;
61
66
  exports.outerWire = faceFns.outerWire;
62
67
  exports.pointOnSurface = faceFns.pointOnSurface;
63
68
  exports.projectPointOnFace = faceFns.projectPointOnFace;
69
+ exports.shapeType = faceFns.shapeType;
64
70
  exports.uvBounds = faceFns.uvBounds;
65
71
  exports.uvCoordinates = faceFns.uvCoordinates;
66
72
  exports.clearMeshCache = meshFns.clearMeshCache;
@@ -68,10 +74,3 @@ exports.createMeshCache = meshFns.createMeshCache;
68
74
  exports.exportIGES = meshFns.exportIGES;
69
75
  exports.exportSTEP = meshFns.exportSTEP;
70
76
  exports.exportSTL = meshFns.exportSTL;
71
- exports.asTopo = cast.asTopo;
72
- exports.cast = cast.cast;
73
- exports.deserializeShape = cast.fromBREP;
74
- exports.downcast = cast.downcast;
75
- exports.isCompSolid = cast.isCompSolid;
76
- exports.iterTopo = cast.iterTopo;
77
- exports.shapeType = cast.shapeType;
package/dist/topology.js CHANGED
@@ -1,76 +1,75 @@
1
- import { q, e, c, b, d, u, x, i, y, z, A, B, v } from "./shapeFns-k1YHFwmB.js";
2
- import { e as e2, d as d2 } from "./booleanFns-C-M6qqvB.js";
3
- import { a, b as b2, c as c2, e as e3, f, d as d3, g, j, s, t, k, l, v as v2, w } from "./topology-tMKHJgw2.js";
4
- import { g as g2, d as d4, c as c3, h, f as f2, i as i2, b as b3, e as e4, a as a2, k as k2, l as l2, m, n, o } from "./curveFns-ZuQUBZvd.js";
5
- import { c as c4, f as f3, a as a3, b as b4, d as d5, g as g3, i as i3, n as n2, o as o2, p, e as e5, u as u2, h as h2 } from "./faceFns-CfJIbHY3.js";
6
- import { c as c5, b as b5, e as e6, d as d6, f as f4 } from "./meshFns-CqNwW0PO.js";
7
- import { e as e7, c as c6, f as f5, d as d7, g as g4, i as i4, s as s2 } from "./cast-Cerqtxtb.js";
1
+ import { u, d, a, e, f, c, x, i, y, z, A, B, v } from "./shapeFns-4ioRrhih.js";
2
+ import { h, g } from "./booleanFns-DdjtpcM6.js";
3
+ import { a as a2, b, c as c2, e as e2, f as f2, d as d2, g as g2, j, s, t, k, l, v as v2, w } from "./topology-DRP9zreU.js";
4
+ import { j as j2, a as a3, e as e3, k as k2, i as i2, l as l2, h as h2, d as d3, c as c3, m, b as b2, g as g3, n, o } from "./curveFns-B85Glnfo.js";
5
+ import { l as l3, c as c4, m as m2, j as j3, d as d4, e as e4, f as f3, q, r, g as g4, k as k3, s as s2, i as i3, n as n2, o as o2, p, t as t2, v as v3, u as u2, h as h3 } from "./faceFns-CltrEfOo.js";
6
+ import { c as c5, b as b3, e as e5, d as d5, f as f4 } from "./meshFns-D2gLyLFt.js";
8
7
  export {
9
- a as adjacentFaces,
10
- g2 as approximateCurve,
11
- e7 as asTopo,
12
- b2 as autoHeal,
13
- c6 as cast,
8
+ a2 as adjacentFaces,
9
+ j2 as approximateCurve,
10
+ l3 as asTopo,
11
+ b as autoHeal,
12
+ c4 as cast,
14
13
  c2 as chamferDistAngleShape,
15
- c4 as classifyPointOnFace,
14
+ m2 as classifyPointOnFace,
16
15
  c5 as clearMeshCache,
17
- b5 as createMeshCache,
18
- d4 as curveEndPoint,
19
- c3 as curveIsClosed,
20
- h as curveIsPeriodic,
21
- f2 as curveLength,
22
- i2 as curvePeriod,
23
- b3 as curvePointAt,
24
- e4 as curveStartPoint,
25
- a2 as curveTangentAt,
26
- e2 as cutAll,
27
- f5 as deserializeShape,
28
- d7 as downcast,
29
- e3 as edgesOfFace,
30
- e6 as exportIGES,
31
- d6 as exportSTEP,
16
+ b3 as createMeshCache,
17
+ a3 as curveEndPoint,
18
+ e3 as curveIsClosed,
19
+ k2 as curveIsPeriodic,
20
+ i2 as curveLength,
21
+ l2 as curvePeriod,
22
+ h2 as curvePointAt,
23
+ d3 as curveStartPoint,
24
+ c3 as curveTangentAt,
25
+ h as cutAll,
26
+ j3 as deserializeShape,
27
+ d4 as downcast,
28
+ e2 as edgesOfFace,
29
+ e5 as exportIGES,
30
+ d5 as exportSTEP,
32
31
  f4 as exportSTL,
33
- f3 as faceCenter,
34
- a3 as faceGeomType,
35
- b4 as faceOrientation,
36
- f as facesOfEdge,
37
- d5 as flipFaceOrientation,
38
- k2 as flipOrientation,
39
- d2 as fuseAll,
40
- q as getBounds,
41
- l2 as getCurveType,
42
- e as getEdges,
43
- c as getFaces,
44
- b as getHashCode,
45
- m as getOrientation,
46
- g3 as getSurfaceType,
47
- d as getVertices,
48
- u as getWires,
49
- d3 as healFace,
50
- g as healSolid,
32
+ e4 as faceCenter,
33
+ f3 as faceGeomType,
34
+ q as faceOrientation,
35
+ f2 as facesOfEdge,
36
+ r as flipFaceOrientation,
37
+ m as flipOrientation,
38
+ g as fuseAll,
39
+ u as getBounds,
40
+ b2 as getCurveType,
41
+ d as getEdges,
42
+ a as getFaces,
43
+ e as getHashCode,
44
+ g3 as getOrientation,
45
+ g4 as getSurfaceType,
46
+ f as getVertices,
47
+ c as getWires,
48
+ d2 as healFace,
49
+ g2 as healSolid,
51
50
  j as healWire,
52
- i3 as innerWires,
51
+ k3 as innerWires,
53
52
  n as interpolateCurve,
54
- g4 as isCompSolid,
53
+ s2 as isCompSolid,
55
54
  x as isEqualShape,
56
55
  i as isSameShape,
57
56
  y as iterEdges,
58
57
  z as iterFaces,
59
- i4 as iterTopo,
58
+ i3 as iterTopo,
60
59
  A as iterVertices,
61
60
  B as iterWires,
62
61
  n2 as normalAt,
63
62
  o as offsetWire2D,
64
63
  o2 as outerWire,
65
64
  p as pointOnSurface,
66
- e5 as projectPointOnFace,
67
- s2 as shapeType,
65
+ t2 as projectPointOnFace,
66
+ v3 as shapeType,
68
67
  s as sharedEdges,
69
68
  t as toBufferGeometryData,
70
69
  k as toGroupedBufferGeometryData,
71
70
  l as toLineGeometryData,
72
71
  u2 as uvBounds,
73
- h2 as uvCoordinates,
72
+ h3 as uvCoordinates,
74
73
  v as vertexPosition,
75
74
  v2 as verticesOfEdge,
76
75
  w as wiresOfFace
@@ -1,6 +1,6 @@
1
- import { d as makeOcAx3, a as toVec3 } from "./occtBoundary-D_gjqgzo.js";
1
+ import { e as makeOcAx3, a as toVec3 } from "./occtBoundary-CWzWqBCm.js";
2
2
  import { j as vecNormalize, f as vecIsZero, b as vecCross, v as vecAdd, n as vecScale, o as vecSub, d as vecDot, m as vecRotate, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
3
- import { e as err, x as validationError, l as ok } from "./errors-CSYOlCCR.js";
3
+ import { e as err, x as validationError, l as ok } from "./errors-Coh_5_19.js";
4
4
  function createPlane(origin, xDirection = null, normal = [0, 0, 1]) {
5
5
  const zDir = vecNormalize(normal);
6
6
  if (vecIsZero(zDir)) throw new Error("Plane normal must be non-zero");
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
- const occtBoundary = require("./occtBoundary-CocN2VKx.cjs");
2
+ const occtBoundary = require("./occtBoundary-DH2VO-rq.cjs");
3
3
  const vecOps = require("./vecOps-CjRL1jau.cjs");
4
- const errors = require("./errors-D13q2HCk.cjs");
4
+ const errors = require("./errors-eRQu29oc.cjs");
5
5
  function createPlane(origin, xDirection = null, normal = [0, 0, 1]) {
6
6
  const zDir = vecOps.vecNormalize(normal);
7
7
  if (vecOps.vecIsZero(zDir)) throw new Error("Plane normal must be non-zero");
package/dist/vectors.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const occtBoundary = require("./occtBoundary-CocN2VKx.cjs");
3
+ const occtBoundary = require("./occtBoundary-DH2VO-rq.cjs");
4
4
  const vecOps = require("./vecOps-CjRL1jau.cjs");
5
- const vectors = require("./vectors-DVmHF4zt.cjs");
5
+ const vectors = require("./vectors-DwFeX0Ja.cjs");
6
6
  exports.resolveDirection = occtBoundary.resolveDirection;
7
7
  exports.toVec2 = occtBoundary.toVec2;
8
8
  exports.toVec3 = occtBoundary.toVec3;
package/dist/vectors.js CHANGED
@@ -1,6 +1,6 @@
1
- import { r, t, a } from "./occtBoundary-D_gjqgzo.js";
1
+ import { r, t, a } from "./occtBoundary-CWzWqBCm.js";
2
2
  import { D, R, v, a as a2, b, c, d, e, f, g, h, i, j, k, l, m, n, o } from "./vecOps-ZDdZWbwT.js";
3
- import { c as c2, a as a3, p, r as r2, t as t2 } from "./vectors-DE0XriuQ.js";
3
+ import { c as c2, a as a3, p, r as r2, t as t2 } from "./vectors-CZV4ZrTz.js";
4
4
  export {
5
5
  D as DEG2RAD,
6
6
  R as RAD2DEG,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brepjs",
3
- "version": "8.4.0",
3
+ "version": "8.7.4",
4
4
  "description": "Web CAD library built on OpenCascade",
5
5
  "keywords": [
6
6
  "cad",
@@ -184,6 +184,7 @@
184
184
  "docs:api": "typedoc",
185
185
  "docs:generate-lookup": "npx tsx scripts/generate-function-lookup.ts",
186
186
  "docs:generate-previews": "npx tsx scripts/generate-example-previews.ts",
187
+ "postinstall": "bash scripts/ensure-wasm.sh",
187
188
  "prepare": "husky"
188
189
  },
189
190
  "devDependencies": {
@@ -198,7 +199,7 @@
198
199
  "knip": "5.83.1",
199
200
  "lint-staged": "16.2.7",
200
201
  "prettier": "3.8.1",
201
- "typedoc": "0.28.16",
202
+ "typedoc": "0.28.17",
202
203
  "typescript": "5.9.3",
203
204
  "typescript-eslint": "8.56.0",
204
205
  "vite": "7.3.1",
@@ -206,7 +207,7 @@
206
207
  "vitest": "4.0.18"
207
208
  },
208
209
  "peerDependencies": {
209
- "brepjs-opencascade": "^0.5.1 || ^0.6.0 || ^0.7.0"
210
+ "brepjs-opencascade": "^0.5.1 || ^0.6.0 || ^0.7.0 || ^0.8.0"
210
211
  },
211
212
  "dependencies": {
212
213
  "flatbush": "4.5.0",
@@ -1,102 +0,0 @@
1
- "use strict";
2
- const shapeTypes = require("./shapeTypes-BxVxLdiD.cjs");
3
- const occtBoundary = require("./occtBoundary-CocN2VKx.cjs");
4
- const errors = require("./errors-D13q2HCk.cjs");
5
- let _topoMap = null;
6
- const asTopo = (entity) => {
7
- if (!_topoMap) {
8
- const oc = occtBoundary.getKernel().oc;
9
- const ta = oc.TopAbs_ShapeEnum;
10
- _topoMap = /* @__PURE__ */ new Map([
11
- ["vertex", ta.TopAbs_VERTEX],
12
- ["edge", ta.TopAbs_EDGE],
13
- ["wire", ta.TopAbs_WIRE],
14
- ["face", ta.TopAbs_FACE],
15
- ["shell", ta.TopAbs_SHELL],
16
- ["solid", ta.TopAbs_SOLID],
17
- ["solidCompound", ta.TopAbs_COMPSOLID],
18
- ["compound", ta.TopAbs_COMPOUND],
19
- ["shape", ta.TopAbs_SHAPE]
20
- ]);
21
- }
22
- return _topoMap.get(entity);
23
- };
24
- const iterTopo = function* iterTopo2(shape, topo) {
25
- const topoToShapeType = {
26
- vertex: "vertex",
27
- edge: "edge",
28
- wire: "wire",
29
- face: "face",
30
- shell: "shell",
31
- solid: "solid",
32
- solidCompound: "compsolid",
33
- compound: "compound",
34
- shape: "compound"
35
- // fallback; 'shape' isn't used in iterShapes
36
- };
37
- const shapeType2 = topoToShapeType[topo];
38
- if (shapeType2) {
39
- const shapes = occtBoundary.getKernel().iterShapes(shape, shapeType2);
40
- for (const s of shapes) yield s;
41
- }
42
- };
43
- const shapeType = (shape) => {
44
- if (shape.IsNull()) return errors.err(errors.typeCastError("NULL_SHAPE", "This shape has no type, it is null"));
45
- return errors.ok(shape.ShapeType());
46
- };
47
- let _downcastMap = null;
48
- function getDowncastMap() {
49
- if (!_downcastMap) {
50
- const oc = occtBoundary.getKernel().oc;
51
- const ta = oc.TopAbs_ShapeEnum;
52
- _downcastMap = /* @__PURE__ */ new Map([
53
- [ta.TopAbs_VERTEX, oc.TopoDS.Vertex_1],
54
- [ta.TopAbs_EDGE, oc.TopoDS.Edge_1],
55
- [ta.TopAbs_WIRE, oc.TopoDS.Wire_1],
56
- [ta.TopAbs_FACE, oc.TopoDS.Face_1],
57
- [ta.TopAbs_SHELL, oc.TopoDS.Shell_1],
58
- [ta.TopAbs_SOLID, oc.TopoDS.Solid_1],
59
- [ta.TopAbs_COMPSOLID, oc.TopoDS.CompSolid_1],
60
- [ta.TopAbs_COMPOUND, oc.TopoDS.Compound_1]
61
- ]);
62
- }
63
- return _downcastMap;
64
- }
65
- function downcast(shape) {
66
- return errors.andThen(shapeType(shape), (myType) => {
67
- const caster = getDowncastMap().get(myType);
68
- if (!caster)
69
- return errors.err(errors.typeCastError("NO_WRAPPER", "Could not find a wrapper for this shape type"));
70
- return errors.ok(caster(shape));
71
- });
72
- }
73
- function cast(shape) {
74
- if (shape.IsNull()) {
75
- return errors.err(errors.typeCastError("NULL_SHAPE", "Cannot cast a null shape"));
76
- }
77
- return errors.ok(shapeTypes.castShape(shape));
78
- }
79
- function isShape3D(shape) {
80
- return shapeTypes.isShape3D(shape);
81
- }
82
- function isWire(shape) {
83
- return shapeTypes.isWire(shape);
84
- }
85
- function isCompSolid(shape) {
86
- const st = shape.wrapped.ShapeType();
87
- const oc = occtBoundary.getKernel().oc;
88
- return st === oc.TopAbs_ShapeEnum.TopAbs_COMPSOLID;
89
- }
90
- function fromBREP(data) {
91
- const oc = occtBoundary.getKernel().oc;
92
- return cast(oc.BRepToolsWrapper.Read(data));
93
- }
94
- exports.asTopo = asTopo;
95
- exports.cast = cast;
96
- exports.downcast = downcast;
97
- exports.fromBREP = fromBREP;
98
- exports.isCompSolid = isCompSolid;
99
- exports.isShape3D = isShape3D;
100
- exports.isWire = isWire;
101
- exports.iterTopo = iterTopo;
102
- exports.shapeType = shapeType;
@@ -1,103 +0,0 @@
1
- import { c as castShape, h as isShape3D$1, m as isWire$1 } from "./shapeTypes-c-_pgYCx.js";
2
- import { g as getKernel } from "./occtBoundary-D_gjqgzo.js";
3
- import { e as err, p as typeCastError, l as ok, a as andThen } from "./errors-CSYOlCCR.js";
4
- let _topoMap = null;
5
- const asTopo = (entity) => {
6
- if (!_topoMap) {
7
- const oc = getKernel().oc;
8
- const ta = oc.TopAbs_ShapeEnum;
9
- _topoMap = /* @__PURE__ */ new Map([
10
- ["vertex", ta.TopAbs_VERTEX],
11
- ["edge", ta.TopAbs_EDGE],
12
- ["wire", ta.TopAbs_WIRE],
13
- ["face", ta.TopAbs_FACE],
14
- ["shell", ta.TopAbs_SHELL],
15
- ["solid", ta.TopAbs_SOLID],
16
- ["solidCompound", ta.TopAbs_COMPSOLID],
17
- ["compound", ta.TopAbs_COMPOUND],
18
- ["shape", ta.TopAbs_SHAPE]
19
- ]);
20
- }
21
- return _topoMap.get(entity);
22
- };
23
- const iterTopo = function* iterTopo2(shape, topo) {
24
- const topoToShapeType = {
25
- vertex: "vertex",
26
- edge: "edge",
27
- wire: "wire",
28
- face: "face",
29
- shell: "shell",
30
- solid: "solid",
31
- solidCompound: "compsolid",
32
- compound: "compound",
33
- shape: "compound"
34
- // fallback; 'shape' isn't used in iterShapes
35
- };
36
- const shapeType2 = topoToShapeType[topo];
37
- if (shapeType2) {
38
- const shapes = getKernel().iterShapes(shape, shapeType2);
39
- for (const s of shapes) yield s;
40
- }
41
- };
42
- const shapeType = (shape) => {
43
- if (shape.IsNull()) return err(typeCastError("NULL_SHAPE", "This shape has no type, it is null"));
44
- return ok(shape.ShapeType());
45
- };
46
- let _downcastMap = null;
47
- function getDowncastMap() {
48
- if (!_downcastMap) {
49
- const oc = getKernel().oc;
50
- const ta = oc.TopAbs_ShapeEnum;
51
- _downcastMap = /* @__PURE__ */ new Map([
52
- [ta.TopAbs_VERTEX, oc.TopoDS.Vertex_1],
53
- [ta.TopAbs_EDGE, oc.TopoDS.Edge_1],
54
- [ta.TopAbs_WIRE, oc.TopoDS.Wire_1],
55
- [ta.TopAbs_FACE, oc.TopoDS.Face_1],
56
- [ta.TopAbs_SHELL, oc.TopoDS.Shell_1],
57
- [ta.TopAbs_SOLID, oc.TopoDS.Solid_1],
58
- [ta.TopAbs_COMPSOLID, oc.TopoDS.CompSolid_1],
59
- [ta.TopAbs_COMPOUND, oc.TopoDS.Compound_1]
60
- ]);
61
- }
62
- return _downcastMap;
63
- }
64
- function downcast(shape) {
65
- return andThen(shapeType(shape), (myType) => {
66
- const caster = getDowncastMap().get(myType);
67
- if (!caster)
68
- return err(typeCastError("NO_WRAPPER", "Could not find a wrapper for this shape type"));
69
- return ok(caster(shape));
70
- });
71
- }
72
- function cast(shape) {
73
- if (shape.IsNull()) {
74
- return err(typeCastError("NULL_SHAPE", "Cannot cast a null shape"));
75
- }
76
- return ok(castShape(shape));
77
- }
78
- function isShape3D(shape) {
79
- return isShape3D$1(shape);
80
- }
81
- function isWire(shape) {
82
- return isWire$1(shape);
83
- }
84
- function isCompSolid(shape) {
85
- const st = shape.wrapped.ShapeType();
86
- const oc = getKernel().oc;
87
- return st === oc.TopAbs_ShapeEnum.TopAbs_COMPSOLID;
88
- }
89
- function fromBREP(data) {
90
- const oc = getKernel().oc;
91
- return cast(oc.BRepToolsWrapper.Read(data));
92
- }
93
- export {
94
- isShape3D as a,
95
- isWire as b,
96
- cast as c,
97
- downcast as d,
98
- asTopo as e,
99
- fromBREP as f,
100
- isCompSolid as g,
101
- iterTopo as i,
102
- shapeType as s
103
- };