brepjs 18.77.0 → 18.78.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 (29) hide show
  1. package/dist/brepjs.cjs +135 -134
  2. package/dist/brepjs.js +8 -8
  3. package/dist/{drawFns-BBoTkSta.js → drawFns-C6h_w03r.js} +1 -1
  4. package/dist/{drawFns-DNokXs9U.cjs → drawFns-DxjMxRpE.cjs} +1 -1
  5. package/dist/{primitiveFns-ItlGYe3M.cjs → healingFns-B7dElsC4.cjs} +5 -462
  6. package/dist/{primitiveFns-DWIzRvTY.js → healingFns-DS_nK9KF.js} +6 -301
  7. package/dist/index.d.ts +1 -0
  8. package/dist/{extrudeFns-CSWqlW-n.js → loftFns-DuxEscJB.js} +92 -1
  9. package/dist/{extrudeFns-BJSW3EaV.cjs → loftFns-DycLH1Pq.cjs} +103 -0
  10. package/dist/operations/threadFns.d.ts +39 -0
  11. package/dist/operations.cjs +33 -32
  12. package/dist/operations.d.ts +1 -0
  13. package/dist/operations.js +3 -3
  14. package/dist/{booleanFns-D7Xgt-Og.js → primitiveFns-BxH5omw3.js} +300 -6
  15. package/dist/{booleanFns-CFa3bgbG.cjs → primitiveFns-JRmXxbRr.cjs} +456 -0
  16. package/dist/sketching.cjs +2 -2
  17. package/dist/sketching.js +2 -2
  18. package/dist/text.cjs +2 -2
  19. package/dist/text.js +2 -2
  20. package/dist/{textBlueprints-CYc0xi6l.js → textBlueprints-C3IbySW_.js} +4 -94
  21. package/dist/{textBlueprints-D31dKTZS.cjs → textBlueprints-SKuamOmI.cjs} +11 -113
  22. package/dist/{textMetrics-DfxB-y9A.js → textMetrics--BwiJH2B.js} +1 -1
  23. package/dist/{textMetrics-CjbXCzpg.cjs → textMetrics-Bzbkal_A.cjs} +1 -1
  24. package/dist/{historyFns-Ck2tXVAL.js → threadFns-D8-zfJ0b.js} +71 -4
  25. package/dist/{historyFns-4ggYGJB2.cjs → threadFns-aWgxzqmT.cjs} +76 -3
  26. package/dist/topology/booleanFns.d.ts +9 -1
  27. package/dist/topology.cjs +34 -34
  28. package/dist/topology.js +2 -2
  29. package/package.json +1 -1
@@ -7,6 +7,7 @@ const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
7
7
  const require_shapeFns = require("./shapeFns-D5WNrq3s.cjs");
8
8
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
9
9
  const require_surfaceBuilders = require("./surfaceBuilders-CPHOXRLE.cjs");
10
+ const require_solidBuilders = require("./solidBuilders-diw2zyyN.cjs");
10
11
  //#region src/topology/booleanFns.ts
11
12
  /**
12
13
  * Boolean and compound operations — functional replacements for _3DShape boolean methods.
@@ -454,12 +455,347 @@ function booleanPipelineFallback(base, steps, options) {
454
455
  return require_errors.ok(current);
455
456
  }
456
457
  //#endregion
458
+ //#region src/topology/primitiveFns.ts
459
+ /**
460
+ * Create a box with the given dimensions.
461
+ *
462
+ * @param width - Size along X.
463
+ * @param depth - Size along Y.
464
+ * @param height - Size along Z.
465
+ */
466
+ function box(width, depth, height, options) {
467
+ const solid = require_shapeTypes.createSolid(require_shapeTypes.getKernel().makeBox(width, depth, height));
468
+ const center = options?.at ?? (options?.centered ? [
469
+ 0,
470
+ 0,
471
+ 0
472
+ ] : void 0);
473
+ if (center) return require_shapeFns.translate(solid, [
474
+ center[0] - width / 2,
475
+ center[1] - depth / 2,
476
+ center[2] - height / 2
477
+ ]);
478
+ return solid;
479
+ }
480
+ /**
481
+ * Create a cylinder with the given radius and height.
482
+ */
483
+ function cylinder(radius, height, options) {
484
+ const at = options?.at ?? [
485
+ 0,
486
+ 0,
487
+ 0
488
+ ];
489
+ const axis = options?.axis ?? [
490
+ 0,
491
+ 0,
492
+ 1
493
+ ];
494
+ let solid = require_solidBuilders.makeCylinder(radius, height, at, axis);
495
+ if (options?.centered) {
496
+ const halfShift = [
497
+ -axis[0] * height * .5,
498
+ -axis[1] * height * .5,
499
+ -axis[2] * height * .5
500
+ ];
501
+ solid = require_shapeFns.translate(solid, halfShift);
502
+ }
503
+ return solid;
504
+ }
505
+ /**
506
+ * Create a sphere with the given radius.
507
+ */
508
+ function sphere(radius, options) {
509
+ let solid = require_solidBuilders.makeSphere(radius);
510
+ if (options?.at) solid = require_shapeFns.translate(solid, options.at);
511
+ return solid;
512
+ }
513
+ /**
514
+ * Create a cone (or frustum) with the given radii and height.
515
+ *
516
+ * @param bottomRadius - Radius at the base.
517
+ * @param topRadius - Radius at the top (0 for a full cone).
518
+ * @param height - Height of the cone.
519
+ */
520
+ function cone(bottomRadius, topRadius, height, options) {
521
+ const at = options?.at ?? [
522
+ 0,
523
+ 0,
524
+ 0
525
+ ];
526
+ const axis = options?.axis ?? [
527
+ 0,
528
+ 0,
529
+ 1
530
+ ];
531
+ let solid = require_solidBuilders.makeCone(bottomRadius, topRadius, height, at, axis);
532
+ if (options?.centered) {
533
+ const halfShift = [
534
+ -axis[0] * height * .5,
535
+ -axis[1] * height * .5,
536
+ -axis[2] * height * .5
537
+ ];
538
+ solid = require_shapeFns.translate(solid, halfShift);
539
+ }
540
+ return solid;
541
+ }
542
+ /**
543
+ * Create a torus with the given major and minor radii.
544
+ */
545
+ function torus(majorRadius, minorRadius, options) {
546
+ return require_solidBuilders.makeTorus(majorRadius, minorRadius, options?.at ?? [
547
+ 0,
548
+ 0,
549
+ 0
550
+ ], options?.axis ?? [
551
+ 0,
552
+ 0,
553
+ 1
554
+ ]);
555
+ }
556
+ /**
557
+ * Create an ellipsoid with the given axis half-lengths.
558
+ *
559
+ * @param rx - Half-length along X.
560
+ * @param ry - Half-length along Y.
561
+ * @param rz - Half-length along Z.
562
+ */
563
+ function ellipsoid(rx, ry, rz, options) {
564
+ let solid = require_solidBuilders.makeEllipsoid(rx, ry, rz);
565
+ if (options?.at) solid = require_shapeFns.translate(solid, options.at);
566
+ return solid;
567
+ }
568
+ /** Create a straight edge between two 3D points. */
569
+ function line(from, to) {
570
+ return require_surfaceBuilders.makeLine(from, to);
571
+ }
572
+ /** Create a circular edge with the given radius. */
573
+ function circle(radius, options) {
574
+ const axisDir = options?.axis ?? [
575
+ 0,
576
+ 0,
577
+ 1
578
+ ];
579
+ return require_surfaceBuilders.makeCircle(radius, options?.at ?? [
580
+ 0,
581
+ 0,
582
+ 0
583
+ ], axisDir);
584
+ }
585
+ /**
586
+ * Create an elliptical edge.
587
+ *
588
+ * @returns An error if `minorRadius` exceeds `majorRadius`.
589
+ */
590
+ function ellipse(majorRadius, minorRadius, options) {
591
+ const axisDir = options?.axis ?? [
592
+ 0,
593
+ 0,
594
+ 1
595
+ ];
596
+ return require_surfaceBuilders.makeEllipse(majorRadius, minorRadius, options?.at ?? [
597
+ 0,
598
+ 0,
599
+ 0
600
+ ], axisDir, options?.xDir);
601
+ }
602
+ /**
603
+ * Create a helical wire.
604
+ *
605
+ * @param pitch - Vertical distance per full turn.
606
+ * @param height - Total height.
607
+ * @param radius - Helix radius.
608
+ */
609
+ function helix(pitch, height, radius, options) {
610
+ return require_surfaceBuilders.makeHelix(pitch, height, radius, options?.at ?? [
611
+ 0,
612
+ 0,
613
+ 0
614
+ ], options?.axis ?? [
615
+ 0,
616
+ 0,
617
+ 1
618
+ ], options?.lefthand ?? false);
619
+ }
620
+ /** Create a circular arc edge passing through three points. */
621
+ function threePointArc(p1, p2, p3) {
622
+ return require_surfaceBuilders.makeThreePointArc(p1, p2, p3);
623
+ }
624
+ /**
625
+ * Create an elliptical arc edge between two angles.
626
+ *
627
+ * All angles are in **degrees** (unlike the legacy `makeEllipseArc` which used radians).
628
+ *
629
+ * @param startAngle - Start angle in degrees.
630
+ * @param endAngle - End angle in degrees.
631
+ */
632
+ function ellipseArc(majorRadius, minorRadius, startAngle, endAngle, options) {
633
+ const axisDir = options?.axis ?? [
634
+ 0,
635
+ 0,
636
+ 1
637
+ ];
638
+ return require_surfaceBuilders.makeEllipseArc(majorRadius, minorRadius, startAngle * require_constants.DEG2RAD, endAngle * require_constants.DEG2RAD, options?.at ?? [
639
+ 0,
640
+ 0,
641
+ 0
642
+ ], axisDir, options?.xDir);
643
+ }
644
+ /**
645
+ * Create a B-spline edge that approximates a set of 3D points.
646
+ *
647
+ * @returns An error if the approximation algorithm fails.
648
+ */
649
+ function bsplineApprox(points, config) {
650
+ return require_surfaceBuilders.makeBSplineApproximation(points, config);
651
+ }
652
+ /**
653
+ * Create a Bezier curve edge from control points.
654
+ *
655
+ * @param points - Two or more control points.
656
+ */
657
+ function bezier(points) {
658
+ return require_surfaceBuilders.makeBezierCurve(points);
659
+ }
660
+ /**
661
+ * Create a circular arc edge tangent to a direction at the start point.
662
+ */
663
+ function tangentArc(startPoint, startTgt, endPoint) {
664
+ return require_surfaceBuilders.makeTangentArc(startPoint, startTgt, endPoint);
665
+ }
666
+ /**
667
+ * Assemble edges and/or wires into a single connected wire.
668
+ */
669
+ function wire(listOfEdges) {
670
+ return require_surfaceBuilders.assembleWire(listOfEdges);
671
+ }
672
+ /**
673
+ * Assemble edges into a wire and verify it forms a closed loop.
674
+ *
675
+ * Combines {@link wire} + the `closedWire` smart constructor in a single step.
676
+ * Returns an error if the edges cannot be assembled or the wire is not closed.
677
+ *
678
+ * @example
679
+ * ```ts
680
+ * const cw = unwrap(wireLoop([e1, e2, e3, e4]));
681
+ * const f = unwrap(face(cw)); // ClosedWire accepted directly
682
+ * ```
683
+ */
684
+ function wireLoop(listOfEdges) {
685
+ return require_errors.andThen(require_surfaceBuilders.assembleWire(listOfEdges), (w) => {
686
+ if (require_shapeTypes.isClosedWire(w)) return require_errors.ok(w);
687
+ return require_errors.err(require_errors.validationError("WIRE_NOT_CLOSED", "Assembled wire is not closed: start and end points do not coincide"));
688
+ });
689
+ }
690
+ /**
691
+ * Create a planar face from a closed wire, optionally with holes.
692
+ * The resulting face is always oriented (consistent normal direction).
693
+ */
694
+ function face(w, holes) {
695
+ return require_surfaceBuilders.makeFace(w, holes);
696
+ }
697
+ /**
698
+ * Create a non-planar face from a wire using surface filling.
699
+ * The resulting face is always oriented.
700
+ */
701
+ function filledFace(w) {
702
+ return require_surfaceBuilders.makeNonPlanarFace(w);
703
+ }
704
+ /**
705
+ * Create a face bounded by a wire on an existing face's surface.
706
+ * The resulting face inherits orientation from the origin face.
707
+ */
708
+ function subFace(originFace, w) {
709
+ return require_surfaceBuilders.makeNewFaceWithinFace(originFace, w);
710
+ }
711
+ /**
712
+ * Create a polygonal face from three or more coplanar points.
713
+ * The resulting face is always oriented.
714
+ */
715
+ function polygon(points) {
716
+ return require_surfaceBuilders.makePolygon(points);
717
+ }
718
+ /** Create a vertex at a 3D point. */
719
+ function vertex(point) {
720
+ return require_solidBuilders.makeVertex(point);
721
+ }
722
+ /**
723
+ * Build a compound from multiple shapes.
724
+ */
725
+ function compound(shapeArray) {
726
+ return require_solidBuilders.makeCompound(shapeArray);
727
+ }
728
+ /**
729
+ * Weld faces and shells into a single solid.
730
+ * The resulting solid is always validated.
731
+ */
732
+ function solid(facesOrShells) {
733
+ return require_solidBuilders.makeSolid(facesOrShells);
734
+ }
735
+ /**
736
+ * Create an offset shape from a face.
737
+ */
738
+ function offsetFace(f, distance, tolerance) {
739
+ return require_solidBuilders.makeOffset(f, distance, tolerance);
740
+ }
741
+ /**
742
+ * Weld faces and shells into a single shell.
743
+ */
744
+ function sewShells(facesOrShells, ignoreType) {
745
+ return require_solidBuilders.weldShellsAndFaces(facesOrShells, ignoreType);
746
+ }
747
+ function addHoles(f, holes) {
748
+ return require_surfaceBuilders.addHolesInFace(f, holes);
749
+ }
750
+ //#endregion
751
+ Object.defineProperty(exports, "addHoles", {
752
+ enumerable: true,
753
+ get: function() {
754
+ return addHoles;
755
+ }
756
+ });
757
+ Object.defineProperty(exports, "bezier", {
758
+ enumerable: true,
759
+ get: function() {
760
+ return bezier;
761
+ }
762
+ });
457
763
  Object.defineProperty(exports, "booleanPipeline", {
458
764
  enumerable: true,
459
765
  get: function() {
460
766
  return booleanPipeline;
461
767
  }
462
768
  });
769
+ Object.defineProperty(exports, "box", {
770
+ enumerable: true,
771
+ get: function() {
772
+ return box;
773
+ }
774
+ });
775
+ Object.defineProperty(exports, "bsplineApprox", {
776
+ enumerable: true,
777
+ get: function() {
778
+ return bsplineApprox;
779
+ }
780
+ });
781
+ Object.defineProperty(exports, "circle", {
782
+ enumerable: true,
783
+ get: function() {
784
+ return circle;
785
+ }
786
+ });
787
+ Object.defineProperty(exports, "compound", {
788
+ enumerable: true,
789
+ get: function() {
790
+ return compound;
791
+ }
792
+ });
793
+ Object.defineProperty(exports, "cone", {
794
+ enumerable: true,
795
+ get: function() {
796
+ return cone;
797
+ }
798
+ });
463
799
  Object.defineProperty(exports, "cut", {
464
800
  enumerable: true,
465
801
  get: function() {
@@ -472,6 +808,42 @@ Object.defineProperty(exports, "cutAll", {
472
808
  return cutAll;
473
809
  }
474
810
  });
811
+ Object.defineProperty(exports, "cylinder", {
812
+ enumerable: true,
813
+ get: function() {
814
+ return cylinder;
815
+ }
816
+ });
817
+ Object.defineProperty(exports, "ellipse", {
818
+ enumerable: true,
819
+ get: function() {
820
+ return ellipse;
821
+ }
822
+ });
823
+ Object.defineProperty(exports, "ellipseArc", {
824
+ enumerable: true,
825
+ get: function() {
826
+ return ellipseArc;
827
+ }
828
+ });
829
+ Object.defineProperty(exports, "ellipsoid", {
830
+ enumerable: true,
831
+ get: function() {
832
+ return ellipsoid;
833
+ }
834
+ });
835
+ Object.defineProperty(exports, "face", {
836
+ enumerable: true,
837
+ get: function() {
838
+ return face;
839
+ }
840
+ });
841
+ Object.defineProperty(exports, "filledFace", {
842
+ enumerable: true,
843
+ get: function() {
844
+ return filledFace;
845
+ }
846
+ });
475
847
  Object.defineProperty(exports, "fuse", {
476
848
  enumerable: true,
477
849
  get: function() {
@@ -484,12 +856,36 @@ Object.defineProperty(exports, "fuseAll", {
484
856
  return fuseAll;
485
857
  }
486
858
  });
859
+ Object.defineProperty(exports, "helix", {
860
+ enumerable: true,
861
+ get: function() {
862
+ return helix;
863
+ }
864
+ });
487
865
  Object.defineProperty(exports, "intersect", {
488
866
  enumerable: true,
489
867
  get: function() {
490
868
  return intersect;
491
869
  }
492
870
  });
871
+ Object.defineProperty(exports, "line", {
872
+ enumerable: true,
873
+ get: function() {
874
+ return line;
875
+ }
876
+ });
877
+ Object.defineProperty(exports, "offsetFace", {
878
+ enumerable: true,
879
+ get: function() {
880
+ return offsetFace;
881
+ }
882
+ });
883
+ Object.defineProperty(exports, "polygon", {
884
+ enumerable: true,
885
+ get: function() {
886
+ return polygon;
887
+ }
888
+ });
493
889
  Object.defineProperty(exports, "section", {
494
890
  enumerable: true,
495
891
  get: function() {
@@ -502,15 +898,75 @@ Object.defineProperty(exports, "sectionToFace", {
502
898
  return sectionToFace;
503
899
  }
504
900
  });
901
+ Object.defineProperty(exports, "sewShells", {
902
+ enumerable: true,
903
+ get: function() {
904
+ return sewShells;
905
+ }
906
+ });
505
907
  Object.defineProperty(exports, "slice", {
506
908
  enumerable: true,
507
909
  get: function() {
508
910
  return slice;
509
911
  }
510
912
  });
913
+ Object.defineProperty(exports, "solid", {
914
+ enumerable: true,
915
+ get: function() {
916
+ return solid;
917
+ }
918
+ });
919
+ Object.defineProperty(exports, "sphere", {
920
+ enumerable: true,
921
+ get: function() {
922
+ return sphere;
923
+ }
924
+ });
511
925
  Object.defineProperty(exports, "split", {
512
926
  enumerable: true,
513
927
  get: function() {
514
928
  return split;
515
929
  }
516
930
  });
931
+ Object.defineProperty(exports, "subFace", {
932
+ enumerable: true,
933
+ get: function() {
934
+ return subFace;
935
+ }
936
+ });
937
+ Object.defineProperty(exports, "tangentArc", {
938
+ enumerable: true,
939
+ get: function() {
940
+ return tangentArc;
941
+ }
942
+ });
943
+ Object.defineProperty(exports, "threePointArc", {
944
+ enumerable: true,
945
+ get: function() {
946
+ return threePointArc;
947
+ }
948
+ });
949
+ Object.defineProperty(exports, "torus", {
950
+ enumerable: true,
951
+ get: function() {
952
+ return torus;
953
+ }
954
+ });
955
+ Object.defineProperty(exports, "vertex", {
956
+ enumerable: true,
957
+ get: function() {
958
+ return vertex;
959
+ }
960
+ });
961
+ Object.defineProperty(exports, "wire", {
962
+ enumerable: true,
963
+ get: function() {
964
+ return wire;
965
+ }
966
+ });
967
+ Object.defineProperty(exports, "wireLoop", {
968
+ enumerable: true,
969
+ get: function() {
970
+ return wireLoop;
971
+ }
972
+ });
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_textBlueprints = require("./textBlueprints-D31dKTZS.cjs");
2
+ const require_textBlueprints = require("./textBlueprints-SKuamOmI.cjs");
3
3
  const require_blueprintSketcher = require("./blueprintSketcher-D75tuXkF.cjs");
4
- const require_drawFns = require("./drawFns-DNokXs9U.cjs");
4
+ const require_drawFns = require("./drawFns-DxjMxRpE.cjs");
5
5
  //#region 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
1
  import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-DL-wgnVs.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-BBoTkSta.js";
3
- import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, o as compoundSketchExtrude, p as sketchRevolve, s as compoundSketchFace, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-CYc0xi6l.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-C6h_w03r.js";
3
+ import { a as Sketch, c as compoundSketchLoft, d as sketchFace, f as sketchLoft, h as sketchWires, i as Sketches, l as compoundSketchRevolve, m as sketchSweep, o as compoundSketchExtrude, p as sketchRevolve, s as compoundSketchFace, u as sketchExtrude, v as CompoundSketch } from "./textBlueprints-C3IbySW_.js";
4
4
  //#region src/sketching.ts
5
5
  /**
6
6
  * brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
package/dist/text.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_textBlueprints = require("./textBlueprints-D31dKTZS.cjs");
3
- const require_textMetrics = require("./textMetrics-CjbXCzpg.cjs");
2
+ const require_textBlueprints = require("./textBlueprints-SKuamOmI.cjs");
3
+ const require_textMetrics = require("./textMetrics-Bzbkal_A.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 { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-CYc0xi6l.js";
2
- import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-DfxB-y9A.js";
1
+ import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-C3IbySW_.js";
2
+ import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics--BwiJH2B.js";
3
3
  export { fontMetrics, getFont, loadFont, sketchText, textBlueprints, textMetrics };
@@ -1,5 +1,5 @@
1
- import { Z as getKernel, h as isShape3D, o as createFace, p as isFace, t as castShape, u as createWire } from "./shapeTypes-CyTY0prh.js";
2
- import { A as ok, R as unwrap, T as isOk, b as err, d as validationError, h as bug, i as kernelError, l as typeCastError, r as ioError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
1
+ import { Z as getKernel, o as createFace, p as isFace, u as createWire } from "./shapeTypes-CyTY0prh.js";
2
+ import { A as ok, R as unwrap, T as isOk, b as err, h as bug, r as ioError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
3
3
  import { r as toVec3 } from "./types-D24Y27N0.js";
4
4
  import { d as vecNormalize, h as vecScale, r as vecCross } from "./vecOps-SKPRvPH-.js";
5
5
  import { n as createPlane } from "./planeOps-DSjjtrjg.js";
@@ -9,98 +9,8 @@ import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js"
9
9
  import { i as makeNewFaceWithinFace, r as makeFace, t as addHolesInFace } from "./surfaceBuilders-Do0rypyD.js";
10
10
  import { r as organiseBlueprints, t as BlueprintSketcher } from "./blueprintSketcher-DL-wgnVs.js";
11
11
  import { o as makeSolid, t as makeCompound } from "./solidBuilders-BtEFUFQ9.js";
12
- import { c as sweep, i as complexExtrude, l as twistExtrude, r as revolve, t as extrude } from "./extrudeFns-CSWqlW-n.js";
12
+ import { a as revolve, d as twistExtrude, o as complexExtrude, r as extrude, t as loft, u as sweep } from "./loftFns-DuxEscJB.js";
13
13
  import opentype from "opentype.js";
14
- //#region src/operations/loftFns.ts
15
- /**
16
- * Functional loft operation using branded shape types.
17
- */
18
- /**
19
- * Loft through a set of wire profiles to create a 3D shape.
20
- *
21
- * Builds a `BRepOffsetAPI_ThruSections` surface through the given wires,
22
- * optionally starting and/or ending at point vertices. Produces a solid
23
- * by default, or a shell when `returnShell` is `true`.
24
- *
25
- * @param wires - Ordered wire profiles to loft through.
26
- * @param config - Loft configuration (ruled interpolation, start/end points).
27
- * @param returnShell - When `true`, return a shell instead of a solid.
28
- * @returns `Result` containing the lofted 3D shape, or an error on failure.
29
- *
30
- * @example
31
- * ```ts
32
- * const result = loft([bottomWire, topWire], { ruled: false });
33
- * ```
34
- *
35
- * @see {@link loft!loft | loft} for the OOP API equivalent.
36
- */
37
- function loft(wires, { ruled = true, startPoint, endPoint, tolerance = 1e-6 } = {}, returnShell = false) {
38
- if (wires.length === 0 && !startPoint && !endPoint) return err(validationError("LOFT_EMPTY", "Loft requires at least one wire or start/end point"));
39
- const kernel = getKernel();
40
- const startVertex = startPoint ? kernel.makeVertex(...toVec3(startPoint)) : void 0;
41
- const endVertex = endPoint ? kernel.makeVertex(...toVec3(endPoint)) : void 0;
42
- try {
43
- const result = castShape(kernel.loftAdvanced(wires.map((w) => w.wrapped), {
44
- solid: !returnShell,
45
- ruled,
46
- tolerance,
47
- ...startVertex ? { startVertex } : {},
48
- ...endVertex ? { endVertex } : {}
49
- }));
50
- if (!isShape3D(result)) return err(typeCastError("LOFT_NOT_3D", "Loft did not produce a 3D shape"));
51
- return ok(result);
52
- } catch (e) {
53
- return err(kernelError("LOFT_FAILED", "Loft operation failed", e, void 0, "Common causes: wire profiles with different edge counts, self-intersecting result, or profiles too far apart. Ensure profiles are compatible and ordered."));
54
- }
55
- }
56
- /**
57
- * Batch loft: build N independent lofts in a single kernel call.
58
- *
59
- * Uses the C++ LoftBatch extractor when available (single WASM call),
60
- * falling back to N individual loft operations otherwise.
61
- *
62
- * @returns Array of 3D shapes, one per entry.
63
- */
64
- function loftAll(entries) {
65
- if (entries.length === 0) return ok([]);
66
- const kernel = getKernel();
67
- const verticesToDelete = [];
68
- const kernelEntries = entries.map((e) => {
69
- const startVertex = e.startPoint ? kernel.makeVertex(...toVec3(e.startPoint)) : void 0;
70
- const endVertex = e.endPoint ? kernel.makeVertex(...toVec3(e.endPoint)) : void 0;
71
- if (startVertex) verticesToDelete.push(startVertex);
72
- if (endVertex) verticesToDelete.push(endVertex);
73
- return {
74
- wires: e.wires.map((w) => w.wrapped),
75
- solid: true,
76
- ruled: e.ruled ?? true,
77
- tolerance: e.tolerance ?? 1e-6,
78
- startVertex,
79
- endVertex
80
- };
81
- });
82
- try {
83
- const shapes = kernel.loftBatch?.(kernelEntries) ?? kernelEntries.map((e) => kernel.loftAdvanced(e.wires, {
84
- solid: e.solid,
85
- ruled: e.ruled,
86
- tolerance: e.tolerance,
87
- startVertex: e.startVertex,
88
- endVertex: e.endVertex
89
- }));
90
- const results = [];
91
- for (const shape of shapes) {
92
- const cast = castShape(shape);
93
- if (!isShape3D(cast)) return err(typeCastError("LOFT_ALL_NOT_3D", "Batch loft entry did not produce a 3D shape"));
94
- results.push(cast);
95
- }
96
- return ok(results);
97
- } catch (e) {
98
- return err(kernelError("LOFT_ALL_FAILED", "Batch loft operation failed", e));
99
- } finally {
100
- for (const v of verticesToDelete) kernel.dispose(v);
101
- }
102
- }
103
- //#endregion
104
14
  //#region src/sketching/compoundSketch.ts
105
15
  /**
106
16
  * Represent a face with holes as a group of sketches (one outer + zero or more inner).
@@ -640,4 +550,4 @@ function textBlueprints(text, { startX = 0, startY = 0, fontSize = 16, fontFamil
640
550
  return organiseBlueprints(Array.from(sketchFontCommands(writtenText.commands))).mirror([0, 0]);
641
551
  }
642
552
  //#endregion
643
- export { wrapSketchDataArray as _, Sketch as a, loftAll as b, compoundSketchLoft as c, sketchFace as d, sketchLoft as f, wrapSketchData as g, sketchWires as h, Sketches as i, compoundSketchRevolve as l, sketchSweep as m, getFont as n, compoundSketchExtrude as o, sketchRevolve as p, loadFont as r, compoundSketchFace as s, textBlueprints as t, sketchExtrude as u, CompoundSketch as v, loft as y };
553
+ export { wrapSketchDataArray as _, Sketch as a, compoundSketchLoft as c, sketchFace as d, sketchLoft as f, wrapSketchData as g, sketchWires as h, Sketches as i, compoundSketchRevolve as l, sketchSweep as m, getFont as n, compoundSketchExtrude as o, sketchRevolve as p, loadFont as r, compoundSketchFace as s, textBlueprints as t, sketchExtrude as u, CompoundSketch as v };