@metamesh/modeling 0.8.0 → 0.10.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 +18 -0
- package/README.md +29 -415
- package/THIRD_PARTY_NOTICES.md +4 -148
- package/dist/api/geometry.d.ts +1049 -963
- package/dist/api/index.d.ts +13 -1
- package/dist/geometry/index.js +2 -1
- package/dist/geometry/profiles/contour.js +102 -0
- package/dist/geometry/profiles/{open-profile.js → side-profile.js} +3 -3
- package/dist/geometry/svg-import.js +9 -17
- package/package.json +1 -1
package/dist/api/geometry.d.ts
CHANGED
|
@@ -436,6 +436,39 @@ export declare interface ArcCurve3 {
|
|
|
436
436
|
*/
|
|
437
437
|
export declare function computeTriangleMeshCentroid(mesh: TriangleMesh): Vec3;
|
|
438
438
|
|
|
439
|
+
/** One explicitly closed planar contour, independent of editor metadata and parameter contracts. */
|
|
440
|
+
export declare interface ContourCurve {
|
|
441
|
+
/** Initial anchor; coordinates may be any finite value. */
|
|
442
|
+
readonly start: ContourPoint;
|
|
443
|
+
/** Ordered chain of 2–32 segments; the final end must exactly match start. */
|
|
444
|
+
readonly segments: readonly ContourSegment[];
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/** Planar X and upward Y in millimetres, or in units converted by sampling scales. */
|
|
448
|
+
export declare interface ContourPoint {
|
|
449
|
+
/** Horizontal coordinate; physical scaling does not center the contour. */
|
|
450
|
+
readonly x: number;
|
|
451
|
+
/** Upward planar coordinate. */
|
|
452
|
+
readonly y: number;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/** Straight or cubic Bézier segment in one closed planar contour. */
|
|
456
|
+
export declare type ContourSegment = {
|
|
457
|
+
/** Straight segment discriminator. */
|
|
458
|
+
readonly type: "line";
|
|
459
|
+
/** Next anchor; the final anchor repeats the curve start. */
|
|
460
|
+
readonly end: ContourPoint;
|
|
461
|
+
} | {
|
|
462
|
+
/** Cubic Bézier segment discriminator. */
|
|
463
|
+
readonly type: "cubic";
|
|
464
|
+
/** Outgoing control from the previous anchor. */
|
|
465
|
+
readonly control1: ContourPoint;
|
|
466
|
+
/** Incoming control at the next anchor. */
|
|
467
|
+
readonly control2: ContourPoint;
|
|
468
|
+
/** Next anchor; the final anchor repeats the curve start. */
|
|
469
|
+
readonly end: ContourPoint;
|
|
470
|
+
};
|
|
471
|
+
|
|
439
472
|
/** One sampled component retaining contour identities and logical point correspondence. */
|
|
440
473
|
export declare interface CorrespondingComponent {
|
|
441
474
|
/** Stable canonical lowercase identity; unique within the containing topology or output. */
|
|
@@ -1193,7 +1226,19 @@ export declare interface ArcCurve3 {
|
|
|
1193
1226
|
readonly end: Vec3;
|
|
1194
1227
|
}
|
|
1195
1228
|
|
|
1196
|
-
/**
|
|
1229
|
+
/**
|
|
1230
|
+
* Associates ordered loft contours without inferring component identities or repairing topology.
|
|
1231
|
+
*
|
|
1232
|
+
* - `direct` preserves seams and subdivides edges to a common count without dropping vertices.
|
|
1233
|
+
* - `reindex` applies direct subdivision, then selects the next contour's cyclic phase with the
|
|
1234
|
+
* least total world-space connection length.
|
|
1235
|
+
* - `fast-distance` preserves supplied seams and minimizes connection length over ordered closed
|
|
1236
|
+
* vertex associations, repeating vertices for triangular fans.
|
|
1237
|
+
* - `distance` runs the same ordered optimization over every cyclic phase of the next contour.
|
|
1238
|
+
*
|
|
1239
|
+
* Components and holes are paired by their existing order. Use identified profiles when semantic
|
|
1240
|
+
* correspondence must remain authoritative.
|
|
1241
|
+
*/
|
|
1197
1242
|
export declare type LoftCorrespondence = "direct" | "reindex" | "fast-distance" | "distance";
|
|
1198
1243
|
|
|
1199
1244
|
/**
|
|
@@ -1442,39 +1487,6 @@ export declare interface ArcCurve3 {
|
|
|
1442
1487
|
*/
|
|
1443
1488
|
export declare function normalizeRegion2(region: Region2, tolerance?: GeometryToleranceOptions): Region2;
|
|
1444
1489
|
|
|
1445
|
-
/** An open radius/height outline; consumers own closure, mounting geometry, and wall policy. */
|
|
1446
|
-
export declare interface OpenProfileCurve {
|
|
1447
|
-
/** Initial radius/height anchor. */
|
|
1448
|
-
readonly start: OpenProfilePoint;
|
|
1449
|
-
/** Ordered chain of 1–31 straight or cubic segments. */
|
|
1450
|
-
readonly segments: readonly OpenProfileSegment[];
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
/** Radius and upward height in millimetres, or in units converted by sampling scales. */
|
|
1454
|
-
export declare interface OpenProfilePoint {
|
|
1455
|
-
/** Nonnegative distance from the revolution axis. */
|
|
1456
|
-
readonly radius: number;
|
|
1457
|
-
/** Upward axial coordinate; anchors progress strictly upward. */
|
|
1458
|
-
readonly height: number;
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
/** One straight or cubic segment of an open, upward-progressing radius/height outline. */
|
|
1462
|
-
export declare type OpenProfileSegment = {
|
|
1463
|
-
/** Straight segment discriminator. */
|
|
1464
|
-
readonly type: "line";
|
|
1465
|
-
/** Next strictly higher anchor. */
|
|
1466
|
-
readonly end: OpenProfilePoint;
|
|
1467
|
-
} | {
|
|
1468
|
-
/** Cubic Bézier segment discriminator. */
|
|
1469
|
-
readonly type: "cubic";
|
|
1470
|
-
/** Outgoing control, with height between the start and second control. */
|
|
1471
|
-
readonly control1: OpenProfilePoint;
|
|
1472
|
-
/** Incoming control, with height between the first control and end. */
|
|
1473
|
-
readonly control2: OpenProfilePoint;
|
|
1474
|
-
/** Next strictly higher anchor. */
|
|
1475
|
-
readonly end: OpenProfilePoint;
|
|
1476
|
-
};
|
|
1477
|
-
|
|
1478
1490
|
/**
|
|
1479
1491
|
* Improves pathological planar triangulation with bounded legal diagonal flips.
|
|
1480
1492
|
*
|
|
@@ -2195,1027 +2207,1101 @@ export declare interface ArcCurve3 {
|
|
|
2195
2207
|
readonly radius: number;
|
|
2196
2208
|
}
|
|
2197
2209
|
|
|
2198
|
-
/** Samples a planar curve with the same guarantees and policy as spatial sampling.
|
|
2199
|
-
* @remarks Private spatial scratch math is shared, while only final planar vectors are copied and
|
|
2200
|
-
* frozen. At stationary tangents, outgoing secants are preferred and endpoints use a backward fallback.
|
|
2201
|
-
* @example
|
|
2202
|
-
* ```ts
|
|
2203
|
-
* const turn = sampleCurve2({kind: "arc", center: [0,0], radius: 10, sweepDegrees: 90});
|
|
2204
|
-
* ```
|
|
2205
|
-
*/
|
|
2206
|
-
export declare function sampleCurve2(curve: Curve2, options?: CurveSamplingOptions): SampledCurve2;
|
|
2207
|
-
|
|
2208
|
-
/**
|
|
2209
|
-
* Samples a spatial curve, preserving endpoints and directed unit tangents.
|
|
2210
|
-
* @remarks Exact counts use uniform curve parameters, not equal physical distances. Adaptive cubics
|
|
2211
|
-
* bound the full control hull. Full-circle arcs repeat their endpoint; closed polylines do not.
|
|
2212
|
-
* @example
|
|
2213
|
-
* ```ts
|
|
2214
|
-
* const path = sampleCurve3({kind: "cubic", start: [0,0,0], control1: [5,0,0], control2: [5,5,5], end: [10,5,5]});
|
|
2215
|
-
* ```
|
|
2216
|
-
*/
|
|
2217
|
-
export declare function sampleCurve3(curve: Curve3, options?: CurveSamplingOptions): SampledCurve3;
|
|
2218
|
-
|
|
2219
|
-
/**
|
|
2220
|
-
* Samples a complete external involute gear boundary in the XY plane.
|
|
2221
|
-
*
|
|
2222
|
-
* The returned loop is counter-clockwise, closed implicitly without a repeated
|
|
2223
|
-
* seam point, and contains no holes. Its center is the origin and its axis is
|
|
2224
|
-
* +Z. Bore, hub, keyway, twist, and face-width choices remain generator-owned.
|
|
2225
|
-
*/
|
|
2226
|
-
export declare function sampleCylindricalGearOutline(spec: CylindricalGearSpec, options?: CylindricalGearOutlineOptions): Loop2;
|
|
2227
|
-
|
|
2228
|
-
/** Immutable planar points and corresponding directed unit tangents. */
|
|
2229
|
-
export declare interface SampledCurve2 {
|
|
2230
|
-
/** Curves retain both endpoints, including full-circle seams; closed resampling omits its seam. */
|
|
2231
|
-
readonly points: readonly Vec2[];
|
|
2232
|
-
/** Directed unit vectors; stationary derivatives use the nearest usable direction. */
|
|
2233
|
-
readonly tangents: readonly Vec2[];
|
|
2234
|
-
}
|
|
2235
|
-
|
|
2236
|
-
/**
|
|
2237
|
-
* Immutable spatial points and corresponding directed unit tangents.
|
|
2238
|
-
*/
|
|
2239
|
-
export declare interface SampledCurve3 {
|
|
2240
|
-
/** Curves retain both endpoints, including full-circle seams; closed resampling omits its seam. */
|
|
2241
|
-
readonly points: readonly Vec3[];
|
|
2242
|
-
/** Directed unit vectors; stationary derivatives use the nearest usable direction. */
|
|
2243
|
-
readonly tangents: readonly Vec3[];
|
|
2244
|
-
}
|
|
2245
|
-
|
|
2246
|
-
/** Sampled paths plus conventional pitch and lead measurements. */
|
|
2247
|
-
export declare interface SampledThreadHelices {
|
|
2248
|
-
/** Axial advance over one revolution, equal to `pitch * starts`. */
|
|
2249
|
-
readonly lead: number;
|
|
2250
|
-
/** One immutable sampled path for each thread start. */
|
|
2251
|
-
readonly paths: readonly Path3[];
|
|
2252
|
-
/** Adjacent axial thread spacing in millimetres. */
|
|
2253
|
-
readonly pitch: number;
|
|
2254
|
-
/** Number of revolutions represented by each path. */
|
|
2255
|
-
readonly turns: number;
|
|
2256
|
-
}
|
|
2257
|
-
|
|
2258
|
-
/**
|
|
2259
|
-
* Creates `segments + 1` points including exact helix endpoints from finite positive dimensions.
|
|
2260
|
-
* Integrated weights must remain finite. The maxPathPoints ceiling defaults to 100000; excessive
|
|
2261
|
-
* exact counts reject before evaluating axial weights or allocating sample arrays.
|
|
2262
|
-
*/
|
|
2263
|
-
export declare const sampleHelix: ({ turns, radius, height, segments, limits, axialWeight, }: SampleHelixOptions) => readonly Vec3[];
|
|
2264
|
-
|
|
2265
|
-
/** Options for a sampled +Z helix with millimetre dimensions. */
|
|
2266
|
-
export declare interface SampleHelixOptions {
|
|
2267
|
-
/** Number of complete rotations around +Z. */
|
|
2268
|
-
readonly turns: number;
|
|
2269
|
-
/** Explicit output allocation ceilings. */
|
|
2270
|
-
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2271
|
-
/** Constant radial distance from the +Z axis. */
|
|
2272
|
-
readonly radius: number;
|
|
2273
|
-
/** Total axial advance from the first point to the last. */
|
|
2274
|
-
readonly height: number;
|
|
2275
|
-
/** Number of sampled line segments; the result contains one additional endpoint. */
|
|
2276
|
-
readonly segments: number;
|
|
2277
|
-
/**
|
|
2278
|
-
* Relative axial advance at a normalized turn position. Values are integrated
|
|
2279
|
-
* and normalized, so the final endpoint is always exactly `height`.
|
|
2280
|
-
*/
|
|
2281
|
-
readonly axialWeight?: (t: number) => number;
|
|
2282
|
-
}
|
|
2283
|
-
|
|
2284
2210
|
/**
|
|
2285
|
-
* Samples
|
|
2211
|
+
* Samples 2–32 connected line/cubic segments into a simple, nonzero-area, immutable CCW XY loop.
|
|
2212
|
+
* Physical scaling precedes adaptive curve sampling; the final end must repeat start exactly.
|
|
2213
|
+
* Shared anchors and the closing seam are emitted once. Winding normalization may change the
|
|
2214
|
+
* starting vertex. The sampled loop is checked for self-intersection and degeneracy by
|
|
2215
|
+
* `normalizeLoop2`; this is a single contour without holes. No editor modes or normalized
|
|
2216
|
+
* coordinate range are required. No native engine, SDK, or ambient resolution is used.
|
|
2286
2217
|
*
|
|
2287
|
-
*
|
|
2288
|
-
*
|
|
2289
|
-
*
|
|
2290
|
-
*
|
|
2291
|
-
*/
|
|
2292
|
-
export declare function sampleInternalCylindricalGearSpaceOutline(spec: CylindricalGearSpec, options?: CylindricalGearOutlineOptions): Loop2;
|
|
2293
|
-
|
|
2294
|
-
/**
|
|
2295
|
-
* Samples 1–31 line/cubic segments into a deeply immutable open [radius,height] polyline.
|
|
2296
|
-
* Anchors must progress strictly upward; nonnegative-radius cubic controls must have ordered
|
|
2297
|
-
* heights between their endpoints. Cubics use de Casteljau subdivision with a conservative
|
|
2298
|
-
* control-hull chord-error bound. Lines also obey the optional physical edge-length ceiling.
|
|
2299
|
-
* Neither normalized coordinates nor editor metadata are required. Endpoints are retained once;
|
|
2300
|
-
* no axis closure, winding normalization, or manufacturing repair is performed.
|
|
2301
|
-
*
|
|
2302
|
-
* @param curve - Open outline in millimetres unless the positive scales convert its coordinates.
|
|
2303
|
-
* @param options - Physical resolution and output budget; defaults to 4096 vertices.
|
|
2304
|
-
* @returns Frozen open polyline in millimetres, ordered from lowest to highest anchor.
|
|
2305
|
-
* @throws {@link GeometryError} for invalid coordinates, order, scale, or exceeded subdivision budget.
|
|
2218
|
+
* @param curve - Closed contour in millimetres unless positive scales convert its coordinates.
|
|
2219
|
+
* @param options - Physical resolution and unique vertex budget; defaults to 4096 vertices.
|
|
2220
|
+
* @returns Frozen counterclockwise loop in millimetres, without a repeated seam endpoint.
|
|
2221
|
+
* @throws {@link GeometryError} for invalid data, topology, scale, or exceeded sampling budgets.
|
|
2306
2222
|
*
|
|
2307
2223
|
* @example
|
|
2308
2224
|
* ```ts
|
|
2309
|
-
* const
|
|
2310
|
-
* start: {
|
|
2311
|
-
* segments: [
|
|
2312
|
-
*
|
|
2225
|
+
* const section = sampleContour({
|
|
2226
|
+
* start: { x: 0, y: 0 },
|
|
2227
|
+
* segments: [
|
|
2228
|
+
* { type: "line", end: { x: 1, y: 0 } },
|
|
2229
|
+
* { type: "line", end: { x: 0.5, y: 1 } },
|
|
2230
|
+
* { type: "line", end: { x: 0, y: 0 } },
|
|
2231
|
+
* ],
|
|
2232
|
+
* }, { widthScale: 20, heightScale: 12 });
|
|
2313
2233
|
* ```
|
|
2314
2234
|
*/
|
|
2315
|
-
export declare function
|
|
2235
|
+
export declare function sampleContour(curve: ContourCurve, options?: SampleContourOptions): Loop2;
|
|
2316
2236
|
|
|
2317
|
-
/** Physical scaling and
|
|
2318
|
-
export declare interface
|
|
2319
|
-
/** Positive
|
|
2320
|
-
readonly
|
|
2321
|
-
/** Positive
|
|
2237
|
+
/** Physical scaling, subdivision policy, and output ceilings for one closed contour. */
|
|
2238
|
+
export declare interface SampleContourOptions {
|
|
2239
|
+
/** Positive horizontal scale; normalized inputs span this width envelope. Defaults to 1. */
|
|
2240
|
+
readonly widthScale?: number;
|
|
2241
|
+
/** Positive vertical scale; normalized inputs span this height envelope. Defaults to 1. */
|
|
2322
2242
|
readonly heightScale?: number;
|
|
2323
|
-
/**
|
|
2243
|
+
/** Physical policy evaluated after scaling, using the shared curve sampler. */
|
|
2324
2244
|
readonly resolution?: GeometryResolution;
|
|
2325
|
-
/**
|
|
2245
|
+
/** Unique output vertex ceiling, at least three, within maxProfilePoints. Defaults to min(4096, maxProfilePoints). */
|
|
2326
2246
|
readonly maximumVertices?: number;
|
|
2327
|
-
/**
|
|
2247
|
+
/** Selected profile and per-segment path ceilings; omitted values use package defaults. */
|
|
2328
2248
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2329
2249
|
}
|
|
2330
2250
|
|
|
2331
|
-
/**
|
|
2332
|
-
*
|
|
2333
|
-
*
|
|
2334
|
-
*
|
|
2335
|
-
*
|
|
2336
|
-
*
|
|
2337
|
-
*
|
|
2338
|
-
*/
|
|
2339
|
-
export declare function sampleRackToothPath(spec: RackPitchSpec, limits?: Partial<GeometrySamplingLimits>): Path2;
|
|
2340
|
-
|
|
2341
|
-
/**
|
|
2342
|
-
* Samples a prepared text layout without shaping text again or loading a font.
|
|
2343
|
-
*
|
|
2344
|
-
* @param layout - Immutable millimetre paths and measurements retained from text preparation.
|
|
2345
|
-
* @param resolution - Explicit curve sampling policy; omitted uses the pure default policy.
|
|
2346
|
-
* @param limits - Explicit profile and circular allocation ceilings.
|
|
2347
|
-
* @returns Frozen contours with original glyph winding and no repeated closing vertex.
|
|
2348
|
-
* @throws GeometryError for empty outlines, invalid paths or policies, over 1000 paths or selected sampling ceilings.
|
|
2349
|
-
*/
|
|
2350
|
-
export declare function sampleTextContours(layout: VectorTextLayout, resolution?: GeometryResolution, limits?: Partial<GeometrySamplingLimits>): readonly Loop2[];
|
|
2351
|
-
|
|
2352
|
-
/**
|
|
2353
|
-
* Samples evenly phased thread helices with finite `lead = pitch * starts`.
|
|
2354
|
-
* All starts together respect maxPathPoints (default 100000); excessive counts fail before allocation.
|
|
2251
|
+
/** Samples a planar curve with the same guarantees and policy as spatial sampling.
|
|
2252
|
+
* @remarks Private spatial scratch math is shared, while only final planar vectors are copied and
|
|
2253
|
+
* frozen. At stationary tangents, outgoing secants are preferred and endpoints use a backward fallback.
|
|
2254
|
+
* @example
|
|
2255
|
+
* ```ts
|
|
2256
|
+
* const turn = sampleCurve2({kind: "arc", center: [0,0], radius: 10, sweepDegrees: 90});
|
|
2257
|
+
* ```
|
|
2355
2258
|
*/
|
|
2356
|
-
export declare function
|
|
2259
|
+
export declare function sampleCurve2(curve: Curve2, options?: CurveSamplingOptions): SampledCurve2;
|
|
2357
2260
|
|
|
2358
2261
|
/**
|
|
2359
|
-
*
|
|
2262
|
+
* Samples a spatial curve, preserving endpoints and directed unit tangents.
|
|
2263
|
+
* @remarks Exact counts use uniform curve parameters, not equal physical distances. Adaptive cubics
|
|
2264
|
+
* bound the full control hull. Full-circle arcs repeat their endpoint; closed polylines do not.
|
|
2360
2265
|
* @example
|
|
2361
2266
|
* ```ts
|
|
2362
|
-
*
|
|
2267
|
+
* const path = sampleCurve3({kind: "cubic", start: [0,0,0], control1: [5,0,0], control2: [5,5,5], end: [10,5,5]});
|
|
2363
2268
|
* ```
|
|
2364
2269
|
*/
|
|
2365
|
-
export declare
|
|
2270
|
+
export declare function sampleCurve3(curve: Curve3, options?: CurveSamplingOptions): SampledCurve3;
|
|
2366
2271
|
|
|
2367
2272
|
/**
|
|
2368
|
-
*
|
|
2369
|
-
*
|
|
2370
|
-
* Negative components are reflections. Zero components are rejected because
|
|
2371
|
-
* they collapse volume and cannot be inverted.
|
|
2273
|
+
* Samples a complete external involute gear boundary in the XY plane.
|
|
2372
2274
|
*
|
|
2373
|
-
*
|
|
2374
|
-
*
|
|
2275
|
+
* The returned loop is counter-clockwise, closed implicitly without a repeated
|
|
2276
|
+
* seam point, and contains no holes. Its center is the origin and its axis is
|
|
2277
|
+
* +Z. Bore, hub, keyway, twist, and face-width choices remain generator-owned.
|
|
2375
2278
|
*/
|
|
2376
|
-
export declare function
|
|
2377
|
-
|
|
2378
|
-
/** Returns the signed area of a non-duplicated loop; positive means CCW. */
|
|
2379
|
-
export declare function signedAreaLoop2(loop: Loop2): number;
|
|
2380
|
-
|
|
2381
|
-
/** A cubic corner transition with zero curvature at its straight tangent joins. */
|
|
2382
|
-
export declare interface SmoothEdgeTreatment {
|
|
2383
|
-
/** Selects continuous-curvature cubic rounding, rather than a circular radius. */
|
|
2384
|
-
readonly kind: "smooth";
|
|
2385
|
-
/** Positive tangent setbacks, equal or [first, second], in millimetres. */
|
|
2386
|
-
readonly distance: number | readonly [first: number, second: number];
|
|
2387
|
-
/** Exact cubic interval count, positive; overrides physical sampling. */
|
|
2388
|
-
readonly segments?: number;
|
|
2389
|
-
/** Physical chord/edge-length sampling; circularSegments does not describe a cubic. */
|
|
2390
|
-
readonly resolution?: GeometryResolution;
|
|
2391
|
-
/** Explicit sampling ceilings, bounded by the host policy. */
|
|
2392
|
-
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2393
|
-
}
|
|
2279
|
+
export declare function sampleCylindricalGearOutline(spec: CylindricalGearSpec, options?: CylindricalGearOutlineOptions): Loop2;
|
|
2394
2280
|
|
|
2395
|
-
/**
|
|
2396
|
-
export declare interface
|
|
2397
|
-
/**
|
|
2398
|
-
readonly
|
|
2399
|
-
/**
|
|
2400
|
-
readonly
|
|
2281
|
+
/** Immutable planar points and corresponding directed unit tangents. */
|
|
2282
|
+
export declare interface SampledCurve2 {
|
|
2283
|
+
/** Curves retain both endpoints, including full-circle seams; closed resampling omits its seam. */
|
|
2284
|
+
readonly points: readonly Vec2[];
|
|
2285
|
+
/** Directed unit vectors; stationary derivatives use the nearest usable direction. */
|
|
2286
|
+
readonly tangents: readonly Vec2[];
|
|
2401
2287
|
}
|
|
2402
2288
|
|
|
2403
2289
|
/**
|
|
2404
|
-
*
|
|
2290
|
+
* Immutable spatial points and corresponding directed unit tangents.
|
|
2405
2291
|
*/
|
|
2406
|
-
export declare
|
|
2407
|
-
/**
|
|
2408
|
-
readonly
|
|
2409
|
-
/**
|
|
2410
|
-
readonly
|
|
2411
|
-
} | {
|
|
2412
|
-
/** Positive full diameter in millimetres; mutually exclusive with radius. */
|
|
2413
|
-
readonly diameter: number;
|
|
2414
|
-
/** Radius is unavailable when diameter is supplied. */
|
|
2415
|
-
readonly radius?: never;
|
|
2416
|
-
});
|
|
2417
|
-
|
|
2418
|
-
/** Square profile with equal crest and root widths. */
|
|
2419
|
-
export declare interface SquareThreadProfileSpec extends ThreadProfileBaseSpec {
|
|
2420
|
-
/** Selects the square profile family. */
|
|
2421
|
-
readonly kind: "square";
|
|
2422
|
-
/**
|
|
2423
|
-
* Radial depth in millimetres.
|
|
2424
|
-
* @defaultValue `pitch / 2`
|
|
2425
|
-
*/
|
|
2426
|
-
readonly depth?: number;
|
|
2292
|
+
export declare interface SampledCurve3 {
|
|
2293
|
+
/** Curves retain both endpoints, including full-circle seams; closed resampling omits its seam. */
|
|
2294
|
+
readonly points: readonly Vec3[];
|
|
2295
|
+
/** Directed unit vectors; stationary derivatives use the nearest usable direction. */
|
|
2296
|
+
readonly tangents: readonly Vec3[];
|
|
2427
2297
|
}
|
|
2428
2298
|
|
|
2429
|
-
/**
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
/** End-cap treatment for an open stroked path. */
|
|
2440
|
-
export declare type StrokePathCap = "butt" | "round" | "square";
|
|
2441
|
-
|
|
2442
|
-
/** Join treatment where adjacent stroked path segments meet. */
|
|
2443
|
-
export declare type StrokePathJoin = "bevel" | "miter" | "round";
|
|
2444
|
-
|
|
2445
|
-
/**
|
|
2446
|
-
* Converts a sampled millimetre path into the filled region covered by a centered stroke.
|
|
2447
|
-
*
|
|
2448
|
-
* Closed paths omit a duplicated seam point. Zero-length sampled segments are ignored, while the
|
|
2449
|
-
* effective path must still contain visible length. Round caps and joins use deterministic physical
|
|
2450
|
-
* resolution. Bevels fill the outer corner triangle; miters extend the outer edges to their
|
|
2451
|
-
* intersection, falling back to bevels above SVG's default miter limit of 4.
|
|
2452
|
-
*/
|
|
2453
|
-
export declare function strokePathRegion(path: Path2, options: StrokePathRegionOptions): Region2;
|
|
2454
|
-
|
|
2455
|
-
/** Physical stroke and topology controls for {@link strokePathRegion}. */
|
|
2456
|
-
export declare interface StrokePathRegionOptions {
|
|
2457
|
-
/** Explicit path, circular and expanded-profile allocation ceilings. */
|
|
2458
|
-
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2459
|
-
/** Treat the path as a closed non-duplicated loop. Default: `false`. */
|
|
2460
|
-
readonly closed?: boolean;
|
|
2461
|
-
/** End-cap treatment for an open path. Ignored for closed paths. Default: `butt`. */
|
|
2462
|
-
readonly cap?: StrokePathCap;
|
|
2463
|
-
/** Corner treatment; miters exceeding SVG's default limit of 4 become bevels. Default: `miter`. */
|
|
2464
|
-
readonly join?: StrokePathJoin;
|
|
2465
|
-
/** Physical tessellation policy for round caps and joins. */
|
|
2466
|
-
readonly resolution?: GeometryResolution;
|
|
2467
|
-
/** Positive total stroke width in millimetres, centered on the sampled path. */
|
|
2468
|
-
readonly width: number;
|
|
2299
|
+
/** Sampled paths plus conventional pitch and lead measurements. */
|
|
2300
|
+
export declare interface SampledThreadHelices {
|
|
2301
|
+
/** Axial advance over one revolution, equal to `pitch * starts`. */
|
|
2302
|
+
readonly lead: number;
|
|
2303
|
+
/** One immutable sampled path for each thread start. */
|
|
2304
|
+
readonly paths: readonly Path3[];
|
|
2305
|
+
/** Adjacent axial thread spacing in millimetres. */
|
|
2306
|
+
readonly pitch: number;
|
|
2307
|
+
/** Number of revolutions represented by each path. */
|
|
2308
|
+
readonly turns: number;
|
|
2469
2309
|
}
|
|
2470
2310
|
|
|
2471
2311
|
/**
|
|
2472
|
-
*
|
|
2473
|
-
*
|
|
2474
|
-
*
|
|
2475
|
-
* subtract3([4, 5, 6], [1, 2, 3]); // [3, 3, 3]
|
|
2476
|
-
* ```
|
|
2312
|
+
* Creates `segments + 1` points including exact helix endpoints from finite positive dimensions.
|
|
2313
|
+
* Integrated weights must remain finite. The maxPathPoints ceiling defaults to 100000; excessive
|
|
2314
|
+
* exact counts reject before evaluating axial weights or allocating sample arrays.
|
|
2477
2315
|
*/
|
|
2478
|
-
export declare const
|
|
2316
|
+
export declare const sampleHelix: ({ turns, radius, height, segments, limits, axialWeight, }: SampleHelixOptions) => readonly Vec3[];
|
|
2479
2317
|
|
|
2480
|
-
/**
|
|
2481
|
-
export declare interface
|
|
2482
|
-
/**
|
|
2318
|
+
/** Options for a sampled +Z helix with millimetre dimensions. */
|
|
2319
|
+
export declare interface SampleHelixOptions {
|
|
2320
|
+
/** Number of complete rotations around +Z. */
|
|
2321
|
+
readonly turns: number;
|
|
2322
|
+
/** Explicit output allocation ceilings. */
|
|
2483
2323
|
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2484
|
-
/**
|
|
2485
|
-
readonly
|
|
2486
|
-
/**
|
|
2487
|
-
readonly
|
|
2324
|
+
/** Constant radial distance from the +Z axis. */
|
|
2325
|
+
readonly radius: number;
|
|
2326
|
+
/** Total axial advance from the first point to the last. */
|
|
2327
|
+
readonly height: number;
|
|
2328
|
+
/** Number of sampled line segments; the result contains one additional endpoint. */
|
|
2329
|
+
readonly segments: number;
|
|
2488
2330
|
/**
|
|
2489
|
-
*
|
|
2490
|
-
*
|
|
2331
|
+
* Relative axial advance at a normalized turn position. Values are integrated
|
|
2332
|
+
* and normalized, so the final endpoint is always exactly `height`.
|
|
2491
2333
|
*/
|
|
2492
|
-
readonly
|
|
2493
|
-
}
|
|
2494
|
-
|
|
2495
|
-
/** Exact normalized SVG region plus bounded source, geometry, and safe-repair diagnostics. */
|
|
2496
|
-
export declare interface SvgRegionPreflight {
|
|
2497
|
-
/** Physical and final-topology measurements of `region`. */
|
|
2498
|
-
readonly geometry: SvgRegionPreflightGeometryMetrics;
|
|
2499
|
-
/** Appearance-preserving cleanup observed during parsing and normalization. */
|
|
2500
|
-
readonly repairs: SvgRegionPreflightRepairs;
|
|
2501
|
-
/** Canonical millimetre, Y-up geometry. */
|
|
2502
|
-
readonly region: Region2;
|
|
2503
|
-
/** Bounded source and flattening complexity measurements. */
|
|
2504
|
-
readonly source: SvgRegionPreflightSourceMetrics;
|
|
2505
|
-
}
|
|
2506
|
-
|
|
2507
|
-
/** Physical and final-topology facts for a normalized imported SVG region. */
|
|
2508
|
-
export declare interface SvgRegionPreflightGeometryMetrics {
|
|
2509
|
-
/** Filled area in square millimetres. */
|
|
2510
|
-
readonly area: number;
|
|
2511
|
-
/** Millimetre bounds, or `null` when no painted region remains. */
|
|
2512
|
-
readonly bounds: Bounds2 | null;
|
|
2513
|
-
/** Disconnected filled polygons in the final region. */
|
|
2514
|
-
readonly components: number;
|
|
2515
|
-
/** Exterior and hole boundary count in the final region. */
|
|
2516
|
-
readonly contours: number;
|
|
2517
|
-
/** Interior boundary count in the final region. */
|
|
2518
|
-
readonly holes: number;
|
|
2519
|
-
/** Shortest final boundary edge in millimetres, or `null` for an empty region. */
|
|
2520
|
-
readonly minEdgeLength: number | null;
|
|
2521
|
-
/** Final boundary edges shorter than the conservative 0.01 mm indicator. */
|
|
2522
|
-
readonly shortEdges: number;
|
|
2523
|
-
/** Components with less than 0.01 square millimetres of filled area. */
|
|
2524
|
-
readonly tinyIslands: number;
|
|
2525
|
-
/** Non-duplicated boundary vertices in the final normalized region. */
|
|
2526
|
-
readonly vertices: number;
|
|
2527
|
-
}
|
|
2528
|
-
|
|
2529
|
-
/** Visible, appearance-preserving cleanup counters from bounded SVG import. */
|
|
2530
|
-
export declare interface SvgRegionPreflightRepairs {
|
|
2531
|
-
/** Graphics elements with neither a visible fill nor a positive-width visible stroke. */
|
|
2532
|
-
readonly invisibleElements: number;
|
|
2533
|
-
/** Open filled subpaths closed by SVG fill semantics without closing their strokes. */
|
|
2534
|
-
readonly implicitFilledClosures: number;
|
|
2535
|
-
/** Visibly painted elements whose fill and stroke both resolved to empty geometry. */
|
|
2536
|
-
readonly emptyElements: number;
|
|
2537
|
-
/** Consecutive repeated flattened vertices discarded before topology resolution. */
|
|
2538
|
-
readonly removedDuplicateVertices: number;
|
|
2539
|
-
/** Explicit repeated seam vertices removed from otherwise closed contours. */
|
|
2540
|
-
readonly removedSeamVertices: number;
|
|
2541
|
-
}
|
|
2542
|
-
|
|
2543
|
-
/** Bounded source-complexity facts collected while parsing one SVG document. */
|
|
2544
|
-
export declare interface SvgRegionPreflightSourceMetrics {
|
|
2545
|
-
/** UTF-8 source size, capped at 256 KiB before parsing. */
|
|
2546
|
-
readonly bytes: number;
|
|
2547
|
-
/** Renderable shape elements, capped at 500; containers and metadata are excluded. */
|
|
2548
|
-
readonly elements: number;
|
|
2549
|
-
/** Flattened vertices emitted before fill, stroke, and clipping operations. */
|
|
2550
|
-
readonly emittedVertices: number;
|
|
2551
|
-
/** Path endpoints and control vertices parsed before adaptive flattening. */
|
|
2552
|
-
readonly parsedVertices: number;
|
|
2334
|
+
readonly axialWeight?: (t: number) => number;
|
|
2553
2335
|
}
|
|
2554
2336
|
|
|
2555
2337
|
/**
|
|
2556
|
-
*
|
|
2338
|
+
* Samples the center opening and tooth spaces used to subtract an internal ring gear.
|
|
2557
2339
|
*
|
|
2558
|
-
*
|
|
2559
|
-
*
|
|
2560
|
-
*
|
|
2561
|
-
*
|
|
2562
|
-
* orientation: { kind: "transport", initialNormal: [0, 1, 0] },
|
|
2563
|
-
* });
|
|
2564
|
-
* ```
|
|
2340
|
+
* Internal tooth tips lie one addendum below the pitch radius and their roots lie one
|
|
2341
|
+
* dedendum above it. At the pitch circle, positive backlash widens each sampled space
|
|
2342
|
+
* tangentially. The returned CCW loop encloses the center and is intended to be reversed
|
|
2343
|
+
* when used as a region hole.
|
|
2565
2344
|
*/
|
|
2566
|
-
export declare function
|
|
2345
|
+
export declare function sampleInternalCylindricalGearSpaceOutline(spec: CylindricalGearSpec, options?: CylindricalGearOutlineOptions): Loop2;
|
|
2567
2346
|
|
|
2568
2347
|
/**
|
|
2569
|
-
*
|
|
2348
|
+
* Samples the open top boundary of a finite rack in its XY pitch plane.
|
|
2349
|
+
*
|
|
2350
|
+
* X follows rack travel, Y is tooth height, and the pitch line is `Y = 0`.
|
|
2351
|
+
* The path begins and ends on the root line, omits duplicate adjacent points,
|
|
2352
|
+
* and leaves base thickness, mounting features, extrusion, and helical sweep to
|
|
2353
|
+
* the owning generator.
|
|
2570
2354
|
*/
|
|
2571
|
-
export declare
|
|
2572
|
-
/** Join the path's last station to its first. Open paths retain watertight end caps. */
|
|
2573
|
-
readonly closed?: boolean;
|
|
2574
|
-
/** Explicit output and sampling allocation ceilings. */
|
|
2575
|
-
readonly limits?: Partial<ModelingLimits>;
|
|
2576
|
-
/** Explicit frame policy; default transport minimizes rotations, initially projecting +X then +Y then +Z. */
|
|
2577
|
-
readonly orientation?: SweepOrientation;
|
|
2578
|
-
/** Physical sampling of nonzero twist; inserted stations retain authored station controls. */
|
|
2579
|
-
readonly resolution?: GeometryResolution;
|
|
2580
|
-
/** Total additional profile rotation in degrees, with progression selected by twistBy. */
|
|
2581
|
-
readonly twistDegrees?: number;
|
|
2582
|
-
/** Twist advances by physical path length (default), or normalized authored station position, including a closed seam gap. */
|
|
2583
|
-
readonly twistBy?: "length" | "stations";
|
|
2584
|
-
/** Positive uniform/XY scale, or one XY pair per path station. Defaults to one. */
|
|
2585
|
-
readonly scale?: number | Vec2 | readonly Vec2[];
|
|
2586
|
-
/** Corresponding point-index advance at a rotationally equivalent closed seam. */
|
|
2587
|
-
readonly seamProfileOffset?: number;
|
|
2588
|
-
}
|
|
2355
|
+
export declare function sampleRackToothPath(spec: RackPitchSpec, limits?: Partial<GeometrySamplingLimits>): Path2;
|
|
2589
2356
|
|
|
2590
2357
|
/**
|
|
2591
|
-
*
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
readonly kind: "frenet";
|
|
2611
|
-
};
|
|
2612
|
-
|
|
2613
|
-
/** End bevel controls shared by threaded rods and cutters. */
|
|
2614
|
-
export declare interface ThreadBevelOptions {
|
|
2615
|
-
/** Apply a 45-degree bevel at Z=0. */
|
|
2616
|
-
readonly bevelBottom?: boolean;
|
|
2617
|
-
/**
|
|
2618
|
-
* Axial bevel extent in millimetres. Active blunt ends default to one sixth of the compensated
|
|
2619
|
-
* male minor radius or female major radius; other ends default to the profile depth.
|
|
2620
|
-
*/
|
|
2621
|
-
readonly bevelSize?: number;
|
|
2622
|
-
/** Apply a 45-degree bevel at Z=length. */
|
|
2623
|
-
readonly bevelTop?: boolean;
|
|
2624
|
-
}
|
|
2625
|
-
|
|
2626
|
-
/** Inputs for resolving one shared circular facet count for a mating thread pair. */
|
|
2627
|
-
export declare interface ThreadCircularSegmentsOptions {
|
|
2628
|
-
/** Explicit circular allocation ceiling for the shared mating grid. */
|
|
2629
|
-
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2630
|
-
/** Printable fit whose larger compensated female envelope governs tessellation. */
|
|
2631
|
-
readonly fit?: PrintableThreadFit | PrintableThreadFitPolicy;
|
|
2632
|
-
/** Nominal major diameter before role-specific compensation. */
|
|
2633
|
-
readonly nominalMajorDiameter: number;
|
|
2634
|
-
/**
|
|
2635
|
-
* Maximum active female face outset beyond the compensated major envelope, in millimetres.
|
|
2636
|
-
* This keeps a compensated male/female pair on one role-independent grid when an internal
|
|
2637
|
-
* cutter has an enlarged entrance bevel. Default: `0`.
|
|
2358
|
+
* Samples 1–31 line/cubic segments into a deeply immutable open [radius,height] polyline.
|
|
2359
|
+
* Anchors must progress strictly upward; nonnegative-radius cubic controls must have ordered
|
|
2360
|
+
* heights between their endpoints. Cubics use de Casteljau subdivision with a conservative
|
|
2361
|
+
* control-hull chord-error bound. Lines also obey the optional physical edge-length ceiling.
|
|
2362
|
+
* Neither normalized coordinates nor editor metadata are required. Endpoints are retained once;
|
|
2363
|
+
* no axis closure, winding normalization, or manufacturing repair is performed.
|
|
2364
|
+
*
|
|
2365
|
+
* @param curve - Open outline in millimetres unless the positive scales convert its coordinates.
|
|
2366
|
+
* @param options - Physical resolution and output budget; defaults to 4096 vertices.
|
|
2367
|
+
* @returns Frozen open polyline in millimetres, ordered from lowest to highest anchor.
|
|
2368
|
+
* @throws {@link GeometryError} for invalid coordinates, order, scale, or exceeded subdivision budget.
|
|
2369
|
+
*
|
|
2370
|
+
* @example
|
|
2371
|
+
* ```ts
|
|
2372
|
+
* const side = sampleSideProfile({
|
|
2373
|
+
* start: { radius: 0.5, height: 0 },
|
|
2374
|
+
* segments: [{ type: "line", end: { radius: 1, height: 1 } }],
|
|
2375
|
+
* }, { radiusScale: 12, heightScale: 30 });
|
|
2376
|
+
* ```
|
|
2638
2377
|
*/
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
/** Male or female geometry being compensated. */
|
|
2655
|
-
readonly role: ThreadRole;
|
|
2656
|
-
/** Radial depth from major to minor envelope in millimetres. */
|
|
2657
|
-
readonly threadDepth: number;
|
|
2658
|
-
/** Optional numerical tolerance overrides. */
|
|
2659
|
-
readonly tolerance?: GeometryToleranceOptions;
|
|
2660
|
-
}
|
|
2378
|
+
export declare function sampleSideProfile(curve: SideProfileCurve, options?: SampleSideProfileOptions): readonly Vec2[];
|
|
2379
|
+
|
|
2380
|
+
/** Physical scaling and bounded adaptive subdivision for an open profile. */
|
|
2381
|
+
export declare interface SampleSideProfileOptions {
|
|
2382
|
+
/** Positive radius scale; use the desired maximum radius for normalized coordinates. Defaults to 1. */
|
|
2383
|
+
readonly radiusScale?: number;
|
|
2384
|
+
/** Positive height scale; use the desired total height for normalized coordinates. Defaults to 1. */
|
|
2385
|
+
readonly heightScale?: number;
|
|
2386
|
+
/** Shared physical policy, evaluated after scaling; exact circular counts do not affect curves. */
|
|
2387
|
+
readonly resolution?: GeometryResolution;
|
|
2388
|
+
/** Maximum output vertex count within maxProfilePoints. Defaults to the smaller of 4096 and that ceiling. */
|
|
2389
|
+
readonly maximumVertices?: number;
|
|
2390
|
+
/** Explicit profile and circular allocation ceilings. */
|
|
2391
|
+
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2392
|
+
}
|
|
2661
2393
|
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
readonly bodyResolution?: GeometryResolution;
|
|
2673
|
-
/** 45-degree body chamfer extent. Default: `min(profile.depth, thickness/4)`. */
|
|
2674
|
-
readonly chamferSize?: number;
|
|
2675
|
-
/** Leave the bottom outside edge flat for build-plate adhesion. Default: `false`. */
|
|
2676
|
-
readonly flushBuildPlateBottom?: boolean;
|
|
2677
|
-
/** Nut body shape. */
|
|
2678
|
-
readonly shape: ThreadedNutShape;
|
|
2679
|
-
/** Nut thickness along +Z in millimetres. */
|
|
2680
|
-
readonly thickness: number;
|
|
2681
|
-
/** Across-flats width for hex/square or diameter for round, in millimetres. */
|
|
2682
|
-
readonly width: number;
|
|
2683
|
-
}
|
|
2684
|
-
|
|
2685
|
-
/** Allocation-free body, cutter, and end-face facts resolved for a threaded nut. */
|
|
2686
|
-
export declare interface ThreadedNutPreflight {
|
|
2687
|
-
/** Polygon segment count used by the nut body. */
|
|
2688
|
-
readonly bodySegments: number;
|
|
2689
|
-
/** Shared 45-degree chamfer size applied to the selected body and cutter edges. */
|
|
2690
|
-
readonly chamferSize: number;
|
|
2691
|
-
/** Maximum compensated cutter radius at either requested face. */
|
|
2692
|
-
readonly cutterFaceRadius: number;
|
|
2693
|
-
/** Minimum nut-body inradius across the requested top and bottom faces. */
|
|
2694
|
-
readonly minimumBodyFaceInradius: number;
|
|
2695
|
-
/** Smallest radial wall left between the body and cutter at either requested face. */
|
|
2696
|
-
readonly minimumFaceWall: number;
|
|
2697
|
-
/** Conservative allocation facts for the exact extended internal-thread cutter mesh. */
|
|
2698
|
-
readonly thread: HelicalThreadSolidMeshPreflight;
|
|
2699
|
-
/** Start-aligned circular facet count used by the compensated thread cutter. */
|
|
2700
|
-
readonly threadCircularSegments: number;
|
|
2701
|
-
}
|
|
2702
|
-
|
|
2703
|
-
/**
|
|
2704
|
-
* Supported printable nut body shapes.
|
|
2705
|
-
*/
|
|
2706
|
-
export declare type ThreadedNutShape = "hex" | "round" | "square";
|
|
2707
|
-
|
|
2708
|
-
/**
|
|
2709
|
-
* Options for a compensated external threaded rod along +Z.
|
|
2710
|
-
*/
|
|
2711
|
-
export declare interface ThreadedRodOptions extends Omit<HelicalThreadRidgeMeshOptions, "majorDiameter">, ThreadBevelOptions {
|
|
2712
|
-
/** Printable fit or caller-calibrated allowances. Default: `normal`. */
|
|
2713
|
-
readonly fit?: PrintableThreadFit | PrintableThreadFitPolicy;
|
|
2714
|
-
/** Nominal major diameter before male compensation. */
|
|
2715
|
-
readonly nominalMajorDiameter: number;
|
|
2716
|
-
}
|
|
2394
|
+
/**
|
|
2395
|
+
* Samples a prepared text layout without shaping text again or loading a font.
|
|
2396
|
+
*
|
|
2397
|
+
* @param layout - Immutable millimetre paths and measurements retained from text preparation.
|
|
2398
|
+
* @param resolution - Explicit curve sampling policy; omitted uses the pure default policy.
|
|
2399
|
+
* @param limits - Explicit profile and circular allocation ceilings.
|
|
2400
|
+
* @returns Frozen contours with original glyph winding and no repeated closing vertex.
|
|
2401
|
+
* @throws GeometryError for empty outlines, invalid paths or policies, over 1000 paths or selected sampling ceilings.
|
|
2402
|
+
*/
|
|
2403
|
+
export declare function sampleTextContours(layout: VectorTextLayout, resolution?: GeometryResolution, limits?: Partial<GeometrySamplingLimits>): readonly Loop2[];
|
|
2717
2404
|
|
|
2718
|
-
|
|
2719
|
-
|
|
2405
|
+
/**
|
|
2406
|
+
* Samples evenly phased thread helices with finite `lead = pitch * starts`.
|
|
2407
|
+
* All starts together respect maxPathPoints (default 100000); excessive counts fail before allocation.
|
|
2408
|
+
*/
|
|
2409
|
+
export declare function sampleThreadHelices(options: ThreadHelixOptions): SampledThreadHelices;
|
|
2720
2410
|
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
/**
|
|
2730
|
-
* Non-negative unthreaded envelope length reserved at each non-standard end, in millimetres.
|
|
2731
|
-
* Active blunt bevels may raise this reservation to the effective bevel size.
|
|
2732
|
-
* @defaultValue `0`
|
|
2733
|
-
*/
|
|
2734
|
-
readonly endLength?: number;
|
|
2735
|
-
/**
|
|
2736
|
-
* Radial envelope toward which a blunt lead-in collapses.
|
|
2737
|
-
* @defaultValue `"minor"`
|
|
2738
|
-
*/
|
|
2739
|
-
readonly leadInEnvelope?: ThreadLeadInEnvelope;
|
|
2740
|
-
/**
|
|
2741
|
-
* Physical circumferential lead-in length in millimetres.
|
|
2742
|
-
* @defaultValue The profile depth.
|
|
2743
|
-
*/
|
|
2744
|
-
readonly leadInLength?: number;
|
|
2745
|
-
/**
|
|
2746
|
-
* Cross-section scaling curve used by blunt ends. `cut` switches abruptly to the full profile.
|
|
2747
|
-
* @defaultValue `"cut"`
|
|
2748
|
-
*/
|
|
2749
|
-
readonly leadInShape?: ThreadLeadInShape;
|
|
2750
|
-
/**
|
|
2751
|
-
* Ridge shape at the upper working boundary. `blunt` ends at full profile height, `standard`
|
|
2752
|
-
* clips the periodic profile at the face, and `tapered` ramps into the minor envelope.
|
|
2753
|
-
* @defaultValue `"blunt"`
|
|
2754
|
-
*/
|
|
2755
|
-
readonly top?: ThreadEndStyle;
|
|
2756
|
-
}
|
|
2411
|
+
/**
|
|
2412
|
+
* Multiplies a vector by a dimensionless scalar.
|
|
2413
|
+
* @example
|
|
2414
|
+
* ```ts
|
|
2415
|
+
* scale3([1, 2, 3], 2); // [2, 4, 6]
|
|
2416
|
+
* ```
|
|
2417
|
+
*/
|
|
2418
|
+
export declare const scale3: (vector: Vec3, scale: number) => Vec3;
|
|
2757
2419
|
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2420
|
+
/**
|
|
2421
|
+
* Creates an immutable axis-aligned scale transform.
|
|
2422
|
+
*
|
|
2423
|
+
* Negative components are reflections. Zero components are rejected because
|
|
2424
|
+
* they collapse volume and cannot be inverted.
|
|
2425
|
+
*
|
|
2426
|
+
* @param factors - Finite, non-zero XYZ scale factors.
|
|
2427
|
+
* @returns A frozen row-major transform.
|
|
2428
|
+
*/
|
|
2429
|
+
export declare function scaleTransform3(factors: Vec3): Transform3;
|
|
2430
|
+
|
|
2431
|
+
/** An open radius/height outline; consumers own closure, mounting geometry, and wall policy. */
|
|
2432
|
+
export declare interface SideProfileCurve {
|
|
2433
|
+
/** Initial radius/height anchor. */
|
|
2434
|
+
readonly start: SideProfilePoint;
|
|
2435
|
+
/** Ordered chain of 1–31 straight or cubic segments. */
|
|
2436
|
+
readonly segments: readonly SideProfileSegment[];
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2439
|
+
/** Radius and upward height in millimetres, or in units converted by sampling scales. */
|
|
2440
|
+
export declare interface SideProfilePoint {
|
|
2441
|
+
/** Nonnegative distance from the revolution axis. */
|
|
2442
|
+
readonly radius: number;
|
|
2443
|
+
/** Upward axial coordinate; anchors progress strictly upward. */
|
|
2444
|
+
readonly height: number;
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
/** One straight or cubic segment of an open, upward-progressing radius/height outline. */
|
|
2448
|
+
export declare type SideProfileSegment = {
|
|
2449
|
+
/** Straight segment discriminator. */
|
|
2450
|
+
readonly type: "line";
|
|
2451
|
+
/** Next strictly higher anchor. */
|
|
2452
|
+
readonly end: SideProfilePoint;
|
|
2453
|
+
} | {
|
|
2454
|
+
/** Cubic Bézier segment discriminator. */
|
|
2455
|
+
readonly type: "cubic";
|
|
2456
|
+
/** Outgoing control, with height between the start and second control. */
|
|
2457
|
+
readonly control1: SideProfilePoint;
|
|
2458
|
+
/** Incoming control, with height between the first control and end. */
|
|
2459
|
+
readonly control2: SideProfilePoint;
|
|
2460
|
+
/** Next strictly higher anchor. */
|
|
2461
|
+
readonly end: SideProfilePoint;
|
|
2462
|
+
};
|
|
2463
|
+
|
|
2464
|
+
/** Returns the signed area of a non-duplicated loop; positive means CCW. */
|
|
2465
|
+
export declare function signedAreaLoop2(loop: Loop2): number;
|
|
2466
|
+
|
|
2467
|
+
/** A cubic corner transition with zero curvature at its straight tangent joins. */
|
|
2468
|
+
export declare interface SmoothEdgeTreatment {
|
|
2469
|
+
/** Selects continuous-curvature cubic rounding, rather than a circular radius. */
|
|
2470
|
+
readonly kind: "smooth";
|
|
2471
|
+
/** Positive tangent setbacks, equal or [first, second], in millimetres. */
|
|
2472
|
+
readonly distance: number | readonly [first: number, second: number];
|
|
2473
|
+
/** Exact cubic interval count, positive; overrides physical sampling. */
|
|
2474
|
+
readonly segments?: number;
|
|
2475
|
+
/** Physical chord/edge-length sampling; circularSegments does not describe a cubic. */
|
|
2476
|
+
readonly resolution?: GeometryResolution;
|
|
2477
|
+
/** Explicit sampling ceilings, bounded by the host policy. */
|
|
2478
|
+
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
/** Bounded floating-point intersection and shell-orientation validation settings. */
|
|
2482
|
+
export declare interface SolidMeshValidationOptions {
|
|
2483
|
+
/** Work ceiling for spatial comparisons and containment tests; defaults to 2,000,000 and may only lower it. */
|
|
2484
|
+
readonly maximumTests?: number;
|
|
2485
|
+
/** Distance comparison policy in millimetres; near contacts reject conservatively. */
|
|
2486
|
+
readonly tolerance?: GeometryToleranceOptions;
|
|
2487
|
+
}
|
|
2762
2488
|
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2489
|
+
/**
|
|
2490
|
+
* Exactly one radius or diameter, placement, and tessellation for an origin-centered sphere.
|
|
2491
|
+
*/
|
|
2492
|
+
export declare type SphereOptions = CircularPrimitiveOptions & PrimitivePlacement & ({
|
|
2493
|
+
/** Positive radius in millimetres; mutually exclusive with diameter. */
|
|
2494
|
+
readonly radius: number;
|
|
2495
|
+
/** Full diameter is unavailable when radius is supplied. */
|
|
2496
|
+
readonly diameter?: never;
|
|
2497
|
+
} | {
|
|
2498
|
+
/** Positive full diameter in millimetres; mutually exclusive with radius. */
|
|
2499
|
+
readonly diameter: number;
|
|
2500
|
+
/** Radius is unavailable when diameter is supplied. */
|
|
2501
|
+
readonly radius?: never;
|
|
2502
|
+
});
|
|
2503
|
+
|
|
2504
|
+
/** Square profile with equal crest and root widths. */
|
|
2505
|
+
export declare interface SquareThreadProfileSpec extends ThreadProfileBaseSpec {
|
|
2506
|
+
/** Selects the square profile family. */
|
|
2507
|
+
readonly kind: "square";
|
|
2508
|
+
/**
|
|
2509
|
+
* Radial depth in millimetres.
|
|
2510
|
+
* @defaultValue `pitch / 2`
|
|
2511
|
+
*/
|
|
2512
|
+
readonly depth?: number;
|
|
2513
|
+
}
|
|
2784
2514
|
|
|
2785
|
-
|
|
2786
|
-
|
|
2515
|
+
/**
|
|
2516
|
+
* Creates a centered CCW alternating-radius star within the selected profile sampling ceiling.
|
|
2517
|
+
*
|
|
2518
|
+
* @example Five-point outline
|
|
2519
|
+
* ```ts
|
|
2520
|
+
* starLoop(12, 5, 6);
|
|
2521
|
+
* ```
|
|
2522
|
+
*/
|
|
2523
|
+
export declare const starLoop: (outerRadius: number, points: number, innerRadius?: number, limits?: Partial<GeometrySamplingLimits>) => readonly Vec2[];
|
|
2787
2524
|
|
|
2788
|
-
|
|
2789
|
-
|
|
2525
|
+
/** End-cap treatment for an open stroked path. */
|
|
2526
|
+
export declare type StrokePathCap = "butt" | "round" | "square";
|
|
2790
2527
|
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
*/
|
|
2794
|
-
export declare interface ThreadProfile {
|
|
2795
|
-
/** Axial width of the flat at the major envelope. */
|
|
2796
|
-
readonly crestFlatWidth: number;
|
|
2797
|
-
/** Radial distance from the major envelope to the root. */
|
|
2798
|
-
readonly depth: number;
|
|
2799
|
-
/** Profile family that produced this validated profile. */
|
|
2800
|
-
readonly kind: ThreadProfileSpec["kind"];
|
|
2801
|
-
/** Adjacent axial thread spacing in millimetres. */
|
|
2802
|
-
readonly pitch: number;
|
|
2803
|
-
/** Immutable open `[axial, radial]` path spanning one pitch. */
|
|
2804
|
-
readonly points: readonly Vec2[];
|
|
2805
|
-
/** Axial width of the flat at the minor envelope. */
|
|
2806
|
-
readonly rootFlatWidth: number;
|
|
2807
|
-
}
|
|
2528
|
+
/** Join treatment where adjacent stroked path segments meet. */
|
|
2529
|
+
export declare type StrokePathJoin = "bevel" | "miter" | "round";
|
|
2808
2530
|
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2531
|
+
/**
|
|
2532
|
+
* Converts a sampled millimetre path into the filled region covered by a centered stroke.
|
|
2533
|
+
*
|
|
2534
|
+
* Closed paths omit a duplicated seam point. Zero-length sampled segments are ignored, while the
|
|
2535
|
+
* effective path must still contain visible length. Round caps and joins use deterministic physical
|
|
2536
|
+
* resolution. Bevels fill the outer corner triangle; miters extend the outer edges to their
|
|
2537
|
+
* intersection, falling back to bevels above SVG's default miter limit of 4.
|
|
2538
|
+
*/
|
|
2539
|
+
export declare function strokePathRegion(path: Path2, options: StrokePathRegionOptions): Region2;
|
|
2540
|
+
|
|
2541
|
+
/** Physical stroke and topology controls for {@link strokePathRegion}. */
|
|
2542
|
+
export declare interface StrokePathRegionOptions {
|
|
2543
|
+
/** Explicit path, circular and expanded-profile allocation ceilings. */
|
|
2544
|
+
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2545
|
+
/** Treat the path as a closed non-duplicated loop. Default: `false`. */
|
|
2546
|
+
readonly closed?: boolean;
|
|
2547
|
+
/** End-cap treatment for an open path. Ignored for closed paths. Default: `butt`. */
|
|
2548
|
+
readonly cap?: StrokePathCap;
|
|
2549
|
+
/** Corner treatment; miters exceeding SVG's default limit of 4 become bevels. Default: `miter`. */
|
|
2550
|
+
readonly join?: StrokePathJoin;
|
|
2551
|
+
/** Physical tessellation policy for round caps and joins. */
|
|
2552
|
+
readonly resolution?: GeometryResolution;
|
|
2553
|
+
/** Positive total stroke width in millimetres, centered on the sampled path. */
|
|
2554
|
+
readonly width: number;
|
|
2555
|
+
}
|
|
2816
2556
|
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2557
|
+
/**
|
|
2558
|
+
* Subtracts `b` from `a`.
|
|
2559
|
+
* @example
|
|
2560
|
+
* ```ts
|
|
2561
|
+
* subtract3([4, 5, 6], [1, 2, 3]); // [3, 3, 3]
|
|
2562
|
+
* ```
|
|
2563
|
+
*/
|
|
2564
|
+
export declare const subtract3: (a: Vec3, b: Vec3) => Vec3;
|
|
2565
|
+
|
|
2566
|
+
/** Sampling controls for deterministic SVG-to-region conversion. */
|
|
2567
|
+
export declare interface SvgImportOptions {
|
|
2568
|
+
/** Explicit profile and circular allocation ceilings; bounded SVG source/work limits remain fixed. */
|
|
2569
|
+
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2570
|
+
/** Exact segments for a complete ellipse or round stroke feature. */
|
|
2571
|
+
readonly circularSegments?: number;
|
|
2572
|
+
/** Operation-level physical tessellation policy over the active model-wide policy. */
|
|
2573
|
+
readonly resolution?: GeometryResolution;
|
|
2574
|
+
/**
|
|
2575
|
+
* `"center"` places the viewport center at the origin. `"document"` places its converted
|
|
2576
|
+
* lower-left corner at the origin. Default: `"center"`.
|
|
2577
|
+
*/
|
|
2578
|
+
readonly origin?: "center" | "document";
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
/** Exact normalized SVG region plus bounded source, geometry, and safe-repair diagnostics. */
|
|
2582
|
+
export declare interface SvgRegionPreflight {
|
|
2583
|
+
/** Physical and final-topology measurements of `region`. */
|
|
2584
|
+
readonly geometry: SvgRegionPreflightGeometryMetrics;
|
|
2585
|
+
/** Appearance-preserving cleanup observed during parsing and normalization. */
|
|
2586
|
+
readonly repairs: SvgRegionPreflightRepairs;
|
|
2587
|
+
/** Canonical millimetre, Y-up geometry. */
|
|
2588
|
+
readonly region: Region2;
|
|
2589
|
+
/** Bounded source and flattening complexity measurements. */
|
|
2590
|
+
readonly source: SvgRegionPreflightSourceMetrics;
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
/** Physical and final-topology facts for a normalized imported SVG region. */
|
|
2594
|
+
export declare interface SvgRegionPreflightGeometryMetrics {
|
|
2595
|
+
/** Filled area in square millimetres. */
|
|
2596
|
+
readonly area: number;
|
|
2597
|
+
/** Millimetre bounds, or `null` when no painted region remains. */
|
|
2598
|
+
readonly bounds: Bounds2 | null;
|
|
2599
|
+
/** Disconnected filled polygons in the final region. */
|
|
2600
|
+
readonly components: number;
|
|
2601
|
+
/** Exterior and hole boundary count in the final region. */
|
|
2602
|
+
readonly contours: number;
|
|
2603
|
+
/** Interior boundary count in the final region. */
|
|
2604
|
+
readonly holes: number;
|
|
2605
|
+
/** Shortest final boundary edge in millimetres, or `null` for an empty region. */
|
|
2606
|
+
readonly minEdgeLength: number | null;
|
|
2607
|
+
/** Final boundary edges shorter than the conservative 0.01 mm indicator. */
|
|
2608
|
+
readonly shortEdges: number;
|
|
2609
|
+
/** Components with less than 0.01 square millimetres of filled area. */
|
|
2610
|
+
readonly tinyIslands: number;
|
|
2611
|
+
/** Non-duplicated boundary vertices in the final normalized region. */
|
|
2612
|
+
readonly vertices: number;
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
/** Visible, appearance-preserving cleanup counters from bounded SVG import. */
|
|
2616
|
+
export declare interface SvgRegionPreflightRepairs {
|
|
2617
|
+
/** Graphics elements with neither a visible fill nor a positive-width visible stroke. */
|
|
2618
|
+
readonly invisibleElements: number;
|
|
2619
|
+
/** Open filled subpaths closed by SVG fill semantics without closing their strokes. */
|
|
2620
|
+
readonly implicitFilledClosures: number;
|
|
2621
|
+
/** Visibly painted elements whose fill and stroke both resolved to empty geometry. */
|
|
2622
|
+
readonly emptyElements: number;
|
|
2623
|
+
/** Consecutive repeated flattened vertices discarded before topology resolution. */
|
|
2624
|
+
readonly removedDuplicateVertices: number;
|
|
2625
|
+
/** Explicit repeated seam vertices removed from otherwise closed contours. */
|
|
2626
|
+
readonly removedSeamVertices: number;
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2629
|
+
/** Bounded source-complexity facts collected while parsing one SVG document. */
|
|
2630
|
+
export declare interface SvgRegionPreflightSourceMetrics {
|
|
2631
|
+
/** UTF-8 source size, capped at 256 KiB before parsing. */
|
|
2632
|
+
readonly bytes: number;
|
|
2633
|
+
/** Renderable shape elements, capped at 500; containers and metadata are excluded. */
|
|
2634
|
+
readonly elements: number;
|
|
2635
|
+
/** Flattened vertices emitted before fill, stroke, and clipping operations. */
|
|
2636
|
+
readonly emittedVertices: number;
|
|
2637
|
+
/** Path endpoints and control vertices parsed before adaptive flattening. */
|
|
2638
|
+
readonly parsedVertices: number;
|
|
2639
|
+
}
|
|
2821
2640
|
|
|
2822
|
-
|
|
2823
|
-
|
|
2641
|
+
/**
|
|
2642
|
+
* Sweeps one explicitly ordered point loop, with caps or a geometrically matching closed seam.
|
|
2643
|
+
*
|
|
2644
|
+
* @example Sweep point data along a bent path
|
|
2645
|
+
* ```ts
|
|
2646
|
+
* const profile = rectangleLoop({ size: [6, 3] });
|
|
2647
|
+
* sweepMesh(profile, [[0, 0, 0], [0, 0, 15], [10, 0, 25]], {
|
|
2648
|
+
* orientation: { kind: "transport", initialNormal: [0, 1, 0] },
|
|
2649
|
+
* });
|
|
2650
|
+
* ```
|
|
2651
|
+
*/
|
|
2652
|
+
export declare function sweepMesh(profile: Loop2, path: readonly Vec3[], options?: SweepOptions): TriangleMesh;
|
|
2824
2653
|
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2654
|
+
/**
|
|
2655
|
+
* Controls shared by pure mesh construction and filled modeling sweeps.
|
|
2656
|
+
*/
|
|
2657
|
+
export declare interface SweepOptions {
|
|
2658
|
+
/** Join the path's last station to its first. Open paths retain watertight end caps. */
|
|
2659
|
+
readonly closed?: boolean;
|
|
2660
|
+
/** Explicit output and sampling allocation ceilings. */
|
|
2661
|
+
readonly limits?: Partial<ModelingLimits>;
|
|
2662
|
+
/** Explicit frame policy; default transport minimizes rotations, initially projecting +X then +Y then +Z. */
|
|
2663
|
+
readonly orientation?: SweepOrientation;
|
|
2664
|
+
/** Physical sampling of nonzero twist; inserted stations retain authored station controls. */
|
|
2665
|
+
readonly resolution?: GeometryResolution;
|
|
2666
|
+
/** Total additional profile rotation in degrees, with progression selected by twistBy. */
|
|
2667
|
+
readonly twistDegrees?: number;
|
|
2668
|
+
/** Twist advances by physical path length (default), or normalized authored station position, including a closed seam gap. */
|
|
2669
|
+
readonly twistBy?: "length" | "stations";
|
|
2670
|
+
/** Positive uniform/XY scale, or one XY pair per path station. Defaults to one. */
|
|
2671
|
+
readonly scale?: number | Vec2 | readonly Vec2[];
|
|
2672
|
+
/** Corresponding point-index advance at a rotationally equivalent closed seam. */
|
|
2673
|
+
readonly seamProfileOffset?: number;
|
|
2674
|
+
}
|
|
2842
2675
|
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2676
|
+
/**
|
|
2677
|
+
* Explicit profile-X frame policy; all normals are directed, and selected singular policies reject.
|
|
2678
|
+
*/
|
|
2679
|
+
export declare type SweepOrientation = {
|
|
2680
|
+
/** Minimizes frame rotation by parallel transport. */
|
|
2681
|
+
readonly kind: "transport";
|
|
2682
|
+
/** Initial profile +X guide, projected perpendicular to the first tangent. */
|
|
2683
|
+
readonly initialNormal?: Vec3;
|
|
2684
|
+
} | {
|
|
2685
|
+
/** Projects one fixed world-space normal at every path station. */
|
|
2686
|
+
readonly kind: "fixed-normal";
|
|
2687
|
+
/** Directed profile +X guide; must not be parallel to any local tangent. */
|
|
2688
|
+
readonly normal: Vec3;
|
|
2689
|
+
} | {
|
|
2690
|
+
/** Uses an explicitly directed normal callback at each original normalized station. */
|
|
2691
|
+
readonly kind: "guide";
|
|
2692
|
+
/** Finite profile +X guide callback, evaluated once per original path station. */
|
|
2693
|
+
readonly normal: PathNormalGuide;
|
|
2694
|
+
} | {
|
|
2695
|
+
/** Uses sampled curvature normals; zero-curvature stations reject. */
|
|
2696
|
+
readonly kind: "frenet";
|
|
2697
|
+
};
|
|
2698
|
+
|
|
2699
|
+
/** End bevel controls shared by threaded rods and cutters. */
|
|
2700
|
+
export declare interface ThreadBevelOptions {
|
|
2701
|
+
/** Apply a 45-degree bevel at Z=0. */
|
|
2702
|
+
readonly bevelBottom?: boolean;
|
|
2703
|
+
/**
|
|
2704
|
+
* Axial bevel extent in millimetres. Active blunt ends default to one sixth of the compensated
|
|
2705
|
+
* male minor radius or female major radius; other ends default to the profile depth.
|
|
2706
|
+
*/
|
|
2707
|
+
readonly bevelSize?: number;
|
|
2708
|
+
/** Apply a 45-degree bevel at Z=length. */
|
|
2709
|
+
readonly bevelTop?: boolean;
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
/** Inputs for resolving one shared circular facet count for a mating thread pair. */
|
|
2713
|
+
export declare interface ThreadCircularSegmentsOptions {
|
|
2714
|
+
/** Explicit circular allocation ceiling for the shared mating grid. */
|
|
2715
|
+
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2716
|
+
/** Printable fit whose larger compensated female envelope governs tessellation. */
|
|
2717
|
+
readonly fit?: PrintableThreadFit | PrintableThreadFitPolicy;
|
|
2718
|
+
/** Nominal major diameter before role-specific compensation. */
|
|
2719
|
+
readonly nominalMajorDiameter: number;
|
|
2720
|
+
/**
|
|
2721
|
+
* Maximum active female face outset beyond the compensated major envelope, in millimetres.
|
|
2722
|
+
* This keeps a compensated male/female pair on one role-independent grid when an internal
|
|
2723
|
+
* cutter has an enlarged entrance bevel. Default: `0`.
|
|
2724
|
+
*/
|
|
2725
|
+
readonly maximumRadialOutset?: number;
|
|
2726
|
+
/** Validated mating profile whose pitch and flank capacities govern tessellation. */
|
|
2727
|
+
readonly profile: ThreadProfile;
|
|
2728
|
+
/** Physical or exact circular resolution policy. */
|
|
2729
|
+
readonly resolution?: GeometryResolution;
|
|
2730
|
+
/** Number of phased starts. Default: `1`. */
|
|
2731
|
+
readonly starts?: number;
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
/** Options for compensating nominal male or female thread diameters. */
|
|
2735
|
+
export declare interface ThreadCompensationOptions {
|
|
2736
|
+
/** Named policy or explicit caller-calibrated allowances. */
|
|
2737
|
+
readonly fit?: PrintableThreadFit | PrintableThreadFitPolicy;
|
|
2738
|
+
/** Nominal sharp or truncated major diameter in millimetres. */
|
|
2739
|
+
readonly nominalMajorDiameter: number;
|
|
2740
|
+
/** Male or female geometry being compensated. */
|
|
2741
|
+
readonly role: ThreadRole;
|
|
2742
|
+
/** Radial depth from major to minor envelope in millimetres. */
|
|
2743
|
+
readonly threadDepth: number;
|
|
2744
|
+
/** Optional numerical tolerance overrides. */
|
|
2745
|
+
readonly tolerance?: GeometryToleranceOptions;
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
/** Nut-edge bevel selection. */
|
|
2749
|
+
export declare type ThreadedNutBevel = "automatic" | "both" | "inside" | "none" | "outside";
|
|
2867
2750
|
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2751
|
+
/**
|
|
2752
|
+
* Options for a compensated nut with an internal thread.
|
|
2753
|
+
*/
|
|
2754
|
+
export declare interface ThreadedNutOptions extends Omit<InternalThreadCutterOptions, "bevelBottom" | "bevelSize" | "bevelTop" | "length"> {
|
|
2755
|
+
/** Nut body bevel selection. Default: `automatic`. */
|
|
2756
|
+
readonly bevel?: ThreadedNutBevel;
|
|
2757
|
+
/** Optional physical policy for a round body, independent of the thread's matched facet grid. */
|
|
2758
|
+
readonly bodyResolution?: GeometryResolution;
|
|
2759
|
+
/** 45-degree body chamfer extent. Default: `min(profile.depth, thickness/4)`. */
|
|
2760
|
+
readonly chamferSize?: number;
|
|
2761
|
+
/** Leave the bottom outside edge flat for build-plate adhesion. Default: `false`. */
|
|
2762
|
+
readonly flushBuildPlateBottom?: boolean;
|
|
2763
|
+
/** Nut body shape. */
|
|
2764
|
+
readonly shape: ThreadedNutShape;
|
|
2765
|
+
/** Nut thickness along +Z in millimetres. */
|
|
2766
|
+
readonly thickness: number;
|
|
2767
|
+
/** Across-flats width for hex/square or diameter for round, in millimetres. */
|
|
2768
|
+
readonly width: number;
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
/** Allocation-free body, cutter, and end-face facts resolved for a threaded nut. */
|
|
2772
|
+
export declare interface ThreadedNutPreflight {
|
|
2773
|
+
/** Polygon segment count used by the nut body. */
|
|
2774
|
+
readonly bodySegments: number;
|
|
2775
|
+
/** Shared 45-degree chamfer size applied to the selected body and cutter edges. */
|
|
2776
|
+
readonly chamferSize: number;
|
|
2777
|
+
/** Maximum compensated cutter radius at either requested face. */
|
|
2778
|
+
readonly cutterFaceRadius: number;
|
|
2779
|
+
/** Minimum nut-body inradius across the requested top and bottom faces. */
|
|
2780
|
+
readonly minimumBodyFaceInradius: number;
|
|
2781
|
+
/** Smallest radial wall left between the body and cutter at either requested face. */
|
|
2782
|
+
readonly minimumFaceWall: number;
|
|
2783
|
+
/** Conservative allocation facts for the exact extended internal-thread cutter mesh. */
|
|
2784
|
+
readonly thread: HelicalThreadSolidMeshPreflight;
|
|
2785
|
+
/** Start-aligned circular facet count used by the compensated thread cutter. */
|
|
2786
|
+
readonly threadCircularSegments: number;
|
|
2787
|
+
}
|
|
2877
2788
|
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
*/
|
|
2883
|
-
export declare function transformLoop2(loop: Loop2, transform: Transform3, tolerance?: GeometryToleranceOptions): Loop2;
|
|
2789
|
+
/**
|
|
2790
|
+
* Supported printable nut body shapes.
|
|
2791
|
+
*/
|
|
2792
|
+
export declare type ThreadedNutShape = "hex" | "round" | "square";
|
|
2884
2793
|
|
|
2885
|
-
|
|
2886
|
-
|
|
2794
|
+
/**
|
|
2795
|
+
* Options for a compensated external threaded rod along +Z.
|
|
2796
|
+
*/
|
|
2797
|
+
export declare interface ThreadedRodOptions extends Omit<HelicalThreadRidgeMeshOptions, "majorDiameter">, ThreadBevelOptions {
|
|
2798
|
+
/** Printable fit or caller-calibrated allowances. Default: `normal`. */
|
|
2799
|
+
readonly fit?: PrintableThreadFit | PrintableThreadFitPolicy;
|
|
2800
|
+
/** Nominal major diameter before male compensation. */
|
|
2801
|
+
readonly nominalMajorDiameter: number;
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
/** End shape of a generated helical ridge. */
|
|
2805
|
+
export declare type ThreadEndStyle = "blunt" | "standard" | "tapered";
|
|
2806
|
+
|
|
2807
|
+
/** Axial end controls for a generated ridge. */
|
|
2808
|
+
export declare interface ThreadEndTreatmentOptions {
|
|
2809
|
+
/**
|
|
2810
|
+
* Ridge shape at the lower working boundary. `blunt` ends at full profile height, `standard`
|
|
2811
|
+
* clips the periodic profile at the face, and `tapered` ramps out from the minor envelope.
|
|
2812
|
+
* @defaultValue `"blunt"`
|
|
2813
|
+
*/
|
|
2814
|
+
readonly bottom?: ThreadEndStyle;
|
|
2815
|
+
/**
|
|
2816
|
+
* Non-negative unthreaded envelope length reserved at each non-standard end, in millimetres.
|
|
2817
|
+
* Active blunt bevels may raise this reservation to the effective bevel size.
|
|
2818
|
+
* @defaultValue `0`
|
|
2819
|
+
*/
|
|
2820
|
+
readonly endLength?: number;
|
|
2821
|
+
/**
|
|
2822
|
+
* Radial envelope toward which a blunt lead-in collapses.
|
|
2823
|
+
* @defaultValue `"minor"`
|
|
2824
|
+
*/
|
|
2825
|
+
readonly leadInEnvelope?: ThreadLeadInEnvelope;
|
|
2826
|
+
/**
|
|
2827
|
+
* Physical circumferential lead-in length in millimetres.
|
|
2828
|
+
* @defaultValue The profile depth.
|
|
2829
|
+
*/
|
|
2830
|
+
readonly leadInLength?: number;
|
|
2831
|
+
/**
|
|
2832
|
+
* Cross-section scaling curve used by blunt ends. `cut` switches abruptly to the full profile.
|
|
2833
|
+
* @defaultValue `"cut"`
|
|
2834
|
+
*/
|
|
2835
|
+
readonly leadInShape?: ThreadLeadInShape;
|
|
2836
|
+
/**
|
|
2837
|
+
* Ridge shape at the upper working boundary. `blunt` ends at full profile height, `standard`
|
|
2838
|
+
* clips the periodic profile at the face, and `tapered` ramps into the minor envelope.
|
|
2839
|
+
* @defaultValue `"blunt"`
|
|
2840
|
+
*/
|
|
2841
|
+
readonly top?: ThreadEndStyle;
|
|
2842
|
+
}
|
|
2887
2843
|
|
|
2888
|
-
|
|
2889
|
-
|
|
2844
|
+
/**
|
|
2845
|
+
* Direction in which a conventional helical thread advances around +Z.
|
|
2846
|
+
*/
|
|
2847
|
+
export declare type ThreadHandedness = "left" | "right";
|
|
2848
|
+
|
|
2849
|
+
/** Conventional helix options: `pitch` is adjacent spacing and lead is `pitch * starts`. */
|
|
2850
|
+
export declare interface ThreadHelixOptions {
|
|
2851
|
+
/** Helix direction. Default: `right`. */
|
|
2852
|
+
readonly handedness?: ThreadHandedness;
|
|
2853
|
+
/** Explicit aggregate path allocation ceilings across all starts. */
|
|
2854
|
+
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2855
|
+
/** Total sampled axial length in millimetres. */
|
|
2856
|
+
readonly length: number;
|
|
2857
|
+
/** Angular offset of the first start in degrees. Default: `0`. */
|
|
2858
|
+
readonly phaseDegrees?: number;
|
|
2859
|
+
/** Adjacent axial thread spacing in millimetres. */
|
|
2860
|
+
readonly pitch: number;
|
|
2861
|
+
/** Radial distance from the +Z axis in millimetres. */
|
|
2862
|
+
readonly radius: number;
|
|
2863
|
+
/** Angular sampling density for each revolution. Default: `32`. */
|
|
2864
|
+
readonly segmentsPerTurn?: number;
|
|
2865
|
+
/** Number of evenly phased helices. Default: `1`. */
|
|
2866
|
+
readonly starts?: number;
|
|
2867
|
+
/** Optional numerical tolerance overrides. */
|
|
2868
|
+
readonly tolerance?: GeometryToleranceOptions;
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2871
|
+
/** Radial envelope toward which a blunt lead-in collapses. */
|
|
2872
|
+
export declare type ThreadLeadInEnvelope = "major" | "minor";
|
|
2873
|
+
|
|
2874
|
+
/** BOSL2-compatible cross-section scaling curve for a blunt thread lead-in. */
|
|
2875
|
+
export declare type ThreadLeadInShape = "cut" | "linear" | "smooth" | "sqrt";
|
|
2890
2876
|
|
|
2891
|
-
|
|
2892
|
-
|
|
2877
|
+
/**
|
|
2878
|
+
* A validated immutable periodic thread profile in `[axial, radial]` millimetres.
|
|
2879
|
+
*/
|
|
2880
|
+
export declare interface ThreadProfile {
|
|
2881
|
+
/** Axial width of the flat at the major envelope. */
|
|
2882
|
+
readonly crestFlatWidth: number;
|
|
2883
|
+
/** Radial distance from the major envelope to the root. */
|
|
2884
|
+
readonly depth: number;
|
|
2885
|
+
/** Profile family that produced this validated profile. */
|
|
2886
|
+
readonly kind: ThreadProfileSpec["kind"];
|
|
2887
|
+
/** Adjacent axial thread spacing in millimetres. */
|
|
2888
|
+
readonly pitch: number;
|
|
2889
|
+
/** Immutable open `[axial, radial]` path spanning one pitch. */
|
|
2890
|
+
readonly points: readonly Vec2[];
|
|
2891
|
+
/** Axial width of the flat at the minor envelope. */
|
|
2892
|
+
readonly rootFlatWidth: number;
|
|
2893
|
+
}
|
|
2894
|
+
|
|
2895
|
+
/** Fields shared by all thread profile specifications. */
|
|
2896
|
+
export declare interface ThreadProfileBaseSpec {
|
|
2897
|
+
/** Adjacent axial thread spacing in millimetres. */
|
|
2898
|
+
readonly pitch: number;
|
|
2899
|
+
/** Optional numerical tolerance overrides. */
|
|
2900
|
+
readonly tolerance?: GeometryToleranceOptions;
|
|
2901
|
+
}
|
|
2893
2902
|
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
* automatically reverses every triangle. Singular transforms are rejected.
|
|
2899
|
-
*
|
|
2900
|
-
* @param mesh - Mesh to transform without mutation.
|
|
2901
|
-
* @param transform - Row-major affine transform.
|
|
2902
|
-
* @returns A mesh with fresh transformed positions and copied or reversed indices.
|
|
2903
|
-
*/
|
|
2904
|
-
export declare function transformTriangleMesh(mesh: TriangleMesh, transform: Transform3): TriangleMesh;
|
|
2903
|
+
/**
|
|
2904
|
+
* Supported built-in and caller-defined thread profiles.
|
|
2905
|
+
*/
|
|
2906
|
+
export declare type ThreadProfileSpec = AcmeThreadProfileSpec | ButtressThreadProfileSpec | CustomThreadProfileSpec | SquareThreadProfileSpec | TrapezoidalThreadProfileSpec | TriangularThreadProfileSpec;
|
|
2905
2907
|
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
*
|
|
2909
|
-
* @param offset - Finite XYZ translation in model units.
|
|
2910
|
-
* @returns A frozen row-major transform.
|
|
2911
|
-
*/
|
|
2912
|
-
export declare function translationTransform3(offset: Vec3): Transform3;
|
|
2908
|
+
/** Whether compensation is being applied to an external or internal thread. */
|
|
2909
|
+
export declare type ThreadRole = "male" | "female";
|
|
2913
2910
|
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
*/
|
|
2927
|
-
|
|
2928
|
-
|
|
2911
|
+
/**
|
|
2912
|
+
* Dimensions and independent ring/profile tessellation for a torus around the Z axis.
|
|
2913
|
+
*/
|
|
2914
|
+
export declare interface TorusOptions extends PrimitivePlacement {
|
|
2915
|
+
/** Explicit sampling ceilings, bounded by the host policy. */
|
|
2916
|
+
readonly limits?: Partial<GeometrySamplingLimits>;
|
|
2917
|
+
/** Radius from the Z axis to the profile center, in millimetres; greater than `minorRadius`. */
|
|
2918
|
+
readonly majorRadius: number;
|
|
2919
|
+
/** Exact segment count around the Z axis; omitted uses adaptive resolution. */
|
|
2920
|
+
readonly majorSegments?: number;
|
|
2921
|
+
/** Radius of the swept circular profile in millimetres. */
|
|
2922
|
+
readonly minorRadius: number;
|
|
2923
|
+
/** Exact segment count around the swept profile; omitted uses adaptive resolution. */
|
|
2924
|
+
readonly minorSegments?: number;
|
|
2925
|
+
/** Operation-level physical tessellation policy over the active model-wide policy. */
|
|
2926
|
+
readonly resolution?: GeometryResolution;
|
|
2927
|
+
}
|
|
2929
2928
|
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2929
|
+
/**
|
|
2930
|
+
* A row-major affine 4x4 matrix applied to column vectors.
|
|
2931
|
+
*
|
|
2932
|
+
* Translation occupies indices 3, 7, and 11. The final row must be
|
|
2933
|
+
* `[0, 0, 0, 1]` within the active geometry tolerance.
|
|
2934
|
+
*/
|
|
2935
|
+
export declare type Transform3 = readonly [
|
|
2936
|
+
m00: number,
|
|
2937
|
+
m01: number,
|
|
2938
|
+
m02: number,
|
|
2939
|
+
m03: number,
|
|
2940
|
+
m10: number,
|
|
2941
|
+
m11: number,
|
|
2942
|
+
m12: number,
|
|
2943
|
+
m13: number,
|
|
2944
|
+
m20: number,
|
|
2945
|
+
m21: number,
|
|
2946
|
+
m22: number,
|
|
2947
|
+
m23: number,
|
|
2948
|
+
m30: number,
|
|
2949
|
+
m31: number,
|
|
2950
|
+
m32: number,
|
|
2951
|
+
m33: number
|
|
2952
|
+
];
|
|
2939
2953
|
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2954
|
+
/**
|
|
2955
|
+
* Returns the determinant of a transform's linear 3x3 component.
|
|
2956
|
+
*
|
|
2957
|
+
* A negative result identifies a reflection; zero is rejected as singular.
|
|
2958
|
+
*
|
|
2959
|
+
* @param transform - Valid affine transform.
|
|
2960
|
+
* @returns Signed linear determinant.
|
|
2961
|
+
*/
|
|
2962
|
+
export declare function transformDeterminant3(transform: Transform3): number;
|
|
2949
2963
|
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
}
|
|
2964
|
+
/**
|
|
2965
|
+
* Transforms a closed loop and preserves its original winding convention.
|
|
2966
|
+
*
|
|
2967
|
+
* Reflections reverse the point order automatically through normalization.
|
|
2968
|
+
*/
|
|
2969
|
+
export declare function transformLoop2(loop: Loop2, transform: Transform3, tolerance?: GeometryToleranceOptions): Loop2;
|
|
2957
2970
|
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
*/
|
|
2961
|
-
export declare interface TriangleMeshMeasurements {
|
|
2962
|
-
/** Axis-aligned bounds. */
|
|
2963
|
-
readonly bounds: MeshBounds;
|
|
2964
|
-
/** Signed enclosed volume; positive values correspond to outward winding. */
|
|
2965
|
-
readonly signedVolume: number;
|
|
2966
|
-
/** Sum of all triangle areas in squared model units. */
|
|
2967
|
-
readonly surfaceArea: number;
|
|
2968
|
-
/** Number of indexed triangles. */
|
|
2969
|
-
readonly triangleCount: number;
|
|
2970
|
-
/** Number of distinct entries in the position buffer. */
|
|
2971
|
-
readonly vertexCount: number;
|
|
2972
|
-
}
|
|
2971
|
+
/** Applies an XY-plane-preserving affine transform to a 2D path. */
|
|
2972
|
+
export declare function transformPath2(path: Path2, transform: Transform3, tolerance?: GeometryToleranceOptions): Path2;
|
|
2973
2973
|
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
/** Maximum number of triangles inspected. Defaults to `200000`. */
|
|
2977
|
-
readonly maximumTriangleCount?: number;
|
|
2978
|
-
/** Numeric comparison overrides; model coordinates are interpreted in their existing units. */
|
|
2979
|
-
readonly tolerance?: GeometryToleranceOptions;
|
|
2980
|
-
}
|
|
2974
|
+
/** Applies an affine transform to a 3D path without mutating its points. */
|
|
2975
|
+
export declare function transformPath3(path: Path3, transform: Transform3): Path3;
|
|
2981
2976
|
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
/** Number of duplicate triangles beyond their first unordered occurrence. */
|
|
2985
|
-
readonly duplicateTriangleCount: number;
|
|
2986
|
-
/** Number of two-face edges whose incident triangles use the same direction. */
|
|
2987
|
-
readonly inconsistentWindingEdgeCount: number;
|
|
2988
|
-
/** Whether the mesh has valid faces and exactly two oppositely wound faces at every edge. */
|
|
2989
|
-
readonly isClosedOrientedManifold: boolean;
|
|
2990
|
-
/** Largest normalized triangle aspect ratio; an equilateral triangle has ratio `1`. */
|
|
2991
|
-
readonly maximumTriangleAspectRatio: number;
|
|
2992
|
-
/** Largest number of triangles incident to one indexed vertex. */
|
|
2993
|
-
readonly maximumVertexTriangleIncidence: number;
|
|
2994
|
-
/** Largest number of distinct neighbours connected to one indexed vertex. */
|
|
2995
|
-
readonly maximumVertexValence: number;
|
|
2996
|
-
/** Smallest interior triangle angle in degrees. */
|
|
2997
|
-
readonly minimumTriangleAngleDegrees: number;
|
|
2998
|
-
/** Number of triangles at or below the scale-aware zero-area threshold. */
|
|
2999
|
-
readonly nearZeroAreaTriangleCount: number;
|
|
3000
|
-
/** Number of edges with more than two incident triangles. */
|
|
3001
|
-
readonly nonManifoldEdgeCount: number;
|
|
3002
|
-
/** Number of edges with exactly one incident triangle. */
|
|
3003
|
-
readonly openEdgeCount: number;
|
|
3004
|
-
/** Edge-connected coplanar patches in deterministic first-triangle order. */
|
|
3005
|
-
readonly planarPatches: readonly PlanarPatchQuality[];
|
|
3006
|
-
/** Signed enclosed volume in cubic model units; positive values indicate outward winding. */
|
|
3007
|
-
readonly signedVolume: number;
|
|
3008
|
-
/** Total triangle area in squared model units. */
|
|
3009
|
-
readonly surfaceArea: number;
|
|
3010
|
-
/** Number of indexed triangles. */
|
|
3011
|
-
readonly triangleCount: number;
|
|
3012
|
-
/** Number of entries in the position buffer. */
|
|
3013
|
-
readonly vertexCount: number;
|
|
3014
|
-
}
|
|
2977
|
+
/** Transforms an explicit outer/hole region with reflection-safe winding correction. */
|
|
2978
|
+
export declare function transformRegion2(region: Region2, transform: Transform3, tolerance?: GeometryToleranceOptions): Region2;
|
|
3015
2979
|
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
readonly signedVolume: number;
|
|
3028
|
-
/** Quantization used to make the signature stable across insignificant numeric drift. */
|
|
3029
|
-
readonly tolerances: TriangleMeshSignatureTolerances;
|
|
3030
|
-
/** Number of indexed triangles. */
|
|
3031
|
-
readonly triangleCount: number;
|
|
3032
|
-
/** Number of referenced position-buffer vertices. */
|
|
3033
|
-
readonly vertexCount: number;
|
|
3034
|
-
}
|
|
2980
|
+
/**
|
|
2981
|
+
* Applies an affine transform to a mesh and preserves outward face orientation.
|
|
2982
|
+
*
|
|
2983
|
+
* A transform with a negative linear determinant reflects space, so this helper
|
|
2984
|
+
* automatically reverses every triangle. Singular transforms are rejected.
|
|
2985
|
+
*
|
|
2986
|
+
* @param mesh - Mesh to transform without mutation.
|
|
2987
|
+
* @param transform - Row-major affine transform.
|
|
2988
|
+
* @returns A mesh with fresh transformed positions and copied or reversed indices.
|
|
2989
|
+
*/
|
|
2990
|
+
export declare function transformTriangleMesh(mesh: TriangleMesh, transform: Transform3): TriangleMesh;
|
|
3035
2991
|
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
2992
|
+
/**
|
|
2993
|
+
* Creates an immutable translation transform.
|
|
2994
|
+
*
|
|
2995
|
+
* @param offset - Finite XYZ translation in model units.
|
|
2996
|
+
* @returns A frozen row-major transform.
|
|
2997
|
+
*/
|
|
2998
|
+
export declare function translationTransform3(offset: Vec3): Transform3;
|
|
2999
|
+
|
|
3000
|
+
/** Trapezoidal thread profile with a configurable included angle. */
|
|
3001
|
+
export declare interface TrapezoidalThreadProfileSpec extends ThreadProfileBaseSpec {
|
|
3002
|
+
/** Selects the trapezoidal profile family. */
|
|
3003
|
+
readonly kind: "trapezoidal";
|
|
3004
|
+
/**
|
|
3005
|
+
* Radial depth in millimetres.
|
|
3006
|
+
* @defaultValue `pitch / 2`
|
|
3007
|
+
*/
|
|
3008
|
+
readonly depth?: number;
|
|
3009
|
+
/**
|
|
3010
|
+
* Included flank angle in degrees. Use `90` for printable 45-degree slopes.
|
|
3011
|
+
* @defaultValue `30`
|
|
3012
|
+
*/
|
|
3013
|
+
readonly threadAngle?: number;
|
|
3014
|
+
}
|
|
3045
3015
|
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3016
|
+
/**
|
|
3017
|
+
* A topology-preserving indexed triangle mesh with XYZ vertex positions.
|
|
3018
|
+
*/
|
|
3019
|
+
export declare interface TriangleMesh {
|
|
3020
|
+
/** Three unsigned vertex indices per triangle. */
|
|
3021
|
+
readonly indices: Uint32Array;
|
|
3022
|
+
/** Flat XYZ coordinates, three finite values per vertex. */
|
|
3023
|
+
readonly positions: Float32Array;
|
|
3024
|
+
}
|
|
3053
3025
|
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3026
|
+
/**
|
|
3027
|
+
* Measurements and optional edge-connected topology from one validated mesh traversal.
|
|
3028
|
+
*/
|
|
3029
|
+
export declare interface TriangleMeshAnalysis extends TriangleMeshMeasurements {
|
|
3030
|
+
/** Number of referenced edge-connected components when `includeTopology` is requested. */
|
|
3031
|
+
readonly connectedComponentCount?: number;
|
|
3032
|
+
/** Number of distinct indexed undirected edges when `includeTopology` is requested. */
|
|
3033
|
+
readonly edgeCount?: number;
|
|
3034
|
+
}
|
|
3063
3035
|
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
* Crest width divided by pitch.
|
|
3072
|
-
* @defaultValue `1 / 8`
|
|
3073
|
-
*/
|
|
3074
|
-
readonly crestFlatRatio?: number;
|
|
3075
|
-
/**
|
|
3076
|
-
* Root width divided by pitch.
|
|
3077
|
-
* @defaultValue `1 / 4`
|
|
3078
|
-
*/
|
|
3079
|
-
readonly rootFlatRatio?: number;
|
|
3080
|
-
}
|
|
3036
|
+
/**
|
|
3037
|
+
* Validation and optional connectivity controls for a shared mesh analysis.
|
|
3038
|
+
*/
|
|
3039
|
+
export declare interface TriangleMeshAnalysisOptions extends TriangleMeshValidationOptions {
|
|
3040
|
+
/** Compute indexed edge/component counts and reject unreferenced vertices; defaults to false. */
|
|
3041
|
+
readonly includeTopology?: boolean;
|
|
3042
|
+
}
|
|
3081
3043
|
|
|
3082
|
-
|
|
3083
|
-
|
|
3044
|
+
/**
|
|
3045
|
+
* Geometric measurements derived from a validated, non-empty triangle mesh.
|
|
3046
|
+
*/
|
|
3047
|
+
export declare interface TriangleMeshMeasurements {
|
|
3048
|
+
/** Axis-aligned bounds. */
|
|
3049
|
+
readonly bounds: MeshBounds;
|
|
3050
|
+
/** Signed enclosed volume; positive values correspond to outward winding. */
|
|
3051
|
+
readonly signedVolume: number;
|
|
3052
|
+
/** Sum of all triangle areas in squared model units. */
|
|
3053
|
+
readonly surfaceArea: number;
|
|
3054
|
+
/** Number of indexed triangles. */
|
|
3055
|
+
readonly triangleCount: number;
|
|
3056
|
+
/** Number of distinct entries in the position buffer. */
|
|
3057
|
+
readonly vertexCount: number;
|
|
3058
|
+
}
|
|
3059
|
+
|
|
3060
|
+
/** Options controlling bounded triangle-mesh quality analysis. */
|
|
3061
|
+
export declare interface TriangleMeshQualityOptions {
|
|
3062
|
+
/** Maximum number of triangles inspected. Defaults to `200000`. */
|
|
3063
|
+
readonly maximumTriangleCount?: number;
|
|
3064
|
+
/** Numeric comparison overrides; model coordinates are interpreted in their existing units. */
|
|
3065
|
+
readonly tolerance?: GeometryToleranceOptions;
|
|
3066
|
+
}
|
|
3067
|
+
|
|
3068
|
+
/** Structural, topological, and planar-patch measurements for one indexed triangle mesh. */
|
|
3069
|
+
export declare interface TriangleMeshQualityReport {
|
|
3070
|
+
/** Number of duplicate triangles beyond their first unordered occurrence. */
|
|
3071
|
+
readonly duplicateTriangleCount: number;
|
|
3072
|
+
/** Number of two-face edges whose incident triangles use the same direction. */
|
|
3073
|
+
readonly inconsistentWindingEdgeCount: number;
|
|
3074
|
+
/** Whether the mesh has valid faces and exactly two oppositely wound faces at every edge. */
|
|
3075
|
+
readonly isClosedOrientedManifold: boolean;
|
|
3076
|
+
/** Largest normalized triangle aspect ratio; an equilateral triangle has ratio `1`. */
|
|
3077
|
+
readonly maximumTriangleAspectRatio: number;
|
|
3078
|
+
/** Largest number of triangles incident to one indexed vertex. */
|
|
3079
|
+
readonly maximumVertexTriangleIncidence: number;
|
|
3080
|
+
/** Largest number of distinct neighbours connected to one indexed vertex. */
|
|
3081
|
+
readonly maximumVertexValence: number;
|
|
3082
|
+
/** Smallest interior triangle angle in degrees. */
|
|
3083
|
+
readonly minimumTriangleAngleDegrees: number;
|
|
3084
|
+
/** Number of triangles at or below the scale-aware zero-area threshold. */
|
|
3085
|
+
readonly nearZeroAreaTriangleCount: number;
|
|
3086
|
+
/** Number of edges with more than two incident triangles. */
|
|
3087
|
+
readonly nonManifoldEdgeCount: number;
|
|
3088
|
+
/** Number of edges with exactly one incident triangle. */
|
|
3089
|
+
readonly openEdgeCount: number;
|
|
3090
|
+
/** Edge-connected coplanar patches in deterministic first-triangle order. */
|
|
3091
|
+
readonly planarPatches: readonly PlanarPatchQuality[];
|
|
3092
|
+
/** Signed enclosed volume in cubic model units; positive values indicate outward winding. */
|
|
3093
|
+
readonly signedVolume: number;
|
|
3094
|
+
/** Total triangle area in squared model units. */
|
|
3095
|
+
readonly surfaceArea: number;
|
|
3096
|
+
/** Number of indexed triangles. */
|
|
3097
|
+
readonly triangleCount: number;
|
|
3098
|
+
/** Number of entries in the position buffer. */
|
|
3099
|
+
readonly vertexCount: number;
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
/** Immutable deterministic measurements for a closed, oriented triangle mesh. */
|
|
3103
|
+
export declare interface TriangleMeshSignature {
|
|
3104
|
+
/** Axis-aligned bounds quantized by `tolerances.position`. */
|
|
3105
|
+
readonly bounds: MeshBounds;
|
|
3106
|
+
/** Number of edge-connected closed components. */
|
|
3107
|
+
readonly connectedComponentCount: number;
|
|
3108
|
+
/** Total orientable genus across all connected components. */
|
|
3109
|
+
readonly genus: number;
|
|
3110
|
+
/** Order-independent hash of quantized vertices and oriented triangles. */
|
|
3111
|
+
readonly fingerprint: string;
|
|
3112
|
+
/** Signed enclosed volume quantized by `tolerances.signedVolume`. */
|
|
3113
|
+
readonly signedVolume: number;
|
|
3114
|
+
/** Quantization used to make the signature stable across insignificant numeric drift. */
|
|
3115
|
+
readonly tolerances: TriangleMeshSignatureTolerances;
|
|
3116
|
+
/** Number of indexed triangles. */
|
|
3117
|
+
readonly triangleCount: number;
|
|
3118
|
+
/** Number of referenced position-buffer vertices. */
|
|
3119
|
+
readonly vertexCount: number;
|
|
3120
|
+
}
|
|
3121
|
+
|
|
3122
|
+
/** Options controlling deterministic triangle-mesh regression signatures. */
|
|
3123
|
+
export declare interface TriangleMeshSignatureOptions {
|
|
3124
|
+
/** Maximum accepted triangle count. Defaults to 200,000. */
|
|
3125
|
+
readonly maximumTriangleCount?: number;
|
|
3126
|
+
/** Position and bounds quantization in model units. Defaults to `1e-5`. */
|
|
3127
|
+
readonly positionTolerance?: number;
|
|
3128
|
+
/** Signed-volume quantization in cubic model units. Defaults to `1e-4`. */
|
|
3129
|
+
readonly volumeTolerance?: number;
|
|
3130
|
+
}
|
|
3131
|
+
|
|
3132
|
+
/** Absolute tolerances recorded in a triangle-mesh regression signature. */
|
|
3133
|
+
export declare interface TriangleMeshSignatureTolerances {
|
|
3134
|
+
/** Position and bounds quantization in model units. */
|
|
3135
|
+
readonly position: number;
|
|
3136
|
+
/** Signed-volume quantization in cubic model units. */
|
|
3137
|
+
readonly signedVolume: number;
|
|
3138
|
+
}
|
|
3139
|
+
|
|
3140
|
+
/** Options controlling structural and manufacturing validation of a mesh. */
|
|
3141
|
+
export declare interface TriangleMeshValidationOptions {
|
|
3142
|
+
/** Permit an empty position and index buffer. Defaults to `false`. */
|
|
3143
|
+
readonly allowEmpty?: boolean;
|
|
3144
|
+
/** Require two oppositely wound faces per edge; geometric self-intersections are not detected. */
|
|
3145
|
+
readonly requireClosed?: boolean;
|
|
3146
|
+
/** Numeric comparison overrides used for zero-area triangle detection. */
|
|
3147
|
+
readonly tolerance?: GeometryToleranceOptions;
|
|
3148
|
+
}
|
|
3084
3149
|
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3150
|
+
/**
|
|
3151
|
+
* ISO/UTS-like 60-degree truncated triangular profile.
|
|
3152
|
+
*/
|
|
3153
|
+
export declare interface TriangularThreadProfileSpec extends ThreadProfileBaseSpec {
|
|
3154
|
+
/** Selects the 60-degree triangular profile family. */
|
|
3155
|
+
readonly kind: "triangular";
|
|
3156
|
+
/**
|
|
3157
|
+
* Crest width divided by pitch.
|
|
3158
|
+
* @defaultValue `1 / 8`
|
|
3159
|
+
*/
|
|
3160
|
+
readonly crestFlatRatio?: number;
|
|
3161
|
+
/**
|
|
3162
|
+
* Root width divided by pitch.
|
|
3163
|
+
* @defaultValue `1 / 4`
|
|
3164
|
+
*/
|
|
3165
|
+
readonly rootFlatRatio?: number;
|
|
3166
|
+
}
|
|
3101
3167
|
|
|
3102
|
-
|
|
3103
|
-
|
|
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;
|
|
3168
|
+
/** Ear-clips one normalized simple CCW loop into stable local vertex indices. */
|
|
3169
|
+
export declare function triangulateLoop2(loop: Loop2): Uint32Array;
|
|
3117
3170
|
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3171
|
+
/**
|
|
3172
|
+
* Dimensions, placement, and tessellation for a hollow Z-axis tube.
|
|
3173
|
+
*/
|
|
3174
|
+
export declare interface TubeOptions extends CircularPrimitiveOptions, PrimitivePlacement {
|
|
3175
|
+
/**
|
|
3176
|
+
* Centers the tube on the Z origin when `true`; otherwise its bottom is at `Z = 0`.
|
|
3177
|
+
* @defaultValue `true`
|
|
3178
|
+
*/
|
|
3179
|
+
readonly center?: boolean;
|
|
3180
|
+
/** Total height along Z in millimetres. */
|
|
3181
|
+
readonly height: number;
|
|
3182
|
+
/** Positive inner radius in millimetres. */
|
|
3183
|
+
readonly innerRadius: number;
|
|
3184
|
+
/** Outer radius in millimetres; greater than {@link TubeOptions.innerRadius}. */
|
|
3185
|
+
readonly outerRadius: number;
|
|
3186
|
+
}
|
|
3127
3187
|
|
|
3128
3188
|
/**
|
|
3129
|
-
*
|
|
3189
|
+
* Checks closed indexed topology, triangle intersections, and alternating nested shell orientation.
|
|
3190
|
+
* Outward exterior shells and inward cavity shells are accepted. Separate shells must not touch,
|
|
3191
|
+
* intersect, or overlap as material. Indexed neighbours may share their own vertex or edge.
|
|
3130
3192
|
*
|
|
3131
|
-
*
|
|
3132
|
-
*
|
|
3133
|
-
*
|
|
3134
|
-
*
|
|
3193
|
+
* Uses bounded floating-point tests, not exact predicates or repair. Contacts within the selected
|
|
3194
|
+
* tolerance reject conservatively. At most 200,000 triangles and 2,000,000 spatial/containment tests
|
|
3195
|
+
* are supported; exhausting a ceiling throws COMPLEXITY_LIMIT rather than claiming validity.
|
|
3196
|
+
* Input buffers are freshly inspected and never modified; units are millimetres.
|
|
3135
3197
|
*
|
|
3136
|
-
* @param mesh -
|
|
3137
|
-
* @param options -
|
|
3138
|
-
* @returns The original mesh after
|
|
3139
|
-
|
|
3198
|
+
* @param mesh - Closed triangle mesh to inspect.
|
|
3199
|
+
* @param options - Optional lower work ceiling and numeric comparison policy.
|
|
3200
|
+
* @returns The original mesh after every requested check succeeds.
|
|
3201
|
+
*/
|
|
3202
|
+
export declare function validateSolidMesh(mesh: TriangleMesh, options?: SolidMeshValidationOptions): TriangleMesh;
|
|
3203
|
+
|
|
3204
|
+
/**
|
|
3205
|
+
* Validates that a transform is finite, affine, and non-singular.
|
|
3206
|
+
*
|
|
3207
|
+
* @param transform - Row-major matrix to validate.
|
|
3208
|
+
* @param tolerance - Optional comparison overrides.
|
|
3209
|
+
* @returns The original transform after successful validation.
|
|
3210
|
+
* @throws {@link GeometryError} For non-finite, non-affine, or singular matrices.
|
|
3140
3211
|
*/
|
|
3141
|
-
export declare function
|
|
3142
|
-
|
|
3143
|
-
/** A two-dimensional Cartesian vector or point. */
|
|
3144
|
-
export declare type Vec2 = readonly [x: number, y: number];
|
|
3145
|
-
|
|
3146
|
-
/** A three-dimensional Cartesian vector or point. */
|
|
3147
|
-
export declare type Vec3 = readonly [x: number, y: number, z: number];
|
|
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
|
-
|
|
3161
|
-
/** Exact curve bounds in millimetres; positive Y points upward. */
|
|
3162
|
-
export declare interface VectorTextBounds {
|
|
3163
|
-
/** Minimum X and Y of visible outlines, including accents, descenders, and overhangs. */
|
|
3164
|
-
readonly min: readonly [number, number];
|
|
3165
|
-
/** Maximum X and Y of visible outlines. */
|
|
3166
|
-
readonly max: readonly [number, number];
|
|
3167
|
-
}
|
|
3212
|
+
export declare function validateTransform3(transform: Transform3, tolerance?: GeometryToleranceOptions): Transform3;
|
|
3168
3213
|
|
|
3169
3214
|
/**
|
|
3170
|
-
*
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3215
|
+
* Validates mesh buffers, indices, triangle area, and optionally closed topology.
|
|
3216
|
+
*
|
|
3217
|
+
* Closed validation requires each edge to occur exactly twice with opposite
|
|
3218
|
+
* directions, rejecting boundary and non-manifold edges. Validation does not
|
|
3219
|
+
* mutate or copy the mesh. This establishes edge connectivity, not the absence
|
|
3220
|
+
* of geometric self-intersections between faces.
|
|
3221
|
+
*
|
|
3222
|
+
* @param mesh - Mesh to inspect.
|
|
3223
|
+
* @param options - Empty-mesh, topology, and tolerance policy.
|
|
3224
|
+
* @returns The original mesh after successful validation.
|
|
3225
|
+
* @throws {@link GeometryError} When any requested invariant fails.
|
|
3226
|
+
*/
|
|
3227
|
+
export declare function validateTriangleMesh(mesh: TriangleMesh, options?: TriangleMeshValidationOptions): TriangleMesh;
|
|
3228
|
+
|
|
3229
|
+
/** A two-dimensional Cartesian vector or point. */
|
|
3230
|
+
export declare type Vec2 = readonly [x: number, y: number];
|
|
3231
|
+
|
|
3232
|
+
/** A three-dimensional Cartesian vector or point. */
|
|
3233
|
+
export declare type Vec3 = readonly [x: number, y: number, z: number];
|
|
3234
|
+
|
|
3235
|
+
/** A circular baseline centered at the XY origin, with rigid shaped glyph groups. */
|
|
3236
|
+
export declare interface VectorTextArcBaseline {
|
|
3237
|
+
/** Selects a circular baseline; glyph outlines rotate without bending or stretching. */
|
|
3238
|
+
readonly kind: "arc";
|
|
3239
|
+
/** Baseline radius in millimetres, greater than zero and at most 10000. */
|
|
3240
|
+
readonly radius: number;
|
|
3241
|
+
/** Alignment datum in degrees counterclockwise from +X; defaults to 90. */
|
|
3242
|
+
readonly centerAngleDegrees?: number;
|
|
3243
|
+
/** Reading direction around the circle; defaults to clockwise. */
|
|
3244
|
+
readonly direction?: "clockwise" | "counterclockwise";
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
/** Exact curve bounds in millimetres; positive Y points upward. */
|
|
3248
|
+
export declare interface VectorTextBounds {
|
|
3249
|
+
/** Minimum X and Y of visible outlines, including accents, descenders, and overhangs. */
|
|
3250
|
+
readonly min: readonly [number, number];
|
|
3251
|
+
/** Maximum X and Y of visible outlines. */
|
|
3252
|
+
readonly max: readonly [number, number];
|
|
3253
|
+
}
|
|
3178
3254
|
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3255
|
+
/**
|
|
3256
|
+
* Immutable vector layout with no browser, font parser, or kernel ownership.
|
|
3257
|
+
*/
|
|
3258
|
+
export declare interface VectorTextLayout {
|
|
3259
|
+
/** Nonzero-filled path data in millimetres, positive Y upward; empty for text with no ink. */
|
|
3260
|
+
readonly paths: readonly string[];
|
|
3261
|
+
/** Exact measurements of these paths and their logical text layout. */
|
|
3262
|
+
readonly metrics: VectorTextMetrics;
|
|
3263
|
+
}
|
|
3264
|
+
|
|
3265
|
+
/**
|
|
3266
|
+
* Text bounded to 512 UTF-16 units: horizontal lines or one circular line without wrapping.
|
|
3267
|
+
*/
|
|
3268
|
+
export declare interface VectorTextLayoutOptions extends VectorTextOptions {
|
|
3269
|
+
/** Place the advance's start, midpoint or end at the datum; defaults to center on arcs, otherwise left. */
|
|
3270
|
+
readonly align?: "left" | "center" | "right";
|
|
3271
|
+
/** Omitted uses horizontal lines. Arcs require one line and baseline vertical alignment. */
|
|
3272
|
+
readonly baseline?: VectorTextArcBaseline;
|
|
3273
|
+
/** Baseline spacing in ems, 0.5–5; omitted uses the selected face's natural vertical metrics. */
|
|
3274
|
+
readonly lineHeight?: number;
|
|
3275
|
+
/** Place the first baseline or complete ink bounds at Y=0; arcs only accept baseline. */
|
|
3276
|
+
readonly verticalAlign?: "baseline" | "top" | "center" | "bottom";
|
|
3277
|
+
}
|
|
3278
|
+
|
|
3279
|
+
/** Text measurements from the same immutable layout that supplies geometry and SVG outlines. */
|
|
3280
|
+
export declare interface VectorTextMetrics {
|
|
3281
|
+
/** Visible curve bounds after alignment, or null when the text has no ink. */
|
|
3282
|
+
readonly bounds: VectorTextBounds | null;
|
|
3283
|
+
/** Unaligned logical advance and negative baseline displacement in mm; arcs retain [arc length, 0]. */
|
|
3284
|
+
readonly advance: readonly [number, number];
|
|
3285
|
+
/** Maximum logical line advance in millimetres, including spaces; arc length on circular baselines. */
|
|
3286
|
+
readonly logicalWidth: number;
|
|
3287
|
+
/** Selected font's ascender distance above a baseline in millimetres, independent of the text. */
|
|
3288
|
+
readonly ascent: number;
|
|
3289
|
+
/** Selected font's descender distance below a baseline in millimetres, a non-negative value. */
|
|
3290
|
+
readonly descent: number;
|
|
3291
|
+
/** Actual distance between baselines in millimetres. */
|
|
3292
|
+
readonly lineHeight: number;
|
|
3293
|
+
/** Number of lines, including empty and trailing lines; empty text occupies one line. */
|
|
3294
|
+
readonly lineCount: number;
|
|
3295
|
+
}
|
|
3296
|
+
|
|
3297
|
+
/** Shaping controls for a prepared exact font face; all lengths are in millimetres. */
|
|
3298
|
+
export declare interface VectorTextOptions {
|
|
3299
|
+
/** Em size in millimetres, greater than zero and at most 10000; not the visible glyph height. */
|
|
3300
|
+
readonly fontSize: number;
|
|
3301
|
+
/** Actual static or variable weight, 1–1000; defaults to the prepared face's static weight. */
|
|
3302
|
+
readonly fontWeight?: number;
|
|
3303
|
+
/** Tracking between glyph clusters in millimetres, -100–100; defaults to zero. */
|
|
3304
|
+
readonly letterSpacing?: number;
|
|
3305
|
+
}
|
|
3306
|
+
|
|
3307
|
+
export { }
|