@snaptrude/plugin-core 0.9.3 → 0.9.5
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 +7 -0
- package/api-manifest.json +1343 -43
- package/dist/api/core/geom/create/index.d.ts +141 -27
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/brep.d.ts +68 -0
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/io/underlay/index.d.ts +519 -0
- package/dist/api/core/io/underlay/index.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +127 -0
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/index.cjs +231 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +209 -2
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
- package/src/api/core/geom/create/index.ts +162 -29
- package/src/api/core/geom/query/brep.ts +74 -0
- package/src/api/core/io/underlay/index.ts +418 -8
- package/src/api/design/query/index.ts +99 -0
|
@@ -63,6 +63,54 @@ export declare abstract class PluginCoreIoUnderlayApi {
|
|
|
63
63
|
* ```
|
|
64
64
|
*/
|
|
65
65
|
abstract getBounds(underlay: UnderlayHandle): PluginApiReturn<BBoxComponents | null>;
|
|
66
|
+
/**
|
|
67
|
+
* List the distinct original AutoCAD layer names retained by a placed CAD
|
|
68
|
+
* underlay. Returns `[]` for non-CAD underlays, legacy imports created before
|
|
69
|
+
* source-layer retention, missing underlays, or CAD drawings without layer tags.
|
|
70
|
+
*
|
|
71
|
+
* @param underlay - The placed CAD underlay to inspect.
|
|
72
|
+
* @returns the retained AutoCAD layer names in first-appearance order.
|
|
73
|
+
*
|
|
74
|
+
* @examplePrompt List the original AutoCAD layers in this imported drawing
|
|
75
|
+
* @examplePrompt Which CAD layers are available in this underlay?
|
|
76
|
+
*
|
|
77
|
+
* # Example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const layers = await snaptrude.core.io.underlay.listCadLayers(cad)
|
|
80
|
+
* console.log(layers)
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
abstract listCadLayers(underlay: UnderlayHandle): PluginApiReturn<string[]>;
|
|
84
|
+
/**
|
|
85
|
+
* Read one original AutoCAD layer's retained line and arc geometry in
|
|
86
|
+
* **Snaptrude world space** and Snaptrude internal units. Results are paged so
|
|
87
|
+
* large drawings can be inspected without returning the whole DWG at once.
|
|
88
|
+
*
|
|
89
|
+
* The world-space coordinates include the CAD underlay's current position,
|
|
90
|
+
* rotation, scale, and storey elevation. `null` means the underlay no longer
|
|
91
|
+
* resolves. An unknown layer returns a page with `total: 0`.
|
|
92
|
+
*
|
|
93
|
+
* @param underlay - The placed CAD underlay to inspect.
|
|
94
|
+
* @param layer - Exact, case-sensitive original AutoCAD layer name.
|
|
95
|
+
* @param options - Optional zero-based offset and page limit (default 500,
|
|
96
|
+
* maximum 1000).
|
|
97
|
+
* @returns a page of retained CAD curves, or `null` if the underlay is gone.
|
|
98
|
+
* @throws if the handle resolves to an image/PDF rather than a CAD underlay.
|
|
99
|
+
*
|
|
100
|
+
* @examplePrompt Read the wall geometry from the A-WALL layer in this CAD underlay
|
|
101
|
+
* @examplePrompt Get the next 500 curves from the structural CAD layer
|
|
102
|
+
*
|
|
103
|
+
* # Example
|
|
104
|
+
* ```ts
|
|
105
|
+
* const page = await snaptrude.core.io.underlay.getCadLayerGeometry(
|
|
106
|
+
* cad,
|
|
107
|
+
* "A-WALL",
|
|
108
|
+
* { offset: 0, limit: 500 },
|
|
109
|
+
* )
|
|
110
|
+
* if (page) console.log(`${page.curves.length} of ${page.total} curves`)
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
abstract getCadLayerGeometry(underlay: UnderlayHandle, layer: string, options?: PluginCadLayerGeometryOptions): PluginApiReturn<PluginCadLayerGeometryPage | null>;
|
|
66
114
|
/**
|
|
67
115
|
* Read an underlay's scale. Works for **image and PDF** underlays. Returns
|
|
68
116
|
* `null` for CAD (scaling not supported) or if the handle no longer resolves.
|
|
@@ -213,6 +261,96 @@ export declare abstract class PluginCoreIoUnderlayApi {
|
|
|
213
261
|
* ```
|
|
214
262
|
*/
|
|
215
263
|
abstract delete(underlay: UnderlayHandle): PluginApiReturn<void>;
|
|
264
|
+
/**
|
|
265
|
+
* Extract **continuous wall centrelines** from one retained AutoCAD layer's
|
|
266
|
+
* double-line wall faces — the deterministic tracing primitive behind
|
|
267
|
+
* CAD-to-BIM wall conversion. Instead of paging raw curves and re-deriving
|
|
268
|
+
* the geometry in worker code, this reads the whole layer and runs the vetted
|
|
269
|
+
* pipeline: cull fragments, dedupe, merge collinear runs into *faces*, pair
|
|
270
|
+
* parallel faces a wall-thickness apart into centrelines (midline = axis,
|
|
271
|
+
* separation = thickness), bridge collinear gaps up to
|
|
272
|
+
* `bridgeOpenings.maxWidth` into ONE continuous centreline while recording
|
|
273
|
+
* each bridged span as an opening, then snap near-touching endpoints at
|
|
274
|
+
* junctions.
|
|
275
|
+
*
|
|
276
|
+
* CAD drafters interrupt wall faces at every door/window, so raw wall layers
|
|
277
|
+
* always have gaps; Snaptrude doors/windows must host into a continuous wall.
|
|
278
|
+
* The returned centrelines are ready for `design.create.walls`, and each
|
|
279
|
+
* centreline's `openings` records where the CAD had a gap — feed those to the
|
|
280
|
+
* door/window placement step. `unpaired` faces (no parallel partner at wall
|
|
281
|
+
* thickness) are evidence, not noise: a run of unpaired perimeter faces
|
|
282
|
+
* usually means that stretch of facade is glazed, not solid.
|
|
283
|
+
*
|
|
284
|
+
* All lengths are in **Snaptrude internal units** (convert from project units
|
|
285
|
+
* with `core.units.convert`). Coordinates are world-space plan (x, z).
|
|
286
|
+
*
|
|
287
|
+
* Thin parallel pairs (glass lines, mullion faces) are the same algorithm at
|
|
288
|
+
* a smaller separation: pass e.g. `thicknessRange: [0.01, 0.25]` with
|
|
289
|
+
* `bridgeOpenings: null` to detect glazing runs on a glazing layer.
|
|
290
|
+
*
|
|
291
|
+
* @param underlay - The placed CAD underlay to read.
|
|
292
|
+
* @param layer - Exact, case-sensitive original AutoCAD layer name.
|
|
293
|
+
* @param options - Tolerances; see {@linkcode PluginCadCenterlineOptions}.
|
|
294
|
+
* @returns centrelines + unpaired faces + stats, or `null` if the underlay is gone.
|
|
295
|
+
* @throws if the handle resolves to an image/PDF rather than a CAD underlay.
|
|
296
|
+
*
|
|
297
|
+
* @examplePrompt Trace the walls from the a-wall CAD layer
|
|
298
|
+
* @examplePrompt Convert the AutoCAD wall linework into Snaptrude walls
|
|
299
|
+
* @examplePrompt Extract wall centrelines with thickness from the imported DWG
|
|
300
|
+
* @examplePrompt Find the glazing runs on the a-glazing layer
|
|
301
|
+
*
|
|
302
|
+
* # Example
|
|
303
|
+
* ```ts
|
|
304
|
+
* const [cad] = await snaptrude.core.io.underlay.list()
|
|
305
|
+
* const r = await snaptrude.core.io.underlay.extractCenterlines(cad, "a-wall")
|
|
306
|
+
* if (r) {
|
|
307
|
+
* const items = r.centerlines.map((c) => ({
|
|
308
|
+
* profile: [c.start, c.end],
|
|
309
|
+
* thickness: c.thickness,
|
|
310
|
+
* }))
|
|
311
|
+
* console.log(`${items.length} walls, ${r.unpaired.length} unpaired faces`)
|
|
312
|
+
* }
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
abstract extractCenterlines(underlay: UnderlayHandle, layer: string, options?: PluginCadCenterlineOptions): PluginApiReturn<PluginCadCenterlinesResult | null>;
|
|
316
|
+
/**
|
|
317
|
+
* Classify one retained AutoCAD layer's **arcs as door swings** — the
|
|
318
|
+
* deterministic tracing primitive behind CAD-to-BIM door placement. A door
|
|
319
|
+
* swing is drawn as a ~90° arc whose radius IS the leaf width and whose
|
|
320
|
+
* centre IS the hinge point. This filters the layer's arcs by plausible
|
|
321
|
+
* radius and sweep (rejecting inch-scale fillets, full-circle symbols and
|
|
322
|
+
* long shallow curves), reads each survivor as a door candidate (hinge, leaf
|
|
323
|
+
* width, swing direction, hosting wall direction), merges mirrored pairs
|
|
324
|
+
* sharing a chord line into double doors, and returns a radius histogram —
|
|
325
|
+
* real drawings use a handful of standard door sizes, so the histogram's
|
|
326
|
+
* clusters are the drawing's door widths (sanity-check them against the
|
|
327
|
+
* catalog; distrust arcs in no cluster).
|
|
328
|
+
*
|
|
329
|
+
* All lengths are in **Snaptrude internal units**. `rejected` lists filtered
|
|
330
|
+
* arcs with reasons so nothing is silently dropped.
|
|
331
|
+
*
|
|
332
|
+
* @param underlay - The placed CAD underlay to read.
|
|
333
|
+
* @param layer - Exact, case-sensitive original AutoCAD layer name.
|
|
334
|
+
* @param options - Gates and binning; see {@linkcode PluginCadArcClassifyOptions}.
|
|
335
|
+
* @returns door candidates + rejected arcs + histogram, or `null` if the underlay is gone.
|
|
336
|
+
* @throws if the handle resolves to an image/PDF rather than a CAD underlay.
|
|
337
|
+
*
|
|
338
|
+
* @examplePrompt Find the doors on the a-door CAD layer
|
|
339
|
+
* @examplePrompt Classify the door swing arcs in the imported drawing
|
|
340
|
+
* @examplePrompt What door sizes does this DWG use?
|
|
341
|
+
* @examplePrompt Read hinge points and leaf widths from the CAD door layer
|
|
342
|
+
*
|
|
343
|
+
* # Example
|
|
344
|
+
* ```ts
|
|
345
|
+
* const [cad] = await snaptrude.core.io.underlay.list()
|
|
346
|
+
* const r = await snaptrude.core.io.underlay.classifyArcs(cad, "a-door")
|
|
347
|
+
* if (r) {
|
|
348
|
+
* console.log(`${r.doors.length} doors; sizes:`,
|
|
349
|
+
* r.radiusHistogram.filter((b) => b.count > 1))
|
|
350
|
+
* }
|
|
351
|
+
* ```
|
|
352
|
+
*/
|
|
353
|
+
abstract classifyArcs(underlay: UnderlayHandle, layer: string, options?: PluginCadArcClassifyOptions): PluginApiReturn<PluginCadArcClassifyResult | null>;
|
|
216
354
|
}
|
|
217
355
|
/**
|
|
218
356
|
* Arguments for {@link PluginCoreIoUnderlayApi.list}.
|
|
@@ -283,4 +421,385 @@ export declare const PluginUnderlayRefArgs: z.ZodObject<{
|
|
|
283
421
|
underlay: z.ZodPipe<z.ZodString, z.ZodTransform<UnderlayHandle, string>>;
|
|
284
422
|
}, z.core.$strip>;
|
|
285
423
|
export type PluginUnderlayRefArgs = z.infer<typeof PluginUnderlayRefArgs>;
|
|
424
|
+
/** A retained AutoCAD line represented as a world-space read record. */
|
|
425
|
+
export declare const PluginCadLineGeometry: z.ZodObject<{
|
|
426
|
+
type: z.ZodLiteral<"line">;
|
|
427
|
+
start: z.ZodObject<{
|
|
428
|
+
x: z.ZodNumber;
|
|
429
|
+
y: z.ZodNumber;
|
|
430
|
+
z: z.ZodNumber;
|
|
431
|
+
}, z.core.$strip>;
|
|
432
|
+
end: z.ZodObject<{
|
|
433
|
+
x: z.ZodNumber;
|
|
434
|
+
y: z.ZodNumber;
|
|
435
|
+
z: z.ZodNumber;
|
|
436
|
+
}, z.core.$strip>;
|
|
437
|
+
}, z.core.$strip>;
|
|
438
|
+
export type PluginCadLineGeometry = z.infer<typeof PluginCadLineGeometry>;
|
|
439
|
+
/** A retained AutoCAD arc represented as a world-space read record. */
|
|
440
|
+
export declare const PluginCadArcGeometry: z.ZodObject<{
|
|
441
|
+
type: z.ZodLiteral<"arc">;
|
|
442
|
+
centre: z.ZodObject<{
|
|
443
|
+
x: z.ZodNumber;
|
|
444
|
+
y: z.ZodNumber;
|
|
445
|
+
z: z.ZodNumber;
|
|
446
|
+
}, z.core.$strip>;
|
|
447
|
+
axis: z.ZodObject<{
|
|
448
|
+
x: z.ZodNumber;
|
|
449
|
+
y: z.ZodNumber;
|
|
450
|
+
z: z.ZodNumber;
|
|
451
|
+
}, z.core.$strip>;
|
|
452
|
+
start: z.ZodObject<{
|
|
453
|
+
x: z.ZodNumber;
|
|
454
|
+
y: z.ZodNumber;
|
|
455
|
+
z: z.ZodNumber;
|
|
456
|
+
}, z.core.$strip>;
|
|
457
|
+
end: z.ZodObject<{
|
|
458
|
+
x: z.ZodNumber;
|
|
459
|
+
y: z.ZodNumber;
|
|
460
|
+
z: z.ZodNumber;
|
|
461
|
+
}, z.core.$strip>;
|
|
462
|
+
}, z.core.$strip>;
|
|
463
|
+
export type PluginCadArcGeometry = z.infer<typeof PluginCadArcGeometry>;
|
|
464
|
+
/** Line or arc geometry returned by `getCadLayerGeometry`. */
|
|
465
|
+
export declare const PluginCadGeometry: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
466
|
+
type: z.ZodLiteral<"line">;
|
|
467
|
+
start: z.ZodObject<{
|
|
468
|
+
x: z.ZodNumber;
|
|
469
|
+
y: z.ZodNumber;
|
|
470
|
+
z: z.ZodNumber;
|
|
471
|
+
}, z.core.$strip>;
|
|
472
|
+
end: z.ZodObject<{
|
|
473
|
+
x: z.ZodNumber;
|
|
474
|
+
y: z.ZodNumber;
|
|
475
|
+
z: z.ZodNumber;
|
|
476
|
+
}, z.core.$strip>;
|
|
477
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
478
|
+
type: z.ZodLiteral<"arc">;
|
|
479
|
+
centre: z.ZodObject<{
|
|
480
|
+
x: z.ZodNumber;
|
|
481
|
+
y: z.ZodNumber;
|
|
482
|
+
z: z.ZodNumber;
|
|
483
|
+
}, z.core.$strip>;
|
|
484
|
+
axis: z.ZodObject<{
|
|
485
|
+
x: z.ZodNumber;
|
|
486
|
+
y: z.ZodNumber;
|
|
487
|
+
z: z.ZodNumber;
|
|
488
|
+
}, z.core.$strip>;
|
|
489
|
+
start: z.ZodObject<{
|
|
490
|
+
x: z.ZodNumber;
|
|
491
|
+
y: z.ZodNumber;
|
|
492
|
+
z: z.ZodNumber;
|
|
493
|
+
}, z.core.$strip>;
|
|
494
|
+
end: z.ZodObject<{
|
|
495
|
+
x: z.ZodNumber;
|
|
496
|
+
y: z.ZodNumber;
|
|
497
|
+
z: z.ZodNumber;
|
|
498
|
+
}, z.core.$strip>;
|
|
499
|
+
}, z.core.$strip>], "type">;
|
|
500
|
+
export type PluginCadGeometry = z.infer<typeof PluginCadGeometry>;
|
|
501
|
+
/** Pagination options for `getCadLayerGeometry`. */
|
|
502
|
+
export declare const PluginCadLayerGeometryOptions: z.ZodObject<{
|
|
503
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
504
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
505
|
+
}, z.core.$strip>;
|
|
506
|
+
export type PluginCadLayerGeometryOptions = z.input<typeof PluginCadLayerGeometryOptions>;
|
|
507
|
+
/** Arguments for {@link PluginCoreIoUnderlayApi.getCadLayerGeometry}. */
|
|
508
|
+
export declare const PluginCadLayerGeometryArgs: z.ZodObject<{
|
|
509
|
+
underlay: z.ZodPipe<z.ZodString, z.ZodTransform<UnderlayHandle, string>>;
|
|
510
|
+
layer: z.ZodString;
|
|
511
|
+
options: z.ZodDefault<z.ZodObject<{
|
|
512
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
513
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
514
|
+
}, z.core.$strip>>;
|
|
515
|
+
}, z.core.$strip>;
|
|
516
|
+
export type PluginCadLayerGeometryArgs = z.infer<typeof PluginCadLayerGeometryArgs>;
|
|
517
|
+
/** A page of one original AutoCAD layer's geometry in Snaptrude world space. */
|
|
518
|
+
export declare const PluginCadLayerGeometryPage: z.ZodObject<{
|
|
519
|
+
layer: z.ZodString;
|
|
520
|
+
coordinateSpace: z.ZodLiteral<"snaptrude-world">;
|
|
521
|
+
units: z.ZodLiteral<"snaptrude-internal">;
|
|
522
|
+
total: z.ZodNumber;
|
|
523
|
+
offset: z.ZodNumber;
|
|
524
|
+
curves: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
525
|
+
type: z.ZodLiteral<"line">;
|
|
526
|
+
start: z.ZodObject<{
|
|
527
|
+
x: z.ZodNumber;
|
|
528
|
+
y: z.ZodNumber;
|
|
529
|
+
z: z.ZodNumber;
|
|
530
|
+
}, z.core.$strip>;
|
|
531
|
+
end: z.ZodObject<{
|
|
532
|
+
x: z.ZodNumber;
|
|
533
|
+
y: z.ZodNumber;
|
|
534
|
+
z: z.ZodNumber;
|
|
535
|
+
}, z.core.$strip>;
|
|
536
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
537
|
+
type: z.ZodLiteral<"arc">;
|
|
538
|
+
centre: z.ZodObject<{
|
|
539
|
+
x: z.ZodNumber;
|
|
540
|
+
y: z.ZodNumber;
|
|
541
|
+
z: z.ZodNumber;
|
|
542
|
+
}, z.core.$strip>;
|
|
543
|
+
axis: z.ZodObject<{
|
|
544
|
+
x: z.ZodNumber;
|
|
545
|
+
y: z.ZodNumber;
|
|
546
|
+
z: z.ZodNumber;
|
|
547
|
+
}, z.core.$strip>;
|
|
548
|
+
start: z.ZodObject<{
|
|
549
|
+
x: z.ZodNumber;
|
|
550
|
+
y: z.ZodNumber;
|
|
551
|
+
z: z.ZodNumber;
|
|
552
|
+
}, z.core.$strip>;
|
|
553
|
+
end: z.ZodObject<{
|
|
554
|
+
x: z.ZodNumber;
|
|
555
|
+
y: z.ZodNumber;
|
|
556
|
+
z: z.ZodNumber;
|
|
557
|
+
}, z.core.$strip>;
|
|
558
|
+
}, z.core.$strip>], "type">>;
|
|
559
|
+
}, z.core.$strip>;
|
|
560
|
+
export type PluginCadLayerGeometryPage = z.infer<typeof PluginCadLayerGeometryPage>;
|
|
561
|
+
/** A point in the world-space plan (x, z) projection, Snaptrude internal units. */
|
|
562
|
+
export declare const PluginPlanPoint: z.ZodObject<{
|
|
563
|
+
x: z.ZodNumber;
|
|
564
|
+
z: z.ZodNumber;
|
|
565
|
+
}, z.core.$strip>;
|
|
566
|
+
export type PluginPlanPoint = z.infer<typeof PluginPlanPoint>;
|
|
567
|
+
/**
|
|
568
|
+
* Options for {@link PluginCoreIoUnderlayApi.extractCenterlines}. All lengths in
|
|
569
|
+
* Snaptrude internal units.
|
|
570
|
+
*
|
|
571
|
+
* | Property | Type | Description |
|
|
572
|
+
* |---|---|---|
|
|
573
|
+
* | `thicknessRange` | `[number, number]`? | Plausible wall thickness `[min, max]` (default `[0.3, 1.6]` ≈ 3–16 in) |
|
|
574
|
+
* | `mergeGap` | `number`? | Noise tolerance joining collinear segments that are really one face (default `0.05`) |
|
|
575
|
+
* | `minLength` | `number`? | Cull fragments shorter than this (default `0.1`) |
|
|
576
|
+
* | `parallelTolDeg` | `number`? | Max angle in degrees between faces still considered parallel (default `2`) |
|
|
577
|
+
* | `minOverlap` | `number`? | Fraction of the shorter face that must overlap its pair (default `0.6`) |
|
|
578
|
+
* | `bridgeOpenings` | `{ maxWidth }` \| `null`? | Close collinear centreline gaps up to `maxWidth`, recording each as an opening (default `{ maxWidth: 9.6 }` ≈ 8 ft); `null` disables bridging |
|
|
579
|
+
*/
|
|
580
|
+
export declare const PluginCadCenterlineOptions: z.ZodObject<{
|
|
581
|
+
thicknessRange: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
582
|
+
mergeGap: z.ZodDefault<z.ZodNumber>;
|
|
583
|
+
minLength: z.ZodDefault<z.ZodNumber>;
|
|
584
|
+
parallelTolDeg: z.ZodDefault<z.ZodNumber>;
|
|
585
|
+
minOverlap: z.ZodDefault<z.ZodNumber>;
|
|
586
|
+
bridgeOpenings: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
587
|
+
maxWidth: z.ZodNumber;
|
|
588
|
+
}, z.core.$strip>>>;
|
|
589
|
+
}, z.core.$strip>;
|
|
590
|
+
export type PluginCadCenterlineOptions = z.input<typeof PluginCadCenterlineOptions>;
|
|
591
|
+
/** Arguments for {@link PluginCoreIoUnderlayApi.extractCenterlines}. */
|
|
592
|
+
export declare const PluginCadCenterlinesArgs: z.ZodObject<{
|
|
593
|
+
underlay: z.ZodPipe<z.ZodString, z.ZodTransform<UnderlayHandle, string>>;
|
|
594
|
+
layer: z.ZodString;
|
|
595
|
+
options: z.ZodDefault<z.ZodObject<{
|
|
596
|
+
thicknessRange: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
597
|
+
mergeGap: z.ZodDefault<z.ZodNumber>;
|
|
598
|
+
minLength: z.ZodDefault<z.ZodNumber>;
|
|
599
|
+
parallelTolDeg: z.ZodDefault<z.ZodNumber>;
|
|
600
|
+
minOverlap: z.ZodDefault<z.ZodNumber>;
|
|
601
|
+
bridgeOpenings: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
602
|
+
maxWidth: z.ZodNumber;
|
|
603
|
+
}, z.core.$strip>>>;
|
|
604
|
+
}, z.core.$strip>>;
|
|
605
|
+
}, z.core.$strip>;
|
|
606
|
+
export type PluginCadCenterlinesArgs = z.infer<typeof PluginCadCenterlinesArgs>;
|
|
607
|
+
/** A span bridged over a CAD gap in a continuous centreline — a door/window opening candidate. */
|
|
608
|
+
export declare const PluginCadOpening: z.ZodObject<{
|
|
609
|
+
start: z.ZodObject<{
|
|
610
|
+
x: z.ZodNumber;
|
|
611
|
+
z: z.ZodNumber;
|
|
612
|
+
}, z.core.$strip>;
|
|
613
|
+
end: z.ZodObject<{
|
|
614
|
+
x: z.ZodNumber;
|
|
615
|
+
z: z.ZodNumber;
|
|
616
|
+
}, z.core.$strip>;
|
|
617
|
+
width: z.ZodNumber;
|
|
618
|
+
}, z.core.$strip>;
|
|
619
|
+
export type PluginCadOpening = z.infer<typeof PluginCadOpening>;
|
|
620
|
+
/**
|
|
621
|
+
* One continuous wall centreline extracted from CAD wall faces. `thickness` is
|
|
622
|
+
* the measured face separation; `openings` are the CAD gaps bridged into this
|
|
623
|
+
* centreline (feed the door/window step).
|
|
624
|
+
*/
|
|
625
|
+
export declare const PluginCadCenterline: z.ZodObject<{
|
|
626
|
+
start: z.ZodObject<{
|
|
627
|
+
x: z.ZodNumber;
|
|
628
|
+
z: z.ZodNumber;
|
|
629
|
+
}, z.core.$strip>;
|
|
630
|
+
end: z.ZodObject<{
|
|
631
|
+
x: z.ZodNumber;
|
|
632
|
+
z: z.ZodNumber;
|
|
633
|
+
}, z.core.$strip>;
|
|
634
|
+
thickness: z.ZodNumber;
|
|
635
|
+
length: z.ZodNumber;
|
|
636
|
+
sourceFaceCount: z.ZodNumber;
|
|
637
|
+
openings: z.ZodArray<z.ZodObject<{
|
|
638
|
+
start: z.ZodObject<{
|
|
639
|
+
x: z.ZodNumber;
|
|
640
|
+
z: z.ZodNumber;
|
|
641
|
+
}, z.core.$strip>;
|
|
642
|
+
end: z.ZodObject<{
|
|
643
|
+
x: z.ZodNumber;
|
|
644
|
+
z: z.ZodNumber;
|
|
645
|
+
}, z.core.$strip>;
|
|
646
|
+
width: z.ZodNumber;
|
|
647
|
+
}, z.core.$strip>>;
|
|
648
|
+
}, z.core.$strip>;
|
|
649
|
+
export type PluginCadCenterline = z.infer<typeof PluginCadCenterline>;
|
|
650
|
+
/** A merged face with no parallel partner at wall thickness — evidence (often glazing), not noise. */
|
|
651
|
+
export declare const PluginCadUnpairedFace: z.ZodObject<{
|
|
652
|
+
start: z.ZodObject<{
|
|
653
|
+
x: z.ZodNumber;
|
|
654
|
+
z: z.ZodNumber;
|
|
655
|
+
}, z.core.$strip>;
|
|
656
|
+
end: z.ZodObject<{
|
|
657
|
+
x: z.ZodNumber;
|
|
658
|
+
z: z.ZodNumber;
|
|
659
|
+
}, z.core.$strip>;
|
|
660
|
+
length: z.ZodNumber;
|
|
661
|
+
}, z.core.$strip>;
|
|
662
|
+
export type PluginCadUnpairedFace = z.infer<typeof PluginCadUnpairedFace>;
|
|
663
|
+
/** Result of {@link PluginCoreIoUnderlayApi.extractCenterlines}. */
|
|
664
|
+
export declare const PluginCadCenterlinesResult: z.ZodObject<{
|
|
665
|
+
layer: z.ZodString;
|
|
666
|
+
coordinateSpace: z.ZodLiteral<"snaptrude-world">;
|
|
667
|
+
units: z.ZodLiteral<"snaptrude-internal">;
|
|
668
|
+
centerlines: z.ZodArray<z.ZodObject<{
|
|
669
|
+
start: z.ZodObject<{
|
|
670
|
+
x: z.ZodNumber;
|
|
671
|
+
z: z.ZodNumber;
|
|
672
|
+
}, z.core.$strip>;
|
|
673
|
+
end: z.ZodObject<{
|
|
674
|
+
x: z.ZodNumber;
|
|
675
|
+
z: z.ZodNumber;
|
|
676
|
+
}, z.core.$strip>;
|
|
677
|
+
thickness: z.ZodNumber;
|
|
678
|
+
length: z.ZodNumber;
|
|
679
|
+
sourceFaceCount: z.ZodNumber;
|
|
680
|
+
openings: z.ZodArray<z.ZodObject<{
|
|
681
|
+
start: z.ZodObject<{
|
|
682
|
+
x: z.ZodNumber;
|
|
683
|
+
z: z.ZodNumber;
|
|
684
|
+
}, z.core.$strip>;
|
|
685
|
+
end: z.ZodObject<{
|
|
686
|
+
x: z.ZodNumber;
|
|
687
|
+
z: z.ZodNumber;
|
|
688
|
+
}, z.core.$strip>;
|
|
689
|
+
width: z.ZodNumber;
|
|
690
|
+
}, z.core.$strip>>;
|
|
691
|
+
}, z.core.$strip>>;
|
|
692
|
+
unpaired: z.ZodArray<z.ZodObject<{
|
|
693
|
+
start: z.ZodObject<{
|
|
694
|
+
x: z.ZodNumber;
|
|
695
|
+
z: z.ZodNumber;
|
|
696
|
+
}, z.core.$strip>;
|
|
697
|
+
end: z.ZodObject<{
|
|
698
|
+
x: z.ZodNumber;
|
|
699
|
+
z: z.ZodNumber;
|
|
700
|
+
}, z.core.$strip>;
|
|
701
|
+
length: z.ZodNumber;
|
|
702
|
+
}, z.core.$strip>>;
|
|
703
|
+
stats: z.ZodObject<{
|
|
704
|
+
curvesRead: z.ZodNumber;
|
|
705
|
+
arcsSkipped: z.ZodNumber;
|
|
706
|
+
fragmentsCulled: z.ZodNumber;
|
|
707
|
+
duplicates: z.ZodNumber;
|
|
708
|
+
faces: z.ZodNumber;
|
|
709
|
+
}, z.core.$strip>;
|
|
710
|
+
}, z.core.$strip>;
|
|
711
|
+
export type PluginCadCenterlinesResult = z.infer<typeof PluginCadCenterlinesResult>;
|
|
712
|
+
/**
|
|
713
|
+
* Options for {@link PluginCoreIoUnderlayApi.classifyArcs}. Lengths in Snaptrude
|
|
714
|
+
* internal units, sweeps in degrees.
|
|
715
|
+
*
|
|
716
|
+
* | Property | Type | Description |
|
|
717
|
+
* |---|---|---|
|
|
718
|
+
* | `radiusRange` | `[number, number]`? | Plausible door-leaf widths (default `[3, 5.4]` ≈ 2.5–4.5 ft) |
|
|
719
|
+
* | `sweepRangeDeg` | `[number, number]`? | Accepted arc sweep in degrees (default `[60, 120]`; a swing is ~90°) |
|
|
720
|
+
* | `clusterTol` | `number`? | Radius bin size for the histogram (default `0.1`) |
|
|
721
|
+
*/
|
|
722
|
+
export declare const PluginCadArcClassifyOptions: z.ZodObject<{
|
|
723
|
+
radiusRange: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
724
|
+
sweepRangeDeg: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
725
|
+
clusterTol: z.ZodDefault<z.ZodNumber>;
|
|
726
|
+
}, z.core.$strip>;
|
|
727
|
+
export type PluginCadArcClassifyOptions = z.input<typeof PluginCadArcClassifyOptions>;
|
|
728
|
+
/** Arguments for {@link PluginCoreIoUnderlayApi.classifyArcs}. */
|
|
729
|
+
export declare const PluginCadArcClassifyArgs: z.ZodObject<{
|
|
730
|
+
underlay: z.ZodPipe<z.ZodString, z.ZodTransform<UnderlayHandle, string>>;
|
|
731
|
+
layer: z.ZodString;
|
|
732
|
+
options: z.ZodDefault<z.ZodObject<{
|
|
733
|
+
radiusRange: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
734
|
+
sweepRangeDeg: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
735
|
+
clusterTol: z.ZodDefault<z.ZodNumber>;
|
|
736
|
+
}, z.core.$strip>>;
|
|
737
|
+
}, z.core.$strip>;
|
|
738
|
+
export type PluginCadArcClassifyArgs = z.infer<typeof PluginCadArcClassifyArgs>;
|
|
739
|
+
/**
|
|
740
|
+
* One door candidate read from a CAD swing arc. `hinge` is the arc centre,
|
|
741
|
+
* `leafWidth` the arc radius, `swingDir` the unit direction from hinge toward
|
|
742
|
+
* the open leaf, `wallDir` the unit direction of the hosting wall (hinge →
|
|
743
|
+
* closed-leaf chord end). `openingWidth` equals `leafWidth` for singles and
|
|
744
|
+
* `2 × leafWidth` for doubles.
|
|
745
|
+
*/
|
|
746
|
+
export declare const PluginCadDoorCandidate: z.ZodObject<{
|
|
747
|
+
hinge: z.ZodObject<{
|
|
748
|
+
x: z.ZodNumber;
|
|
749
|
+
z: z.ZodNumber;
|
|
750
|
+
}, z.core.$strip>;
|
|
751
|
+
leafWidth: z.ZodNumber;
|
|
752
|
+
swingDir: z.ZodObject<{
|
|
753
|
+
x: z.ZodNumber;
|
|
754
|
+
z: z.ZodNumber;
|
|
755
|
+
}, z.core.$strip>;
|
|
756
|
+
wallDir: z.ZodObject<{
|
|
757
|
+
x: z.ZodNumber;
|
|
758
|
+
z: z.ZodNumber;
|
|
759
|
+
}, z.core.$strip>;
|
|
760
|
+
openingWidth: z.ZodNumber;
|
|
761
|
+
double: z.ZodBoolean;
|
|
762
|
+
}, z.core.$strip>;
|
|
763
|
+
export type PluginCadDoorCandidate = z.infer<typeof PluginCadDoorCandidate>;
|
|
764
|
+
/** Result of {@link PluginCoreIoUnderlayApi.classifyArcs}. */
|
|
765
|
+
export declare const PluginCadArcClassifyResult: z.ZodObject<{
|
|
766
|
+
layer: z.ZodString;
|
|
767
|
+
coordinateSpace: z.ZodLiteral<"snaptrude-world">;
|
|
768
|
+
units: z.ZodLiteral<"snaptrude-internal">;
|
|
769
|
+
doors: z.ZodArray<z.ZodObject<{
|
|
770
|
+
hinge: z.ZodObject<{
|
|
771
|
+
x: z.ZodNumber;
|
|
772
|
+
z: z.ZodNumber;
|
|
773
|
+
}, z.core.$strip>;
|
|
774
|
+
leafWidth: z.ZodNumber;
|
|
775
|
+
swingDir: z.ZodObject<{
|
|
776
|
+
x: z.ZodNumber;
|
|
777
|
+
z: z.ZodNumber;
|
|
778
|
+
}, z.core.$strip>;
|
|
779
|
+
wallDir: z.ZodObject<{
|
|
780
|
+
x: z.ZodNumber;
|
|
781
|
+
z: z.ZodNumber;
|
|
782
|
+
}, z.core.$strip>;
|
|
783
|
+
openingWidth: z.ZodNumber;
|
|
784
|
+
double: z.ZodBoolean;
|
|
785
|
+
}, z.core.$strip>>;
|
|
786
|
+
rejected: z.ZodArray<z.ZodObject<{
|
|
787
|
+
centre: z.ZodObject<{
|
|
788
|
+
x: z.ZodNumber;
|
|
789
|
+
z: z.ZodNumber;
|
|
790
|
+
}, z.core.$strip>;
|
|
791
|
+
radius: z.ZodNumber;
|
|
792
|
+
sweepDeg: z.ZodNumber;
|
|
793
|
+
reason: z.ZodString;
|
|
794
|
+
}, z.core.$strip>>;
|
|
795
|
+
radiusHistogram: z.ZodArray<z.ZodObject<{
|
|
796
|
+
radius: z.ZodNumber;
|
|
797
|
+
count: z.ZodNumber;
|
|
798
|
+
}, z.core.$strip>>;
|
|
799
|
+
stats: z.ZodObject<{
|
|
800
|
+
curvesRead: z.ZodNumber;
|
|
801
|
+
arcsConsidered: z.ZodNumber;
|
|
802
|
+
}, z.core.$strip>;
|
|
803
|
+
}, z.core.$strip>;
|
|
804
|
+
export type PluginCadArcClassifyResult = z.infer<typeof PluginCadArcClassifyResult>;
|
|
286
805
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/core/io/underlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/core/io/underlay/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,cAAc,EACd,cAAc,EAEf,MAAM,qBAAqB,CAA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;AAClE,eAAO,MAAM,wBAAwB;;;;;;;;iBAQnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;iBAOjC,CAAA;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E,8DAA8D;AAC9D,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoBrC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,CAClC,CAAA"}
|
|
@@ -1148,7 +1148,134 @@ export declare abstract class PluginDesignQueryApi {
|
|
|
1148
1148
|
* ```
|
|
1149
1149
|
*/
|
|
1150
1150
|
abstract getBoundingBox(components: ComponentHandle[]): PluginApiReturn<BBoxComponents | null>;
|
|
1151
|
+
/**
|
|
1152
|
+
* Compute the plan **outline of what is built on a storey** — the union of
|
|
1153
|
+
* the storey's wall (by default) footprints as polygons-with-holes. This is
|
|
1154
|
+
* the footprint-from-the-built-model query: by the time slabs are needed the
|
|
1155
|
+
* walls exist, and the engine's own solids (snapped, joined and mitred at
|
|
1156
|
+
* creation) are the cleanest wall network available — no CAD re-tracing.
|
|
1157
|
+
*
|
|
1158
|
+
* Semantics: the union of wall solids is the wall *material* — a ring-shaped
|
|
1159
|
+
* polygon. The **outer ring is the OUTSIDE wall face** (the slab boundary);
|
|
1160
|
+
* every enclosed region — rooms AND courtyards — appears as a hole. When the
|
|
1161
|
+
* largest hole is ~zero the walls don't enclose anything: the footprint
|
|
1162
|
+
* reports `enclosed: false` (an open wall network), never a garbage outline.
|
|
1163
|
+
* Detached buildings come back as separate footprints.
|
|
1164
|
+
*
|
|
1165
|
+
* A read — nothing is created. Feed a footprint's `outline` to
|
|
1166
|
+
* `core.geom.create.profileFromLinePoints` → `design.create.slab` to build
|
|
1167
|
+
* the floor/roof plate. Coordinates are world-space plan (x, z) in Snaptrude
|
|
1168
|
+
* internal units; `areaSq` values are in squared internal units.
|
|
1169
|
+
*
|
|
1170
|
+
* @param options - storey / included kinds / debris filter; see
|
|
1171
|
+
* {@linkcode PluginStoreyOutlineOptions}.
|
|
1172
|
+
* @returns the storey's footprints (possibly several for detached buildings)
|
|
1173
|
+
* plus pieces discarded by `minArea` (`footprints: []` when nothing matches).
|
|
1174
|
+
*
|
|
1175
|
+
* @examplePrompt What is the building footprint on the ground floor?
|
|
1176
|
+
* @examplePrompt Create a floor slab covering the whole storey
|
|
1177
|
+
* @examplePrompt Get the outline of the walls on storey 1
|
|
1178
|
+
* @examplePrompt How much area do the ground-floor walls enclose?
|
|
1179
|
+
*
|
|
1180
|
+
* # Example
|
|
1181
|
+
* ```ts
|
|
1182
|
+
* const r = await snaptrude.design.query.storeyOutline({ storey: 1 })
|
|
1183
|
+
* const main = r.footprints.find((f) => f.enclosed)
|
|
1184
|
+
* if (main) {
|
|
1185
|
+
* const profile = await snaptrude.core.geom.create.profileFromLinePoints(
|
|
1186
|
+
* main.outline.map((p) => ({ x: p.x, y: 0, z: p.z })),
|
|
1187
|
+
* )
|
|
1188
|
+
* // → design.create.slab with the profile's contour
|
|
1189
|
+
* }
|
|
1190
|
+
* ```
|
|
1191
|
+
*/
|
|
1192
|
+
abstract storeyOutline(options?: PluginStoreyOutlineOptions): PluginApiReturn<PluginStoreyOutlineResult>;
|
|
1151
1193
|
}
|
|
1194
|
+
/** A point in the world-space plan (x, z) projection, Snaptrude internal units. */
|
|
1195
|
+
export declare const PluginOutlinePlanPoint: z.ZodObject<{
|
|
1196
|
+
x: z.ZodNumber;
|
|
1197
|
+
z: z.ZodNumber;
|
|
1198
|
+
}, z.core.$strip>;
|
|
1199
|
+
export type PluginOutlinePlanPoint = z.infer<typeof PluginOutlinePlanPoint>;
|
|
1200
|
+
/**
|
|
1201
|
+
* Options for {@link PluginDesignQueryApi.storeyOutline}.
|
|
1202
|
+
*
|
|
1203
|
+
* | Property | Type | Description |
|
|
1204
|
+
* |---|---|---|
|
|
1205
|
+
* | `storey` | `number`? | Only components on this storey (default: all storeys) |
|
|
1206
|
+
* | `include` | {@link PluginEntityType}`[]`? | Component kinds to union (default `["wall"]`) |
|
|
1207
|
+
* | `minArea` | `number`? | Drop union pieces below this plan area, squared internal units (default `1`) |
|
|
1208
|
+
*/
|
|
1209
|
+
export declare const PluginStoreyOutlineOptions: z.ZodObject<{
|
|
1210
|
+
storey: z.ZodOptional<z.ZodNumber>;
|
|
1211
|
+
include: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
1212
|
+
mass: "mass";
|
|
1213
|
+
floor: "floor";
|
|
1214
|
+
wall: "wall";
|
|
1215
|
+
ceiling: "ceiling";
|
|
1216
|
+
door: "door";
|
|
1217
|
+
window: "window";
|
|
1218
|
+
furniture: "furniture";
|
|
1219
|
+
space: "space";
|
|
1220
|
+
slab: "slab";
|
|
1221
|
+
roof: "roof";
|
|
1222
|
+
column: "column";
|
|
1223
|
+
beam: "beam";
|
|
1224
|
+
staircase: "staircase";
|
|
1225
|
+
referenceLine: "referenceLine";
|
|
1226
|
+
curtainWall: "curtainWall";
|
|
1227
|
+
mullion: "mullion";
|
|
1228
|
+
panel: "panel";
|
|
1229
|
+
}>>>;
|
|
1230
|
+
minArea: z.ZodDefault<z.ZodNumber>;
|
|
1231
|
+
}, z.core.$strip>;
|
|
1232
|
+
export type PluginStoreyOutlineOptions = z.input<typeof PluginStoreyOutlineOptions>;
|
|
1233
|
+
/**
|
|
1234
|
+
* One connected footprint from {@link PluginDesignQueryApi.storeyOutline}.
|
|
1235
|
+
* `outline` traces the OUTSIDE wall face; `holes` are the enclosed regions
|
|
1236
|
+
* (rooms and courtyards). `enclosed` is `false` when the wall network does not
|
|
1237
|
+
* close around any region (open C-shape) — don't slab an unenclosed outline
|
|
1238
|
+
* without checking it.
|
|
1239
|
+
*/
|
|
1240
|
+
export declare const PluginStoreyFootprint: z.ZodObject<{
|
|
1241
|
+
outline: z.ZodArray<z.ZodObject<{
|
|
1242
|
+
x: z.ZodNumber;
|
|
1243
|
+
z: z.ZodNumber;
|
|
1244
|
+
}, z.core.$strip>>;
|
|
1245
|
+
holes: z.ZodArray<z.ZodObject<{
|
|
1246
|
+
ring: z.ZodArray<z.ZodObject<{
|
|
1247
|
+
x: z.ZodNumber;
|
|
1248
|
+
z: z.ZodNumber;
|
|
1249
|
+
}, z.core.$strip>>;
|
|
1250
|
+
areaSq: z.ZodNumber;
|
|
1251
|
+
}, z.core.$strip>>;
|
|
1252
|
+
areaSq: z.ZodNumber;
|
|
1253
|
+
enclosed: z.ZodBoolean;
|
|
1254
|
+
}, z.core.$strip>;
|
|
1255
|
+
export type PluginStoreyFootprint = z.infer<typeof PluginStoreyFootprint>;
|
|
1256
|
+
/** Result of {@link PluginDesignQueryApi.storeyOutline}. */
|
|
1257
|
+
export declare const PluginStoreyOutlineResult: z.ZodObject<{
|
|
1258
|
+
footprints: z.ZodArray<z.ZodObject<{
|
|
1259
|
+
outline: z.ZodArray<z.ZodObject<{
|
|
1260
|
+
x: z.ZodNumber;
|
|
1261
|
+
z: z.ZodNumber;
|
|
1262
|
+
}, z.core.$strip>>;
|
|
1263
|
+
holes: z.ZodArray<z.ZodObject<{
|
|
1264
|
+
ring: z.ZodArray<z.ZodObject<{
|
|
1265
|
+
x: z.ZodNumber;
|
|
1266
|
+
z: z.ZodNumber;
|
|
1267
|
+
}, z.core.$strip>>;
|
|
1268
|
+
areaSq: z.ZodNumber;
|
|
1269
|
+
}, z.core.$strip>>;
|
|
1270
|
+
areaSq: z.ZodNumber;
|
|
1271
|
+
enclosed: z.ZodBoolean;
|
|
1272
|
+
}, z.core.$strip>>;
|
|
1273
|
+
discarded: z.ZodArray<z.ZodObject<{
|
|
1274
|
+
areaSq: z.ZodNumber;
|
|
1275
|
+
reason: z.ZodString;
|
|
1276
|
+
}, z.core.$strip>>;
|
|
1277
|
+
}, z.core.$strip>;
|
|
1278
|
+
export type PluginStoreyOutlineResult = z.infer<typeof PluginStoreyOutlineResult>;
|
|
1152
1279
|
export * from "./geometry";
|
|
1153
1280
|
export * from "./spaces";
|
|
1154
1281
|
export * from "./referenceLines";
|