brepjs 18.82.4 → 18.82.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d.cjs +6 -6
- package/dist/2d.js +6 -6
- package/dist/{blueprint-BBUOweQy.cjs → blueprint-C2gkyxYc.cjs} +7 -7
- package/dist/{blueprint-DjzevNhB.js → blueprint-yJsyEFn_.js} +7 -7
- package/dist/{blueprintFns-CRES_5vP.cjs → blueprintFns-CL4VZzCL.cjs} +2 -2
- package/dist/{blueprintFns-CxSMnMfl.js → blueprintFns-DjpRmsbi.js} +2 -2
- package/dist/{blueprintSketcher-CFa32JZU.cjs → blueprintSketcher-BLXntEIS.cjs} +140 -86
- package/dist/{blueprintSketcher-CIydRzRr.js → blueprintSketcher-BbYPEPMa.js} +140 -86
- package/dist/{boolean2D-Z0KE98a4.cjs → boolean2D-BbvyYF-v.cjs} +4 -4
- package/dist/{boolean2D-BRWPIJhe.js → boolean2D-C3k4iO92.js} +4 -4
- package/dist/brepjs.cjs +50 -50
- package/dist/brepjs.js +25 -25
- package/dist/{cameraFns-B3Wb4Br9.js → cameraFns-BiQGAnPd.js} +2 -2
- package/dist/{cameraFns-Drgka78Q.cjs → cameraFns-BkSHm_Vo.cjs} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/{cornerFinder-BRYZAgdE.js → cornerFinder-C9zvdkpK.js} +1 -1
- package/dist/{cornerFinder-BuYpqGO8.cjs → cornerFinder-D3lGL_Td.cjs} +1 -1
- package/dist/{curveFns-XSz4F9j3.js → curveFns-B4_om-yp.js} +1 -1
- package/dist/{curveFns-BA5zsoce.cjs → curveFns-Dlbfncal.cjs} +1 -1
- package/dist/{drawFns-DrlxFhe4.js → drawFns-DaTn2p7M.js} +12 -12
- package/dist/{drawFns-CmSMHb12.cjs → drawFns-lls9IuPY.cjs} +12 -12
- package/dist/{faceFns-BO8IXhhf.js → faceFns-4JEna8n9.js} +2 -2
- package/dist/{faceFns-6AarivqH.cjs → faceFns-Obtamglc.cjs} +2 -2
- package/dist/{healingFns-MxlhdTIc.cjs → healingFns-gHxvhsbJ.cjs} +9 -9
- package/dist/{healingFns-Ct_-O3yk.js → healingFns-uXLI1vJ7.js} +5 -5
- package/dist/{helpers-CTc8ZbY8.js → helpers-CJV31xig.js} +6 -6
- package/dist/{helpers-DN6s-TLC.cjs → helpers-rAK5qEBu.cjs} +6 -6
- package/dist/{importFns-Cb-cmpGG.cjs → importFns-BJVEly-l.cjs} +2 -2
- package/dist/{importFns-D4Xet5aD.js → importFns-Dcc2KviL.js} +2 -2
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/brepkit/brepkitWasmTypes.d.ts +10 -6
- package/dist/kernel/occtWasm/kernel2dOps.d.ts +8 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/{loftFns-DxhcdpAu.cjs → loftFns-BAM49XJy.cjs} +1 -1
- package/dist/{loftFns-BVbzy6gm.js → loftFns-DF3KNz9-.js} +1 -1
- package/dist/{measureFns-BNHvjShh.cjs → measureFns-Ym_I522s.cjs} +3 -3
- package/dist/{measureFns-7Nz5JklM.js → measureFns-xpevHRLG.js} +3 -3
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-YXFipjjx.cjs → meshFns-DDhKhVK0.cjs} +3 -3
- package/dist/{meshFns-CWwOpBlM.js → meshFns-soCHj3jp.js} +3 -3
- package/dist/{occtWasmAdapter-BMV179Ji.js → occtWasmAdapter-BK6h0nKd.js} +29 -5
- package/dist/{occtWasmAdapter-5hzzhkME.cjs → occtWasmAdapter-Bfz5Zfmk.cjs} +29 -5
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/primitiveFns-BmUIWDC7.js +300 -0
- package/dist/primitiveFns-SEyCwNra.cjs +461 -0
- package/dist/projection.cjs +1 -1
- package/dist/projection.js +1 -1
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/{shapeFns-B6UAiYAx.js → shapeFns-B8REDWBf.js} +2 -2
- package/dist/{shapeFns-sF0x5Zhj.cjs → shapeFns-CE6c_4D4.cjs} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeRefFns-Bb0aQZWz.cjs → shapeRefFns-C3tglb5A.cjs} +4 -4
- package/dist/{shapeRefFns-NdQvPa5J.js → shapeRefFns-O5h8bOr9.js} +4 -4
- package/dist/{shapeTypes-D4Evnmz_.js → shapeTypes-B8d_6R0X.js} +9 -6
- package/dist/{shapeTypes-D1eUDuzl.cjs → shapeTypes-nFeOa7gQ.cjs} +9 -6
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{primitiveFns-CjL5bygY.js → solidBuilders-BSnsqitN.js} +100 -257
- package/dist/{primitiveFns-LWkd7M2f.cjs → solidBuilders-DfGIPlQ2.cjs} +124 -383
- package/dist/{surfaceBuilders-R4DKNFkI.cjs → surfaceBuilders-CDX6sDZz.cjs} +2 -2
- package/dist/{surfaceBuilders-CLMyFimy.js → surfaceBuilders-D5sQZ6ah.js} +2 -2
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-BjSwFtO2.cjs → textBlueprints-BwRqV98S.cjs} +31 -48
- package/dist/{textBlueprints-BJ22J1c2.js → textBlueprints-Cqu-mcRD.js} +32 -49
- package/dist/{textMetrics-BrSfzuY6.js → textMetrics-Cikow3vH.js} +1 -1
- package/dist/{textMetrics-5DyMA99n.cjs → textMetrics-DpCTYcE2.cjs} +1 -1
- package/dist/{threadFns-DqMbjyxZ.js → threadFns-BQHEnI7a.js} +6 -5
- package/dist/{threadFns-CX9l8sRv.cjs → threadFns-BzFhh87N.cjs} +8 -7
- package/dist/topology.cjs +10 -9
- package/dist/topology.js +8 -7
- package/dist/{topologyQueryFns-5EeBz6_7.js → topologyQueryFns-BcGLEMvc.js} +1 -1
- package/dist/{topologyQueryFns-Nnu56Ke2.cjs → topologyQueryFns-Bhey0q1G.cjs} +1 -1
- package/package.json +16 -16
- package/dist/solidBuilders-CgPOdC3Q.js +0 -140
- package/dist/solidBuilders-mxHbGDW6.cjs +0 -199
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-nFeOa7gQ.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-Bhey0q1G.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
6
6
|
const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
|
|
7
|
-
const
|
|
7
|
+
const require_faceFns = require("./faceFns-Obtamglc.cjs");
|
|
8
|
+
const require_shapeFns = require("./shapeFns-CE6c_4D4.cjs");
|
|
8
9
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
9
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
10
|
-
const require_solidBuilders = require("./solidBuilders-mxHbGDW6.cjs");
|
|
10
|
+
const require_surfaceBuilders = require("./surfaceBuilders-CDX6sDZz.cjs");
|
|
11
11
|
//#region src/topology/booleanFns.ts
|
|
12
12
|
/**
|
|
13
13
|
* Boolean and compound operations — functional replacements for _3DShape boolean methods.
|
|
@@ -455,347 +455,148 @@ function booleanPipelineFallback(base, steps, options) {
|
|
|
455
455
|
return require_errors.ok(current);
|
|
456
456
|
}
|
|
457
457
|
//#endregion
|
|
458
|
-
//#region src/topology/
|
|
458
|
+
//#region src/topology/shapeUtils.ts
|
|
459
459
|
/**
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
* @param width - Size along X.
|
|
463
|
-
* @param depth - Size along Y.
|
|
464
|
-
* @param height - Size along Z.
|
|
460
|
+
* Shape assembly utilities — welding and sewing operations.
|
|
465
461
|
*/
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
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;
|
|
462
|
+
/** Sew faces/shells into a single shape using the kernel's sewing algorithm. */
|
|
463
|
+
function weldShapes(facesOrShells) {
|
|
464
|
+
return require_errors.unwrap(require_faceFns.cast(require_errors.unwrap(require_faceFns.downcast(require_shapeTypes.getKernel().sew(facesOrShells.map((s) => s.wrapped))))));
|
|
479
465
|
}
|
|
480
466
|
/**
|
|
481
|
-
*
|
|
467
|
+
* Welds faces and shells into a single shell.
|
|
468
|
+
*
|
|
469
|
+
* @param facesOrShells - An array of faces and shells to be welded.
|
|
470
|
+
* @param ignoreType - If true, the function will not check if the result is a shell.
|
|
471
|
+
* @returns A shell that contains all the faces and shells.
|
|
482
472
|
*/
|
|
483
|
-
function
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
|
|
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;
|
|
473
|
+
function weldShellsAndFaces(facesOrShells, ignoreType = false) {
|
|
474
|
+
const shell = weldShapes(facesOrShells);
|
|
475
|
+
if (!ignoreType && !require_shapeTypes.isShell(shell)) return require_errors.err(require_errors.typeCastError("WELD_NOT_SHELL", "Could not make a shell from faces and shells"));
|
|
476
|
+
return require_errors.ok(shell);
|
|
504
477
|
}
|
|
478
|
+
//#endregion
|
|
479
|
+
//#region src/topology/solidBuilders.ts
|
|
505
480
|
/**
|
|
506
|
-
*
|
|
481
|
+
* Solid and primitive construction helpers — boxes, cylinders, spheres, cones,
|
|
482
|
+
* tori, ellipsoids, vertices, compounds, and offsets.
|
|
507
483
|
*/
|
|
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
484
|
/**
|
|
514
|
-
*
|
|
485
|
+
* Creates a cylinder with the given radius and height.
|
|
515
486
|
*
|
|
516
|
-
* @
|
|
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.
|
|
487
|
+
* @category Solids
|
|
544
488
|
*/
|
|
545
|
-
function
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
]);
|
|
489
|
+
function makeCylinder(radius, height, location = [
|
|
490
|
+
0,
|
|
491
|
+
0,
|
|
492
|
+
0
|
|
493
|
+
], direction = [
|
|
494
|
+
0,
|
|
495
|
+
0,
|
|
496
|
+
1
|
|
497
|
+
]) {
|
|
498
|
+
return require_shapeTypes.createSolid(require_shapeTypes.getKernel().makeCylinder(radius, height, [...location], [...direction]));
|
|
555
499
|
}
|
|
556
500
|
/**
|
|
557
|
-
*
|
|
501
|
+
* Creates a sphere with the given radius.
|
|
558
502
|
*
|
|
559
|
-
* @
|
|
560
|
-
* @param ry - Half-length along Y.
|
|
561
|
-
* @param rz - Half-length along Z.
|
|
503
|
+
* @category Solids
|
|
562
504
|
*/
|
|
563
|
-
function
|
|
564
|
-
|
|
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);
|
|
505
|
+
function makeSphere(radius) {
|
|
506
|
+
return require_shapeTypes.createSolid(require_shapeTypes.getKernel().makeSphere(radius));
|
|
584
507
|
}
|
|
585
508
|
/**
|
|
586
|
-
*
|
|
509
|
+
* Creates a cone (or frustum) with the given radii and height.
|
|
587
510
|
*
|
|
588
|
-
* @
|
|
511
|
+
* @category Solids
|
|
589
512
|
*/
|
|
590
|
-
function
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
], axisDir, options?.xDir);
|
|
513
|
+
function makeCone(radius1, radius2, height, location = [
|
|
514
|
+
0,
|
|
515
|
+
0,
|
|
516
|
+
0
|
|
517
|
+
], direction = [
|
|
518
|
+
0,
|
|
519
|
+
0,
|
|
520
|
+
1
|
|
521
|
+
]) {
|
|
522
|
+
return require_shapeTypes.createSolid(require_shapeTypes.getKernel().makeCone(radius1, radius2, height, [...location], [...direction]));
|
|
601
523
|
}
|
|
602
524
|
/**
|
|
603
|
-
*
|
|
525
|
+
* Creates a torus with the given major and minor radii.
|
|
604
526
|
*
|
|
605
|
-
* @
|
|
606
|
-
* @param height - Total height.
|
|
607
|
-
* @param radius - Helix radius.
|
|
527
|
+
* @category Solids
|
|
608
528
|
*/
|
|
609
|
-
function
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
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);
|
|
529
|
+
function makeTorus(majorRadius, minorRadius, location = [
|
|
530
|
+
0,
|
|
531
|
+
0,
|
|
532
|
+
0
|
|
533
|
+
], direction = [
|
|
534
|
+
0,
|
|
535
|
+
0,
|
|
536
|
+
1
|
|
537
|
+
]) {
|
|
538
|
+
return require_shapeTypes.createSolid(require_shapeTypes.getKernel().makeTorus(majorRadius, minorRadius, [...location], [...direction]));
|
|
623
539
|
}
|
|
624
540
|
/**
|
|
625
|
-
*
|
|
541
|
+
* Creates an ellipsoid with the given axis lengths.
|
|
626
542
|
*
|
|
627
|
-
*
|
|
543
|
+
* The algorithm creates a unit BSpline sphere surface, transforms its
|
|
544
|
+
* control-point poles with an affinity matrix to match the requested
|
|
545
|
+
* axis half-lengths, then sews the result into a solid.
|
|
628
546
|
*
|
|
629
|
-
* @
|
|
630
|
-
* @param endAngle - End angle in degrees.
|
|
547
|
+
* @category Solids
|
|
631
548
|
*/
|
|
632
|
-
function
|
|
633
|
-
|
|
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);
|
|
549
|
+
function makeEllipsoid(aLength, bLength, cLength) {
|
|
550
|
+
return require_shapeTypes.createSolid(require_shapeTypes.getKernel().makeEllipsoid(aLength, bLength, cLength));
|
|
643
551
|
}
|
|
644
|
-
/**
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
* @returns An error if the approximation algorithm fails.
|
|
648
|
-
*/
|
|
649
|
-
function bsplineApprox(points, config) {
|
|
650
|
-
return require_surfaceBuilders.makeBSplineApproximation(points, config);
|
|
552
|
+
/** Create a vertex at a 3D point. */
|
|
553
|
+
function makeVertex(point) {
|
|
554
|
+
return require_shapeTypes.createVertex(require_shapeTypes.getKernel().makeVertex(point[0], point[1], point[2]));
|
|
651
555
|
}
|
|
652
556
|
/**
|
|
653
|
-
* Create
|
|
557
|
+
* Create an offset shape from a face.
|
|
654
558
|
*
|
|
655
|
-
* @param
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
return require_surfaceBuilders.makeTangentArc(startPoint, startTgt, endPoint);
|
|
559
|
+
* @param offset - Signed offset distance (positive = outward).
|
|
560
|
+
* @param tolerance - Geometric tolerance for the offset algorithm.
|
|
561
|
+
* @returns An error if the result is not a valid 3D shape.
|
|
562
|
+
*/
|
|
563
|
+
function makeOffset(face, offset, tolerance = 1e-6) {
|
|
564
|
+
return require_errors.andThen(require_faceFns.downcast(require_shapeTypes.getKernel().offset(face.wrapped, offset, tolerance)), (downcasted) => require_errors.andThen(require_faceFns.cast(downcasted), (newShape) => {
|
|
565
|
+
if (!require_shapeTypes.isShape3D(newShape)) return require_errors.err(require_errors.typeCastError("OFFSET_NOT_3D", "Could not offset to a 3d shape"));
|
|
566
|
+
return require_errors.ok(newShape);
|
|
567
|
+
}));
|
|
665
568
|
}
|
|
666
569
|
/**
|
|
667
|
-
*
|
|
570
|
+
* Build a compound from multiple shapes.
|
|
571
|
+
*
|
|
572
|
+
* @param shapeArray - Shapes to group into a single compound.
|
|
573
|
+
* @returns A new Compound containing all input shapes.
|
|
668
574
|
*/
|
|
669
|
-
function
|
|
670
|
-
return
|
|
575
|
+
function makeCompound(shapeArray) {
|
|
576
|
+
return require_shapeTypes.createCompound(require_shapeTypes.getKernel().makeCompound(shapeArray.map((s) => s.wrapped)));
|
|
671
577
|
}
|
|
672
578
|
/**
|
|
673
|
-
*
|
|
579
|
+
* Welds faces and shells into a single shell and then makes a solid.
|
|
674
580
|
*
|
|
675
|
-
*
|
|
676
|
-
*
|
|
581
|
+
* @param facesOrShells - An array of faces and shells to be welded.
|
|
582
|
+
* @returns A solid that contains all the faces and shells.
|
|
677
583
|
*
|
|
678
|
-
* @
|
|
679
|
-
* ```ts
|
|
680
|
-
* const cw = unwrap(wireLoop([e1, e2, e3, e4]));
|
|
681
|
-
* const f = unwrap(face(cw)); // ClosedWire accepted directly
|
|
682
|
-
* ```
|
|
584
|
+
* @category Solids
|
|
683
585
|
*/
|
|
684
|
-
function
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
return require_errors.err(require_errors.
|
|
586
|
+
function makeSolid(facesOrShells) {
|
|
587
|
+
const shell = weldShapes(facesOrShells);
|
|
588
|
+
return require_errors.andThen(require_faceFns.cast(require_shapeTypes.getKernel().solidFromShell(shell.wrapped)), (solid) => {
|
|
589
|
+
if (!require_shapeTypes.isSolid(solid)) return require_errors.err(require_errors.typeCastError("SOLID_BUILD_FAILED", "Could not make a solid of faces and shells"));
|
|
590
|
+
return require_errors.ok(solid);
|
|
688
591
|
});
|
|
689
592
|
}
|
|
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
593
|
//#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
|
-
});
|
|
763
594
|
Object.defineProperty(exports, "booleanPipeline", {
|
|
764
595
|
enumerable: true,
|
|
765
596
|
get: function() {
|
|
766
597
|
return booleanPipeline;
|
|
767
598
|
}
|
|
768
599
|
});
|
|
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
|
-
});
|
|
799
600
|
Object.defineProperty(exports, "cut", {
|
|
800
601
|
enumerable: true,
|
|
801
602
|
get: function() {
|
|
@@ -808,82 +609,76 @@ Object.defineProperty(exports, "cutAll", {
|
|
|
808
609
|
return cutAll;
|
|
809
610
|
}
|
|
810
611
|
});
|
|
811
|
-
Object.defineProperty(exports, "
|
|
812
|
-
enumerable: true,
|
|
813
|
-
get: function() {
|
|
814
|
-
return cylinder;
|
|
815
|
-
}
|
|
816
|
-
});
|
|
817
|
-
Object.defineProperty(exports, "ellipse", {
|
|
612
|
+
Object.defineProperty(exports, "fuse", {
|
|
818
613
|
enumerable: true,
|
|
819
614
|
get: function() {
|
|
820
|
-
return
|
|
615
|
+
return fuse;
|
|
821
616
|
}
|
|
822
617
|
});
|
|
823
|
-
Object.defineProperty(exports, "
|
|
618
|
+
Object.defineProperty(exports, "fuseAll", {
|
|
824
619
|
enumerable: true,
|
|
825
620
|
get: function() {
|
|
826
|
-
return
|
|
621
|
+
return fuseAll;
|
|
827
622
|
}
|
|
828
623
|
});
|
|
829
|
-
Object.defineProperty(exports, "
|
|
624
|
+
Object.defineProperty(exports, "intersect", {
|
|
830
625
|
enumerable: true,
|
|
831
626
|
get: function() {
|
|
832
|
-
return
|
|
627
|
+
return intersect;
|
|
833
628
|
}
|
|
834
629
|
});
|
|
835
|
-
Object.defineProperty(exports, "
|
|
630
|
+
Object.defineProperty(exports, "makeCompound", {
|
|
836
631
|
enumerable: true,
|
|
837
632
|
get: function() {
|
|
838
|
-
return
|
|
633
|
+
return makeCompound;
|
|
839
634
|
}
|
|
840
635
|
});
|
|
841
|
-
Object.defineProperty(exports, "
|
|
636
|
+
Object.defineProperty(exports, "makeCone", {
|
|
842
637
|
enumerable: true,
|
|
843
638
|
get: function() {
|
|
844
|
-
return
|
|
639
|
+
return makeCone;
|
|
845
640
|
}
|
|
846
641
|
});
|
|
847
|
-
Object.defineProperty(exports, "
|
|
642
|
+
Object.defineProperty(exports, "makeCylinder", {
|
|
848
643
|
enumerable: true,
|
|
849
644
|
get: function() {
|
|
850
|
-
return
|
|
645
|
+
return makeCylinder;
|
|
851
646
|
}
|
|
852
647
|
});
|
|
853
|
-
Object.defineProperty(exports, "
|
|
648
|
+
Object.defineProperty(exports, "makeEllipsoid", {
|
|
854
649
|
enumerable: true,
|
|
855
650
|
get: function() {
|
|
856
|
-
return
|
|
651
|
+
return makeEllipsoid;
|
|
857
652
|
}
|
|
858
653
|
});
|
|
859
|
-
Object.defineProperty(exports, "
|
|
654
|
+
Object.defineProperty(exports, "makeOffset", {
|
|
860
655
|
enumerable: true,
|
|
861
656
|
get: function() {
|
|
862
|
-
return
|
|
657
|
+
return makeOffset;
|
|
863
658
|
}
|
|
864
659
|
});
|
|
865
|
-
Object.defineProperty(exports, "
|
|
660
|
+
Object.defineProperty(exports, "makeSolid", {
|
|
866
661
|
enumerable: true,
|
|
867
662
|
get: function() {
|
|
868
|
-
return
|
|
663
|
+
return makeSolid;
|
|
869
664
|
}
|
|
870
665
|
});
|
|
871
|
-
Object.defineProperty(exports, "
|
|
666
|
+
Object.defineProperty(exports, "makeSphere", {
|
|
872
667
|
enumerable: true,
|
|
873
668
|
get: function() {
|
|
874
|
-
return
|
|
669
|
+
return makeSphere;
|
|
875
670
|
}
|
|
876
671
|
});
|
|
877
|
-
Object.defineProperty(exports, "
|
|
672
|
+
Object.defineProperty(exports, "makeTorus", {
|
|
878
673
|
enumerable: true,
|
|
879
674
|
get: function() {
|
|
880
|
-
return
|
|
675
|
+
return makeTorus;
|
|
881
676
|
}
|
|
882
677
|
});
|
|
883
|
-
Object.defineProperty(exports, "
|
|
678
|
+
Object.defineProperty(exports, "makeVertex", {
|
|
884
679
|
enumerable: true,
|
|
885
680
|
get: function() {
|
|
886
|
-
return
|
|
681
|
+
return makeVertex;
|
|
887
682
|
}
|
|
888
683
|
});
|
|
889
684
|
Object.defineProperty(exports, "section", {
|
|
@@ -898,75 +693,21 @@ Object.defineProperty(exports, "sectionToFace", {
|
|
|
898
693
|
return sectionToFace;
|
|
899
694
|
}
|
|
900
695
|
});
|
|
901
|
-
Object.defineProperty(exports, "sewShells", {
|
|
902
|
-
enumerable: true,
|
|
903
|
-
get: function() {
|
|
904
|
-
return sewShells;
|
|
905
|
-
}
|
|
906
|
-
});
|
|
907
696
|
Object.defineProperty(exports, "slice", {
|
|
908
697
|
enumerable: true,
|
|
909
698
|
get: function() {
|
|
910
699
|
return slice;
|
|
911
700
|
}
|
|
912
701
|
});
|
|
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
|
-
});
|
|
925
702
|
Object.defineProperty(exports, "split", {
|
|
926
703
|
enumerable: true,
|
|
927
704
|
get: function() {
|
|
928
705
|
return split;
|
|
929
706
|
}
|
|
930
707
|
});
|
|
931
|
-
Object.defineProperty(exports, "
|
|
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", {
|
|
708
|
+
Object.defineProperty(exports, "weldShellsAndFaces", {
|
|
968
709
|
enumerable: true,
|
|
969
710
|
get: function() {
|
|
970
|
-
return
|
|
711
|
+
return weldShellsAndFaces;
|
|
971
712
|
}
|
|
972
713
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-nFeOa7gQ.cjs");
|
|
2
2
|
const require_errors = require("./errors-CXJtc4I7.cjs");
|
|
3
|
-
const require_faceFns = require("./faceFns-
|
|
3
|
+
const require_faceFns = require("./faceFns-Obtamglc.cjs");
|
|
4
4
|
//#region src/utils/range.ts
|
|
5
5
|
/** Generate an array of integers `[0, 1, …, len - 1]`. */
|
|
6
6
|
function range(len) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Z as getKernel, a as createEdge, o as createFace, p as isFace, u as createWire, w as isPlanarFace } from "./shapeTypes-
|
|
1
|
+
import { Z as getKernel, a as createEdge, o as createFace, p as isFace, u as createWire, w as isPlanarFace } from "./shapeTypes-B8d_6R0X.js";
|
|
2
2
|
import { A as ok, b as err, d as validationError, i as kernelError, v as andThen } from "./errors-DNWJsfVU.js";
|
|
3
|
-
import { _ as cast, u as outerWire } from "./faceFns-
|
|
3
|
+
import { _ as cast, u as outerWire } from "./faceFns-4JEna8n9.js";
|
|
4
4
|
//#region src/utils/range.ts
|
|
5
5
|
/** Generate an array of integers `[0, 1, …, len - 1]`. */
|
|
6
6
|
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-
|
|
3
|
-
const require_textMetrics = require("./textMetrics-
|
|
2
|
+
const require_textBlueprints = require("./textBlueprints-BwRqV98S.cjs");
|
|
3
|
+
const require_textMetrics = require("./textMetrics-DpCTYcE2.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-
|
|
2
|
-
import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-
|
|
1
|
+
import { n as getFont, r as loadFont, t as textBlueprints } from "./textBlueprints-Cqu-mcRD.js";
|
|
2
|
+
import { n as textMetrics, r as sketchText, t as fontMetrics } from "./textMetrics-Cikow3vH.js";
|
|
3
3
|
export { fontMetrics, getFont, loadFont, sketchText, textBlueprints, textMetrics };
|