@snaptrude/plugin-core 0.0.0-dev-20260908074328 → 0.0.0-dev-20260911064951
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 -16
- package/dist/api/core/io/import/index.d.ts +3 -1
- package/dist/api/core/io/import/index.d.ts.map +1 -1
- package/dist/api/design/create/bulk-items.d.ts +185 -0
- package/dist/api/design/create/bulk-items.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +315 -50
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/create/opening-fields.d.ts +37 -0
- package/dist/api/design/create/opening-fields.d.ts.map +1 -0
- package/dist/api/design/delete/index.d.ts +6 -20
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/dimensions.d.ts +427 -0
- package/dist/api/design/dimensions.d.ts.map +1 -0
- package/dist/api/design/doors/index.d.ts +20 -13
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +5 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +0 -2
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/spaces.d.ts +0 -61
- package/dist/api/design/query/spaces.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +0 -3
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/presentation/annotate.d.ts +2 -2
- package/dist/api/presentation/placedViews.d.ts +1 -35
- package/dist/api/presentation/placedViews.d.ts.map +1 -1
- package/dist/api/presentation/shapes.d.ts +2 -2
- package/dist/api/presentation/sheets.d.ts +2 -20
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/errors/codes.d.ts +3 -8
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/handles.d.ts +19 -0
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +2031 -1940
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2008 -1935
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/core/io/import/index.ts +11 -3
- package/src/api/design/create/bulk-items.ts +186 -0
- package/src/api/design/create/index.ts +341 -70
- package/src/api/design/create/opening-fields.ts +37 -0
- package/src/api/design/delete/index.ts +5 -20
- package/src/api/design/dimensions.ts +453 -0
- package/src/api/design/doors/index.ts +20 -13
- package/src/api/design/index.ts +5 -0
- package/src/api/design/query/index.ts +0 -2
- package/src/api/design/query/spaces.ts +0 -68
- package/src/api/entity/space.ts +0 -2
- package/src/api/presentation/placedViews.ts +1 -29
- package/src/api/presentation/sheets.ts +3 -19
- package/src/errors/codes.ts +2 -30
- package/src/handles.ts +24 -0
- package/test/errors.test.mjs +0 -4
- package/snaptrude-plugin-core-0.11.0.tgz +0 -0
|
@@ -3,11 +3,13 @@ import { PluginApiReturn } from "../../../types";
|
|
|
3
3
|
import { BrepHandle, ComponentHandle, ContourHandle, ProfileHandle, Vec3Handle } from "../../../handles";
|
|
4
4
|
import { PluginSpaceType, PluginMassType, PluginDepartmentId } from "../../entity/space";
|
|
5
5
|
import { PluginBuildableEnvelopePolygonVertex, PluginBuildableEnvelopeSetbackTier, PluginBuildableEnvelopeVerticalCap, PluginBuildableEnvelopeCreateResult } from "../../entity/buildableEnvelope";
|
|
6
|
+
import type { PluginCreateDoorItem, PluginCreateFloorItem, PluginCreateFurnitureItem, PluginCreateWallRunItem, PluginCreateWindowItem } from "./bulk-items";
|
|
6
7
|
/**
|
|
7
8
|
* `design.create.*` — author new scene-committed BIM entities.
|
|
8
9
|
*
|
|
9
10
|
* Every creator takes geometry handles + scalars and returns a
|
|
10
|
-
* {@linkcode ComponentHandle} (or `ComponentHandle[]` for plural creators
|
|
11
|
+
* {@linkcode ComponentHandle} (or `ComponentHandle[]` for plural creators;
|
|
12
|
+
* `wallRuns` returns one `ComponentHandle[]` per run) — the
|
|
11
13
|
* `Component.id` of the created entity, resolvable across the rest of the
|
|
12
14
|
* `design.*` surface. Creation is an undoable host call; it **throws** on failure
|
|
13
15
|
* (no `Result` wrapper — consistent with `core.geom.create.*`).
|
|
@@ -173,26 +175,11 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
173
175
|
* Create a **floor** by extruding a footprint contour by `thickness`
|
|
174
176
|
* (extruded upward).
|
|
175
177
|
*
|
|
176
|
-
* The parametric engine owns floor topology and may resolve the request
|
|
177
|
-
* differently than asked: drawing against existing floors can **split** the
|
|
178
|
-
* footprint into several floors, or **merge** it into a pre-existing
|
|
179
|
-
* neighbour (that floor's region grows; nothing new is created). The call
|
|
180
|
-
* honors the engine's resolution and returns **every floor that covers the
|
|
181
|
-
* requested footprint after the operation** — the newly created floor(s),
|
|
182
|
-
* and/or the pre-existing floor that absorbed it. The array is never empty
|
|
183
|
-
* on success; a lone independently-created floor comes back as `[floor]`.
|
|
184
|
-
*
|
|
185
|
-
* **Breaking change in 0.11.0** — previously returned a single
|
|
186
|
-
* {@linkcode ComponentHandle}; callers must switch to the array (the first
|
|
187
|
-
* element preserves the old single-floor behavior for simple creates).
|
|
188
|
-
*
|
|
189
178
|
* @param contour - Footprint (outer + holes)
|
|
190
179
|
* @param thickness - Floor thickness (> 0)
|
|
191
180
|
* @param position - Offset from origin
|
|
192
|
-
* @returns the {@linkcode ComponentHandle}
|
|
193
|
-
*
|
|
194
|
-
* @throws if the contour is invalid, the thickness is not positive, or the
|
|
195
|
-
* engine rejected the operation (nothing covers the footprint)
|
|
181
|
+
* @returns the {@linkcode ComponentHandle} of the created floor
|
|
182
|
+
* @throws if the contour is invalid or the thickness is not positive
|
|
196
183
|
*
|
|
197
184
|
* @examplePrompt Create a floor from this room outline
|
|
198
185
|
* @examplePrompt Add a 100mm thick floor over the footprint
|
|
@@ -203,10 +190,51 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
203
190
|
* ```ts
|
|
204
191
|
* const rect = await snaptrude.core.geom.create.profileRect(5, 4)
|
|
205
192
|
* const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
|
|
206
|
-
* const
|
|
193
|
+
* const floor = await snaptrude.design.create.floor(contour, 0.1)
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* @performance For MORE THAN ONE floor, call `design.create.floors(items[])` — one
|
|
197
|
+
* host round-trip and ONE undo entry for the whole batch. Looping this single-floor
|
|
198
|
+
* creator is N round-trips and N undo entries.
|
|
199
|
+
*/
|
|
200
|
+
abstract floor(contour: ContourHandle, thickness: number, position?: Vec3Handle): PluginApiReturn<ComponentHandle>;
|
|
201
|
+
/**
|
|
202
|
+
* Create **many floors** in one undoable operation (bulk plural of
|
|
203
|
+
* {@linkcode floor}). Each item extrudes its own footprint contour (outer
|
|
204
|
+
* profile + holes) upward by its own `thickness`, at its own optional
|
|
205
|
+
* position offset. Validate-all-or-throw; one command.
|
|
206
|
+
*
|
|
207
|
+
* @param items - One {@linkcode PluginCreateFloorItem} per floor to create
|
|
208
|
+
* (≥1, ≤1000)
|
|
209
|
+
* @returns the created floors as {@linkcode ComponentHandle}`[]`, in input order
|
|
210
|
+
* @throws `VALIDATION` if the items fail the schema (empty array, more than
|
|
211
|
+
* 1000 items, a non-positive thickness) or a contour is degenerate;
|
|
212
|
+
* `HANDLE_INVALID` if a `contour` or `position` handle is unknown or
|
|
213
|
+
* released; `OPERATION_FAILED` if extrusion fails (nothing is created —
|
|
214
|
+
* `details.itemIndex` is the failing item); `METHOD_NOT_PERMITTED` if the
|
|
215
|
+
* plugin may not write.
|
|
216
|
+
*
|
|
217
|
+
* @examplePrompt Create floors for all these room outlines at once
|
|
218
|
+
* @examplePrompt Add a floor to every space in one operation
|
|
219
|
+
* @examplePrompt Bulk create the floor plates for this building
|
|
220
|
+
* @examplePrompt Lay 100mm floors across these five footprints in one undo step
|
|
221
|
+
* @examplePrompt Create the ground and first floor slabs together
|
|
222
|
+
*
|
|
223
|
+
* @performance Bulk creator — the whole batch is ONE host round-trip and ONE undo
|
|
224
|
+
* entry. Always prefer this over calling `design.create.floor` in a loop: build the
|
|
225
|
+
* full `items[]` array first (all contours and offsets up front), then make one call.
|
|
226
|
+
*
|
|
227
|
+
* # Example
|
|
228
|
+
* ```ts
|
|
229
|
+
* const rect = await snaptrude.core.geom.create.profileRect(5, 4)
|
|
230
|
+
* const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
|
|
231
|
+
* const [ground, upper] = await snaptrude.design.create.floors([
|
|
232
|
+
* { contour, thickness: 0.1 },
|
|
233
|
+
* { contour, thickness: 0.1, position: await snaptrude.core.math.vec3.new(0, 3, 0) },
|
|
234
|
+
* ])
|
|
207
235
|
* ```
|
|
208
236
|
*/
|
|
209
|
-
abstract
|
|
237
|
+
abstract floors(items: PluginCreateFloorItem[]): PluginApiReturn<ComponentHandle[]>;
|
|
210
238
|
/**
|
|
211
239
|
* Create a **roof** by extruding a footprint contour by `thickness`. Created
|
|
212
240
|
* flat (extruded downward); pitch/slope is a separate post-creation edit.
|
|
@@ -341,13 +369,7 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
341
369
|
* single undo entry. The storey must already exist
|
|
342
370
|
* (`core.storeys.create` first). Default: geometry-derived — a profile
|
|
343
371
|
* drawn at y = 0 lands on storey 1; the ACTIVE storey is NOT consulted.
|
|
344
|
-
* @returns
|
|
345
|
-
* parametric engine owns wall topology — curves touching existing walls
|
|
346
|
-
* may merge into or split against them, so the returned count can differ
|
|
347
|
-
* from the input curve count. Profile-ordered 1:1 matches come first,
|
|
348
|
-
* then the remaining merged/split products in creation order. Re-query
|
|
349
|
-
* (e.g. `design.query.spaces.listGeneratedBim`) rather than assuming a
|
|
350
|
-
* wall per input curve.
|
|
372
|
+
* @returns a {@linkcode ComponentHandle}`[]` (one per wall), in profile order
|
|
351
373
|
* @throws if the profile is empty, `wallType` names no wall type in the
|
|
352
374
|
* project, `storey` does not exist, or wall creation fails
|
|
353
375
|
*
|
|
@@ -374,8 +396,63 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
374
396
|
* centerlines, 3, undefined, brick.label,
|
|
375
397
|
* )
|
|
376
398
|
* ```
|
|
399
|
+
*
|
|
400
|
+
* @performance For MORE THAN ONE run, call `design.create.wallRuns(items[])` — one
|
|
401
|
+
* host round-trip and ONE undo entry for every run in the batch. Looping this
|
|
402
|
+
* single-run creator is N round-trips and N undo entries.
|
|
377
403
|
*/
|
|
378
404
|
abstract walls(profile: ProfileHandle, height?: number, thickness?: number, wallType?: string, storey?: number): PluginApiReturn<ComponentHandle[]>;
|
|
405
|
+
/**
|
|
406
|
+
* Create **many wall runs** in one undoable operation (bulk plural of
|
|
407
|
+
* {@linkcode walls}). Each item is one full run — a wall per curve in that
|
|
408
|
+
* item's profile chain, mitred at shared endpoints. Junctions resolve within a
|
|
409
|
+
* run, not between runs. Each item carries its own
|
|
410
|
+
* dimensions, `wallType` and `storey`, so a single call can build a whole
|
|
411
|
+
* floor plate or several storeys at once. Validate-all-or-throw; one command.
|
|
412
|
+
*
|
|
413
|
+
* @param items - One {@linkcode PluginCreateWallRunItem} per run to create
|
|
414
|
+
* (≥1, ≤1000)
|
|
415
|
+
* @returns one {@linkcode ComponentHandle}`[]` per item, in input order —
|
|
416
|
+
* each inner array holding that run's walls in profile-curve order
|
|
417
|
+
* @throws `VALIDATION` if the items fail the schema (empty array, more than
|
|
418
|
+
* 1000 items, a non-positive height or thickness, a zero-length curve);
|
|
419
|
+
* `HANDLE_INVALID` if a `profile` handle is unknown or released;
|
|
420
|
+
* `PRECONDITION_FAILED` if a profile has no curves, `wallType` names no
|
|
421
|
+
* wall type in the project, or `storey` does not exist;
|
|
422
|
+
* `OPERATION_FAILED` if wall creation fails (nothing is created —
|
|
423
|
+
* `details.itemIndex` is the failing item); `METHOD_NOT_PERMITTED` if the
|
|
424
|
+
* plugin may not write.
|
|
425
|
+
*
|
|
426
|
+
* @examplePrompt Draw all the walls of this floor plan at once
|
|
427
|
+
* @examplePrompt Build every room's perimeter in one operation
|
|
428
|
+
* @examplePrompt Bulk create wall runs from these centerlines
|
|
429
|
+
* @examplePrompt Create the walls for both storeys in a single undo step
|
|
430
|
+
* @examplePrompt Turn these polylines into 200mm brick walls together
|
|
431
|
+
*
|
|
432
|
+
* @performance Bulk creator — the whole batch is ONE host round-trip and ONE undo
|
|
433
|
+
* entry. Always prefer this over calling `design.create.walls` in a loop: build the
|
|
434
|
+
* full `items[]` array first (all profiles up front), then make one call.
|
|
435
|
+
*
|
|
436
|
+
* # Example
|
|
437
|
+
* ```ts
|
|
438
|
+
* const v = snaptrude.core.math.vec3
|
|
439
|
+
* const ground = await snaptrude.core.geom.create.profileFromLinePoints([
|
|
440
|
+
* await v.new(0, 0, 0),
|
|
441
|
+
* await v.new(8, 0, 0),
|
|
442
|
+
* await v.new(8, 0, 6),
|
|
443
|
+
* ])
|
|
444
|
+
* const upper = await snaptrude.core.geom.create.profileFromLinePoints([
|
|
445
|
+
* await v.new(0, 0, 0),
|
|
446
|
+
* await v.new(8, 0, 0),
|
|
447
|
+
* ])
|
|
448
|
+
* const [groundWalls, upperWalls] = await snaptrude.design.create.wallRuns([
|
|
449
|
+
* { profile: ground, height: 3, thickness: 0.2 },
|
|
450
|
+
* { profile: upper, height: 3, storey: 2 },
|
|
451
|
+
* ])
|
|
452
|
+
* console.log(groundWalls.length, "walls on the ground floor")
|
|
453
|
+
* ```
|
|
454
|
+
*/
|
|
455
|
+
abstract wallRuns(items: PluginCreateWallRunItem[]): PluginApiReturn<ComponentHandle[][]>;
|
|
379
456
|
/**
|
|
380
457
|
* Create a **staircase** from a parametric preset, placed at a point.
|
|
381
458
|
*
|
|
@@ -465,17 +542,19 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
465
542
|
* `position.y` (the same surface-flush contract as interactive drag-drop) —
|
|
466
543
|
* pass the floor/storey elevation to stand furniture on it; never add half
|
|
467
544
|
* the item's height yourself.
|
|
468
|
-
* @param options - Optional placement options: `label` — instance name
|
|
469
|
-
* (default auto `${name}Ins${n}`);
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
*
|
|
545
|
+
* @param options - Optional placement options: `label` — instance name and
|
|
546
|
+
* readable label (`design.query.getLabel`; default auto `${name}Ins${n}`);
|
|
547
|
+
* `createNewSourceMesh` — legacy flag, kept for compatibility. The host owns
|
|
548
|
+
* source-mesh persistence: a catalog source is recorded exactly once, by the
|
|
549
|
+
* first placement that brings it in, and this flag cannot skip that record.
|
|
473
550
|
* @param angleInDegrees - Optional signed rotation about the vertical axis, in
|
|
474
551
|
* degrees (same convention as {@linkcode PluginDesignTransformApi.rotate}).
|
|
475
552
|
* Applied at creation time so it is part of the placement's single undo entry.
|
|
476
553
|
* Default: the item's own (unrotated) orientation.
|
|
477
554
|
* @returns the {@linkcode ComponentHandle} of the placed furniture instance
|
|
478
|
-
* @throws if the catalog id is unknown, the source mesh fails to load, or placement fails
|
|
555
|
+
* @throws if the catalog id is unknown, the source mesh fails to load, or placement fails;
|
|
556
|
+
* `PRECONDITION_FAILED` (`details.engineCode: "TOOL_ACTIVE"`) while the interactive
|
|
557
|
+
* furniture tool is active — finish or cancel it first
|
|
479
558
|
*
|
|
480
559
|
* @examplePrompt Place a chair from the library at this spot
|
|
481
560
|
* @examplePrompt Add a sofa from the furniture catalog to the living room
|
|
@@ -499,11 +578,58 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
499
578
|
* 90,
|
|
500
579
|
* )
|
|
501
580
|
* ```
|
|
581
|
+
*
|
|
582
|
+
* @performance For MORE THAN ONE item, call `design.create.furnitureItems(items[])` —
|
|
583
|
+
* one host round-trip and ONE undo entry, and a catalog source shared by several
|
|
584
|
+
* items is fetched once. Looping this single-item creator is N round-trips.
|
|
502
585
|
*/
|
|
503
586
|
abstract furniture(catalogId: string, position: Vec3Handle, options?: {
|
|
504
587
|
label?: string;
|
|
505
588
|
createNewSourceMesh?: boolean;
|
|
506
589
|
}, angleInDegrees?: number): PluginApiReturn<ComponentHandle>;
|
|
590
|
+
/**
|
|
591
|
+
* Place **many furniture items** in one undoable operation (bulk plural of
|
|
592
|
+
* {@linkcode furniture}). Each item names a catalog id and an absolute world
|
|
593
|
+
* position (`position.y` is the REST elevation — the same grounding contract
|
|
594
|
+
* as the singular creator), with optional label and rotation. A catalog
|
|
595
|
+
* source shared by several items is fetched and recorded once for the whole
|
|
596
|
+
* batch, so the host — not the caller — owns source persistence (there is no
|
|
597
|
+
* per-item `createNewSourceMesh`). Validate-all-or-throw; one command.
|
|
598
|
+
*
|
|
599
|
+
* @param items - One {@linkcode PluginCreateFurnitureItem} per instance to
|
|
600
|
+
* place (≥1, ≤1000)
|
|
601
|
+
* @returns the placed instances as {@linkcode ComponentHandle}`[]`, in input order
|
|
602
|
+
* @throws `VALIDATION` if the items fail the schema (empty array, more than
|
|
603
|
+
* 1000 items); `HANDLE_INVALID` if a `position` handle is unknown or
|
|
604
|
+
* released; `PRECONDITION_FAILED` if a catalog id is unknown, a furniture
|
|
605
|
+
* tool is active, or a parametric group is active (exit it first, or place
|
|
606
|
+
* items one at a time with `furniture`); `OPERATION_FAILED` if a source
|
|
607
|
+
* mesh fails to load or placement fails (nothing is created —
|
|
608
|
+
* `details.itemIndex` is the failing item); `METHOD_NOT_PERMITTED` if the plugin may not write.
|
|
609
|
+
*
|
|
610
|
+
* @examplePrompt Place all the desks for this office at once
|
|
611
|
+
* @examplePrompt Furnish every bedroom in one operation
|
|
612
|
+
* @examplePrompt Bulk place these chairs around the table
|
|
613
|
+
* @examplePrompt Add the whole furniture layout in a single undo step
|
|
614
|
+
* @examplePrompt Drop twenty copies of this chair at these positions
|
|
615
|
+
*
|
|
616
|
+
* @performance Bulk creator — the whole batch is ONE host round-trip and ONE undo
|
|
617
|
+
* entry, and each distinct catalog source loads once. Always prefer this over
|
|
618
|
+
* calling `design.create.furniture` in a loop: build the full `items[]` array
|
|
619
|
+
* first (all positions and angles up front), then make one call.
|
|
620
|
+
*
|
|
621
|
+
* # Example
|
|
622
|
+
* ```ts
|
|
623
|
+
* const v = snaptrude.core.math.vec3
|
|
624
|
+
* const [chair] = await snaptrude.design.furniture.listCatalog()
|
|
625
|
+
* const placed = await snaptrude.design.create.furnitureItems([
|
|
626
|
+
* { catalogId: chair.id, position: await v.new(3, 0, 5), label: "Chair-01" },
|
|
627
|
+
* { catalogId: chair.id, position: await v.new(4, 0, 5), angleInDegrees: 90 },
|
|
628
|
+
* { catalogId: chair.id, position: await v.new(5, 0, 5), angleInDegrees: 180 },
|
|
629
|
+
* ])
|
|
630
|
+
* ```
|
|
631
|
+
*/
|
|
632
|
+
abstract furnitureItems(items: PluginCreateFurnitureItem[]): PluginApiReturn<ComponentHandle[]>;
|
|
507
633
|
/**
|
|
508
634
|
* Place a **door** from the catalog into a host wall.
|
|
509
635
|
*
|
|
@@ -517,12 +643,15 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
517
643
|
* @param catalogId - Library id: team `_id` or general `fullName`
|
|
518
644
|
* @param hostWall - The wall to host the door
|
|
519
645
|
* @param position - World point projected onto the wall to locate the opening
|
|
520
|
-
* @param options - Optional placement options: `label` — instance name
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
*
|
|
525
|
-
*
|
|
646
|
+
* @param options - Optional placement options: `label` — instance name;
|
|
647
|
+
* `hinge` — world point near the jamb the door is hinged on (the door is
|
|
648
|
+
* reflected along the wall so its hinged jamb is the one nearer this
|
|
649
|
+
* point; default the catalog item's authored hinge side)
|
|
650
|
+
* @param facing - World point on the side of the wall the door swings open
|
|
651
|
+
* to (the room it opens into — where the plan symbol draws the swing arc).
|
|
652
|
+
* Any point clearly on that side works (e.g. the room's center). Default:
|
|
653
|
+
* the engine picks a side (nondeterministic when `position` sits on the
|
|
654
|
+
* wall centerline).
|
|
526
655
|
* @returns the {@linkcode ComponentHandle} of the placed door
|
|
527
656
|
* @throws if the catalog id is unknown, the host is not a wall, the source
|
|
528
657
|
* mesh fails to load, or the projected point falls **outside** the host wall
|
|
@@ -533,6 +662,7 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
533
662
|
* @examplePrompt Insert the entrance door into this wall
|
|
534
663
|
* @examplePrompt Add a door to the wall and call it Entry-01
|
|
535
664
|
* @examplePrompt Add a door that opens into the living room
|
|
665
|
+
* @examplePrompt Put a door here hinged on the north jamb
|
|
536
666
|
*
|
|
537
667
|
* # Example
|
|
538
668
|
* ```ts
|
|
@@ -552,11 +682,76 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
552
682
|
* undefined,
|
|
553
683
|
* await snaptrude.core.math.vec3.new(3, 0, 9),
|
|
554
684
|
* )
|
|
685
|
+
* // …and hinged on the jamb nearest a point (here the +x end of the opening):
|
|
686
|
+
* const hingedRight = await snaptrude.design.create.door(
|
|
687
|
+
* entry.id,
|
|
688
|
+
* wall,
|
|
689
|
+
* await snaptrude.core.math.vec3.new(3, 0, 5),
|
|
690
|
+
* { hinge: await snaptrude.core.math.vec3.new(3.5, 0, 5) },
|
|
691
|
+
* await snaptrude.core.math.vec3.new(3, 0, 9),
|
|
692
|
+
* )
|
|
555
693
|
* ```
|
|
694
|
+
*
|
|
695
|
+
* @performance For MORE THAN ONE door, call `design.create.doors(items[])` — one host
|
|
696
|
+
* round-trip and ONE undo entry, with each host wall re-cut once per opening inside
|
|
697
|
+
* that single call. Looping this single-door creator is N round-trips.
|
|
556
698
|
*/
|
|
557
699
|
abstract door(catalogId: string, hostWall: ComponentHandle, position: Vec3Handle, options?: {
|
|
558
700
|
label?: string;
|
|
701
|
+
hinge?: Vec3Handle;
|
|
559
702
|
}, facing?: Vec3Handle): PluginApiReturn<ComponentHandle>;
|
|
703
|
+
/**
|
|
704
|
+
* Place **many doors** into host walls in one undoable operation (bulk plural
|
|
705
|
+
* of {@linkcode door}). Each item carries its own catalog id, host wall,
|
|
706
|
+
* world position, and optional `facing`, `label`, `width` and `height` — the
|
|
707
|
+
* same fields as a `"door"` {@linkcode PluginDesignCreateOpeningOptions}.
|
|
708
|
+
* Validate-all-or-throw; one command.
|
|
709
|
+
*
|
|
710
|
+
* As with the singular creator, placing an opening **re-cuts its host wall**:
|
|
711
|
+
* the wall you passed as `hostWall` stops resolving once the call returns.
|
|
712
|
+
* Several items MAY name the same original wall handle in one call — the host
|
|
713
|
+
* chains the re-cuts internally — but after the call recover the surviving
|
|
714
|
+
* wall with `design.query.getHost(opening)`, never by reusing the handle you
|
|
715
|
+
* passed in.
|
|
716
|
+
*
|
|
717
|
+
* @param items - One {@linkcode PluginCreateDoorItem} per door to place
|
|
718
|
+
* (≥1, ≤1000)
|
|
719
|
+
* @returns the placed doors as {@linkcode ComponentHandle}`[]`, in input order
|
|
720
|
+
* @throws `VALIDATION` if the items fail the schema (empty array, more than
|
|
721
|
+
* 1000 items, unknown fields, a non-positive `width`/`height`);
|
|
722
|
+
* `HANDLE_INVALID` if a `position`, `facing` or `hinge` handle is unknown
|
|
723
|
+
* or released; `PRECONDITION_FAILED` if a catalog id is unknown, a `hostWall`
|
|
724
|
+
* is not a wall / is locked / is not in the active proposal, the projected
|
|
725
|
+
* point falls outside its host wall, or a door tool is active;
|
|
726
|
+
* `OPERATION_FAILED` if a source mesh fails to load or placement fails
|
|
727
|
+
* (nothing is created — `details.itemIndex` is the failing item);
|
|
728
|
+
* `METHOD_NOT_PERMITTED` if the plugin may not write.
|
|
729
|
+
*
|
|
730
|
+
* @examplePrompt Add doors to all of these walls at once
|
|
731
|
+
* @examplePrompt Place a door in every room in one operation
|
|
732
|
+
* @examplePrompt Bulk add the entrance doors from this schedule
|
|
733
|
+
* @examplePrompt Put three doors on this wall in a single undo step
|
|
734
|
+
* @examplePrompt Add all the doors for this floor plan together
|
|
735
|
+
*
|
|
736
|
+
* @performance Bulk creator — the whole batch is ONE host round-trip and ONE undo
|
|
737
|
+
* entry, and each distinct catalog source loads once. Always prefer this over
|
|
738
|
+
* calling `design.create.door` in a loop: build the full `items[]` array first
|
|
739
|
+
* (all host walls and points up front), then make one call.
|
|
740
|
+
*
|
|
741
|
+
* # Example
|
|
742
|
+
* ```ts
|
|
743
|
+
* const v = snaptrude.core.math.vec3
|
|
744
|
+
* const [wall] = await snaptrude.design.query.listWalls({ isSelected: true })
|
|
745
|
+
* const [entry] = await snaptrude.design.doors.listCatalog()
|
|
746
|
+
* const [front, side] = await snaptrude.design.create.doors([
|
|
747
|
+
* { catalogId: entry.id, hostWall: wall, position: await v.new(2, 0, 5), label: "D-01" },
|
|
748
|
+
* { catalogId: entry.id, hostWall: wall, position: await v.new(6, 0, 5), width: 1.2 },
|
|
749
|
+
* ])
|
|
750
|
+
* // `wall` was re-cut twice and no longer resolves — ask the opening for its host:
|
|
751
|
+
* const currentWall = await snaptrude.design.query.getHost(front)
|
|
752
|
+
* ```
|
|
753
|
+
*/
|
|
754
|
+
abstract doors(items: PluginCreateDoorItem[]): PluginApiReturn<ComponentHandle[]>;
|
|
560
755
|
/**
|
|
561
756
|
* Place a **window** from the catalog into a host wall.
|
|
562
757
|
*
|
|
@@ -570,11 +765,14 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
570
765
|
* @param catalogId - Library id: team `_id` or general `fullName`
|
|
571
766
|
* @param hostWall - The wall to host the window
|
|
572
767
|
* @param position - World point projected onto the wall to locate the opening
|
|
573
|
-
* @param options - Optional placement options: `label` — instance name
|
|
574
|
-
*
|
|
575
|
-
*
|
|
576
|
-
*
|
|
577
|
-
*
|
|
768
|
+
* @param options - Optional placement options: `label` — instance name;
|
|
769
|
+
* `hinge` — world point near the jamb the window is hinged on (same rule
|
|
770
|
+
* as {@linkcode PluginDesignCreateApi.door}; default the catalog item's
|
|
771
|
+
* authored side)
|
|
772
|
+
* @param facing - World point on the side of the wall the window opens to
|
|
773
|
+
* (matters for asymmetric windows, e.g. casement swing) — same convention
|
|
774
|
+
* as {@linkcode PluginDesignCreateApi.door}. Default: the engine picks a
|
|
775
|
+
* side (nondeterministic when `position` sits on the centerline).
|
|
578
776
|
* @returns the {@linkcode ComponentHandle} of the placed window
|
|
579
777
|
* @throws if the catalog id is unknown, the host is not a wall, the source
|
|
580
778
|
* mesh fails to load, or the projected point falls **outside** the host wall
|
|
@@ -597,10 +795,68 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
597
795
|
* { label: "Win-01" },
|
|
598
796
|
* )
|
|
599
797
|
* ```
|
|
798
|
+
*
|
|
799
|
+
* @performance For MORE THAN ONE window, call `design.create.windows(items[])` — one
|
|
800
|
+
* host round-trip and ONE undo entry, with each host wall re-cut once per opening
|
|
801
|
+
* inside that single call. Looping this single-window creator is N round-trips.
|
|
600
802
|
*/
|
|
601
803
|
abstract window(catalogId: string, hostWall: ComponentHandle, position: Vec3Handle, options?: {
|
|
602
804
|
label?: string;
|
|
805
|
+
hinge?: Vec3Handle;
|
|
603
806
|
}, facing?: Vec3Handle): PluginApiReturn<ComponentHandle>;
|
|
807
|
+
/**
|
|
808
|
+
* Place **many windows** into host walls in one undoable operation (bulk
|
|
809
|
+
* plural of {@linkcode window}). Each item carries its own catalog id, host
|
|
810
|
+
* wall, world position, and optional `facing`, `label`, `width`, `height` and
|
|
811
|
+
* `sillHeight` — the same fields as a `"window"`
|
|
812
|
+
* {@linkcode PluginDesignCreateOpeningOptions}. `sillHeight` is measured from
|
|
813
|
+
* the host wall base to the BOTTOM of the window. Validate-all-or-throw; one
|
|
814
|
+
* command.
|
|
815
|
+
*
|
|
816
|
+
* As with the singular creator, placing an opening **re-cuts its host wall**:
|
|
817
|
+
* the wall you passed as `hostWall` stops resolving once the call returns.
|
|
818
|
+
* Several items MAY name the same original wall handle in one call — the host
|
|
819
|
+
* chains the re-cuts internally — but after the call recover the surviving
|
|
820
|
+
* wall with `design.query.getHost(opening)`, never by reusing the handle you
|
|
821
|
+
* passed in.
|
|
822
|
+
*
|
|
823
|
+
* @param items - One {@linkcode PluginCreateWindowItem} per window to place
|
|
824
|
+
* (≥1, ≤1000)
|
|
825
|
+
* @returns the placed windows as {@linkcode ComponentHandle}`[]`, in input order
|
|
826
|
+
* @throws `VALIDATION` if the items fail the schema (empty array, more than
|
|
827
|
+
* 1000 items, unknown fields, a non-positive `width`/`height`, a negative
|
|
828
|
+
* `sillHeight`); `HANDLE_INVALID` if a `position`, `facing` or `hinge`
|
|
829
|
+
* handle is unknown or released; `PRECONDITION_FAILED` if a catalog id is unknown, a
|
|
830
|
+
* `hostWall` is not a wall / is locked / is not in the active proposal, the
|
|
831
|
+
* projected point falls outside its host wall, or a window tool is active;
|
|
832
|
+
* `OPERATION_FAILED` if a source mesh fails to load or placement fails
|
|
833
|
+
* (nothing is created — `details.itemIndex` is the failing item);
|
|
834
|
+
* `METHOD_NOT_PERMITTED` if the plugin may not write.
|
|
835
|
+
*
|
|
836
|
+
* @examplePrompt Add windows along this whole facade at once
|
|
837
|
+
* @examplePrompt Place a window in every bedroom in one operation
|
|
838
|
+
* @examplePrompt Bulk add the windows from this schedule
|
|
839
|
+
* @examplePrompt Put four windows on this wall in a single undo step
|
|
840
|
+
* @examplePrompt Add all the windows with a 0.9m sill height together
|
|
841
|
+
*
|
|
842
|
+
* @performance Bulk creator — the whole batch is ONE host round-trip and ONE undo
|
|
843
|
+
* entry, and each distinct catalog source loads once. Always prefer this over
|
|
844
|
+
* calling `design.create.window` in a loop: build the full `items[]` array first
|
|
845
|
+
* (all host walls and points up front), then make one call.
|
|
846
|
+
*
|
|
847
|
+
* # Example
|
|
848
|
+
* ```ts
|
|
849
|
+
* const v = snaptrude.core.math.vec3
|
|
850
|
+
* const [wall] = await snaptrude.design.query.listWalls({ isSelected: true })
|
|
851
|
+
* const [casement] = await snaptrude.design.windows.listCatalog()
|
|
852
|
+
* const placed = await snaptrude.design.create.windows([
|
|
853
|
+
* { catalogId: casement.id, hostWall: wall, position: await v.new(2, 0, 5), sillHeight: 0.9 },
|
|
854
|
+
* { catalogId: casement.id, hostWall: wall, position: await v.new(5, 0, 5), sillHeight: 0.9 },
|
|
855
|
+
* ])
|
|
856
|
+
* const currentWall = await snaptrude.design.query.getHost(placed[0])
|
|
857
|
+
* ```
|
|
858
|
+
*/
|
|
859
|
+
abstract windows(items: PluginCreateWindowItem[]): PluginApiReturn<ComponentHandle[]>;
|
|
604
860
|
/**
|
|
605
861
|
* Place a catalog **door or window** into a host wall with optional size overrides.
|
|
606
862
|
*
|
|
@@ -610,7 +866,7 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
610
866
|
* its center. Placement is asynchronous and committed as one undoable creation.
|
|
611
867
|
*
|
|
612
868
|
* @param options - Opening kind, catalog and host references, placement, and
|
|
613
|
-
* optional facing, label, and dimensions
|
|
869
|
+
* optional facing (swing side), hinge (hinged jamb), label, and dimensions
|
|
614
870
|
* @returns the {@linkcode ComponentHandle} of the placed door or window
|
|
615
871
|
* @throws if the options are invalid, the catalog id is unknown, the host is
|
|
616
872
|
* not a wall, loading fails, or the opening cannot be placed on the host
|
|
@@ -618,8 +874,9 @@ export declare abstract class PluginDesignCreateApi {
|
|
|
618
874
|
* @examplePrompt Add a 1m wide door to this wall here
|
|
619
875
|
* @examplePrompt Place a window with a 0.9m sill height on the selected wall
|
|
620
876
|
*
|
|
621
|
-
* @performance Single-opening creator — use it for one hosted opening.
|
|
622
|
-
*
|
|
877
|
+
* @performance Single-opening creator — use it for one hosted opening. For MORE
|
|
878
|
+
* THAN ONE, call `design.create.doors(items[])` / `design.create.windows(items[])`:
|
|
879
|
+
* the same per-item fields, one host round-trip, ONE undo entry.
|
|
623
880
|
*
|
|
624
881
|
* # Example
|
|
625
882
|
* ```ts
|
|
@@ -1141,7 +1398,7 @@ export type PluginDesignCreateStaircaseArgs = z.infer<typeof PluginDesignCreateS
|
|
|
1141
1398
|
* | `catalogId` | `string` | Library id: team `_id` or general `fullName` |
|
|
1142
1399
|
* | `position` | {@linkcode Vec3Handle} | Absolute world placement point |
|
|
1143
1400
|
* | `label` | `string`? | Instance name (default auto `${name}Ins${n}`) |
|
|
1144
|
-
* | `createNewSourceMesh` | `boolean`? |
|
|
1401
|
+
* | `createNewSourceMesh` | `boolean`? | Legacy, kept for compatibility; the host records a catalog source exactly once and this flag cannot skip it |
|
|
1145
1402
|
* | `angleInDegrees` | `number`? | Rotation about the vertical axis, in degrees (default unrotated) |
|
|
1146
1403
|
*/
|
|
1147
1404
|
export declare const PluginDesignCreateFurnitureArgs: z.ZodObject<{
|
|
@@ -1161,7 +1418,8 @@ export type PluginDesignCreateFurnitureArgs = z.infer<typeof PluginDesignCreateF
|
|
|
1161
1418
|
* | `hostWall` | {@linkcode ComponentHandle} | The wall to host the door |
|
|
1162
1419
|
* | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
|
|
1163
1420
|
* | `label` | `string`? | Instance name (optional) |
|
|
1164
|
-
* | `facing` | {@linkcode Vec3Handle}? | World point on the side of the wall the door
|
|
1421
|
+
* | `facing` | {@linkcode Vec3Handle}? | World point on the side of the wall the door swings open to (default engine-chosen) |
|
|
1422
|
+
* | `hinge` | {@linkcode Vec3Handle}? | World point near the jamb the door is hinged on (default the catalog item's authored side) |
|
|
1165
1423
|
*/
|
|
1166
1424
|
export declare const PluginDesignCreateDoorArgs: z.ZodObject<{
|
|
1167
1425
|
catalogId: z.ZodString;
|
|
@@ -1169,6 +1427,7 @@ export declare const PluginDesignCreateDoorArgs: z.ZodObject<{
|
|
|
1169
1427
|
position: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
|
|
1170
1428
|
label: z.ZodOptional<z.ZodString>;
|
|
1171
1429
|
facing: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
|
|
1430
|
+
hinge: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
|
|
1172
1431
|
}, z.core.$strip>;
|
|
1173
1432
|
export type PluginDesignCreateDoorArgs = z.infer<typeof PluginDesignCreateDoorArgs>;
|
|
1174
1433
|
/**
|
|
@@ -1180,7 +1439,8 @@ export type PluginDesignCreateDoorArgs = z.infer<typeof PluginDesignCreateDoorAr
|
|
|
1180
1439
|
* | `hostWall` | {@linkcode ComponentHandle} | The wall to host the window |
|
|
1181
1440
|
* | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
|
|
1182
1441
|
* | `label` | `string`? | Instance name (optional) |
|
|
1183
|
-
* | `facing` | {@linkcode Vec3Handle}? | World point on the side of the wall the window
|
|
1442
|
+
* | `facing` | {@linkcode Vec3Handle}? | World point on the side of the wall the window opens to (default engine-chosen) |
|
|
1443
|
+
* | `hinge` | {@linkcode Vec3Handle}? | World point near the jamb the window is hinged on (default the catalog item's authored side) |
|
|
1184
1444
|
*/
|
|
1185
1445
|
export declare const PluginDesignCreateWindowArgs: z.ZodObject<{
|
|
1186
1446
|
catalogId: z.ZodString;
|
|
@@ -1188,6 +1448,7 @@ export declare const PluginDesignCreateWindowArgs: z.ZodObject<{
|
|
|
1188
1448
|
position: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
|
|
1189
1449
|
label: z.ZodOptional<z.ZodString>;
|
|
1190
1450
|
facing: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
|
|
1451
|
+
hinge: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
|
|
1191
1452
|
}, z.core.$strip>;
|
|
1192
1453
|
export type PluginDesignCreateWindowArgs = z.infer<typeof PluginDesignCreateWindowArgs>;
|
|
1193
1454
|
/**
|
|
@@ -1201,6 +1462,7 @@ export declare const PluginDesignCreateOpeningOptions: z.ZodDiscriminatedUnion<[
|
|
|
1201
1462
|
hostWall: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
1202
1463
|
position: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
|
|
1203
1464
|
facing: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
|
|
1465
|
+
hinge: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
|
|
1204
1466
|
label: z.ZodOptional<z.ZodString>;
|
|
1205
1467
|
width: z.ZodOptional<z.ZodNumber>;
|
|
1206
1468
|
height: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1211,6 +1473,7 @@ export declare const PluginDesignCreateOpeningOptions: z.ZodDiscriminatedUnion<[
|
|
|
1211
1473
|
hostWall: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
1212
1474
|
position: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
|
|
1213
1475
|
facing: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
|
|
1476
|
+
hinge: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
|
|
1214
1477
|
label: z.ZodOptional<z.ZodString>;
|
|
1215
1478
|
width: z.ZodOptional<z.ZodNumber>;
|
|
1216
1479
|
height: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1371,4 +1634,6 @@ export declare const PluginCreateSpaceItem: z.ZodObject<{
|
|
|
1371
1634
|
storey: z.ZodOptional<z.ZodNumber>;
|
|
1372
1635
|
}, z.core.$strip>;
|
|
1373
1636
|
export type PluginCreateSpaceItem = z.infer<typeof PluginCreateSpaceItem>;
|
|
1637
|
+
export * from "./opening-fields";
|
|
1638
|
+
export * from "./bulk-items";
|
|
1374
1639
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/create/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EACL,UAAU,EACV,eAAe,EACf,aAAa,EACb,aAAa,EACb,UAAU,EACX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,eAAe,EACf,cAAc,EACd,kBAAkB,EACnB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,oCAAoC,EACpC,kCAAkC,EAClC,kCAAkC,EAClC,mCAAmC,EACpC,MAAM,gCAAgC,CAAA;AAEvC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/create/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EACL,UAAU,EACV,eAAe,EACf,aAAa,EACb,aAAa,EACb,UAAU,EACX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,eAAe,EACf,cAAc,EACd,kBAAkB,EACnB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,oCAAoC,EACpC,kCAAkC,EAClC,kCAAkC,EAClC,mCAAmC,EACpC,MAAM,gCAAgC,CAAA;AAEvC,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,cAAc,CAAA;AAErB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,8BAAsB,qBAAqB;;IAGzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkDG;aACa,KAAK,CACnB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAA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MAAM,0BAA0B;;;;;;;;iBAKrC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,CAClC,CAAA;AAQD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAShC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { ComponentHandle } from "../../../handles";
|
|
3
|
+
/**
|
|
4
|
+
* The shared field bag every hosted opening (door / window) carries — used by
|
|
5
|
+
* {@linkcode PluginDesignCreateOpeningOptions} and by the bulk item schemas in
|
|
6
|
+
* `bulk-items.ts`, so singular and plural openings validate identically.
|
|
7
|
+
*
|
|
8
|
+
* `facing` and `hinge` are WORLD POINTS, not directions: `facing` sits on the
|
|
9
|
+
* side of the wall the leaf swings open to (where the plan symbol draws the
|
|
10
|
+
* swing arc); `hinge` sits near the jamb the leaf is hinged on — the item is
|
|
11
|
+
* reflected along the wall so its hinged jamb is the one nearer that point.
|
|
12
|
+
* Either may be omitted (engine-chosen side / the catalog item's authored
|
|
13
|
+
* hinge side). Neither has a visible effect on symmetric items such as
|
|
14
|
+
* sliders or fixed windows.
|
|
15
|
+
*
|
|
16
|
+
* | Property | Type | Description |
|
|
17
|
+
* |---|---|---|
|
|
18
|
+
* | `catalogId` | `string` | Library id: team `_id` or general `fullName` |
|
|
19
|
+
* | `hostWall` | {@linkcode ComponentHandle} | The wall to host the opening |
|
|
20
|
+
* | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
|
|
21
|
+
* | `facing` | {@linkcode Vec3Handle}? | World point on the side of the wall the opening swings open to (default engine-chosen) |
|
|
22
|
+
* | `hinge` | {@linkcode Vec3Handle}? | World point near the jamb the opening is hinged on (default the catalog item's authored side) |
|
|
23
|
+
* | `label` | `string`? | Instance name (optional) |
|
|
24
|
+
* | `width` | `number`? | Width override (Snaptrude units, > 0; default the catalog item's) |
|
|
25
|
+
* | `height` | `number`? | Height override (Snaptrude units, > 0; default the catalog item's) |
|
|
26
|
+
*/
|
|
27
|
+
export declare const PluginOpeningBaseOptions: {
|
|
28
|
+
catalogId: z.ZodString;
|
|
29
|
+
hostWall: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
30
|
+
position: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
|
|
31
|
+
facing: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
|
|
32
|
+
hinge: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
|
|
33
|
+
label: z.ZodOptional<z.ZodString>;
|
|
34
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=opening-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opening-fields.d.ts","sourceRoot":"","sources":["../../../../src/api/design/create/opening-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAc,MAAM,kBAAkB,CAAA;AAE9D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;CASpC,CAAA"}
|