@metamesh/modeling 0.6.0 → 0.7.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 +6 -0
- package/README.md +82 -20
- package/dist/api/engine.d.ts +21 -4
- package/dist/api/geometry.d.ts +288 -64
- package/dist/api/index.d.ts +533 -94
- package/dist/api/text.d.ts +20 -4
- package/dist/engine/index.js +12 -1
- package/dist/geometry/curves/sampling.js +2 -1
- package/dist/geometry/heightfield.js +8 -0
- package/dist/geometry/loft.js +16 -1
- package/dist/geometry/math/vector3.js +35 -5
- package/dist/geometry/mechanical/thread-profiles.js +5 -0
- package/dist/geometry/mesh-edge-table.js +126 -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-mesh.js +11 -1
- package/dist/model/operations.js +3 -1
- package/dist/text/index.js +11 -1
- package/package.json +1 -1
package/dist/api/index.d.ts
CHANGED
|
@@ -32,7 +32,9 @@ export declare interface Anchor3 {
|
|
|
32
32
|
/** Host-bound attach operation. Valid only during a synchronous build. */
|
|
33
33
|
export declare const attach: ModelingContext["attach"];
|
|
34
34
|
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Degree-based anchor attachment controls for a scoped solid.
|
|
37
|
+
*/
|
|
36
38
|
export declare interface AttachOptions {
|
|
37
39
|
/** Align outward directions face-to-face (`opposed`) or in parallel (`same`). */
|
|
38
40
|
readonly alignment?: "opposed" | "same";
|
|
@@ -56,7 +58,9 @@ export declare type BoxEdgeSelection = BoxEdge | "top" | "bottom" | "vertical";
|
|
|
56
58
|
/** Independent treatments for disjoint named edge selections; overlapping selections fail. */
|
|
57
59
|
export declare type BoxEdgeTreatments = Readonly<Partial<Record<BoxEdgeSelection, EdgeTreatment>>>;
|
|
58
60
|
|
|
59
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Dimensions, placement, and uniform or independently selected finishing for an axis-aligned box.
|
|
63
|
+
*/
|
|
60
64
|
export declare interface BoxOptions extends PrimitivePlacement {
|
|
61
65
|
/** Explicit sampling ceilings for edge treatments, bounded by the host policy. */
|
|
62
66
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
@@ -94,7 +98,9 @@ declare interface ButtressThreadProfileSpec extends ThreadProfileBaseSpec {
|
|
|
94
98
|
readonly pressureFlankSide?: ButtressPressureFlankSide;
|
|
95
99
|
}
|
|
96
100
|
|
|
97
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* A planar edge or corner chamfer with equal or independent surface setbacks.
|
|
103
|
+
*/
|
|
98
104
|
export declare interface ChamferedEdgeTreatment {
|
|
99
105
|
/** Selects a straight bevel between adjoining surfaces. */
|
|
100
106
|
readonly kind: "chamfer";
|
|
@@ -105,7 +111,9 @@ export declare interface ChamferedEdgeTreatment {
|
|
|
105
111
|
/** Host-bound circle operation. Valid only during a synchronous build. */
|
|
106
112
|
export declare const circle: ModelingContext["circle"];
|
|
107
113
|
|
|
108
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* Circular profile dimensions with exactly one radius or diameter and explicit sampling.
|
|
116
|
+
*/
|
|
109
117
|
export declare type CircleLoopOptions = CircularPrimitiveOptions & RadialSizingOptions & ({
|
|
110
118
|
/** Positive nominal radius in millimetres; mutually exclusive with diameter. */
|
|
111
119
|
readonly radius: number;
|
|
@@ -118,10 +126,14 @@ export declare type CircleLoopOptions = CircularPrimitiveOptions & RadialSizingO
|
|
|
118
126
|
readonly radius?: never;
|
|
119
127
|
});
|
|
120
128
|
|
|
121
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* Circular dimensions with exactly one nominal radius or diameter.
|
|
131
|
+
*/
|
|
122
132
|
export declare type CircleOptions = CircleLoopOptions & PrimitivePlacement;
|
|
123
133
|
|
|
124
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Tessellation controls shared by circular primitives across Geometry entry points.
|
|
136
|
+
*/
|
|
125
137
|
export declare interface CircularPrimitiveOptions {
|
|
126
138
|
/** Explicit sampling ceilings; bound modeling operations may only lower the host policy. */
|
|
127
139
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
@@ -188,7 +200,9 @@ declare interface CustomThreadProfileSpec extends ThreadProfileBaseSpec {
|
|
|
188
200
|
/** Host-bound cylinder operation. Valid only during a synchronous build. */
|
|
189
201
|
export declare const cylinder: ModelingContext["cylinder"];
|
|
190
202
|
|
|
191
|
-
/**
|
|
203
|
+
/**
|
|
204
|
+
* Dimensions, placement, independent end finishing, and tessellation for a Z-axis cylinder or frustum.
|
|
205
|
+
*/
|
|
192
206
|
export declare type CylinderOptions = CircularPrimitiveOptions & RadialSizingOptions & PrimitivePlacement & {
|
|
193
207
|
/**
|
|
194
208
|
* Centers the solid on the Z origin when `true`; otherwise its bottom is at `Z = 0`.
|
|
@@ -211,13 +225,17 @@ export declare type CylinderOptions = CircularPrimitiveOptions & RadialSizingOpt
|
|
|
211
225
|
readonly radius?: never;
|
|
212
226
|
});
|
|
213
227
|
|
|
214
|
-
/**
|
|
228
|
+
/**
|
|
229
|
+
* Uniform finishing vocabulary shared by applicable solid edges and profile corners.
|
|
230
|
+
*/
|
|
215
231
|
export declare type EdgeTreatment = ChamferedEdgeTreatment | RoundedEdgeTreatment | SmoothEdgeTreatment | ProfiledEdgeTreatment;
|
|
216
232
|
|
|
217
233
|
/** Host-bound ellipse operation. Valid only during a synchronous build. */
|
|
218
234
|
export declare const ellipse: ModelingContext["ellipse"];
|
|
219
235
|
|
|
220
|
-
/**
|
|
236
|
+
/**
|
|
237
|
+
* Ellipse dimensions with exactly one XY radii or full-size tuple and explicit sampling.
|
|
238
|
+
*/
|
|
221
239
|
export declare type EllipseLoopOptions = CircularPrimitiveOptions & ({
|
|
222
240
|
/** Positive XY radii in millimetres; mutually exclusive with size. */
|
|
223
241
|
readonly radius: Vec2;
|
|
@@ -230,10 +248,14 @@ export declare type EllipseLoopOptions = CircularPrimitiveOptions & ({
|
|
|
230
248
|
readonly radius?: never;
|
|
231
249
|
});
|
|
232
250
|
|
|
233
|
-
/**
|
|
251
|
+
/**
|
|
252
|
+
* Ellipse dimensions in local XY, with exactly one radii or full-size tuple.
|
|
253
|
+
*/
|
|
234
254
|
export declare type EllipseOptions = EllipseLoopOptions & PrimitivePlacement;
|
|
235
255
|
|
|
236
|
-
/**
|
|
256
|
+
/**
|
|
257
|
+
* Independent inward finishing on primitive or straight convex extrusion ends.
|
|
258
|
+
*/
|
|
237
259
|
export declare interface EndTreatments {
|
|
238
260
|
/** Bottom cap and adjoining side; omitted leaves the end untreated. */
|
|
239
261
|
readonly bottom?: EdgeTreatment;
|
|
@@ -244,7 +266,9 @@ export declare interface EndTreatments {
|
|
|
244
266
|
/** Host-bound extrude operation. Valid only during a synchronous build. */
|
|
245
267
|
export declare const extrude: ModelingContext["extrude"];
|
|
246
268
|
|
|
247
|
-
/**
|
|
269
|
+
/**
|
|
270
|
+
* Dimensions and sampling shared by native and pure +Z extrusion.
|
|
271
|
+
*/
|
|
248
272
|
export declare interface ExtrudeOptions extends ExtrusionSamplingOptions {
|
|
249
273
|
/** Positive extrusion height in millimetres. */
|
|
250
274
|
readonly height: number;
|
|
@@ -318,7 +342,9 @@ export declare interface Frame3 {
|
|
|
318
342
|
/** Host-bound fromRegion operation. Valid only during a synchronous build. */
|
|
319
343
|
export declare const fromRegion: ModelingContext["fromRegion"];
|
|
320
344
|
|
|
321
|
-
/**
|
|
345
|
+
/**
|
|
346
|
+
* Tessellation policy for sampled geometry measured in millimetres.
|
|
347
|
+
*/
|
|
322
348
|
export declare interface GeometryResolution {
|
|
323
349
|
/** Optional exact full-circle segment count, of at least three, bounded by the selected circular ceiling. */
|
|
324
350
|
readonly circularSegments?: number;
|
|
@@ -357,7 +383,9 @@ export declare interface GeometryToleranceOptions {
|
|
|
357
383
|
/** Host-bound gridPattern operation. Valid only during a synchronous build. */
|
|
358
384
|
export declare const gridPattern: ModelingContext["gridPattern"];
|
|
359
385
|
|
|
360
|
-
/**
|
|
386
|
+
/**
|
|
387
|
+
* XY or XYZ grid with X varying fastest. The first item starts at the local origin.
|
|
388
|
+
*/
|
|
361
389
|
export declare type GridPatternOptions = {
|
|
362
390
|
/** Center the complete distribution around its local origin; defaults to false. */
|
|
363
391
|
readonly center?: boolean;
|
|
@@ -487,7 +515,9 @@ export declare const intersect: ModelingContext["intersect"];
|
|
|
487
515
|
/** Host-bound linearPattern operation. Valid only during a synchronous build. */
|
|
488
516
|
export declare const linearPattern: ModelingContext["linearPattern"];
|
|
489
517
|
|
|
490
|
-
/**
|
|
518
|
+
/**
|
|
519
|
+
* Equal linear intervals determined by exactly two of count, spacing and total length.
|
|
520
|
+
*/
|
|
491
521
|
export declare type LinearPatternOptions = {
|
|
492
522
|
/** Direction of repetition; magnitude is ignored. Defaults to +X. */
|
|
493
523
|
readonly direction?: Vec3;
|
|
@@ -520,7 +550,9 @@ export declare const loft: ModelingContext["loft"];
|
|
|
520
550
|
/** Deterministic ordered edge subdivision or bounded geometric vertex association. */
|
|
521
551
|
export declare type LoftCorrespondence = "direct" | "reindex" | "fast-distance" | "distance";
|
|
522
552
|
|
|
523
|
-
/**
|
|
553
|
+
/**
|
|
554
|
+
* Shared controls for native and pure lofts. Point data and arbitrary Sections require explicit correspondence.
|
|
555
|
+
*/
|
|
524
556
|
export declare interface LoftOptions {
|
|
525
557
|
/** 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. */
|
|
526
558
|
readonly correspondence?: LoftCorrespondence | readonly LoftCorrespondence[];
|
|
@@ -536,7 +568,9 @@ export declare interface LoftOptions {
|
|
|
536
568
|
readonly limits?: Partial<ModelingLimits>;
|
|
537
569
|
}
|
|
538
570
|
|
|
539
|
-
/**
|
|
571
|
+
/**
|
|
572
|
+
* A horizontal XY station height, or an explicit right-handed spatial frame, never both.
|
|
573
|
+
*/
|
|
540
574
|
export declare type LoftPlacement = {
|
|
541
575
|
/** Horizontal XY station height in millimetres. */
|
|
542
576
|
readonly z: number;
|
|
@@ -549,7 +583,9 @@ export declare type LoftPlacement = {
|
|
|
549
583
|
readonly z?: never;
|
|
550
584
|
};
|
|
551
585
|
|
|
552
|
-
/**
|
|
586
|
+
/**
|
|
587
|
+
* A Section or point loop at an explicit height or frame.
|
|
588
|
+
*/
|
|
553
589
|
export declare type LoftStation = LoftPlacement & {
|
|
554
590
|
/** Same-build filled Section or ordered XY boundary point data. */
|
|
555
591
|
readonly profile: Section | Loop2;
|
|
@@ -574,7 +610,9 @@ export declare interface MatchProfilesOptions {
|
|
|
574
610
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
575
611
|
}
|
|
576
612
|
|
|
577
|
-
/**
|
|
613
|
+
/**
|
|
614
|
+
* Axis-aligned bounds of a non-empty triangle mesh.
|
|
615
|
+
*/
|
|
578
616
|
export declare interface MeshBounds {
|
|
579
617
|
/** Inclusive minimum XYZ coordinates. */
|
|
580
618
|
readonly min: Vec3;
|
|
@@ -607,101 +645,335 @@ export declare const mirror: ModelingContext["mirror"];
|
|
|
607
645
|
export declare interface ModelingContext {
|
|
608
646
|
/** Derives a context with explicit physical sampling defaults in the same execution. */
|
|
609
647
|
withResolution(this: void, resolution: GeometryResolution): ModelingContext;
|
|
610
|
-
/**
|
|
648
|
+
/**
|
|
649
|
+
* Axis-aligned box with uniform or disjoint named edge/group treatments.
|
|
650
|
+
*
|
|
651
|
+
* @example Rounded box
|
|
652
|
+
* ```ts
|
|
653
|
+
* box({ size: [30, 20, 8], treatment: { kind: "round", radius: 2 } });
|
|
654
|
+
* ```
|
|
655
|
+
*/
|
|
611
656
|
box(this: void, options: BoxOptions): Solid;
|
|
612
|
-
/**
|
|
657
|
+
/**
|
|
658
|
+
* +Z cylinder or frustum. Face sizing compensates polygon faceting.
|
|
659
|
+
*
|
|
660
|
+
* @example Cylinder
|
|
661
|
+
* ```ts
|
|
662
|
+
* cylinder({ height: 20, radius: 10 });
|
|
663
|
+
* ```
|
|
664
|
+
*
|
|
665
|
+
* @example Cone
|
|
666
|
+
* ```ts
|
|
667
|
+
* cylinder({ height: 20, radius: [10, 0] });
|
|
668
|
+
* ```
|
|
669
|
+
*/
|
|
613
670
|
cylinder(this: void, options: CylinderOptions): Solid;
|
|
614
|
-
/**
|
|
671
|
+
/**
|
|
672
|
+
* Hollow +Z tube.
|
|
673
|
+
*
|
|
674
|
+
* @example Tube
|
|
675
|
+
* ```ts
|
|
676
|
+
* tube({ height: 20, outerRadius: 10, innerRadius: 6 });
|
|
677
|
+
* ```
|
|
678
|
+
*/
|
|
615
679
|
tube(this: void, options: TubeOptions): Solid;
|
|
616
|
-
/**
|
|
680
|
+
/**
|
|
681
|
+
* Origin-centered sphere.
|
|
682
|
+
*
|
|
683
|
+
* @example Sphere
|
|
684
|
+
* ```ts
|
|
685
|
+
* sphere({ diameter: 20 });
|
|
686
|
+
* ```
|
|
687
|
+
*/
|
|
617
688
|
sphere(this: void, options: SphereOptions): Solid;
|
|
618
|
-
/**
|
|
689
|
+
/**
|
|
690
|
+
* Torus around +Z.
|
|
691
|
+
*
|
|
692
|
+
* @example Torus
|
|
693
|
+
* ```ts
|
|
694
|
+
* torus({ majorRadius: 12, minorRadius: 3 });
|
|
695
|
+
* ```
|
|
696
|
+
*/
|
|
619
697
|
torus(this: void, options: TorusOptions): Solid;
|
|
620
|
-
/**
|
|
698
|
+
/**
|
|
699
|
+
* Robust union.
|
|
700
|
+
*
|
|
701
|
+
* @example Union
|
|
702
|
+
* ```ts
|
|
703
|
+
* const block = box({ size: 20 });
|
|
704
|
+
* const cap = translate(sphere({ radius: 10 }), [0, 0, 10]);
|
|
705
|
+
* union([block, cap]);
|
|
706
|
+
* ```
|
|
707
|
+
*/
|
|
621
708
|
union(this: void, solids: readonly Solid[]): Solid;
|
|
622
709
|
/** Native filled section union; dimensions cannot be mixed. */
|
|
623
710
|
union(this: void, sections: readonly Section[]): Section;
|
|
624
|
-
/**
|
|
711
|
+
/**
|
|
712
|
+
* Robust difference; an empty cutter array preserves the source.
|
|
713
|
+
*
|
|
714
|
+
* @example Subtract
|
|
715
|
+
* ```ts
|
|
716
|
+
* const plate = box({ size: [30, 20, 6] });
|
|
717
|
+
* // Extend the cutter beyond both faces.
|
|
718
|
+
* const bore = cylinder({ height: 8, radius: 3, sizing: "face" });
|
|
719
|
+
* subtract(plate, [bore]);
|
|
720
|
+
* ```
|
|
721
|
+
*/
|
|
625
722
|
subtract(this: void, solid: Solid, cutters: readonly Solid[]): Solid;
|
|
626
723
|
/** Native section difference; an empty cutter array preserves the source. */
|
|
627
724
|
subtract(this: void, section: Section, cutters: readonly Section[]): Section;
|
|
628
|
-
/**
|
|
725
|
+
/**
|
|
726
|
+
* Robust intersection.
|
|
727
|
+
*
|
|
728
|
+
* @example Intersect
|
|
729
|
+
* ```ts
|
|
730
|
+
* intersect([box({ size: 20 }), sphere({ radius: 12 })]);
|
|
731
|
+
* ```
|
|
732
|
+
*/
|
|
629
733
|
intersect(this: void, solids: readonly Solid[]): Solid;
|
|
630
734
|
/** Native filled section intersection; dimensions cannot be mixed. */
|
|
631
735
|
intersect(this: void, sections: readonly Section[]): Section;
|
|
632
736
|
/** Combines disjoint components without resolving overlap. */
|
|
633
737
|
compose(this: void, solids: readonly Solid[]): Solid;
|
|
634
|
-
/**
|
|
738
|
+
/**
|
|
739
|
+
* Convex hull of points or solids.
|
|
740
|
+
*
|
|
741
|
+
* @example Hull
|
|
742
|
+
* ```ts
|
|
743
|
+
* const left = translate(sphere({ radius: 5 }), [-10, 0, 0]);
|
|
744
|
+
* const right = translate(sphere({ radius: 5 }), [10, 0, 0]);
|
|
745
|
+
* hull({ solids: [left, right] });
|
|
746
|
+
* ```
|
|
747
|
+
*/
|
|
635
748
|
hull(this: void, options: HullOptions): Solid;
|
|
636
749
|
/** Three-dimensional Minkowski sum. */
|
|
637
750
|
minkowskiSum(this: void, a: Solid, b: Solid): Solid;
|
|
638
|
-
/**
|
|
751
|
+
/**
|
|
752
|
+
* Imports a bounded closed indexed mesh.
|
|
753
|
+
*
|
|
754
|
+
* @example Mesh import
|
|
755
|
+
* ```ts
|
|
756
|
+
* import { solidFromMesh } from "@metamesh/modeling";
|
|
757
|
+
* import { extrudeMesh, rectangleLoop } from "@metamesh/modeling/geometry";
|
|
758
|
+
*
|
|
759
|
+
* const mesh = extrudeMesh(rectangleLoop({ size: [20, 12] }), { height: 6 });
|
|
760
|
+
* solidFromMesh(mesh);
|
|
761
|
+
* ```
|
|
762
|
+
*/
|
|
639
763
|
solidFromMesh(this: void, mesh: TriangleMesh): Solid;
|
|
640
764
|
/** Copies a handle to manufacturing mesh buffers. */
|
|
641
765
|
toTriangleMesh(this: void, solid: Solid): TriangleMesh;
|
|
642
766
|
/** Translation preserving dimensionality. */
|
|
643
767
|
translate(this: void, section: Section, offset: Vec2): Section;
|
|
644
|
-
/**
|
|
768
|
+
/**
|
|
769
|
+
* Translation preserving dimensionality.
|
|
770
|
+
*
|
|
771
|
+
* @example Translate
|
|
772
|
+
* ```ts
|
|
773
|
+
* translate(box({ size: [12, 8, 4] }), [15, 0, 0]);
|
|
774
|
+
* ```
|
|
775
|
+
*/
|
|
645
776
|
translate(this: void, solid: Solid, offset: Vec3): Solid;
|
|
646
777
|
/** Degree rotation; scalar XY rotation or XYZ solid Euler angles. */
|
|
647
778
|
rotate(this: void, section: Section, degrees: number): Section;
|
|
648
|
-
/**
|
|
779
|
+
/**
|
|
780
|
+
* Degree rotation; scalar XY rotation or XYZ solid Euler angles.
|
|
781
|
+
*
|
|
782
|
+
* @example Rotate
|
|
783
|
+
* ```ts
|
|
784
|
+
* rotate(box({ size: [20, 10, 6] }), [0, 0, 30]);
|
|
785
|
+
* ```
|
|
786
|
+
*/
|
|
649
787
|
rotate(this: void, solid: Solid, degrees: Vec3): Solid;
|
|
650
|
-
/**
|
|
788
|
+
/**
|
|
789
|
+
* Nonsingular scaling about the origin.
|
|
790
|
+
*/
|
|
651
791
|
scale(this: void, section: Section, factors: number | Vec2): Section;
|
|
652
|
-
/**
|
|
792
|
+
/**
|
|
793
|
+
* Nonsingular scaling about the origin.
|
|
794
|
+
*
|
|
795
|
+
* @example Scale
|
|
796
|
+
* ```ts
|
|
797
|
+
* scale(sphere({ radius: 8 }), [2, 1, 1]);
|
|
798
|
+
* ```
|
|
799
|
+
*/
|
|
653
800
|
scale(this: void, solid: Solid, factors: number | Vec3): Solid;
|
|
654
801
|
/** Reflection across an origin line/plane. */
|
|
655
802
|
mirror(this: void, section: Section, normal: Vec2): Section;
|
|
656
|
-
/**
|
|
803
|
+
/**
|
|
804
|
+
* Reflection across an origin line/plane.
|
|
805
|
+
*
|
|
806
|
+
* @example Mirror
|
|
807
|
+
* ```ts
|
|
808
|
+
* const block = translate(box({ size: [12, 8, 4] }), [10, 0, 0]);
|
|
809
|
+
* mirror(block, [1, 0, 0]);
|
|
810
|
+
* ```
|
|
811
|
+
*/
|
|
657
812
|
mirror(this: void, solid: Solid, normal: Vec3): Solid;
|
|
658
813
|
/** Row-major affine transform preserving dimensionality. */
|
|
659
814
|
transform(this: void, section: Section, matrix: Transform2): Section;
|
|
660
815
|
/** Row-major affine transform preserving dimensionality. */
|
|
661
816
|
transform(this: void, solid: Solid, matrix: Transform3): Solid;
|
|
662
|
-
/**
|
|
817
|
+
/**
|
|
818
|
+
* Reads a copied, immutable named anchor from this exact active build.
|
|
819
|
+
*
|
|
820
|
+
* @example Read the top datum
|
|
821
|
+
* ```ts
|
|
822
|
+
* const plate = box({ size: [30, 20, 6] });
|
|
823
|
+
* anchor(plate, "top"); // position [0, 0, 3], direction [0, 0, 1]
|
|
824
|
+
* ```
|
|
825
|
+
*/
|
|
663
826
|
anchor(this: void, shape: Solid | Section, name: string): Anchor3;
|
|
664
|
-
/**
|
|
827
|
+
/**
|
|
828
|
+
* Returns a new same-build handle with copied named anchors; existing names may be replaced.
|
|
829
|
+
*/
|
|
665
830
|
withAnchors<T extends Solid | Section>(this: void, shape: T, anchors: Readonly<Record<string, Anchor3>>): T;
|
|
666
|
-
/**
|
|
831
|
+
/**
|
|
832
|
+
* Places an explicit or named source anchor against an explicit target anchor.
|
|
833
|
+
*
|
|
834
|
+
* @example Anchor attachment
|
|
835
|
+
* ```ts
|
|
836
|
+
* const plate = box({ size: [30, 20, 6] });
|
|
837
|
+
* const pin = cylinder({ height: 12, radius: 3 });
|
|
838
|
+
* attach(pin, "bottom", anchor(plate, "top"), { gap: 1 });
|
|
839
|
+
* ```
|
|
840
|
+
*/
|
|
667
841
|
attach(this: void, solid: Solid, source: Anchor3 | string, target: Anchor3, options?: AttachOptions): Solid;
|
|
668
|
-
/**
|
|
842
|
+
/**
|
|
843
|
+
* Creates a native filled section without an intermediate Region2 conversion.
|
|
844
|
+
*/
|
|
669
845
|
sectionFromContours(this: void, contours: readonly Loop2[], options?: SectionFromContoursOptions): Section;
|
|
670
846
|
/** Imports explicit region topology once. */
|
|
671
847
|
fromRegion(this: void, region: Region2): Section;
|
|
672
848
|
/** Explicit copied topology inspection; not needed for section operations. */
|
|
673
849
|
toRegion(this: void, section: Section): Region2;
|
|
674
|
-
/**
|
|
850
|
+
/**
|
|
851
|
+
* Filled rectangular section with uniform or independently treated corners.
|
|
852
|
+
*
|
|
853
|
+
* @example Round the corners
|
|
854
|
+
* ```ts
|
|
855
|
+
* rectangle({ size: [30, 20], treatment: { kind: "round", radius: 3 } });
|
|
856
|
+
* ```
|
|
857
|
+
*/
|
|
675
858
|
rectangle(this: void, options: RectangleOptions): Section;
|
|
676
|
-
/**
|
|
859
|
+
/**
|
|
860
|
+
* Centered circular section.
|
|
861
|
+
*
|
|
862
|
+
* @example Size to polygon faces
|
|
863
|
+
* ```ts
|
|
864
|
+
* circle({ diameter: 12, sizing: "face" });
|
|
865
|
+
* ```
|
|
866
|
+
*/
|
|
677
867
|
circle(this: void, options: CircleOptions): Section;
|
|
678
|
-
/**
|
|
868
|
+
/**
|
|
869
|
+
* Centered elliptical section.
|
|
870
|
+
*
|
|
871
|
+
* @example Ellipse by full dimensions
|
|
872
|
+
* ```ts
|
|
873
|
+
* ellipse({ size: [30, 20] });
|
|
874
|
+
* ```
|
|
875
|
+
*/
|
|
679
876
|
ellipse(this: void, options: EllipseOptions): Section;
|
|
680
|
-
/**
|
|
877
|
+
/**
|
|
878
|
+
* Regular polygon with a vertex on +X.
|
|
879
|
+
*
|
|
880
|
+
* @example Hexagonal section
|
|
881
|
+
* ```ts
|
|
882
|
+
* regularPolygon({ radius: 10, sides: 6, sizing: "face" });
|
|
883
|
+
* ```
|
|
884
|
+
*/
|
|
681
885
|
regularPolygon(this: void, options: RegularPolygonOptions): Section;
|
|
682
|
-
/**
|
|
886
|
+
/**
|
|
887
|
+
* Alternating outer/inner star vertices.
|
|
888
|
+
*
|
|
889
|
+
* @example Five-point section
|
|
890
|
+
* ```ts
|
|
891
|
+
* star({ outerRadius: 12, innerRadius: 6, points: 5 });
|
|
892
|
+
* ```
|
|
893
|
+
*/
|
|
683
894
|
star(this: void, options: StarOptions): Section;
|
|
684
|
-
/**
|
|
895
|
+
/**
|
|
896
|
+
* Native millimetre offset preserving holes.
|
|
897
|
+
*
|
|
898
|
+
* @example Add a 2 mm margin
|
|
899
|
+
* ```ts
|
|
900
|
+
* const outline = rectangle({ size: [20, 12] });
|
|
901
|
+
* offset(outline, 2, { join: "round" });
|
|
902
|
+
* ```
|
|
903
|
+
*/
|
|
685
904
|
offset(this: void, section: Section, distance: number, options?: RegionOffsetOptions): Section;
|
|
686
|
-
/**
|
|
905
|
+
/**
|
|
906
|
+
* Extrudes along +Z with degree twist and top scaling.
|
|
907
|
+
*
|
|
908
|
+
* @example Extrude
|
|
909
|
+
* ```ts
|
|
910
|
+
* const outline = rectangle({ size: [30, 20], treatment: { kind: "round", radius: 3 } });
|
|
911
|
+
* extrude(outline, { height: 8 });
|
|
912
|
+
* ```
|
|
913
|
+
*/
|
|
687
914
|
extrude(this: void, shape: ModelingShape, options: ExtrudeOptions): Solid;
|
|
688
|
-
/**
|
|
915
|
+
/**
|
|
916
|
+
* Revolves a filled radial/Z shape around +Z, with caps for partial sweeps.
|
|
917
|
+
*
|
|
918
|
+
* @example Revolve
|
|
919
|
+
* ```ts
|
|
920
|
+
* // Contour coordinates are [radius, Z].
|
|
921
|
+
* const profile = sectionFromContours([[[8, 0], [12, 0], [12, 16], [8, 16]]]);
|
|
922
|
+
* revolve(profile, { revolveDegrees: 270 });
|
|
923
|
+
* ```
|
|
924
|
+
*/
|
|
689
925
|
revolve(this: void, shape: ModelingShape, options?: RevolveOptions): Solid;
|
|
690
926
|
/** Filled XY projection. */
|
|
691
927
|
projectSection(this: void, solid: Solid): Section;
|
|
692
928
|
/** Horizontal filled slice. */
|
|
693
929
|
sliceSection(this: void, solid: Solid, z: number): Section;
|
|
694
|
-
/**
|
|
930
|
+
/**
|
|
931
|
+
* Lofts primitive Sections at z heights or frames; arbitrary Sections and loops require an explicit correspondence method.
|
|
932
|
+
*
|
|
933
|
+
* @example Loft
|
|
934
|
+
* ```ts
|
|
935
|
+
* loft([
|
|
936
|
+
* { profile: circle({ diameter: 16 }), z: 0 },
|
|
937
|
+
* { profile: rectangle({ size: [30, 20], treatment: { kind: "round", radius: 3 } }), z: 30 },
|
|
938
|
+
* ]);
|
|
939
|
+
* ```
|
|
940
|
+
*/
|
|
695
941
|
loft(this: void, stations: readonly LoftStation[], options?: LoftOptions): Solid;
|
|
696
942
|
/** Lofts explicit corresponding contours, including holes and collapsed logical slots. */
|
|
697
943
|
loft(this: void, stations: readonly CorrespondingProfileStation[], options?: LoftOptions): Solid;
|
|
698
944
|
/** Explicit family matching on a shared physical span grid using context resolution. */
|
|
699
945
|
matchProfiles(this: void, profiles: readonly Profile[], options?: MatchProfilesOptions): readonly CorrespondingProfile[];
|
|
700
|
-
/**
|
|
946
|
+
/**
|
|
947
|
+
* Sweeps filled or explicitly corresponding contours using the selected frame policy.
|
|
948
|
+
*
|
|
949
|
+
* @example Sweep
|
|
950
|
+
* ```ts
|
|
951
|
+
* const profile = rectangle({ size: [6, 3], treatment: { kind: "round", radius: 1 } });
|
|
952
|
+
* sweep(profile, [[0, 0, 0], [0, 0, 15], [10, 0, 25]], {
|
|
953
|
+
* orientation: { kind: "transport", initialNormal: [0, 1, 0] },
|
|
954
|
+
* });
|
|
955
|
+
* ```
|
|
956
|
+
*/
|
|
701
957
|
sweep(this: void, shape: ModelingShape, path: readonly Vec3[], options?: SweepOptions): Solid;
|
|
702
|
-
/**
|
|
958
|
+
/**
|
|
959
|
+
* Copies lightweight section measurements.
|
|
960
|
+
*
|
|
961
|
+
* @example Check filled area
|
|
962
|
+
* ```ts
|
|
963
|
+
* const facts = inspectSection(rectangle({ size: [20, 10] }));
|
|
964
|
+
* facts.area; // 200 mm²
|
|
965
|
+
* ```
|
|
966
|
+
*/
|
|
703
967
|
inspectSection(this: void, section: Section): SectionInspection;
|
|
704
|
-
/**
|
|
968
|
+
/**
|
|
969
|
+
* Copies solid bounds and volume; temporary components are owned by the build.
|
|
970
|
+
*
|
|
971
|
+
* @example Check dimensions and volume
|
|
972
|
+
* ```ts
|
|
973
|
+
* const facts = inspectSolid(box({ size: [30, 20, 6] }));
|
|
974
|
+
* facts.volume; // 3600 mm³
|
|
975
|
+
* ```
|
|
976
|
+
*/
|
|
705
977
|
inspectSolid(this: void, solid: Solid): SolidInspection;
|
|
706
978
|
/** Copies intersections along the finite directed origin-to-endpoint segment. */
|
|
707
979
|
rayCast(this: void, solid: Solid, origin: Vec3, endpoint: Vec3): readonly SolidRayHit[];
|
|
@@ -713,23 +985,97 @@ export declare interface ModelingContext {
|
|
|
713
985
|
implicit(this: void, options: ImplicitOptions): Solid;
|
|
714
986
|
/** Replaces native tolerance on an immutable copy; zero selects the kernel minimum. */
|
|
715
987
|
setTolerance(this: void, solid: Solid, tolerance: number): Solid;
|
|
716
|
-
/**
|
|
988
|
+
/**
|
|
989
|
+
* Closed regular-grid top above a flat base; every height is sampled once.
|
|
990
|
+
*
|
|
991
|
+
* @example Heightfield
|
|
992
|
+
* ```ts
|
|
993
|
+
* heightfield({
|
|
994
|
+
* size: [30, 20], segments: [24, 16],
|
|
995
|
+
* height: ([x, y]) => 3 + Math.cos(x / 5) * Math.cos(y / 5),
|
|
996
|
+
* });
|
|
997
|
+
* ```
|
|
998
|
+
*/
|
|
717
999
|
heightfield(this: void, options: HeightfieldOptions): Solid;
|
|
718
|
-
/**
|
|
1000
|
+
/**
|
|
1001
|
+
* Repeats one solid along a normalized direction.
|
|
1002
|
+
*
|
|
1003
|
+
* @example Three copies along X
|
|
1004
|
+
* ```ts
|
|
1005
|
+
* linearPattern(box({ size: 4 }), { count: 3, spacing: 10 });
|
|
1006
|
+
* ```
|
|
1007
|
+
*/
|
|
719
1008
|
linearPattern(this: void, source: PatternSource, options: LinearPatternOptions): readonly Solid[];
|
|
720
|
-
/**
|
|
1009
|
+
/**
|
|
1010
|
+
* Repeats one solid about an axis.
|
|
1011
|
+
*
|
|
1012
|
+
* @example Six copies around Z
|
|
1013
|
+
* ```ts
|
|
1014
|
+
* const pin = translate(cylinder({ height: 6, radius: 2 }), [12, 0, 0]);
|
|
1015
|
+
* radialPattern(pin, { count: 6, axis: [0, 0, 1], angleDegrees: 60 });
|
|
1016
|
+
* ```
|
|
1017
|
+
*/
|
|
721
1018
|
radialPattern(this: void, source: PatternSource, options: RadialPatternOptions): readonly Solid[];
|
|
722
|
-
/**
|
|
1019
|
+
/**
|
|
1020
|
+
* XY or XYZ copies, optionally centered or placed in an explicit frame.
|
|
1021
|
+
*
|
|
1022
|
+
* @example Centered XY grid
|
|
1023
|
+
* ```ts
|
|
1024
|
+
* gridPattern(box({ size: 4 }), { count: [3, 2], spacing: [10, 10], center: true });
|
|
1025
|
+
* ```
|
|
1026
|
+
*/
|
|
723
1027
|
gridPattern(this: void, source: PatternSource, options: GridPatternOptions): readonly Solid[];
|
|
724
|
-
/**
|
|
1028
|
+
/**
|
|
1029
|
+
* Physical arc-length copies along a sampled path, with optional tangent orientation.
|
|
1030
|
+
*
|
|
1031
|
+
* @example Copies along a bent path
|
|
1032
|
+
* ```ts
|
|
1033
|
+
* pathPattern(box({ size: 4 }), [[0, 0, 0], [20, 0, 0], [20, 20, 0]], { count: 5 });
|
|
1034
|
+
* ```
|
|
1035
|
+
*/
|
|
725
1036
|
pathPattern(this: void, source: PatternSource, path: readonly Vec3[], options: PathPatternOptions): readonly Solid[];
|
|
726
1037
|
/** Helical ridge mesh construction. */
|
|
727
1038
|
threadRidge(this: void, options: ThreadRidgeOptions): Solid;
|
|
728
|
-
/**
|
|
1039
|
+
/**
|
|
1040
|
+
* Compensated external threaded rod.
|
|
1041
|
+
*
|
|
1042
|
+
* @example Threaded rod
|
|
1043
|
+
* ```ts
|
|
1044
|
+
* import { threadedRod } from "@metamesh/modeling";
|
|
1045
|
+
* import { createThreadProfile } from "@metamesh/modeling/geometry";
|
|
1046
|
+
*
|
|
1047
|
+
* const profile = createThreadProfile({ kind: "triangular", pitch: 1.75 });
|
|
1048
|
+
* threadedRod({ nominalMajorDiameter: 12, length: 24, profile, fit: "normal" });
|
|
1049
|
+
* ```
|
|
1050
|
+
*/
|
|
729
1051
|
threadedRod(this: void, options: ThreadedRodOptions): Solid;
|
|
730
|
-
/**
|
|
1052
|
+
/**
|
|
1053
|
+
* Compensated internal threaded cutter.
|
|
1054
|
+
*
|
|
1055
|
+
* @example Internal thread
|
|
1056
|
+
* ```ts
|
|
1057
|
+
* import { cylinder, internalThreadCutter, subtract } from "@metamesh/modeling";
|
|
1058
|
+
* import { createThreadProfile } from "@metamesh/modeling/geometry";
|
|
1059
|
+
*
|
|
1060
|
+
* const profile = createThreadProfile({ kind: "triangular", pitch: 1.75 });
|
|
1061
|
+
* const body = cylinder({ diameter: 20, height: 12, center: false });
|
|
1062
|
+
* const cutter = internalThreadCutter({ nominalMajorDiameter: 12, length: 12, profile });
|
|
1063
|
+
* subtract(body, [cutter]);
|
|
1064
|
+
* ```
|
|
1065
|
+
*/
|
|
731
1066
|
internalThreadCutter(this: void, options: InternalThreadCutterOptions): Solid;
|
|
732
|
-
/**
|
|
1067
|
+
/**
|
|
1068
|
+
* Compensated threaded nut.
|
|
1069
|
+
*
|
|
1070
|
+
* @example Threaded nut
|
|
1071
|
+
* ```ts
|
|
1072
|
+
* import { threadedNut } from "@metamesh/modeling";
|
|
1073
|
+
* import { createThreadProfile } from "@metamesh/modeling/geometry";
|
|
1074
|
+
*
|
|
1075
|
+
* const profile = createThreadProfile({ kind: "triangular", pitch: 1.75 });
|
|
1076
|
+
* threadedNut({ nominalMajorDiameter: 12, thickness: 8, width: 20, shape: "hex", profile, fit: "normal" });
|
|
1077
|
+
* ```
|
|
1078
|
+
*/
|
|
733
1079
|
threadedNut(this: void, options: ThreadedNutOptions): Solid;
|
|
734
1080
|
/** Allocation-free external-thread facts. */
|
|
735
1081
|
preflightThreadedRod(this: void, options: ThreadedRodOptions): HelicalThreadSolidMeshPreflight;
|
|
@@ -737,15 +1083,44 @@ export declare interface ModelingContext {
|
|
|
737
1083
|
preflightInternalThreadCutter(this: void, options: InternalThreadCutterOptions): HelicalThreadSolidMeshPreflight;
|
|
738
1084
|
/** Allocation-free nut/cutter facts. */
|
|
739
1085
|
preflightThreadedNut(this: void, options: ThreadedNutOptions): ThreadedNutPreflight;
|
|
740
|
-
/**
|
|
1086
|
+
/**
|
|
1087
|
+
* Consumes a previously prepared layout; never shapes or fetches a font.
|
|
1088
|
+
*
|
|
1089
|
+
* @example Use a prepared text layout
|
|
1090
|
+
* ```ts
|
|
1091
|
+
* // Prepare the exact font and layout before entering build.
|
|
1092
|
+
* function labelSection(layout: VectorTextLayout) {
|
|
1093
|
+
* return textSection(layout);
|
|
1094
|
+
* }
|
|
1095
|
+
* ```
|
|
1096
|
+
*/
|
|
741
1097
|
textSection(this: void, layout: VectorTextLayout, options?: TextSectionOptions): Section;
|
|
742
|
-
/**
|
|
1098
|
+
/**
|
|
1099
|
+
* Imports bounded painted SVG document geometry.
|
|
1100
|
+
*
|
|
1101
|
+
* @example Import a physical SVG rectangle
|
|
1102
|
+
* ```ts
|
|
1103
|
+
* svgSection(
|
|
1104
|
+
* '<svg xmlns="http://www.w3.org/2000/svg" width="30mm" height="20mm" viewBox="0 0 30 20"><rect width="30" height="20"/></svg>',
|
|
1105
|
+
* { origin: "center" },
|
|
1106
|
+
* );
|
|
1107
|
+
* ```
|
|
1108
|
+
*/
|
|
743
1109
|
svgSection(this: void, svg: string, options?: SvgSectionOptions): Section;
|
|
744
|
-
/**
|
|
1110
|
+
/**
|
|
1111
|
+
* Imports bounded filled SVG path data.
|
|
1112
|
+
*
|
|
1113
|
+
* @example Fill an SVG path in millimetres
|
|
1114
|
+
* ```ts
|
|
1115
|
+
* svgPathSection("M0 0H20V12H0Z", { origin: "center", scale: 1 });
|
|
1116
|
+
* ```
|
|
1117
|
+
*/
|
|
745
1118
|
svgPathSection(this: void, path: string, options?: SvgPathSectionOptions): Section;
|
|
746
1119
|
}
|
|
747
1120
|
|
|
748
|
-
/**
|
|
1121
|
+
/**
|
|
1122
|
+
* Returns bound local operations, optionally with derived resolution, without changing imported operations.
|
|
1123
|
+
*/
|
|
749
1124
|
export declare function modelingFunctions(resolution?: GeometryResolution): ModelingContext;
|
|
750
1125
|
|
|
751
1126
|
/** Aggregate manufacturing output ceilings selected by a trusted host. */
|
|
@@ -791,7 +1166,9 @@ export declare interface PathPatternOptions {
|
|
|
791
1166
|
readonly orientation?: "fixed" | "tangent";
|
|
792
1167
|
}
|
|
793
1168
|
|
|
794
|
-
/**
|
|
1169
|
+
/**
|
|
1170
|
+
* One same-build shape, or a synchronous factory called once per copy in index order.
|
|
1171
|
+
*/
|
|
795
1172
|
export declare type PatternSource = Solid | ((index: number) => Solid);
|
|
796
1173
|
|
|
797
1174
|
/**
|
|
@@ -839,7 +1216,9 @@ export declare interface PrimitivePlacementOptions {
|
|
|
839
1216
|
readonly tolerance?: GeometryToleranceOptions;
|
|
840
1217
|
}
|
|
841
1218
|
|
|
842
|
-
/**
|
|
1219
|
+
/**
|
|
1220
|
+
* Named baseline fit policies for calibrated FDM-style printed threads.
|
|
1221
|
+
*/
|
|
843
1222
|
export declare type PrintableThreadFit = "tight" | "normal" | "loose";
|
|
844
1223
|
|
|
845
1224
|
/**
|
|
@@ -939,7 +1318,9 @@ export declare const projectSection: ModelingContext["projectSection"];
|
|
|
939
1318
|
/** Host-bound radialPattern operation. Valid only during a synchronous build. */
|
|
940
1319
|
export declare const radialPattern: ModelingContext["radialPattern"];
|
|
941
1320
|
|
|
942
|
-
/**
|
|
1321
|
+
/**
|
|
1322
|
+
* Options for repeating one solid around an axis through a center point.
|
|
1323
|
+
*/
|
|
943
1324
|
export declare interface RadialPatternOptions {
|
|
944
1325
|
/** Number of solids to return, including the original. */
|
|
945
1326
|
readonly count: number;
|
|
@@ -951,10 +1332,14 @@ export declare interface RadialPatternOptions {
|
|
|
951
1332
|
readonly center?: Vec3;
|
|
952
1333
|
}
|
|
953
1334
|
|
|
954
|
-
/**
|
|
1335
|
+
/**
|
|
1336
|
+
* Radial dimensions refer to polygon vertices or compensate faceting to meet polygon faces.
|
|
1337
|
+
*/
|
|
955
1338
|
export declare type RadialSizing = "vertex" | "face";
|
|
956
1339
|
|
|
957
|
-
/**
|
|
1340
|
+
/**
|
|
1341
|
+
* Nominal radial sizing shared by circular and regular polygon construction.
|
|
1342
|
+
*/
|
|
958
1343
|
export declare interface RadialSizingOptions {
|
|
959
1344
|
/** Explicit sampling ceilings; bound modeling operations may only lower the host policy. */
|
|
960
1345
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
@@ -982,7 +1367,9 @@ bottomLeft: RectangleCornerTreatment,
|
|
|
982
1367
|
bottomRight: RectangleCornerTreatment
|
|
983
1368
|
];
|
|
984
1369
|
|
|
985
|
-
/**
|
|
1370
|
+
/**
|
|
1371
|
+
* Shared rectangle dimensions, origin and uniform or per-corner treatment.
|
|
1372
|
+
*/
|
|
986
1373
|
export declare interface RectangleLoopOptions {
|
|
987
1374
|
/** Positive uniform size or explicit XY extents in millimetres. */
|
|
988
1375
|
readonly size: number | Vec2;
|
|
@@ -994,7 +1381,9 @@ export declare interface RectangleLoopOptions {
|
|
|
994
1381
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
995
1382
|
}
|
|
996
1383
|
|
|
997
|
-
/**
|
|
1384
|
+
/**
|
|
1385
|
+
* Rectangle dimensions, placement and uniform or per-corner treatment.
|
|
1386
|
+
*/
|
|
998
1387
|
export declare interface RectangleOptions extends RectangleLoopOptions, PrimitivePlacement {
|
|
999
1388
|
}
|
|
1000
1389
|
|
|
@@ -1019,7 +1408,9 @@ export declare interface RegionOffsetOptions {
|
|
|
1019
1408
|
/** Host-bound regularPolygon operation. Valid only during a synchronous build. */
|
|
1020
1409
|
export declare const regularPolygon: ModelingContext["regularPolygon"];
|
|
1021
1410
|
|
|
1022
|
-
/**
|
|
1411
|
+
/**
|
|
1412
|
+
* Regular polygon dimensions, radial convention and degree rotation.
|
|
1413
|
+
*/
|
|
1023
1414
|
export declare type RegularPolygonOptions = RadialSizingOptions & PrimitivePlacement & {
|
|
1024
1415
|
/** Positive nominal radius in millimetres, interpreted according to sizing. */
|
|
1025
1416
|
readonly radius: number;
|
|
@@ -1032,7 +1423,9 @@ export declare type RegularPolygonOptions = RadialSizingOptions & PrimitivePlace
|
|
|
1032
1423
|
/** Host-bound revolve operation. Valid only during a synchronous build. */
|
|
1033
1424
|
export declare const revolve: ModelingContext["revolve"];
|
|
1034
1425
|
|
|
1035
|
-
/**
|
|
1426
|
+
/**
|
|
1427
|
+
* Circumferential sampling and degree sweep shared by pure and filled revolution.
|
|
1428
|
+
*/
|
|
1036
1429
|
export declare interface RevolveOptions extends CircularPrimitiveOptions {
|
|
1037
1430
|
/**
|
|
1038
1431
|
* Positive angular sweep no greater than 360 degrees; partial revolutions have end caps.
|
|
@@ -1048,7 +1441,9 @@ export declare interface RevolveOptions extends CircularPrimitiveOptions {
|
|
|
1048
1441
|
/** Host-bound rotate operation. Valid only during a synchronous build. */
|
|
1049
1442
|
export declare const rotate: ModelingContext["rotate"];
|
|
1050
1443
|
|
|
1051
|
-
/**
|
|
1444
|
+
/**
|
|
1445
|
+
* A circular edge or corner roundover with explicit physical sampling.
|
|
1446
|
+
*/
|
|
1052
1447
|
export declare interface RoundedEdgeTreatment extends CircularPrimitiveOptions {
|
|
1053
1448
|
/** Selects circular corners or spherical all-edge roundovers. */
|
|
1054
1449
|
readonly kind: "round";
|
|
@@ -1070,13 +1465,17 @@ declare const sectionBrand: unique symbol;
|
|
|
1070
1465
|
/** Host-bound sectionFromContours operation. Valid only during a synchronous build. */
|
|
1071
1466
|
export declare const sectionFromContours: ModelingContext["sectionFromContours"];
|
|
1072
1467
|
|
|
1073
|
-
/**
|
|
1468
|
+
/**
|
|
1469
|
+
* Filled-contour resolution. Closing vertices are implicit.
|
|
1470
|
+
*/
|
|
1074
1471
|
export declare interface SectionFromContoursOptions {
|
|
1075
1472
|
/** Nonzero or even-odd filled-contour rule; defaults to nonzero. */
|
|
1076
1473
|
readonly fillRule?: "nonzero" | "evenodd";
|
|
1077
1474
|
}
|
|
1078
1475
|
|
|
1079
|
-
/**
|
|
1476
|
+
/**
|
|
1477
|
+
* Copied native filled section facts in millimetres and square millimetres.
|
|
1478
|
+
*/
|
|
1080
1479
|
export declare interface SectionInspection {
|
|
1081
1480
|
/** Filled section area in square millimetres. */
|
|
1082
1481
|
readonly area: number;
|
|
@@ -1126,7 +1525,9 @@ declare const solidBrand: unique symbol;
|
|
|
1126
1525
|
/** Host-bound solidFromMesh operation. Valid only during a synchronous build. */
|
|
1127
1526
|
export declare const solidFromMesh: ModelingContext["solidFromMesh"];
|
|
1128
1527
|
|
|
1129
|
-
/**
|
|
1528
|
+
/**
|
|
1529
|
+
* Copied solid bounds, connected component count, and cubic millimetre volume.
|
|
1530
|
+
*/
|
|
1130
1531
|
export declare interface SolidInspection {
|
|
1131
1532
|
/** Inclusive maximum coordinates in millimetres. */
|
|
1132
1533
|
readonly max: Vec3;
|
|
@@ -1165,7 +1566,9 @@ export declare interface SolidRayHit {
|
|
|
1165
1566
|
/** Host-bound sphere operation. Valid only during a synchronous build. */
|
|
1166
1567
|
export declare const sphere: ModelingContext["sphere"];
|
|
1167
1568
|
|
|
1168
|
-
/**
|
|
1569
|
+
/**
|
|
1570
|
+
* Exactly one radius or diameter, placement, and tessellation for an origin-centered sphere.
|
|
1571
|
+
*/
|
|
1169
1572
|
export declare type SphereOptions = CircularPrimitiveOptions & PrimitivePlacement & ({
|
|
1170
1573
|
/** Positive radius in millimetres; mutually exclusive with diameter. */
|
|
1171
1574
|
readonly radius: number;
|
|
@@ -1192,7 +1595,9 @@ declare interface SquareThreadProfileSpec extends ThreadProfileBaseSpec {
|
|
|
1192
1595
|
/** Host-bound star operation. Valid only during a synchronous build. */
|
|
1193
1596
|
export declare const star: ModelingContext["star"];
|
|
1194
1597
|
|
|
1195
|
-
/**
|
|
1598
|
+
/**
|
|
1599
|
+
* Alternating outer and inner vertices, centered on the XY origin.
|
|
1600
|
+
*/
|
|
1196
1601
|
export declare interface StarOptions extends PrimitivePlacement {
|
|
1197
1602
|
/** Explicit sampling ceilings, bounded by the host policy. */
|
|
1198
1603
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
@@ -1232,7 +1637,9 @@ export declare interface SvgPathSectionOptions {
|
|
|
1232
1637
|
/** Host-bound svgSection operation. Valid only during a synchronous build. */
|
|
1233
1638
|
export declare const svgSection: ModelingContext["svgSection"];
|
|
1234
1639
|
|
|
1235
|
-
/**
|
|
1640
|
+
/**
|
|
1641
|
+
* Bounded SVG document sampling. Center origin uses the final painted bounds.
|
|
1642
|
+
*/
|
|
1236
1643
|
export declare interface SvgSectionOptions {
|
|
1237
1644
|
/** Local allocation ceilings may only lower the configured engine policy. */
|
|
1238
1645
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
@@ -1247,7 +1654,9 @@ export declare interface SvgSectionOptions {
|
|
|
1247
1654
|
/** Host-bound sweep operation. Valid only during a synchronous build. */
|
|
1248
1655
|
export declare const sweep: ModelingContext["sweep"];
|
|
1249
1656
|
|
|
1250
|
-
/**
|
|
1657
|
+
/**
|
|
1658
|
+
* Controls shared by pure mesh construction and filled modeling sweeps.
|
|
1659
|
+
*/
|
|
1251
1660
|
export declare interface SweepOptions {
|
|
1252
1661
|
/** Join the path's last station to its first. Open paths retain watertight end caps. */
|
|
1253
1662
|
readonly closed?: boolean;
|
|
@@ -1267,7 +1676,9 @@ export declare interface SweepOptions {
|
|
|
1267
1676
|
readonly seamProfileOffset?: number;
|
|
1268
1677
|
}
|
|
1269
1678
|
|
|
1270
|
-
/**
|
|
1679
|
+
/**
|
|
1680
|
+
* Explicit profile-X frame policy; all normals are directed, and selected singular policies reject.
|
|
1681
|
+
*/
|
|
1271
1682
|
export declare type SweepOrientation = {
|
|
1272
1683
|
/** Minimizes frame rotation by parallel transport. */
|
|
1273
1684
|
readonly kind: "transport";
|
|
@@ -1291,7 +1702,9 @@ export declare type SweepOrientation = {
|
|
|
1291
1702
|
/** Host-bound textSection operation. Valid only during a synchronous build. */
|
|
1292
1703
|
export declare const textSection: ModelingContext["textSection"];
|
|
1293
1704
|
|
|
1294
|
-
/**
|
|
1705
|
+
/**
|
|
1706
|
+
* Physical curve sampling applied to already prepared vector text.
|
|
1707
|
+
*/
|
|
1295
1708
|
export declare interface TextSectionOptions {
|
|
1296
1709
|
/** Local allocation ceilings may only lower the configured engine policy. */
|
|
1297
1710
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
@@ -1318,7 +1731,9 @@ export declare const threadedNut: ModelingContext["threadedNut"];
|
|
|
1318
1731
|
/** Nut-edge bevel selection. */
|
|
1319
1732
|
export declare type ThreadedNutBevel = "automatic" | "both" | "inside" | "none" | "outside";
|
|
1320
1733
|
|
|
1321
|
-
/**
|
|
1734
|
+
/**
|
|
1735
|
+
* Options for a compensated nut with an internal thread.
|
|
1736
|
+
*/
|
|
1322
1737
|
export declare interface ThreadedNutOptions extends Omit<InternalThreadCutterOptions, "bevelBottom" | "bevelSize" | "bevelTop" | "length"> {
|
|
1323
1738
|
/** Nut body bevel selection. Default: `automatic`. */
|
|
1324
1739
|
readonly bevel?: ThreadedNutBevel;
|
|
@@ -1354,13 +1769,17 @@ export declare interface ThreadedNutPreflight {
|
|
|
1354
1769
|
readonly threadCircularSegments: number;
|
|
1355
1770
|
}
|
|
1356
1771
|
|
|
1357
|
-
/**
|
|
1772
|
+
/**
|
|
1773
|
+
* Supported printable nut body shapes.
|
|
1774
|
+
*/
|
|
1358
1775
|
export declare type ThreadedNutShape = "hex" | "round" | "square";
|
|
1359
1776
|
|
|
1360
1777
|
/** Host-bound threadedRod operation. Valid only during a synchronous build. */
|
|
1361
1778
|
export declare const threadedRod: ModelingContext["threadedRod"];
|
|
1362
1779
|
|
|
1363
|
-
/**
|
|
1780
|
+
/**
|
|
1781
|
+
* Options for a compensated external threaded rod along +Z.
|
|
1782
|
+
*/
|
|
1364
1783
|
export declare interface ThreadedRodOptions extends Omit<HelicalThreadRidgeMeshOptions, "majorDiameter">, ThreadBevelOptions {
|
|
1365
1784
|
/** Printable fit or caller-calibrated allowances. Default: `normal`. */
|
|
1366
1785
|
readonly fit?: PrintableThreadFit | PrintableThreadFitPolicy;
|
|
@@ -1408,7 +1827,9 @@ export declare interface ThreadEndTreatmentOptions {
|
|
|
1408
1827
|
readonly top?: ThreadEndStyle;
|
|
1409
1828
|
}
|
|
1410
1829
|
|
|
1411
|
-
/**
|
|
1830
|
+
/**
|
|
1831
|
+
* Direction in which a conventional helical thread advances around +Z.
|
|
1832
|
+
*/
|
|
1412
1833
|
export declare type ThreadHandedness = "left" | "right";
|
|
1413
1834
|
|
|
1414
1835
|
/** Radial envelope toward which a blunt lead-in collapses. */
|
|
@@ -1417,7 +1838,9 @@ export declare type ThreadLeadInEnvelope = "major" | "minor";
|
|
|
1417
1838
|
/** BOSL2-compatible cross-section scaling curve for a blunt thread lead-in. */
|
|
1418
1839
|
export declare type ThreadLeadInShape = "cut" | "linear" | "smooth" | "sqrt";
|
|
1419
1840
|
|
|
1420
|
-
/**
|
|
1841
|
+
/**
|
|
1842
|
+
* A validated immutable periodic thread profile in `[axial, radial]` millimetres.
|
|
1843
|
+
*/
|
|
1421
1844
|
export declare interface ThreadProfile {
|
|
1422
1845
|
/** Axial width of the flat at the major envelope. */
|
|
1423
1846
|
readonly crestFlatWidth: number;
|
|
@@ -1441,7 +1864,9 @@ declare interface ThreadProfileBaseSpec {
|
|
|
1441
1864
|
readonly tolerance?: GeometryToleranceOptions;
|
|
1442
1865
|
}
|
|
1443
1866
|
|
|
1444
|
-
/**
|
|
1867
|
+
/**
|
|
1868
|
+
* Supported built-in and caller-defined thread profiles.
|
|
1869
|
+
*/
|
|
1445
1870
|
declare type ThreadProfileSpec = AcmeThreadProfileSpec | ButtressThreadProfileSpec | CustomThreadProfileSpec | SquareThreadProfileSpec | TrapezoidalThreadProfileSpec | TriangularThreadProfileSpec;
|
|
1446
1871
|
|
|
1447
1872
|
/** Host-bound threadRidge operation. Valid only during a synchronous build. */
|
|
@@ -1456,7 +1881,9 @@ export declare const toRegion: ModelingContext["toRegion"];
|
|
|
1456
1881
|
/** Host-bound torus operation. Valid only during a synchronous build. */
|
|
1457
1882
|
export declare const torus: ModelingContext["torus"];
|
|
1458
1883
|
|
|
1459
|
-
/**
|
|
1884
|
+
/**
|
|
1885
|
+
* Dimensions and independent ring/profile tessellation for a torus around the Z axis.
|
|
1886
|
+
*/
|
|
1460
1887
|
export declare interface TorusOptions extends PrimitivePlacement {
|
|
1461
1888
|
/** Explicit sampling ceilings, bounded by the host policy. */
|
|
1462
1889
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
@@ -1535,7 +1962,9 @@ declare interface TrapezoidalThreadProfileSpec extends ThreadProfileBaseSpec {
|
|
|
1535
1962
|
readonly threadAngle?: number;
|
|
1536
1963
|
}
|
|
1537
1964
|
|
|
1538
|
-
/**
|
|
1965
|
+
/**
|
|
1966
|
+
* A topology-preserving indexed triangle mesh with XYZ vertex positions.
|
|
1967
|
+
*/
|
|
1539
1968
|
export declare interface TriangleMesh {
|
|
1540
1969
|
/** Three unsigned vertex indices per triangle. */
|
|
1541
1970
|
readonly indices: Uint32Array;
|
|
@@ -1543,7 +1972,9 @@ export declare interface TriangleMesh {
|
|
|
1543
1972
|
readonly positions: Float32Array;
|
|
1544
1973
|
}
|
|
1545
1974
|
|
|
1546
|
-
/**
|
|
1975
|
+
/**
|
|
1976
|
+
* Measurements and optional edge-connected topology from one validated mesh traversal.
|
|
1977
|
+
*/
|
|
1547
1978
|
export declare interface TriangleMeshAnalysis extends TriangleMeshMeasurements {
|
|
1548
1979
|
/** Number of referenced edge-connected components when `includeTopology` is requested. */
|
|
1549
1980
|
readonly connectedComponentCount?: number;
|
|
@@ -1551,7 +1982,9 @@ export declare interface TriangleMeshAnalysis extends TriangleMeshMeasurements {
|
|
|
1551
1982
|
readonly edgeCount?: number;
|
|
1552
1983
|
}
|
|
1553
1984
|
|
|
1554
|
-
/**
|
|
1985
|
+
/**
|
|
1986
|
+
* Geometric measurements derived from a validated, non-empty triangle mesh.
|
|
1987
|
+
*/
|
|
1555
1988
|
export declare interface TriangleMeshMeasurements {
|
|
1556
1989
|
/** Axis-aligned bounds. */
|
|
1557
1990
|
readonly bounds: MeshBounds;
|
|
@@ -1565,7 +1998,9 @@ export declare interface TriangleMeshMeasurements {
|
|
|
1565
1998
|
readonly vertexCount: number;
|
|
1566
1999
|
}
|
|
1567
2000
|
|
|
1568
|
-
/**
|
|
2001
|
+
/**
|
|
2002
|
+
* ISO/UTS-like 60-degree truncated triangular profile.
|
|
2003
|
+
*/
|
|
1569
2004
|
declare interface TriangularThreadProfileSpec extends ThreadProfileBaseSpec {
|
|
1570
2005
|
/** Selects the 60-degree triangular profile family. */
|
|
1571
2006
|
readonly kind: "triangular";
|
|
@@ -1584,7 +2019,9 @@ declare interface TriangularThreadProfileSpec extends ThreadProfileBaseSpec {
|
|
|
1584
2019
|
/** Host-bound tube operation. Valid only during a synchronous build. */
|
|
1585
2020
|
export declare const tube: ModelingContext["tube"];
|
|
1586
2021
|
|
|
1587
|
-
/**
|
|
2022
|
+
/**
|
|
2023
|
+
* Dimensions, placement, and tessellation for a hollow Z-axis tube.
|
|
2024
|
+
*/
|
|
1588
2025
|
export declare interface TubeOptions extends CircularPrimitiveOptions, PrimitivePlacement {
|
|
1589
2026
|
/**
|
|
1590
2027
|
* Centers the tube on the Z origin when `true`; otherwise its bottom is at `Z = 0`.
|
|
@@ -1616,7 +2053,9 @@ export declare interface VectorTextBounds {
|
|
|
1616
2053
|
readonly max: readonly [number, number];
|
|
1617
2054
|
}
|
|
1618
2055
|
|
|
1619
|
-
/**
|
|
2056
|
+
/**
|
|
2057
|
+
* Immutable vector layout with no browser, font parser, or kernel ownership.
|
|
2058
|
+
*/
|
|
1620
2059
|
export declare interface VectorTextLayout {
|
|
1621
2060
|
/** Nonzero-filled path data in millimetres, positive Y upward; empty for text with no ink. */
|
|
1622
2061
|
readonly paths: readonly string[];
|