@snaptrude/plugin-core 0.9.4 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/api-manifest.json +154 -1
- package/dist/api/core/camera/index.d.ts +16 -0
- package/dist/api/core/camera/index.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/core/project/index.d.ts +68 -1
- package/dist/api/core/project/index.d.ts.map +1 -1
- package/dist/api/core/storeys/index.d.ts +14 -0
- package/dist/api/core/storeys/index.d.ts.map +1 -1
- package/dist/api/design/furniture/index.d.ts +33 -0
- package/dist/api/design/furniture/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/api/design/visibility.d.ts +28 -0
- package/dist/api/design/visibility.d.ts.map +1 -1
- package/dist/index.cjs +209 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +186 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/core/camera/index.ts +17 -0
- package/src/api/core/io/underlay/index.ts +418 -8
- package/src/api/core/project/index.ts +62 -1
- package/src/api/core/storeys/index.ts +15 -0
- package/src/api/design/furniture/index.ts +34 -0
- package/src/api/design/query/index.ts +99 -0
- package/src/api/design/visibility.ts +34 -0
- package/api-manifest.full.json +0 -8133
|
@@ -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,MA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;;;;;;;;;;;;;;iBAarC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,CAClC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B;;;;iBAQtC,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,2BAA2B,CACnC,CAAA;AAED,kEAAkE;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"}
|
|
@@ -3,11 +3,41 @@ import { PluginApiReturn } from "../../../types";
|
|
|
3
3
|
/**
|
|
4
4
|
* Project-level settings and info.
|
|
5
5
|
*
|
|
6
|
-
* Accessed via `snaptrude.core.project`.
|
|
6
|
+
* Accessed via `snaptrude.core.project`. Exposes
|
|
7
|
+
* {@linkcode PluginProjectApi.getInfo} (project identity) and
|
|
7
8
|
* {@linkcode PluginProjectApi.settings} (snap + grid controls).
|
|
8
9
|
*/
|
|
9
10
|
export declare abstract class PluginProjectApi {
|
|
10
11
|
constructor();
|
|
12
|
+
/**
|
|
13
|
+
* Read identity and headline facts about the currently open project — id,
|
|
14
|
+
* display name, unit type, storey count, active storey, and site location
|
|
15
|
+
* when the project is geo-located.
|
|
16
|
+
*
|
|
17
|
+
* `activeStorey` and `storeyCount` are both scoped to the ACTIVE BUILDING, so
|
|
18
|
+
* they always describe the same building. In a multi-building project
|
|
19
|
+
* `storeyCount` is therefore NOT the total across every building — use
|
|
20
|
+
* `core.storeys.list()`, which spans all buildings, for that.
|
|
21
|
+
*
|
|
22
|
+
* @returns A {@linkcode PluginProjectInfo}. `name` is `null` only when the
|
|
23
|
+
* project genuinely has no title; `location` is `null` only when the project
|
|
24
|
+
* is not geo-located. Neither is used to signal a failure.
|
|
25
|
+
* @throws PRECONDITION_FAILED when no project is open.
|
|
26
|
+
* @throws OPERATION_FAILED when the project lookup or the site-location read
|
|
27
|
+
* fails. A failed read is never reported as `null`.
|
|
28
|
+
*
|
|
29
|
+
* @examplePrompt What is this project called?
|
|
30
|
+
* @examplePrompt Where is this project located?
|
|
31
|
+
* @examplePrompt Give me a summary of this project
|
|
32
|
+
* @examplePrompt How many storeys does this project have?
|
|
33
|
+
*
|
|
34
|
+
* # Example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const info = await snaptrude.core.project.getInfo()
|
|
37
|
+
* console.log(info.name, info.units, info.storeyCount)
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
abstract getInfo(): PluginApiReturn<PluginProjectInfo>;
|
|
11
41
|
/** Project settings — snaps and grid. See {@linkcode PluginProjectSettingsApi}. */
|
|
12
42
|
abstract settings: PluginProjectSettingsApi;
|
|
13
43
|
}
|
|
@@ -396,4 +426,41 @@ export declare const PluginToleranceArgs: z.ZodObject<{
|
|
|
396
426
|
value: z.ZodNumber;
|
|
397
427
|
}, z.core.$strip>;
|
|
398
428
|
export type PluginToleranceArgs = z.infer<typeof PluginToleranceArgs>;
|
|
429
|
+
/**
|
|
430
|
+
* Identity and headline facts about the currently open project.
|
|
431
|
+
*
|
|
432
|
+
* `location` is a read-only projection of {@linkcode PluginProgramSiteApi.getLocation}
|
|
433
|
+
* — `program.site.*` remains the full site surface (context, weather, polygons).
|
|
434
|
+
* It is mirrored here because "what and where is this project" is one question.
|
|
435
|
+
*
|
|
436
|
+
* | Property | Type | Description |
|
|
437
|
+
* |---|---|---|
|
|
438
|
+
* | `projectId` | `string` | The open project's id (floorkey) |
|
|
439
|
+
* | `name` | `string \| null` | Display name; `null` only when the project has no title (a failed lookup throws) |
|
|
440
|
+
* | `units` | {@linkcode PUnitType} | The project's unit type |
|
|
441
|
+
* | `activeStorey` | `number` | The active storey value, in the active building |
|
|
442
|
+
* | `storeyCount` | `number` | How many storeys the ACTIVE BUILDING has (not the project-wide total — `core.storeys.list()` spans all buildings) |
|
|
443
|
+
* | `location` | `{ latitude, longitude } \| null` | Site location; `null` only when not geo-located (a failed read throws) |
|
|
444
|
+
*/
|
|
445
|
+
export declare const PluginProjectInfo: z.ZodObject<{
|
|
446
|
+
projectId: z.ZodString;
|
|
447
|
+
name: z.ZodNullable<z.ZodString>;
|
|
448
|
+
units: z.ZodEnum<{
|
|
449
|
+
meters: "meters";
|
|
450
|
+
"feet-inches": "feet-inches";
|
|
451
|
+
inches: "inches";
|
|
452
|
+
centimeters: "centimeters";
|
|
453
|
+
millimeters: "millimeters";
|
|
454
|
+
kilometers: "kilometers";
|
|
455
|
+
miles: "miles";
|
|
456
|
+
babylon: "babylon";
|
|
457
|
+
}>;
|
|
458
|
+
activeStorey: z.ZodNumber;
|
|
459
|
+
storeyCount: z.ZodNumber;
|
|
460
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
461
|
+
latitude: z.ZodNumber;
|
|
462
|
+
longitude: z.ZodNumber;
|
|
463
|
+
}, z.core.$strip>>;
|
|
464
|
+
}, z.core.$strip>;
|
|
465
|
+
export type PluginProjectInfo = z.infer<typeof PluginProjectInfo>;
|
|
399
466
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/project/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAA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E9B,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;iBAS5B,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
|
|
@@ -137,6 +137,20 @@ export declare abstract class PluginCoreStoreysApi {
|
|
|
137
137
|
abstract update(storyValue: number, height?: number, options?: {
|
|
138
138
|
name?: string;
|
|
139
139
|
}): PluginApiReturn<PluginStoryUpdateResult>;
|
|
140
|
+
/**
|
|
141
|
+
* Get the active storey's value. Paired with {@linkcode PluginCoreStoreysApi.setActive}.
|
|
142
|
+
*
|
|
143
|
+
* @returns The active storey value, in the same numbering `list` and `get` use.
|
|
144
|
+
*
|
|
145
|
+
* @examplePrompt Which storey am I on?
|
|
146
|
+
* @examplePrompt What is the current storey?
|
|
147
|
+
*
|
|
148
|
+
* # Example
|
|
149
|
+
* ```ts
|
|
150
|
+
* const storey = await snaptrude.core.storeys.getActive()
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
abstract getActive(): PluginApiReturn<number>;
|
|
140
154
|
/**
|
|
141
155
|
* Make a storey the active storey — the same as clicking it in the storey/layer
|
|
142
156
|
* panel. Subsequent draws and creates target this storey, and in 2D the
|