@metamesh/modeling 0.6.0 → 0.8.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.
- package/CHANGELOG.md +30 -0
- package/README.md +157 -22
- package/dist/api/engine.d.ts +25 -4
- package/dist/api/geometry.d.ts +391 -82
- package/dist/api/index.d.ts +732 -108
- package/dist/api/text.d.ts +40 -10
- package/dist/engine/construction-operations.js +52 -10
- package/dist/engine/execution.js +55 -2
- package/dist/engine/export-3mf.js +17 -1
- package/dist/engine/finalization.js +27 -18
- package/dist/engine/index.js +12 -1
- package/dist/engine/inspection-operations.js +26 -22
- package/dist/engine/loft-operations.js +1 -1
- package/dist/engine/mechanical-operations.js +5 -8
- package/dist/engine/mesh-view-cache.js +23 -0
- package/dist/engine/native/adapter.js +2 -4
- package/dist/engine/native/distance.js +42 -0
- package/dist/engine/native/status.js +16 -0
- package/dist/engine/operation-environment.js +2 -1
- package/dist/engine/section-operations.js +3 -3
- package/dist/geometry/curves/sampling.js +2 -1
- package/dist/geometry/heightfield.js +109 -42
- package/dist/geometry/index.js +2 -0
- package/dist/geometry/loft-simple-mesh.js +2 -3
- package/dist/geometry/loft-triangulation.js +12 -9
- package/dist/geometry/loft.js +18 -7
- package/dist/geometry/math/vector3.js +35 -5
- package/dist/geometry/mechanical/standards.js +2 -3
- package/dist/geometry/mechanical/thread-profiles.js +5 -0
- package/dist/geometry/mechanical/threads.js +2 -3
- package/dist/geometry/mesh-centroid.js +36 -0
- package/dist/geometry/mesh-edge-table.js +126 -0
- package/dist/geometry/mesh-solid-intersections.js +123 -0
- package/dist/geometry/mesh-solid.js +284 -0
- package/dist/geometry/mesh.js +8 -25
- package/dist/geometry/paths/path.js +3 -1
- package/dist/geometry/paths/resampling.js +2 -1
- package/dist/geometry/profiles/matched.js +8 -0
- package/dist/geometry/profiles/profiles.js +24 -3
- package/dist/geometry/profiles/rectangle.js +16 -2
- package/dist/geometry/profiles/shapes.js +8 -1
- package/dist/geometry/revolve/revolve-mesh.js +6 -0
- package/dist/geometry/sweeps/sweep-closed.js +4 -4
- package/dist/geometry/sweeps/sweep-mesh.js +13 -7
- package/dist/geometry/sweeps/sweep-open.js +4 -4
- package/dist/geometry/sweeps/validation.js +1 -2
- package/dist/model/operations.js +13 -4
- package/dist/text/index.js +11 -1
- package/dist/text/vector-text-layout.js +46 -3
- package/package.json +1 -1
package/dist/api/geometry.d.ts
CHANGED
|
@@ -11,7 +11,13 @@ export declare interface AcmeThreadProfileSpec extends ThreadProfileBaseSpec {
|
|
|
11
11
|
readonly depth?: number;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Adds two finite XYZ vectors component-wise.
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* add3([1, 2, 3], [4, 5, 6]); // [5, 7, 9]
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
15
21
|
export declare const add3: (a: Vec3, b: Vec3) => Vec3;
|
|
16
22
|
|
|
17
23
|
/** Controls full-circle sampling that must satisfy one or more topology alignments. */
|
|
@@ -168,7 +174,9 @@ export declare interface ArcCurve3 {
|
|
|
168
174
|
readonly tolerance?: GeometryToleranceOptions;
|
|
169
175
|
}
|
|
170
176
|
|
|
171
|
-
/**
|
|
177
|
+
/**
|
|
178
|
+
* One explicitly unit-labelled right-handed axis-angle rotation.
|
|
179
|
+
*/
|
|
172
180
|
export declare type AxisAngleRotation3 = {
|
|
173
181
|
/** Finite right-handed angle in degrees. */
|
|
174
182
|
readonly degrees: number;
|
|
@@ -227,7 +235,9 @@ export declare interface ArcCurve3 {
|
|
|
227
235
|
/** Independent treatments for disjoint named edge selections; overlapping selections fail. */
|
|
228
236
|
export declare type BoxEdgeTreatments = Readonly<Partial<Record<BoxEdgeSelection, EdgeTreatment>>>;
|
|
229
237
|
|
|
230
|
-
/**
|
|
238
|
+
/**
|
|
239
|
+
* Dimensions, placement, and uniform or independently selected finishing for an axis-aligned box.
|
|
240
|
+
*/
|
|
231
241
|
export declare interface BoxOptions extends PrimitivePlacement {
|
|
232
242
|
/** Explicit sampling ceilings for edge treatments, bounded by the host policy. */
|
|
233
243
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
@@ -280,7 +290,9 @@ export declare interface ArcCurve3 {
|
|
|
280
290
|
readonly pressureFlankSide?: ButtressPressureFlankSide;
|
|
281
291
|
}
|
|
282
292
|
|
|
283
|
-
/**
|
|
293
|
+
/**
|
|
294
|
+
* A planar edge or corner chamfer with equal or independent surface setbacks.
|
|
295
|
+
*/
|
|
284
296
|
export declare interface ChamferedEdgeTreatment {
|
|
285
297
|
/** Selects a straight bevel between adjoining surfaces. */
|
|
286
298
|
readonly kind: "chamfer";
|
|
@@ -288,10 +300,19 @@ export declare interface ArcCurve3 {
|
|
|
288
300
|
readonly distance: number | readonly [first: number, second: number];
|
|
289
301
|
}
|
|
290
302
|
|
|
291
|
-
/**
|
|
303
|
+
/**
|
|
304
|
+
* Creates an immutable centered CCW circle with +X seam and vertex or face radial sizing.
|
|
305
|
+
*
|
|
306
|
+
* @example Explicit circular point data
|
|
307
|
+
* ```ts
|
|
308
|
+
* circleLoop({ diameter: 20, segments: 32 });
|
|
309
|
+
* ```
|
|
310
|
+
*/
|
|
292
311
|
export declare const circleLoop: (options: CircleLoopOptions) => Loop2;
|
|
293
312
|
|
|
294
|
-
/**
|
|
313
|
+
/**
|
|
314
|
+
* Circular profile dimensions with exactly one radius or diameter and explicit sampling.
|
|
315
|
+
*/
|
|
295
316
|
export declare type CircleLoopOptions = CircularPrimitiveOptions & RadialSizingOptions & ({
|
|
296
317
|
/** Positive nominal radius in millimetres; mutually exclusive with diameter. */
|
|
297
318
|
readonly radius: number;
|
|
@@ -304,7 +325,9 @@ export declare interface ArcCurve3 {
|
|
|
304
325
|
readonly radius?: never;
|
|
305
326
|
});
|
|
306
327
|
|
|
307
|
-
/**
|
|
328
|
+
/**
|
|
329
|
+
* Tessellation controls shared by circular primitives across Geometry entry points.
|
|
330
|
+
*/
|
|
308
331
|
export declare interface CircularPrimitiveOptions {
|
|
309
332
|
/** Explicit sampling ceilings; bound modeling operations may only lower the host policy. */
|
|
310
333
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
@@ -402,6 +425,17 @@ export declare interface ArcCurve3 {
|
|
|
402
425
|
*/
|
|
403
426
|
export declare const computeParallelTransportFrames: (path: readonly Vec3[], initialNormal?: Vec3, normalGuide?: PathNormalGuide, limits?: Partial<GeometrySamplingLimits>) => readonly PathFrame[];
|
|
404
427
|
|
|
428
|
+
/**
|
|
429
|
+
* Computes the uniform-density volume centroid of an oriented closed solid, including cavity shells.
|
|
430
|
+
* Coordinates are millimetres. Indexed closure and positive aggregate volume are required; callers
|
|
431
|
+
* may use validateSolidMesh first when geometric intersections and shell orientation are untrusted.
|
|
432
|
+
* Fresh mutable input is inspected on every call, and buffers are never changed.
|
|
433
|
+
*
|
|
434
|
+
* @param mesh - Consistently oriented closed mesh with positive enclosed volume.
|
|
435
|
+
* @returns A fresh immutable XYZ volume centroid.
|
|
436
|
+
*/
|
|
437
|
+
export declare function computeTriangleMeshCentroid(mesh: TriangleMesh): Vec3;
|
|
438
|
+
|
|
405
439
|
/** One sampled component retaining contour identities and logical point correspondence. */
|
|
406
440
|
export declare interface CorrespondingComponent {
|
|
407
441
|
/** Stable canonical lowercase identity; unique within the containing topology or output. */
|
|
@@ -455,6 +489,11 @@ export declare interface ArcCurve3 {
|
|
|
455
489
|
* The open path spans one pitch. Radial zero is the major envelope; negative
|
|
456
490
|
* values point toward the shaft. Custom paths must be finite, axially
|
|
457
491
|
* non-decreasing, periodic at their endpoints, and reach radial zero.
|
|
492
|
+
*
|
|
493
|
+
* @example Printable triangular thread profile
|
|
494
|
+
* ```ts
|
|
495
|
+
* createThreadProfile({ kind: "triangular", pitch: 1.75 });
|
|
496
|
+
* ```
|
|
458
497
|
*/
|
|
459
498
|
export declare function createThreadProfile(spec: ThreadProfileSpec): ThreadProfile;
|
|
460
499
|
|
|
@@ -472,7 +511,13 @@ export declare interface ArcCurve3 {
|
|
|
472
511
|
*/
|
|
473
512
|
export declare function createTriangleMeshSignature(mesh: TriangleMesh, options?: TriangleMeshSignatureOptions): TriangleMeshSignature;
|
|
474
513
|
|
|
475
|
-
/**
|
|
514
|
+
/**
|
|
515
|
+
* Returns the right-handed cross product.
|
|
516
|
+
* @example
|
|
517
|
+
* ```ts
|
|
518
|
+
* cross3([1, 0, 0], [0, 1, 0]); // [0, 0, 1]
|
|
519
|
+
* ```
|
|
520
|
+
*/
|
|
476
521
|
export declare const cross3: (a: Vec3, b: Vec3) => Vec3;
|
|
477
522
|
|
|
478
523
|
/** Planar cubic Bézier with explicit endpoint and control coordinates. */
|
|
@@ -489,7 +534,9 @@ export declare interface ArcCurve3 {
|
|
|
489
534
|
readonly end: Vec2;
|
|
490
535
|
}
|
|
491
536
|
|
|
492
|
-
/**
|
|
537
|
+
/**
|
|
538
|
+
* Spatial cubic Bézier with explicit endpoint and control coordinates.
|
|
539
|
+
*/
|
|
493
540
|
export declare interface CubicBezierCurve3 {
|
|
494
541
|
/** Selects a cubic Bézier through two endpoints and two controls. */
|
|
495
542
|
readonly kind: "cubic";
|
|
@@ -509,10 +556,14 @@ export declare interface ArcCurve3 {
|
|
|
509
556
|
/** Reusable planar curve definition. */
|
|
510
557
|
export declare type Curve2 = LineCurve2 | ArcCurve2 | CubicBezierCurve2;
|
|
511
558
|
|
|
512
|
-
/**
|
|
559
|
+
/**
|
|
560
|
+
* Reusable spatial curve definition.
|
|
561
|
+
*/
|
|
513
562
|
export declare type Curve3 = LineCurve3 | ArcCurve3 | CubicBezierCurve3;
|
|
514
563
|
|
|
515
|
-
/**
|
|
564
|
+
/**
|
|
565
|
+
* Explicit physical sampling and allocation policy for reusable curves.
|
|
566
|
+
*/
|
|
516
567
|
export declare interface CurveSamplingOptions {
|
|
517
568
|
/** Exact segment count overrides physical criteria; curve parameters are spaced uniformly. */
|
|
518
569
|
readonly segments?: number;
|
|
@@ -560,7 +611,9 @@ export declare interface ArcCurve3 {
|
|
|
560
611
|
readonly origin?: Vec3;
|
|
561
612
|
}
|
|
562
613
|
|
|
563
|
-
/**
|
|
614
|
+
/**
|
|
615
|
+
* Dimensions, placement, independent end finishing, and tessellation for a Z-axis cylinder or frustum.
|
|
616
|
+
*/
|
|
564
617
|
export declare type CylinderOptions = CircularPrimitiveOptions & RadialSizingOptions & PrimitivePlacement & {
|
|
565
618
|
/**
|
|
566
619
|
* Centers the solid on the Z origin when `true`; otherwise its bottom is at `Z = 0`.
|
|
@@ -583,7 +636,9 @@ export declare interface ArcCurve3 {
|
|
|
583
636
|
readonly radius?: never;
|
|
584
637
|
});
|
|
585
638
|
|
|
586
|
-
/**
|
|
639
|
+
/**
|
|
640
|
+
* Resolved transverse pitch-plane dimensions for one cylindrical gear.
|
|
641
|
+
*/
|
|
587
642
|
export declare interface CylindricalGearDimensions {
|
|
588
643
|
/** Addendum above the pitch circle, in millimetres. */
|
|
589
644
|
readonly addendum: number;
|
|
@@ -621,7 +676,9 @@ export declare interface ArcCurve3 {
|
|
|
621
676
|
readonly virtualToothCount: number;
|
|
622
677
|
}
|
|
623
678
|
|
|
624
|
-
/**
|
|
679
|
+
/**
|
|
680
|
+
* Whether two cylindrical gears mesh on their outside teeth or as a pinion inside a ring.
|
|
681
|
+
*/
|
|
625
682
|
export declare type CylindricalGearMeshKind = "external" | "internal";
|
|
626
683
|
|
|
627
684
|
/** Sampling controls for a complete non-duplicated gear outline. */
|
|
@@ -638,7 +695,9 @@ export declare interface ArcCurve3 {
|
|
|
638
695
|
readonly tipArcSamples?: number;
|
|
639
696
|
}
|
|
640
697
|
|
|
641
|
-
/**
|
|
698
|
+
/**
|
|
699
|
+
* Pitch solution for a coordinated cylindrical gear pair.
|
|
700
|
+
*/
|
|
642
701
|
export declare interface CylindricalGearPairDimensions {
|
|
643
702
|
/** Nominal distance between the two +Z gear axes, in millimetres. */
|
|
644
703
|
readonly centerDistance: number;
|
|
@@ -672,7 +731,9 @@ export declare interface ArcCurve3 {
|
|
|
672
731
|
readonly samples: number;
|
|
673
732
|
}
|
|
674
733
|
|
|
675
|
-
/**
|
|
734
|
+
/**
|
|
735
|
+
* Inputs for resolving a coordinated cylindrical gear pair.
|
|
736
|
+
*/
|
|
676
737
|
export declare interface CylindricalGearPairSpec {
|
|
677
738
|
/** Driving gear or pinion. */
|
|
678
739
|
readonly driver: CylindricalGearSpec;
|
|
@@ -728,16 +789,33 @@ export declare interface ArcCurve3 {
|
|
|
728
789
|
*/
|
|
729
790
|
export declare const distributeAlongPath: (path: readonly Vec3[], count: number, closed: boolean, limits?: Partial<GeometrySamplingLimits>) => readonly PathPlacement[];
|
|
730
791
|
|
|
731
|
-
/**
|
|
792
|
+
/**
|
|
793
|
+
* Returns the scalar dot product.
|
|
794
|
+
* @example
|
|
795
|
+
* ```ts
|
|
796
|
+
* dot3([1, 0, 0], [0, 1, 0]); // 0
|
|
797
|
+
* ```
|
|
798
|
+
*/
|
|
732
799
|
export declare const dot3: (a: Vec3, b: Vec3) => number;
|
|
733
800
|
|
|
734
|
-
/**
|
|
801
|
+
/**
|
|
802
|
+
* Uniform finishing vocabulary shared by applicable solid edges and profile corners.
|
|
803
|
+
*/
|
|
735
804
|
export declare type EdgeTreatment = ChamferedEdgeTreatment | RoundedEdgeTreatment | SmoothEdgeTreatment | ProfiledEdgeTreatment;
|
|
736
805
|
|
|
737
|
-
/**
|
|
806
|
+
/**
|
|
807
|
+
* Creates an immutable centered CCW ellipse with +X seam within the selected sampling ceiling.
|
|
808
|
+
*
|
|
809
|
+
* @example Ellipse by full dimensions
|
|
810
|
+
* ```ts
|
|
811
|
+
* ellipseLoop({ size: [30, 20] });
|
|
812
|
+
* ```
|
|
813
|
+
*/
|
|
738
814
|
export declare function ellipseLoop(options: EllipseLoopOptions): Loop2;
|
|
739
815
|
|
|
740
|
-
/**
|
|
816
|
+
/**
|
|
817
|
+
* Ellipse dimensions with exactly one XY radii or full-size tuple and explicit sampling.
|
|
818
|
+
*/
|
|
741
819
|
export declare type EllipseLoopOptions = CircularPrimitiveOptions & ({
|
|
742
820
|
/** Positive XY radii in millimetres; mutually exclusive with size. */
|
|
743
821
|
readonly radius: Vec2;
|
|
@@ -750,7 +828,9 @@ export declare interface ArcCurve3 {
|
|
|
750
828
|
readonly radius?: never;
|
|
751
829
|
});
|
|
752
830
|
|
|
753
|
-
/**
|
|
831
|
+
/**
|
|
832
|
+
* Independent inward finishing on primitive or straight convex extrusion ends.
|
|
833
|
+
*/
|
|
754
834
|
export declare interface EndTreatments {
|
|
755
835
|
/** Bottom cap and adjoining side; omitted leaves the end untreated. */
|
|
756
836
|
readonly bottom?: EdgeTreatment;
|
|
@@ -770,10 +850,20 @@ export declare interface ArcCurve3 {
|
|
|
770
850
|
*/
|
|
771
851
|
export declare function eulerTransform3(rotationDegrees: Vec3): Transform3;
|
|
772
852
|
|
|
773
|
-
/**
|
|
853
|
+
/**
|
|
854
|
+
* Linearly extrudes one simple profile along +Z with robust ear-clipped caps.
|
|
855
|
+
*
|
|
856
|
+
* @example Extrude point data without an engine
|
|
857
|
+
* ```ts
|
|
858
|
+
* const outline = rectangleLoop({ size: [30, 20], treatment: { kind: "round", radius: 3 } });
|
|
859
|
+
* extrudeMesh(outline, { height: 8 });
|
|
860
|
+
* ```
|
|
861
|
+
*/
|
|
774
862
|
export declare function extrudeMesh(profile: Loop2, options: ExtrudeOptions): TriangleMesh;
|
|
775
863
|
|
|
776
|
-
/**
|
|
864
|
+
/**
|
|
865
|
+
* Dimensions and sampling shared by native and pure +Z extrusion.
|
|
866
|
+
*/
|
|
777
867
|
export declare interface ExtrudeOptions extends ExtrusionSamplingOptions {
|
|
778
868
|
/** Positive extrusion height in millimetres. */
|
|
779
869
|
readonly height: number;
|
|
@@ -859,7 +949,9 @@ export declare interface ArcCurve3 {
|
|
|
859
949
|
readonly operation: string;
|
|
860
950
|
}
|
|
861
951
|
|
|
862
|
-
/**
|
|
952
|
+
/**
|
|
953
|
+
* Tessellation policy for sampled geometry measured in millimetres.
|
|
954
|
+
*/
|
|
863
955
|
export declare interface GeometryResolution {
|
|
864
956
|
/** Optional exact full-circle segment count, of at least three, bounded by the selected circular ceiling. */
|
|
865
957
|
readonly circularSegments?: number;
|
|
@@ -902,32 +994,76 @@ export declare interface ArcCurve3 {
|
|
|
902
994
|
export declare function getMetricFastenerStandard(size: MetricFastenerSize): MetricFastenerStandard;
|
|
903
995
|
|
|
904
996
|
/**
|
|
905
|
-
* Builds a closed indexed
|
|
906
|
-
* Heights
|
|
907
|
-
*
|
|
997
|
+
* Builds a closed indexed mesh from a rectilinear top, matched boundary walls, and flat base.
|
|
998
|
+
* Heights run once per grid point after preflight; center-error adds one evaluation per cell.
|
|
999
|
+
* Top winding is +Z, the base is -Z, and sides face outward. Coordinates and heights must fit
|
|
1000
|
+
* Float32 storage. Explicit axes are captured before sampling; shared wall vertices prevent cracks.
|
|
1001
|
+
*
|
|
1002
|
+
* @example Sample a closed wavy mesh
|
|
1003
|
+
* ```ts
|
|
1004
|
+
* heightfieldMesh({
|
|
1005
|
+
* size: [30, 20], segments: [24, 16],
|
|
1006
|
+
* height: ([x, y]) => 3 + Math.cos(x / 5) * Math.cos(y / 5),
|
|
1007
|
+
* });
|
|
1008
|
+
* ```
|
|
908
1009
|
*/
|
|
909
1010
|
export declare function heightfieldMesh(options: HeightfieldOptions, limits?: HeightfieldMeshLimits): TriangleMesh;
|
|
910
1011
|
|
|
911
1012
|
/** Trusted output ceilings for pure construction; omitted fields use engine defaults. */
|
|
912
1013
|
export declare type HeightfieldMeshLimits = Partial<Pick<ModelingLimits, "maxVertices" | "maxTriangles" | "maxBytes">>;
|
|
913
1014
|
|
|
914
|
-
/**
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
1015
|
+
/**
|
|
1016
|
+
* A closed rectilinear heightfield above a flat base, with uniform or explicit XY samples in millimetres.
|
|
1017
|
+
*
|
|
1018
|
+
* Uniform sampling requires positive `size: [width, depth]` and positive integer `segments: [x, y]`.
|
|
1019
|
+
* Optional `origin` sets the lower-left XY corner; omitting it centres the footprint on XY.
|
|
1020
|
+
* Alternatively, supply `coordinates: { x, y }` with at least two strictly increasing finite
|
|
1021
|
+
* absolute samples per axis, distinct in Float32. This infers the footprint and interval counts;
|
|
1022
|
+
* `size`, `segments`, and `origin` cannot be combined with explicit coordinates.
|
|
1023
|
+
*/
|
|
1024
|
+
export declare type HeightfieldOptions = {
|
|
920
1025
|
/** Absolute top Z at the supplied XY point. Every sample must be above baseZ. */
|
|
921
1026
|
readonly height: (point: Vec2) => number;
|
|
922
1027
|
/** Flat bottom Z. Defaults to zero. */
|
|
923
1028
|
readonly baseZ?: number;
|
|
1029
|
+
/**
|
|
1030
|
+
* Top-cell diagonal policy. Defaults to fixed (lower-left to upper-right).
|
|
1031
|
+
* min-edge selects the shorter 3D diagonal; center-error selects the diagonal whose endpoint
|
|
1032
|
+
* average is closest to one extra height sample at the physical cell centre. Ties use fixed.
|
|
1033
|
+
* All policies retain two triangles per cell; neither estimates error elsewhere in the cell.
|
|
1034
|
+
*/
|
|
1035
|
+
readonly triangulation?: "fixed" | "min-edge" | "center-error";
|
|
1036
|
+
} & ({
|
|
1037
|
+
/** Positive XY footprint for uniform sampling. */
|
|
1038
|
+
readonly size: Vec2;
|
|
1039
|
+
/** Exact positive integer X/Y interval counts. */
|
|
1040
|
+
readonly segments: readonly [x: number, y: number];
|
|
924
1041
|
/** Lower-left footprint XY. Omitted centers the footprint on XY. */
|
|
925
1042
|
readonly origin?: Vec2;
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
1043
|
+
/** Explicit coordinates cannot be combined with uniform sampling. */
|
|
1044
|
+
readonly coordinates?: never;
|
|
1045
|
+
} | {
|
|
1046
|
+
/**
|
|
1047
|
+
* Absolute XY coordinates, each with at least two strictly increasing finite values that
|
|
1048
|
+
* remain distinct in Float32. Uneven spacing permits caller-owned local refinement.
|
|
1049
|
+
*/
|
|
1050
|
+
readonly coordinates: {
|
|
1051
|
+
/** Absolute X samples in ascending order. */
|
|
1052
|
+
readonly x: readonly number[];
|
|
1053
|
+
/** Absolute Y samples in ascending order. */
|
|
1054
|
+
readonly y: readonly number[];
|
|
1055
|
+
};
|
|
1056
|
+
/** The footprint is inferred from explicit coordinates. */
|
|
1057
|
+
readonly size?: never;
|
|
1058
|
+
/** Interval counts are inferred from explicit coordinates. */
|
|
1059
|
+
readonly segments?: never;
|
|
1060
|
+
/** Explicit coordinates already include their origin. */
|
|
1061
|
+
readonly origin?: never;
|
|
1062
|
+
});
|
|
1063
|
+
|
|
1064
|
+
/** Predictable rectilinear-grid allocation facts; this does not evaluate the height callback. */
|
|
929
1065
|
export declare interface HeightfieldPreflight {
|
|
930
|
-
/** Number of grid points
|
|
1066
|
+
/** Number of top grid points; center-error also evaluates one height per cell. */
|
|
931
1067
|
readonly sampleCount: number;
|
|
932
1068
|
/** Number of allocated XYZ vertices. */
|
|
933
1069
|
readonly vertexCount: number;
|
|
@@ -1068,6 +1204,13 @@ export declare interface ArcCurve3 {
|
|
|
1068
1204
|
* Both ends use ear-clipped caps, supporting concave profiles without center fans.
|
|
1069
1205
|
* Intermediate slices interpolate placed world vertices, never frame axes.
|
|
1070
1206
|
* Transformed coordinates must fit finite Float32 mesh storage.
|
|
1207
|
+
*
|
|
1208
|
+
* @example Loft with explicit point correspondence
|
|
1209
|
+
* ```ts
|
|
1210
|
+
* const bottom = rectangleLoop({ size: [20, 12] });
|
|
1211
|
+
* const top = rectangleLoop({ size: [30, 20], treatment: { kind: "round", radius: 3 } });
|
|
1212
|
+
* loftMesh([{ profile: bottom, z: 0 }, { profile: top, z: 30 }], { correspondence: "reindex" });
|
|
1213
|
+
* ```
|
|
1071
1214
|
*/
|
|
1072
1215
|
export declare function loftMesh(stations: readonly LoftMeshStation[], options: LoftOptions): TriangleMesh;
|
|
1073
1216
|
|
|
@@ -1077,7 +1220,9 @@ export declare interface ArcCurve3 {
|
|
|
1077
1220
|
readonly profile: Loop2;
|
|
1078
1221
|
};
|
|
1079
1222
|
|
|
1080
|
-
/**
|
|
1223
|
+
/**
|
|
1224
|
+
* Shared controls for native and pure lofts. Point data and arbitrary Sections require explicit correspondence.
|
|
1225
|
+
*/
|
|
1081
1226
|
export declare interface LoftOptions {
|
|
1082
1227
|
/** One method or one per consecutive station gap. Omitted preserves known landmarks, including circle/ellipse-to-rectangle corners, or maps other unlike primitive seams directly. */
|
|
1083
1228
|
readonly correspondence?: LoftCorrespondence | readonly LoftCorrespondence[];
|
|
@@ -1093,7 +1238,9 @@ export declare interface ArcCurve3 {
|
|
|
1093
1238
|
readonly limits?: Partial<ModelingLimits>;
|
|
1094
1239
|
}
|
|
1095
1240
|
|
|
1096
|
-
/**
|
|
1241
|
+
/**
|
|
1242
|
+
* A horizontal XY station height, or an explicit right-handed spatial frame, never both.
|
|
1243
|
+
*/
|
|
1097
1244
|
export declare type LoftPlacement = {
|
|
1098
1245
|
/** Horizontal XY station height in millimetres. */
|
|
1099
1246
|
readonly z: number;
|
|
@@ -1123,6 +1270,14 @@ export declare interface ArcCurve3 {
|
|
|
1123
1270
|
* Cubics share a checked uniform parameter grid, including grids selected by exact paired requests.
|
|
1124
1271
|
* Input order and winding are preserved. Collapsed spans retain repeated logical slots, which
|
|
1125
1272
|
* the engine maps to shared physical vertices while omitting degenerate faces.
|
|
1273
|
+
*
|
|
1274
|
+
* @example Match named rectangle landmarks
|
|
1275
|
+
* ```ts
|
|
1276
|
+
* matchProfiles([
|
|
1277
|
+
* rectangleProfile({ size: [20, 12] }),
|
|
1278
|
+
* rectangleProfile({ size: [30, 20], treatment: { kind: "round", radius: 3 } }),
|
|
1279
|
+
* ]);
|
|
1280
|
+
* ```
|
|
1126
1281
|
*/
|
|
1127
1282
|
export declare function matchProfiles(profiles: readonly Profile[], options?: MatchProfilesOptions): readonly CorrespondingProfile[];
|
|
1128
1283
|
|
|
@@ -1156,7 +1311,9 @@ export declare interface ArcCurve3 {
|
|
|
1156
1311
|
*/
|
|
1157
1312
|
export declare function measureTriangleMesh(mesh: TriangleMesh, options?: TriangleMeshValidationOptions): TriangleMeshMeasurements;
|
|
1158
1313
|
|
|
1159
|
-
/**
|
|
1314
|
+
/**
|
|
1315
|
+
* Axis-aligned bounds of a non-empty triangle mesh.
|
|
1316
|
+
*/
|
|
1160
1317
|
export declare interface MeshBounds {
|
|
1161
1318
|
/** Inclusive minimum XYZ coordinates. */
|
|
1162
1319
|
readonly min: Vec3;
|
|
@@ -1336,7 +1493,9 @@ export declare interface ArcCurve3 {
|
|
|
1336
1493
|
/** An ordered, open sequence of two-dimensional points. */
|
|
1337
1494
|
export declare type Path2 = readonly Vec2[];
|
|
1338
1495
|
|
|
1339
|
-
/**
|
|
1496
|
+
/**
|
|
1497
|
+
* An ordered, open sequence of three-dimensional points.
|
|
1498
|
+
*/
|
|
1340
1499
|
export declare type Path3 = readonly Vec3[];
|
|
1341
1500
|
|
|
1342
1501
|
/** Orthonormal right-handed frame sampled along a path. */
|
|
@@ -1349,7 +1508,9 @@ export declare interface ArcCurve3 {
|
|
|
1349
1508
|
readonly binormal: Vec3;
|
|
1350
1509
|
}
|
|
1351
1510
|
|
|
1352
|
-
/**
|
|
1511
|
+
/**
|
|
1512
|
+
* Returns total sampled 3D path length, or zero for an empty path.
|
|
1513
|
+
*/
|
|
1353
1514
|
export declare const pathLength: (path: readonly Vec3[], limits?: Partial<GeometrySamplingLimits>) => number;
|
|
1354
1515
|
|
|
1355
1516
|
/**
|
|
@@ -1467,7 +1628,9 @@ export declare interface ArcCurve3 {
|
|
|
1467
1628
|
readonly outer: Loop2;
|
|
1468
1629
|
}
|
|
1469
1630
|
|
|
1470
|
-
/**
|
|
1631
|
+
/**
|
|
1632
|
+
* Equal arc-length sampling of an open path or an implicitly closed loop.
|
|
1633
|
+
*/
|
|
1471
1634
|
export declare interface PolylineResamplingOptions extends CurveSamplingOptions {
|
|
1472
1635
|
/** Exact equal arc-length intervals; closed paths require at least three. */
|
|
1473
1636
|
readonly segments?: number;
|
|
@@ -1475,7 +1638,7 @@ export declare interface ArcCurve3 {
|
|
|
1475
1638
|
readonly closed?: boolean;
|
|
1476
1639
|
}
|
|
1477
1640
|
|
|
1478
|
-
/** Checks
|
|
1641
|
+
/** Checks grid dimensions, coordinate precision, and allocation bounds before evaluating heights. */
|
|
1479
1642
|
export declare function preflightHeightfield(options: HeightfieldOptions, limits?: HeightfieldMeshLimits): HeightfieldPreflight;
|
|
1480
1643
|
|
|
1481
1644
|
/**
|
|
@@ -1542,7 +1705,9 @@ export declare interface ArcCurve3 {
|
|
|
1542
1705
|
loose: PrintableThreadFitPolicy;
|
|
1543
1706
|
}>;
|
|
1544
1707
|
|
|
1545
|
-
/**
|
|
1708
|
+
/**
|
|
1709
|
+
* Named baseline fit policies for calibrated FDM-style printed threads.
|
|
1710
|
+
*/
|
|
1546
1711
|
export declare type PrintableThreadFit = "tight" | "normal" | "loose";
|
|
1547
1712
|
|
|
1548
1713
|
/**
|
|
@@ -1677,10 +1842,14 @@ export declare interface ArcCurve3 {
|
|
|
1677
1842
|
readonly toothCount: number;
|
|
1678
1843
|
}
|
|
1679
1844
|
|
|
1680
|
-
/**
|
|
1845
|
+
/**
|
|
1846
|
+
* Radial dimensions refer to polygon vertices or compensate faceting to meet polygon faces.
|
|
1847
|
+
*/
|
|
1681
1848
|
export declare type RadialSizing = "vertex" | "face";
|
|
1682
1849
|
|
|
1683
|
-
/**
|
|
1850
|
+
/**
|
|
1851
|
+
* Nominal radial sizing shared by circular and regular polygon construction.
|
|
1852
|
+
*/
|
|
1684
1853
|
export declare interface RadialSizingOptions {
|
|
1685
1854
|
/** Explicit sampling ceilings; bound modeling operations may only lower the host policy. */
|
|
1686
1855
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
@@ -1702,10 +1871,19 @@ export declare interface ArcCurve3 {
|
|
|
1702
1871
|
bottomRight: RectangleCornerTreatment
|
|
1703
1872
|
];
|
|
1704
1873
|
|
|
1705
|
-
/**
|
|
1874
|
+
/**
|
|
1875
|
+
* Creates an immutable CCW rectangle loop. Round radius zero is square; tangent saturated endpoints occur once.
|
|
1876
|
+
*
|
|
1877
|
+
* @example Rounded rectangle outline
|
|
1878
|
+
* ```ts
|
|
1879
|
+
* rectangleLoop({ size: [30, 20], treatment: { kind: "round", radius: 3 } });
|
|
1880
|
+
* ```
|
|
1881
|
+
*/
|
|
1706
1882
|
export declare function rectangleLoop(options: RectangleLoopOptions): Loop2;
|
|
1707
1883
|
|
|
1708
|
-
/**
|
|
1884
|
+
/**
|
|
1885
|
+
* Shared rectangle dimensions, origin and uniform or per-corner treatment.
|
|
1886
|
+
*/
|
|
1709
1887
|
export declare interface RectangleLoopOptions {
|
|
1710
1888
|
/** Positive uniform size or explicit XY extents in millimetres. */
|
|
1711
1889
|
readonly size: number | Vec2;
|
|
@@ -1717,7 +1895,14 @@ export declare interface ArcCurve3 {
|
|
|
1717
1895
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
1718
1896
|
}
|
|
1719
1897
|
|
|
1720
|
-
/**
|
|
1898
|
+
/**
|
|
1899
|
+
* Creates an identified rectangle whose edge/corner spans survive zero and saturated round radii. Outer winding is CCW.
|
|
1900
|
+
*
|
|
1901
|
+
* @example Retain rectangle landmarks
|
|
1902
|
+
* ```ts
|
|
1903
|
+
* rectangleProfile({ size: [30, 20], treatment: { kind: "round", radius: 3 } });
|
|
1904
|
+
* ```
|
|
1905
|
+
*/
|
|
1721
1906
|
export declare function rectangleProfile(options: RectangleProfileOptions): Profile;
|
|
1722
1907
|
|
|
1723
1908
|
/** Shared rectangle options with an identified component for explicit profile families. */
|
|
@@ -1744,7 +1929,14 @@ export declare interface ArcCurve3 {
|
|
|
1744
1929
|
/** Returns finite axis-aligned bounds for a non-empty region. */
|
|
1745
1930
|
export declare function regionBounds(region: Region2): Bounds2;
|
|
1746
1931
|
|
|
1747
|
-
/**
|
|
1932
|
+
/**
|
|
1933
|
+
* Creates a centered CCW point loop with vertex or face radial sizing and an implicit seam.
|
|
1934
|
+
*
|
|
1935
|
+
* @example Hexagon sized to its faces
|
|
1936
|
+
* ```ts
|
|
1937
|
+
* regularPolygonLoop({ radius: 10, sides: 6, sizing: "face" });
|
|
1938
|
+
* ```
|
|
1939
|
+
*/
|
|
1748
1940
|
export declare const regularPolygonLoop: (options: RegularPolygonLoopOptions) => readonly Vec2[];
|
|
1749
1941
|
|
|
1750
1942
|
/** Exact regular polygon dimensions and counterclockwise degree rotation. */
|
|
@@ -1766,7 +1958,8 @@ export declare interface ArcCurve3 {
|
|
|
1766
1958
|
*/
|
|
1767
1959
|
export declare function resamplePolyline2(path: readonly Vec2[], options?: PolylineResamplingOptions): SampledCurve2;
|
|
1768
1960
|
|
|
1769
|
-
/**
|
|
1961
|
+
/**
|
|
1962
|
+
* Resamples a spatial polyline at equal arc lengths with directed outgoing tangents.
|
|
1770
1963
|
* @remarks Open paths retain both endpoints; closed paths include the closing edge and omit the
|
|
1771
1964
|
* repeated seam. Repeated adjacent inputs and explicit closing duplicates are removed. Physical
|
|
1772
1965
|
* maxSegmentLength bounds arc-length intervals; exact counts override that policy. Output edges
|
|
@@ -1944,10 +2137,18 @@ export declare interface ArcCurve3 {
|
|
|
1944
2137
|
* @param profile - Closed CCW `[radius, z]` profile without a duplicated seam point.
|
|
1945
2138
|
* @param options - Optional physical or exact circumferential sampling controls. Defaults to `{}`.
|
|
1946
2139
|
* @returns A closed indexed triangle mesh revolved counter-clockwise around +Z.
|
|
2140
|
+
*
|
|
2141
|
+
* @example Partial revolution with end caps
|
|
2142
|
+
* ```ts
|
|
2143
|
+
* // Each point is [radius, Z]; the profile seam is implicit.
|
|
2144
|
+
* revolveMesh([[0, 0], [12, 0], [8, 20], [0, 20]], { revolveDegrees: 270 });
|
|
2145
|
+
* ```
|
|
1947
2146
|
*/
|
|
1948
2147
|
export declare const revolveMesh: (profile: readonly Vec2[], options?: RevolveOptions) => TriangleMesh;
|
|
1949
2148
|
|
|
1950
|
-
/**
|
|
2149
|
+
/**
|
|
2150
|
+
* Circumferential sampling and degree sweep shared by pure and filled revolution.
|
|
2151
|
+
*/
|
|
1951
2152
|
export declare interface RevolveOptions extends CircularPrimitiveOptions {
|
|
1952
2153
|
/**
|
|
1953
2154
|
* Positive angular sweep no greater than 360 degrees; partial revolutions have end caps.
|
|
@@ -1984,7 +2185,9 @@ export declare interface ArcCurve3 {
|
|
|
1984
2185
|
*/
|
|
1985
2186
|
export declare const roundClosedPolylinePath: (points: readonly Vec3[], radius: number, segmentsPerCorner: number, limits?: Partial<GeometrySamplingLimits>) => readonly Vec3[];
|
|
1986
2187
|
|
|
1987
|
-
/**
|
|
2188
|
+
/**
|
|
2189
|
+
* A circular edge or corner roundover with explicit physical sampling.
|
|
2190
|
+
*/
|
|
1988
2191
|
export declare interface RoundedEdgeTreatment extends CircularPrimitiveOptions {
|
|
1989
2192
|
/** Selects circular corners or spherical all-edge roundovers. */
|
|
1990
2193
|
readonly kind: "round";
|
|
@@ -2002,7 +2205,8 @@ export declare interface ArcCurve3 {
|
|
|
2002
2205
|
*/
|
|
2003
2206
|
export declare function sampleCurve2(curve: Curve2, options?: CurveSamplingOptions): SampledCurve2;
|
|
2004
2207
|
|
|
2005
|
-
/**
|
|
2208
|
+
/**
|
|
2209
|
+
* Samples a spatial curve, preserving endpoints and directed unit tangents.
|
|
2006
2210
|
* @remarks Exact counts use uniform curve parameters, not equal physical distances. Adaptive cubics
|
|
2007
2211
|
* bound the full control hull. Full-circle arcs repeat their endpoint; closed polylines do not.
|
|
2008
2212
|
* @example
|
|
@@ -2029,7 +2233,9 @@ export declare interface ArcCurve3 {
|
|
|
2029
2233
|
readonly tangents: readonly Vec2[];
|
|
2030
2234
|
}
|
|
2031
2235
|
|
|
2032
|
-
/**
|
|
2236
|
+
/**
|
|
2237
|
+
* Immutable spatial points and corresponding directed unit tangents.
|
|
2238
|
+
*/
|
|
2033
2239
|
export declare interface SampledCurve3 {
|
|
2034
2240
|
/** Curves retain both endpoints, including full-circle seams; closed resampling omits its seam. */
|
|
2035
2241
|
readonly points: readonly Vec3[];
|
|
@@ -2149,7 +2355,13 @@ export declare interface ArcCurve3 {
|
|
|
2149
2355
|
*/
|
|
2150
2356
|
export declare function sampleThreadHelices(options: ThreadHelixOptions): SampledThreadHelices;
|
|
2151
2357
|
|
|
2152
|
-
/**
|
|
2358
|
+
/**
|
|
2359
|
+
* Multiplies a vector by a dimensionless scalar.
|
|
2360
|
+
* @example
|
|
2361
|
+
* ```ts
|
|
2362
|
+
* scale3([1, 2, 3], 2); // [2, 4, 6]
|
|
2363
|
+
* ```
|
|
2364
|
+
*/
|
|
2153
2365
|
export declare const scale3: (vector: Vec3, scale: number) => Vec3;
|
|
2154
2366
|
|
|
2155
2367
|
/**
|
|
@@ -2180,7 +2392,17 @@ export declare interface ArcCurve3 {
|
|
|
2180
2392
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2181
2393
|
}
|
|
2182
2394
|
|
|
2183
|
-
/**
|
|
2395
|
+
/** Bounded floating-point intersection and shell-orientation validation settings. */
|
|
2396
|
+
export declare interface SolidMeshValidationOptions {
|
|
2397
|
+
/** Work ceiling for spatial comparisons and containment tests; defaults to 2,000,000 and may only lower it. */
|
|
2398
|
+
readonly maximumTests?: number;
|
|
2399
|
+
/** Distance comparison policy in millimetres; near contacts reject conservatively. */
|
|
2400
|
+
readonly tolerance?: GeometryToleranceOptions;
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
/**
|
|
2404
|
+
* Exactly one radius or diameter, placement, and tessellation for an origin-centered sphere.
|
|
2405
|
+
*/
|
|
2184
2406
|
export declare type SphereOptions = CircularPrimitiveOptions & PrimitivePlacement & ({
|
|
2185
2407
|
/** Positive radius in millimetres; mutually exclusive with diameter. */
|
|
2186
2408
|
readonly radius: number;
|
|
@@ -2204,7 +2426,14 @@ export declare interface ArcCurve3 {
|
|
|
2204
2426
|
readonly depth?: number;
|
|
2205
2427
|
}
|
|
2206
2428
|
|
|
2207
|
-
/**
|
|
2429
|
+
/**
|
|
2430
|
+
* Creates a centered CCW alternating-radius star within the selected profile sampling ceiling.
|
|
2431
|
+
*
|
|
2432
|
+
* @example Five-point outline
|
|
2433
|
+
* ```ts
|
|
2434
|
+
* starLoop(12, 5, 6);
|
|
2435
|
+
* ```
|
|
2436
|
+
*/
|
|
2208
2437
|
export declare const starLoop: (outerRadius: number, points: number, innerRadius?: number, limits?: Partial<GeometrySamplingLimits>) => readonly Vec2[];
|
|
2209
2438
|
|
|
2210
2439
|
/** End-cap treatment for an open stroked path. */
|
|
@@ -2239,7 +2468,13 @@ export declare interface ArcCurve3 {
|
|
|
2239
2468
|
readonly width: number;
|
|
2240
2469
|
}
|
|
2241
2470
|
|
|
2242
|
-
/**
|
|
2471
|
+
/**
|
|
2472
|
+
* Subtracts `b` from `a`.
|
|
2473
|
+
* @example
|
|
2474
|
+
* ```ts
|
|
2475
|
+
* subtract3([4, 5, 6], [1, 2, 3]); // [3, 3, 3]
|
|
2476
|
+
* ```
|
|
2477
|
+
*/
|
|
2243
2478
|
export declare const subtract3: (a: Vec3, b: Vec3) => Vec3;
|
|
2244
2479
|
|
|
2245
2480
|
/** Sampling controls for deterministic SVG-to-region conversion. */
|
|
@@ -2317,10 +2552,22 @@ export declare interface ArcCurve3 {
|
|
|
2317
2552
|
readonly parsedVertices: number;
|
|
2318
2553
|
}
|
|
2319
2554
|
|
|
2320
|
-
/**
|
|
2555
|
+
/**
|
|
2556
|
+
* Sweeps one explicitly ordered point loop, with caps or a geometrically matching closed seam.
|
|
2557
|
+
*
|
|
2558
|
+
* @example Sweep point data along a bent path
|
|
2559
|
+
* ```ts
|
|
2560
|
+
* const profile = rectangleLoop({ size: [6, 3] });
|
|
2561
|
+
* sweepMesh(profile, [[0, 0, 0], [0, 0, 15], [10, 0, 25]], {
|
|
2562
|
+
* orientation: { kind: "transport", initialNormal: [0, 1, 0] },
|
|
2563
|
+
* });
|
|
2564
|
+
* ```
|
|
2565
|
+
*/
|
|
2321
2566
|
export declare function sweepMesh(profile: Loop2, path: readonly Vec3[], options?: SweepOptions): TriangleMesh;
|
|
2322
2567
|
|
|
2323
|
-
/**
|
|
2568
|
+
/**
|
|
2569
|
+
* Controls shared by pure mesh construction and filled modeling sweeps.
|
|
2570
|
+
*/
|
|
2324
2571
|
export declare interface SweepOptions {
|
|
2325
2572
|
/** Join the path's last station to its first. Open paths retain watertight end caps. */
|
|
2326
2573
|
readonly closed?: boolean;
|
|
@@ -2340,7 +2587,9 @@ export declare interface ArcCurve3 {
|
|
|
2340
2587
|
readonly seamProfileOffset?: number;
|
|
2341
2588
|
}
|
|
2342
2589
|
|
|
2343
|
-
/**
|
|
2590
|
+
/**
|
|
2591
|
+
* Explicit profile-X frame policy; all normals are directed, and selected singular policies reject.
|
|
2592
|
+
*/
|
|
2344
2593
|
export declare type SweepOrientation = {
|
|
2345
2594
|
/** Minimizes frame rotation by parallel transport. */
|
|
2346
2595
|
readonly kind: "transport";
|
|
@@ -2413,7 +2662,9 @@ export declare interface ArcCurve3 {
|
|
|
2413
2662
|
/** Nut-edge bevel selection. */
|
|
2414
2663
|
export declare type ThreadedNutBevel = "automatic" | "both" | "inside" | "none" | "outside";
|
|
2415
2664
|
|
|
2416
|
-
/**
|
|
2665
|
+
/**
|
|
2666
|
+
* Options for a compensated nut with an internal thread.
|
|
2667
|
+
*/
|
|
2417
2668
|
export declare interface ThreadedNutOptions extends Omit<InternalThreadCutterOptions, "bevelBottom" | "bevelSize" | "bevelTop" | "length"> {
|
|
2418
2669
|
/** Nut body bevel selection. Default: `automatic`. */
|
|
2419
2670
|
readonly bevel?: ThreadedNutBevel;
|
|
@@ -2449,10 +2700,14 @@ export declare interface ArcCurve3 {
|
|
|
2449
2700
|
readonly threadCircularSegments: number;
|
|
2450
2701
|
}
|
|
2451
2702
|
|
|
2452
|
-
/**
|
|
2703
|
+
/**
|
|
2704
|
+
* Supported printable nut body shapes.
|
|
2705
|
+
*/
|
|
2453
2706
|
export declare type ThreadedNutShape = "hex" | "round" | "square";
|
|
2454
2707
|
|
|
2455
|
-
/**
|
|
2708
|
+
/**
|
|
2709
|
+
* Options for a compensated external threaded rod along +Z.
|
|
2710
|
+
*/
|
|
2456
2711
|
export declare interface ThreadedRodOptions extends Omit<HelicalThreadRidgeMeshOptions, "majorDiameter">, ThreadBevelOptions {
|
|
2457
2712
|
/** Printable fit or caller-calibrated allowances. Default: `normal`. */
|
|
2458
2713
|
readonly fit?: PrintableThreadFit | PrintableThreadFitPolicy;
|
|
@@ -2500,7 +2755,9 @@ export declare interface ArcCurve3 {
|
|
|
2500
2755
|
readonly top?: ThreadEndStyle;
|
|
2501
2756
|
}
|
|
2502
2757
|
|
|
2503
|
-
/**
|
|
2758
|
+
/**
|
|
2759
|
+
* Direction in which a conventional helical thread advances around +Z.
|
|
2760
|
+
*/
|
|
2504
2761
|
export declare type ThreadHandedness = "left" | "right";
|
|
2505
2762
|
|
|
2506
2763
|
/** Conventional helix options: `pitch` is adjacent spacing and lead is `pitch * starts`. */
|
|
@@ -2531,7 +2788,9 @@ export declare interface ArcCurve3 {
|
|
|
2531
2788
|
/** BOSL2-compatible cross-section scaling curve for a blunt thread lead-in. */
|
|
2532
2789
|
export declare type ThreadLeadInShape = "cut" | "linear" | "smooth" | "sqrt";
|
|
2533
2790
|
|
|
2534
|
-
/**
|
|
2791
|
+
/**
|
|
2792
|
+
* A validated immutable periodic thread profile in `[axial, radial]` millimetres.
|
|
2793
|
+
*/
|
|
2535
2794
|
export declare interface ThreadProfile {
|
|
2536
2795
|
/** Axial width of the flat at the major envelope. */
|
|
2537
2796
|
readonly crestFlatWidth: number;
|
|
@@ -2555,13 +2814,17 @@ export declare interface ArcCurve3 {
|
|
|
2555
2814
|
readonly tolerance?: GeometryToleranceOptions;
|
|
2556
2815
|
}
|
|
2557
2816
|
|
|
2558
|
-
/**
|
|
2817
|
+
/**
|
|
2818
|
+
* Supported built-in and caller-defined thread profiles.
|
|
2819
|
+
*/
|
|
2559
2820
|
export declare type ThreadProfileSpec = AcmeThreadProfileSpec | ButtressThreadProfileSpec | CustomThreadProfileSpec | SquareThreadProfileSpec | TrapezoidalThreadProfileSpec | TriangularThreadProfileSpec;
|
|
2560
2821
|
|
|
2561
2822
|
/** Whether compensation is being applied to an external or internal thread. */
|
|
2562
2823
|
export declare type ThreadRole = "male" | "female";
|
|
2563
2824
|
|
|
2564
|
-
/**
|
|
2825
|
+
/**
|
|
2826
|
+
* Dimensions and independent ring/profile tessellation for a torus around the Z axis.
|
|
2827
|
+
*/
|
|
2565
2828
|
export declare interface TorusOptions extends PrimitivePlacement {
|
|
2566
2829
|
/** Explicit sampling ceilings, bounded by the host policy. */
|
|
2567
2830
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
@@ -2664,7 +2927,9 @@ export declare interface ArcCurve3 {
|
|
|
2664
2927
|
readonly threadAngle?: number;
|
|
2665
2928
|
}
|
|
2666
2929
|
|
|
2667
|
-
/**
|
|
2930
|
+
/**
|
|
2931
|
+
* A topology-preserving indexed triangle mesh with XYZ vertex positions.
|
|
2932
|
+
*/
|
|
2668
2933
|
export declare interface TriangleMesh {
|
|
2669
2934
|
/** Three unsigned vertex indices per triangle. */
|
|
2670
2935
|
readonly indices: Uint32Array;
|
|
@@ -2672,7 +2937,9 @@ export declare interface ArcCurve3 {
|
|
|
2672
2937
|
readonly positions: Float32Array;
|
|
2673
2938
|
}
|
|
2674
2939
|
|
|
2675
|
-
/**
|
|
2940
|
+
/**
|
|
2941
|
+
* Measurements and optional edge-connected topology from one validated mesh traversal.
|
|
2942
|
+
*/
|
|
2676
2943
|
export declare interface TriangleMeshAnalysis extends TriangleMeshMeasurements {
|
|
2677
2944
|
/** Number of referenced edge-connected components when `includeTopology` is requested. */
|
|
2678
2945
|
readonly connectedComponentCount?: number;
|
|
@@ -2680,13 +2947,17 @@ export declare interface ArcCurve3 {
|
|
|
2680
2947
|
readonly edgeCount?: number;
|
|
2681
2948
|
}
|
|
2682
2949
|
|
|
2683
|
-
/**
|
|
2950
|
+
/**
|
|
2951
|
+
* Validation and optional connectivity controls for a shared mesh analysis.
|
|
2952
|
+
*/
|
|
2684
2953
|
export declare interface TriangleMeshAnalysisOptions extends TriangleMeshValidationOptions {
|
|
2685
2954
|
/** Compute indexed edge/component counts and reject unreferenced vertices; defaults to false. */
|
|
2686
2955
|
readonly includeTopology?: boolean;
|
|
2687
2956
|
}
|
|
2688
2957
|
|
|
2689
|
-
/**
|
|
2958
|
+
/**
|
|
2959
|
+
* Geometric measurements derived from a validated, non-empty triangle mesh.
|
|
2960
|
+
*/
|
|
2690
2961
|
export declare interface TriangleMeshMeasurements {
|
|
2691
2962
|
/** Axis-aligned bounds. */
|
|
2692
2963
|
readonly bounds: MeshBounds;
|
|
@@ -2790,7 +3061,9 @@ export declare interface ArcCurve3 {
|
|
|
2790
3061
|
readonly tolerance?: GeometryToleranceOptions;
|
|
2791
3062
|
}
|
|
2792
3063
|
|
|
2793
|
-
/**
|
|
3064
|
+
/**
|
|
3065
|
+
* ISO/UTS-like 60-degree truncated triangular profile.
|
|
3066
|
+
*/
|
|
2794
3067
|
export declare interface TriangularThreadProfileSpec extends ThreadProfileBaseSpec {
|
|
2795
3068
|
/** Selects the 60-degree triangular profile family. */
|
|
2796
3069
|
readonly kind: "triangular";
|
|
@@ -2809,7 +3082,9 @@ export declare interface ArcCurve3 {
|
|
|
2809
3082
|
/** Ear-clips one normalized simple CCW loop into stable local vertex indices. */
|
|
2810
3083
|
export declare function triangulateLoop2(loop: Loop2): Uint32Array;
|
|
2811
3084
|
|
|
2812
|
-
/**
|
|
3085
|
+
/**
|
|
3086
|
+
* Dimensions, placement, and tessellation for a hollow Z-axis tube.
|
|
3087
|
+
*/
|
|
2813
3088
|
export declare interface TubeOptions extends CircularPrimitiveOptions, PrimitivePlacement {
|
|
2814
3089
|
/**
|
|
2815
3090
|
* Centers the tube on the Z origin when `true`; otherwise its bottom is at `Z = 0`.
|
|
@@ -2824,6 +3099,22 @@ export declare interface ArcCurve3 {
|
|
|
2824
3099
|
readonly outerRadius: number;
|
|
2825
3100
|
}
|
|
2826
3101
|
|
|
3102
|
+
/**
|
|
3103
|
+
* Checks closed indexed topology, triangle intersections, and alternating nested shell orientation.
|
|
3104
|
+
* Outward exterior shells and inward cavity shells are accepted. Separate shells must not touch,
|
|
3105
|
+
* intersect, or overlap as material. Indexed neighbours may share their own vertex or edge.
|
|
3106
|
+
*
|
|
3107
|
+
* Uses bounded floating-point tests, not exact predicates or repair. Contacts within the selected
|
|
3108
|
+
* tolerance reject conservatively. At most 200,000 triangles and 2,000,000 spatial/containment tests
|
|
3109
|
+
* are supported; exhausting a ceiling throws COMPLEXITY_LIMIT rather than claiming validity.
|
|
3110
|
+
* Input buffers are freshly inspected and never modified; units are millimetres.
|
|
3111
|
+
*
|
|
3112
|
+
* @param mesh - Closed triangle mesh to inspect.
|
|
3113
|
+
* @param options - Optional lower work ceiling and numeric comparison policy.
|
|
3114
|
+
* @returns The original mesh after every requested check succeeds.
|
|
3115
|
+
*/
|
|
3116
|
+
export declare function validateSolidMesh(mesh: TriangleMesh, options?: SolidMeshValidationOptions): TriangleMesh;
|
|
3117
|
+
|
|
2827
3118
|
/**
|
|
2828
3119
|
* Validates that a transform is finite, affine, and non-singular.
|
|
2829
3120
|
*
|
|
@@ -2855,6 +3146,18 @@ export declare interface ArcCurve3 {
|
|
|
2855
3146
|
/** A three-dimensional Cartesian vector or point. */
|
|
2856
3147
|
export declare type Vec3 = readonly [x: number, y: number, z: number];
|
|
2857
3148
|
|
|
3149
|
+
/** A circular baseline centered at the XY origin, with rigid shaped glyph groups. */
|
|
3150
|
+
export declare interface VectorTextArcBaseline {
|
|
3151
|
+
/** Selects a circular baseline; glyph outlines rotate without bending or stretching. */
|
|
3152
|
+
readonly kind: "arc";
|
|
3153
|
+
/** Baseline radius in millimetres, greater than zero and at most 10000. */
|
|
3154
|
+
readonly radius: number;
|
|
3155
|
+
/** Alignment datum in degrees counterclockwise from +X; defaults to 90. */
|
|
3156
|
+
readonly centerAngleDegrees?: number;
|
|
3157
|
+
/** Reading direction around the circle; defaults to clockwise. */
|
|
3158
|
+
readonly direction?: "clockwise" | "counterclockwise";
|
|
3159
|
+
}
|
|
3160
|
+
|
|
2858
3161
|
/** Exact curve bounds in millimetres; positive Y points upward. */
|
|
2859
3162
|
export declare interface VectorTextBounds {
|
|
2860
3163
|
/** Minimum X and Y of visible outlines, including accents, descenders, and overhangs. */
|
|
@@ -2863,7 +3166,9 @@ export declare interface ArcCurve3 {
|
|
|
2863
3166
|
readonly max: readonly [number, number];
|
|
2864
3167
|
}
|
|
2865
3168
|
|
|
2866
|
-
/**
|
|
3169
|
+
/**
|
|
3170
|
+
* Immutable vector layout with no browser, font parser, or kernel ownership.
|
|
3171
|
+
*/
|
|
2867
3172
|
export declare interface VectorTextLayout {
|
|
2868
3173
|
/** Nonzero-filled path data in millimetres, positive Y upward; empty for text with no ink. */
|
|
2869
3174
|
readonly paths: readonly string[];
|
|
@@ -2871,13 +3176,17 @@ export declare interface ArcCurve3 {
|
|
|
2871
3176
|
readonly metrics: VectorTextMetrics;
|
|
2872
3177
|
}
|
|
2873
3178
|
|
|
2874
|
-
/**
|
|
3179
|
+
/**
|
|
3180
|
+
* Text bounded to 512 UTF-16 units: horizontal lines or one circular line without wrapping.
|
|
3181
|
+
*/
|
|
2875
3182
|
export declare interface VectorTextLayoutOptions extends VectorTextOptions {
|
|
2876
|
-
/** Place
|
|
3183
|
+
/** Place the advance's start, midpoint or end at the datum; defaults to center on arcs, otherwise left. */
|
|
2877
3184
|
readonly align?: "left" | "center" | "right";
|
|
3185
|
+
/** Omitted uses horizontal lines. Arcs require one line and baseline vertical alignment. */
|
|
3186
|
+
readonly baseline?: VectorTextArcBaseline;
|
|
2878
3187
|
/** Baseline spacing in ems, 0.5–5; omitted uses the selected face's natural vertical metrics. */
|
|
2879
3188
|
readonly lineHeight?: number;
|
|
2880
|
-
/** Place the first baseline or
|
|
3189
|
+
/** Place the first baseline or complete ink bounds at Y=0; arcs only accept baseline. */
|
|
2881
3190
|
readonly verticalAlign?: "baseline" | "top" | "center" | "bottom";
|
|
2882
3191
|
}
|
|
2883
3192
|
|
|
@@ -2885,9 +3194,9 @@ export declare interface ArcCurve3 {
|
|
|
2885
3194
|
export declare interface VectorTextMetrics {
|
|
2886
3195
|
/** Visible curve bounds after alignment, or null when the text has no ink. */
|
|
2887
3196
|
readonly bounds: VectorTextBounds | null;
|
|
2888
|
-
/** Unaligned
|
|
3197
|
+
/** Unaligned logical advance and negative baseline displacement in mm; arcs retain [arc length, 0]. */
|
|
2889
3198
|
readonly advance: readonly [number, number];
|
|
2890
|
-
/** Maximum line advance in millimetres, including spaces;
|
|
3199
|
+
/** Maximum logical line advance in millimetres, including spaces; arc length on circular baselines. */
|
|
2891
3200
|
readonly logicalWidth: number;
|
|
2892
3201
|
/** Selected font's ascender distance above a baseline in millimetres, independent of the text. */
|
|
2893
3202
|
readonly ascent: number;
|