@snaptrude/plugin-core 0.9.13 → 0.9.15
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 +61 -0
- package/api-manifest.full.json +8930 -0
- package/api-manifest.json +1002 -55
- package/dist/api/core/geom/create/index.d.ts +935 -100
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/brep.d.ts +59 -2
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/geom/query/curve.d.ts +59 -35
- package/dist/api/core/geom/query/curve.d.ts.map +1 -1
- package/dist/api/core/geom/query/edge.d.ts +2 -2
- package/dist/api/core/geom/query/face.d.ts +105 -0
- package/dist/api/core/geom/query/face.d.ts.map +1 -1
- package/dist/api/core/geom/update/contour.d.ts +2 -0
- package/dist/api/core/geom/update/contour.d.ts.map +1 -1
- package/dist/api/core/geom/update/curve.d.ts +5 -5
- package/dist/api/core/geom/update/profile.d.ts +3 -1
- package/dist/api/core/geom/update/profile.d.ts.map +1 -1
- package/dist/api/core/handles/index.d.ts +4 -2
- package/dist/api/core/handles/index.d.ts.map +1 -1
- package/dist/api/core/index.d.ts +4 -4
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/layers.d.ts +377 -255
- package/dist/api/core/layers.d.ts.map +1 -1
- package/dist/api/core/proposals/index.d.ts +4 -3
- package/dist/api/core/proposals/index.d.ts.map +1 -1
- package/dist/api/core/storeys/index.d.ts +12 -0
- package/dist/api/core/storeys/index.d.ts.map +1 -1
- package/dist/api/core/storeys/layers.d.ts +408 -0
- package/dist/api/core/storeys/layers.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +3 -3
- package/dist/api/design/create/bulk-items.d.ts +44 -0
- package/dist/api/design/create/bulk-items.d.ts.map +1 -1
- package/dist/api/design/create/grids.d.ts +1 -1
- package/dist/api/design/create/index.d.ts +31 -3
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/family.d.ts +67 -10
- package/dist/api/design/family.d.ts.map +1 -1
- package/dist/api/design/query/geometry/index.d.ts +33 -5
- package/dist/api/design/query/geometry/index.d.ts.map +1 -1
- package/dist/api/design/query/grids.d.ts +3 -3
- package/dist/api/design/query/index.d.ts +47 -0
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/spaces.d.ts +5 -5
- package/dist/api/design/selection/index.d.ts +2 -2
- package/dist/api/design/update/index.d.ts +172 -0
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +1 -1
- package/dist/api/entity/space.d.ts +4 -4
- package/dist/api/entity/story.d.ts +4 -4
- package/dist/api/presentation/aiInspiration.d.ts +13 -13
- package/dist/api/presentation/camera.d.ts +265 -0
- package/dist/api/presentation/camera.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +5 -0
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +1 -1
- package/dist/api/presentation/views.d.ts +3 -1
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/program/site.d.ts +4 -4
- package/dist/api/program/spreadsheet.d.ts +4 -4
- package/dist/handles.d.ts +13 -3
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +3638 -2958
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3558 -2955
- package/dist/index.js.map +1 -1
- package/dist/massParameters.d.ts +287 -0
- package/dist/massParameters.d.ts.map +1 -0
- package/dist/massParameters.ops.d.ts +138 -0
- package/dist/massParameters.ops.d.ts.map +1 -0
- package/package.json +2 -1
- package/scripts/check-dist-fresh.mjs +22 -0
- package/scripts/generate-manifest.test.mjs +14 -3
- package/src/api/core/geom/create/index.ts +1030 -101
- package/src/api/core/geom/query/brep.ts +60 -2
- package/src/api/core/geom/query/curve.ts +26 -2
- package/src/api/core/geom/query/edge.ts +2 -2
- package/src/api/core/geom/query/face.ts +109 -4
- package/src/api/core/geom/update/contour.ts +2 -0
- package/src/api/core/geom/update/profile.ts +2 -0
- package/src/api/core/handles/index.ts +3 -2
- package/src/api/core/index.ts +4 -4
- package/src/api/core/layers.ts +380 -173
- package/src/api/core/proposals/index.ts +4 -3
- package/src/api/core/storeys/index.ts +14 -0
- package/src/api/core/storeys/layers.ts +339 -0
- package/src/api/design/create/bulk-items.ts +68 -0
- package/src/api/design/create/index.ts +30 -4
- package/src/api/design/family.ts +68 -10
- package/src/api/design/query/geometry/index.ts +35 -4
- package/src/api/design/query/index.ts +50 -0
- package/src/api/design/update/index.ts +186 -1
- package/src/api/presentation/camera.ts +289 -0
- package/src/api/presentation/index.ts +5 -0
- package/src/api/presentation/views.ts +3 -1
- package/src/handles.ts +18 -3
- package/src/index.ts +2 -0
- package/src/massParameters.ops.ts +246 -0
- package/src/massParameters.ts +427 -0
- package/test/massParameters.test.mjs +952 -0
package/api-manifest.json
CHANGED
|
@@ -729,8 +729,9 @@
|
|
|
729
729
|
{
|
|
730
730
|
"path": "core.geom.create.brepFromChamfer",
|
|
731
731
|
"namespace": "core.geom.create",
|
|
732
|
-
"summary": "Bevels the given
|
|
732
|
+
"summary": "Bevels the given edges of a solid with a symmetric planar cut. Host API call — returns a new {@linkcode BrepHandle}; the input brep is read-only.",
|
|
733
733
|
"examplePrompts": [
|
|
734
|
+
"Chamfer the top edge of the cylinder",
|
|
734
735
|
"Bevel these edges by 100mm",
|
|
735
736
|
"Chamfer the top edges of the plinth",
|
|
736
737
|
"Cut a 45-degree flat along the corners of this mass\n\n# Example\n```ts\nconst brep = await snaptrude.core.geom.create.brepFromExtrusion(contour, { x: 0, y: 1, z: 0 }, 3)\nconst edges = await snaptrude.core.geom.query.brep.listEdges(brep)\nconst beveled = await snaptrude.core.geom.create.brepFromChamfer(brep, [edges[0]], 0.1)\n```"
|
|
@@ -738,6 +739,28 @@
|
|
|
738
739
|
"argsType": "BrepHandle",
|
|
739
740
|
"resultType": "BrepHandle"
|
|
740
741
|
},
|
|
742
|
+
{
|
|
743
|
+
"path": "core.geom.create.brepFromCone",
|
|
744
|
+
"namespace": "core.geom.create",
|
|
745
|
+
"summary": "Create a solid **cone or frustum** B-rep: bottom-cap centre, axis, base radius, height, and an optional top radius (default 0 — a full cone to a point; > 0 — a frustum / tapered column). Host API call — returns a {@linkcode BrepHandle}; commit with `design.create.massFromBrep`. Carries a creation recipe (radii + height), editable through `design.update.parameters`.",
|
|
746
|
+
"examplePrompts": [
|
|
747
|
+
"Create a cone roof 4m wide and 3m tall",
|
|
748
|
+
"Make a tapered column narrowing from 1m to 0.6m\n\n# Example\n```ts\nconst roof = await snaptrude.core.geom.create.brepFromCone(\n{ x: 0, y: 9, z: 0 },\n{ x: 0, y: 1, z: 0 },\n2,\n3,\n)\n```"
|
|
749
|
+
],
|
|
750
|
+
"argsType": "Vec3Components",
|
|
751
|
+
"resultType": "BrepHandle"
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"path": "core.geom.create.brepFromCylinder",
|
|
755
|
+
"namespace": "core.geom.create",
|
|
756
|
+
"summary": "Create a solid **cylinder** B-rep from its bottom-cap centre, axis direction, radius and height. Host API call — returns a {@linkcode BrepHandle}; commit with `design.create.massFromBrep`. The bottom cap sits AT `base` and the solid extends `height` along `axis` — place `base` on the floor and use axis `{x: 0, y: 1, z: 0}` for an upright column. Carries a creation recipe (radius, height), editable through `design.update.parameters`.",
|
|
757
|
+
"examplePrompts": [
|
|
758
|
+
"Create a cylinder 2m across and 4m tall",
|
|
759
|
+
"Add a circular column here\n\n# Example\n```ts\nconst brep = await snaptrude.core.geom.create.brepFromCylinder(\n{ x: 0, y: 0, z: 0 },\n{ x: 0, y: 1, z: 0 },\n1,\n4,\n)\nconst column = await snaptrude.design.create.massFromBrep(brep, \"Column\")\n```"
|
|
760
|
+
],
|
|
761
|
+
"argsType": "Vec3Components",
|
|
762
|
+
"resultType": "BrepHandle"
|
|
763
|
+
},
|
|
741
764
|
{
|
|
742
765
|
"path": "core.geom.create.brepFromExtrusion",
|
|
743
766
|
"namespace": "core.geom.create",
|
|
@@ -745,7 +768,9 @@
|
|
|
745
768
|
"examplePrompts": [
|
|
746
769
|
"Extrude this profile 3 metres up",
|
|
747
770
|
"Make a solid by extruding this outline",
|
|
748
|
-
"Create a cylinder from a circle profile
|
|
771
|
+
"Create a cylinder from a circle profile",
|
|
772
|
+
"Extrude this floor plate 40m up with a 90 degree twist",
|
|
773
|
+
"Taper this tower to 60 percent of its footprint at the top\n\n# Example\n```ts\nconst rect = await snaptrude.core.geom.create.profileRect(4, 3)\nconst contour = await snaptrude.core.geom.create.contourFromProfile(rect)\nconst brep = await snaptrude.core.geom.create.brepFromExtrusion(contour, { x: 0, y: 1, z: 0 }, 3)\nconst faceCount = await snaptrude.core.geom.query.brep.getFaceCount(brep) // 6\n```"
|
|
749
774
|
],
|
|
750
775
|
"argsType": "ContourHandle",
|
|
751
776
|
"resultType": "BrepHandle"
|
|
@@ -765,11 +790,14 @@
|
|
|
765
790
|
{
|
|
766
791
|
"path": "core.geom.create.brepFromFillet",
|
|
767
792
|
"namespace": "core.geom.create",
|
|
768
|
-
"summary": "Rounds the given
|
|
793
|
+
"summary": "Rounds the given edges of a solid with a constant radius. Host API call — returns a new {@linkcode BrepHandle}; the input brep is read-only.",
|
|
769
794
|
"examplePrompts": [
|
|
770
|
-
"Round the
|
|
795
|
+
"Round the rim of the column with 200 mm",
|
|
796
|
+
"Soften where the dome meets the wall",
|
|
771
797
|
"Fillet the corners of the podium with a 0.5m radius",
|
|
772
|
-
"Soften the vertical edges of this tower
|
|
798
|
+
"Soften the vertical edges of this tower",
|
|
799
|
+
"Blend this edge from 200mm at one end to 600mm at the other",
|
|
800
|
+
"Round this rim wider at the back than at the front\n\n# Example\n```ts\n// Rim = every edge between the cylinder side and a plane cap\nconst edges = await snaptrude.core.geom.query.brep.listEdges(column)\nconst rim = []\nfor (const edge of edges) {\nconst faces = await snaptrude.core.geom.query.edge.listFaces(edge)\nconst kinds = await Promise.all(\nfaces.map((f) => snaptrude.core.geom.query.face.getSurfaceKind(f)),\n)\nif (kinds.includes(\"cylinder\") && kinds.includes(\"plane\")) rim.push(edge)\n}\nconst rounded = await snaptrude.core.geom.create.brepFromFillet(column, rim, 0.787) // 200 mm\n```"
|
|
773
801
|
],
|
|
774
802
|
"argsType": "BrepHandle",
|
|
775
803
|
"resultType": "BrepHandle"
|
|
@@ -789,7 +817,7 @@
|
|
|
789
817
|
{
|
|
790
818
|
"path": "core.geom.create.brepFromLoft",
|
|
791
819
|
"namespace": "core.geom.create",
|
|
792
|
-
"summary": "Create a closed solid **B-rep** by lofting between a bottom and a top contour, optionally through intermediate cross-sections. Host API call — returns a {@linkcode BrepHandle}. Sections with different edge counts are auto-matched: vertices are deterministically inserted on the smaller sections at the larger section's perimeter positions, so the same input always yields the same solid. For straight-edge (all-line) sections the seam is auto-aligned too — winding and start-vertex correspondence are chosen to avoid a twist, so outlines authored from any starting corner loft cleanly; arc-bearing sections keep the authored correspondence unchanged. A pair whose side faces would be non-planar under every correspondence still builds for hole-free straight-edged pairs — planar side quads stay quads and warped ones split into planar triangles (the triangulated
|
|
820
|
+
"summary": "Create a closed solid **B-rep** by lofting between a bottom and a top contour, optionally through intermediate cross-sections. Host API call — returns a {@linkcode BrepHandle}. Sections with different edge counts are auto-matched: vertices are deterministically inserted on the smaller sections at the larger section's perimeter positions, so the same input always yields the same solid. For straight-edge (all-line) sections the seam is auto-aligned too — winding and start-vertex correspondence are chosen to avoid a twist, so outlines authored from any starting corner loft cleanly; arc-bearing sections keep the authored correspondence unchanged. A pair whose side faces would be non-planar under every correspondence still builds for hole-free straight-edged pairs — planar side quads stay quads and warped ones split into planar triangles (the triangulated fallback); arc-bearing or holed twisted pairs are rejected, as is auto-matching that would pair an arc with a straight edge. Matching hole counts are allowed in the two-section form. With intermediates the loft is a chain of ruled segments folded into one solid: sections must be planar and hole-free, ordered bottom → intermediates → top. The contours are copied — the input handles are never mutated.",
|
|
793
821
|
"examplePrompts": [
|
|
794
822
|
"Make a tapered tower from these two outlines",
|
|
795
823
|
"Loft between a large base and a smaller top",
|
|
@@ -798,7 +826,8 @@
|
|
|
798
826
|
"Loft a four-sided base to a five-sided top",
|
|
799
827
|
"Loft these outlines even though their corners don't line up",
|
|
800
828
|
"Loft these outlines exactly as authored, corner to corner",
|
|
801
|
-
"Fail the loft if my sections don't have matching edge counts
|
|
829
|
+
"Fail the loft if my sections don't have matching edge counts",
|
|
830
|
+
"Loft these three outlines with smoothly curving sides\n\n# Example\n```ts\n// A square frustum: 4m base lofted to a 2m top, 3m up\nconst base = await snaptrude.core.geom.create.profileRect(4, 4)\nconst top = await snaptrude.core.geom.create.profileRect(2, 2, await snaptrude.core.math.vec3.new(0, 3, 0))\nconst brep = await snaptrude.core.geom.create.brepFromLoft(\nawait snaptrude.core.geom.create.contourFromProfile(base),\nawait snaptrude.core.geom.create.contourFromProfile(top),\n)\nconst faceCount = await snaptrude.core.geom.query.brep.getFaceCount(brep) // 6\n```"
|
|
802
831
|
],
|
|
803
832
|
"argsType": "ContourHandle",
|
|
804
833
|
"resultType": "BrepHandle"
|
|
@@ -820,6 +849,7 @@
|
|
|
820
849
|
"namespace": "core.geom.create",
|
|
821
850
|
"summary": "Grows or shrinks a solid by offsetting every face — positive distance moves faces outward, negative moves them inward. Host API call — returns a new {@linkcode BrepHandle}; the input brep is read-only.",
|
|
822
851
|
"examplePrompts": [
|
|
852
|
+
"Thicken the torus ring by 100 mm",
|
|
823
853
|
"Grow this solid by 0.5m in every direction",
|
|
824
854
|
"Shrink this mass by 200mm",
|
|
825
855
|
"Offset the building envelope outward by 1m\n\n# Example\n```ts\nconst brep = await snaptrude.core.geom.create.brepFromExtrusion(contour, { x: 0, y: 1, z: 0 }, 3)\nconst grown = await snaptrude.core.geom.create.brepFromOffset(brep, 0.5)\n```"
|
|
@@ -827,14 +857,27 @@
|
|
|
827
857
|
"argsType": "BrepHandle",
|
|
828
858
|
"resultType": "BrepHandle"
|
|
829
859
|
},
|
|
860
|
+
{
|
|
861
|
+
"path": "core.geom.create.brepFromPatch",
|
|
862
|
+
"namespace": "core.geom.create",
|
|
863
|
+
"summary": "Stretches a surface across a closed loop of boundary curves and thickens it into a SOLID in one call — a roof over four curves, a canopy between two rails, a blend across a gap. `thickness` is in internal length units and is required: only solids reach the canvas, and there is no separate surface object to keep. Pass edges as `{ edge, brep, face }` with `continuity: \"tangent\"` to leave the named face smoothly. The result carries NO recipe (`design.query.getParameters` returns `null`) — label it when you commit it, because the label is all the provenance there is.",
|
|
864
|
+
"examplePrompts": [
|
|
865
|
+
"Patch a roof over these four boundary curves, 250 mm thick",
|
|
866
|
+
"Span a canopy between these two curved rails, 300 mm thick\n\n# Example\n```ts\n// A roof over four curves\nconst roof = await snaptrude.core.geom.create.brepFromPatch(\n[curveA, curveB, curveC, curveD],\n0.984, // 250 mm\n)\nconst mass = await snaptrude.design.create.massFromBrep(roof, \"Roof patch\")\n```\n\n```ts\n// A canopy between two towers' rims, leaving every wall it meets smoothly:\n// with `continuity: \"tangent\"` EVERY item is an edge naming its face.\nconst canopy = await snaptrude.core.geom.create.brepFromPatch(\n[\n{ edge: rimA, brep: towerA, face: wallA },\n{ edge: sideA, brep: towerA, face: endA },\n{ edge: rimB, brep: towerB, face: wallB },\n{ edge: sideB, brep: towerB, face: endB },\n],\n1.181, // 300 mm\n{ continuity: \"tangent\" },\n)\n```"
|
|
867
|
+
],
|
|
868
|
+
"argsType": "(CurveHandle | OwnedEdge)[]",
|
|
869
|
+
"resultType": "BrepHandle"
|
|
870
|
+
},
|
|
830
871
|
{
|
|
831
872
|
"path": "core.geom.create.brepFromRevolution",
|
|
832
873
|
"namespace": "core.geom.create",
|
|
833
|
-
"summary": "Revolves a planar profile about an axis to make a solid of revolution — a full turn by default. Host API call — returns a new {@linkcode BrepHandle}; the input contour is read-only. Holes in the profile are allowed
|
|
874
|
+
"summary": "Revolves a planar profile about an axis to make a solid of revolution — a full turn by default. Host API call — returns a new {@linkcode BrepHandle}; the input contour is read-only. Holes in the profile are allowed, and segments may run at any angle to the axis: an inclined segment revolves into a cone, an arc into a sphere or torus section. This is the general route to domes, vases, columns and rotundas.",
|
|
834
875
|
"examplePrompts": [
|
|
835
876
|
"Create a dome from this section",
|
|
836
877
|
"Revolve this profile 360 degrees around the vertical axis",
|
|
837
|
-
"Build a rotunda by revolving this wall section
|
|
878
|
+
"Build a rotunda by revolving this wall section",
|
|
879
|
+
"Make a dome by revolving a quarter-circle about the vertical axis",
|
|
880
|
+
"Turn this curved outline into a vase\n\n# Example\n```ts\n// A cylinder: revolve a 2m-wide, 3m-tall rectangle about the Y axis at\n// its edge — the left edge sits ON the axis, which is legal.\nconst rect = await snaptrude.core.geom.create.profileFromLinePoints([\nawait snaptrude.core.math.vec3.new(0, 0, 0),\nawait snaptrude.core.math.vec3.new(2, 0, 0),\nawait snaptrude.core.math.vec3.new(2, 3, 0),\nawait snaptrude.core.math.vec3.new(0, 3, 0),\n])\nconst profile = await snaptrude.core.geom.create.contourFromProfile(rect)\nconst cylinder = await snaptrude.core.geom.create.brepFromRevolution(\nprofile,\n{ x: 0, y: 0, z: 0 },\n{ x: 0, y: 1, z: 0 },\n)\n```"
|
|
838
881
|
],
|
|
839
882
|
"argsType": "ContourHandle",
|
|
840
883
|
"resultType": "BrepHandle"
|
|
@@ -844,13 +887,25 @@
|
|
|
844
887
|
"namespace": "core.geom.create",
|
|
845
888
|
"summary": "Hollows a solid into constant-thickness walls, removing the given faces as openings. Host API call — returns a new {@linkcode BrepHandle}; the input brep is read-only. The outer surface is kept and the walls grow inward.",
|
|
846
889
|
"examplePrompts": [
|
|
890
|
+
"Hollow the dome into a 300 mm shell, open at the base",
|
|
847
891
|
"Hollow this mass into 200mm walls",
|
|
848
892
|
"Shell this form with the top face open",
|
|
849
|
-
"Turn this solid tower into a tube open at both ends\n\n# Example\n```ts\nconst
|
|
893
|
+
"Turn this solid tower into a tube open at both ends\n\n# Example\n```ts\n// Open the dome at its flat base: the one face whose surface is a plane\nconst faces = await snaptrude.core.geom.query.brep.listFaces(dome)\nconst base = []\nfor (const face of faces) {\nif ((await snaptrude.core.geom.query.face.getSurfaceKind(face)) === \"plane\") base.push(face)\n}\nconst hollow = await snaptrude.core.geom.create.brepFromShell(dome, base, 1.181) // 300 mm\n```"
|
|
850
894
|
],
|
|
851
895
|
"argsType": "BrepHandle",
|
|
852
896
|
"resultType": "BrepHandle"
|
|
853
897
|
},
|
|
898
|
+
{
|
|
899
|
+
"path": "core.geom.create.brepFromSphere",
|
|
900
|
+
"namespace": "core.geom.create",
|
|
901
|
+
"summary": "Create a solid **sphere** B-rep (boundary representation: the solid's exact faces, edges and vertices) from a centre and radius. Host API call — returns a {@linkcode BrepHandle}; commit it to the scene with `design.create.massFromBrep`. The result carries an exact spherical surface (not a faceted approximation) and a creation recipe — read the committed mass's parameters back with `design.query.getParameters` and edit them with `design.update.parameters`.",
|
|
902
|
+
"examplePrompts": [
|
|
903
|
+
"Create a sphere of radius 5 at the origin",
|
|
904
|
+
"Add a 3m ball on top of the tower\n\n# Example\n```ts\nconst brep = await snaptrude.core.geom.create.brepFromSphere({ x: 0, y: 5, z: 0 }, 5)\nconst mass = await snaptrude.design.create.massFromBrep(brep, \"Sphere\")\n```"
|
|
905
|
+
],
|
|
906
|
+
"argsType": "Vec3Components",
|
|
907
|
+
"resultType": "BrepHandle"
|
|
908
|
+
},
|
|
854
909
|
{
|
|
855
910
|
"path": "core.geom.create.brepFromSubtraction",
|
|
856
911
|
"namespace": "core.geom.create",
|
|
@@ -866,7 +921,7 @@
|
|
|
866
921
|
{
|
|
867
922
|
"path": "core.geom.create.brepFromSweep",
|
|
868
923
|
"namespace": "core.geom.create",
|
|
869
|
-
"summary": "Sweeps a planar profile along a polyline path, with mitred corners at each bend. Host API call — returns a new {@linkcode BrepHandle}; the input contour is read-only. The profile must be hole-free and must not lie in a plane containing the first path segment's direction. Repeating the first point as the last closes the path into a ring solid (a picture frame): closed paths must be flat and straight-segmented and take a straight-edged (arc-free) profile — the ring's cross-section is the authored profile projected along the first leg onto the first mitre plane, so a profile not perpendicular to the first leg appears sheared. An optional scale law tapers the sweep: `startScale`/`endScale` interpolate linearly by arc length, or `scales` gives one factor per path point (scaling is about the profile centroid). A uniform scale (all factors equal) works on any path today's sweep accepts; a varying scale takes straight (collinear) open paths with straight-edged profiles — tapering across a bend or along an arc edge would create faces Snaptrude cannot represent and throws (sweep each straight run separately and union the results instead). An optional `transition` picks the corner treatment: `\"miter\"` (default) is
|
|
924
|
+
"summary": "Sweeps a planar profile along a polyline path, with mitred corners at each bend. Host API call — returns a new {@linkcode BrepHandle}; the input contour is read-only. The profile must be hole-free and must not lie in a plane containing the first path segment's direction. Repeating the first point as the last closes the path into a ring solid (a picture frame): closed paths must be flat and straight-segmented and take a straight-edged (arc-free) profile — the ring's cross-section is the authored profile projected along the first leg onto the first mitre plane, so a profile not perpendicular to the first leg appears sheared. An optional scale law tapers the sweep: `startScale`/`endScale` interpolate linearly by arc length, or `scales` gives one factor per path point (scaling is about the profile centroid). A uniform scale (all factors equal) works on any path today's sweep accepts; a varying scale takes straight (collinear) open paths with straight-edged profiles — tapering across a bend or along an arc edge would create faces Snaptrude cannot represent and throws (sweep each straight run separately and union the results instead). An optional `transition` picks the corner treatment: `\"miter\"` (default) is a sharp mitred bend; `\"round\"` carries the section around each turning corner on a tangent circular arc, so the corner patch is a real curved surface (geometrically cylindrical; `getSurfaceKind` reports it as `\"spline\"`) rather than a flat cut (open paths only — `\"round\"` on a closed ring path is refused); `{ bevel: b }` chamfers each turning corner by cutting `b` back along both adjacent legs (works on open and closed paths — each leg must be long enough for its cuts). On a corner-less path `transition` has no effect, and a varying scale only accepts straight paths, so it never meets a corner.",
|
|
870
925
|
"examplePrompts": [
|
|
871
926
|
"Sweep this profile along the corridor path",
|
|
872
927
|
"Extrude the railing section along this route",
|
|
@@ -874,11 +929,35 @@
|
|
|
874
929
|
"Sweep a frame profile around a closed rectangular loop",
|
|
875
930
|
"Taper this duct from 1x1 to 2x2 along its run",
|
|
876
931
|
"Sweep a column section that narrows toward the top",
|
|
877
|
-
"Chamfer the corners of this swept frame by 200mm
|
|
932
|
+
"Chamfer the corners of this swept frame by 200mm",
|
|
933
|
+
"Sweep this handrail with rounded corners at the bends\n\n# Example\n```ts\nconst rect = await snaptrude.core.geom.create.profileRect(0.4, 0.4)\nconst profile = await snaptrude.core.geom.create.contourFromProfile(rect)\n// profileRect lies in the XZ plane, so the path must START out of that\n// plane (here: straight up), then it can run horizontally.\nconst duct = await snaptrude.core.geom.create.brepFromSweep(profile, [\n{ x: 0, y: 0, z: 0 },\n{ x: 0, y: 2.8, z: 0 },\n{ x: 10, y: 2.8, z: 0 },\n])\n// A closed ring (picture frame): repeat the first point as the last\nconst frame = await snaptrude.core.geom.create.brepFromSweep(profile, [\n{ x: 0, y: 0, z: 0 },\n{ x: 0, y: 3, z: 0 },\n{ x: 4, y: 3, z: 0 },\n{ x: 4, y: 0, z: 0 },\n{ x: 0, y: 0, z: 0 },\n])\n// A tapered straight run: 0.4x0.4 at the start, 0.8x0.8 at the end\nconst flue = await snaptrude.core.geom.create.brepFromSweep(\nprofile,\n[\n{ x: 0, y: 0, z: 0 },\n{ x: 0, y: 10, z: 0 },\n],\n{ startScale: 1, endScale: 2 },\n)\n```"
|
|
934
|
+
],
|
|
935
|
+
"argsType": "ContourHandle",
|
|
936
|
+
"resultType": "BrepHandle"
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
"path": "core.geom.create.brepFromSweepAlongCurve",
|
|
940
|
+
"namespace": "core.geom.create",
|
|
941
|
+
"summary": "Sweeps a cross-section along a SMOOTH path — splines, arcs and lines chained end to end — with control of how the profile turns. {@linkcode PluginGeomCreateApi.brepFromSweep} takes a polyline path; this takes curves. Host API call — returns a new {@linkcode BrepHandle}; the inputs are read-only. Records as `sweepAlongCurve`, so the orientation stays editable through `design.update.parameters`. The properties panel shows it read-only, because it is a text value, not a number. A railed sweep records nothing (`getParameters` answers `null`).",
|
|
942
|
+
"examplePrompts": [
|
|
943
|
+
"Sweep a 600x400 duct along this curved route and keep it upright",
|
|
944
|
+
"Run this handrail along the curved stair edge",
|
|
945
|
+
"Bend this footprint along the arc\n\n# Example\n```ts\nconst route = await snaptrude.core.geom.create.splineFromPoints(points)\nconst duct = await snaptrude.core.geom.create.brepFromSweepAlongCurve(profile, [route], {\norientation: \"upright\",\n})\n```"
|
|
878
946
|
],
|
|
879
947
|
"argsType": "ContourHandle",
|
|
880
948
|
"resultType": "BrepHandle"
|
|
881
949
|
},
|
|
950
|
+
{
|
|
951
|
+
"path": "core.geom.create.brepFromTorus",
|
|
952
|
+
"namespace": "core.geom.create",
|
|
953
|
+
"summary": "Create a solid **torus** (ring / donut) B-rep from its centre, plane normal, ring radius and tube radius. Host API call — returns a {@linkcode BrepHandle}; commit with `design.create.massFromBrep`. `majorRadius` is centre-to-tube-centre; `minorRadius` is the tube's own radius and must be strictly smaller. Carries a creation recipe, editable through `design.update.parameters`.",
|
|
954
|
+
"examplePrompts": [
|
|
955
|
+
"Create a donut-shaped ring 10m across with a 1m tube",
|
|
956
|
+
"Add a torus canopy around the tower\n\n# Example\n```ts\nconst ring = await snaptrude.core.geom.create.brepFromTorus(\n{ x: 0, y: 6, z: 0 },\n{ x: 0, y: 1, z: 0 },\n5,\n1,\n)\n```"
|
|
957
|
+
],
|
|
958
|
+
"argsType": "Vec3Components",
|
|
959
|
+
"resultType": "BrepHandle"
|
|
960
|
+
},
|
|
882
961
|
{
|
|
883
962
|
"path": "core.geom.create.brepFromUnion",
|
|
884
963
|
"namespace": "core.geom.create",
|
|
@@ -903,6 +982,16 @@
|
|
|
903
982
|
"argsType": "BrepHandle",
|
|
904
983
|
"resultType": "BrepHandle[]"
|
|
905
984
|
},
|
|
985
|
+
{
|
|
986
|
+
"path": "core.geom.create.brepsFromSplitByFace",
|
|
987
|
+
"namespace": "core.geom.create",
|
|
988
|
+
"summary": "Cuts a solid with a FACE of another solid — the curved twin of {@linkcode PluginGeomCreateApi.brepsFromSplit}, which cuts with a plane. Host API call — returns new {@linkcode BrepHandle}s; both inputs are read-only. BOTH breps must be in the same frame: read scene masses with `design.query.geometry.getBrep(x, { frame: \"world\" })` (the default is each mass's own local frame, and two masses have two). The pieces come back in DESCENDING volume order; pick the one you want with `core.geom.query.brep.getCentroid` or `getVolume` and commit it. A piece carries no recipe — label it.",
|
|
989
|
+
"examplePrompts": [
|
|
990
|
+
"Cut this mass with the curved roof surface and keep the lower part\n\n# Example\n```ts\nconst target = await snaptrude.design.query.geometry.getBrep(tower, { frame: \"world\" })\nconst tool = await snaptrude.design.query.geometry.getBrep(roof, { frame: \"world\" })\nconst [toolFace] = await snaptrude.core.geom.query.brep.listFaces(tool)\nconst pieces = await snaptrude.core.geom.create.brepsFromSplitByFace(target, toolFace, tool)\n```"
|
|
991
|
+
],
|
|
992
|
+
"argsType": "BrepHandle",
|
|
993
|
+
"resultType": "BrepHandle[]"
|
|
994
|
+
},
|
|
906
995
|
{
|
|
907
996
|
"path": "core.geom.create.circle",
|
|
908
997
|
"namespace": "core.geom.create",
|
|
@@ -933,6 +1022,14 @@
|
|
|
933
1022
|
"argsType": "ProfileHandle",
|
|
934
1023
|
"resultType": "ContourHandle"
|
|
935
1024
|
},
|
|
1025
|
+
{
|
|
1026
|
+
"path": "core.geom.create.curvesFromProjection",
|
|
1027
|
+
"namespace": "core.geom.create",
|
|
1028
|
+
"summary": "Drops a curve onto a face along the face's normal and returns the curves it lands on — one per connected run, empty when the curve misses the face entirely. Host API call — returns new curve handles; the inputs are read-only. No lengths are involved: the result is a curve in the same internal length units as its inputs.",
|
|
1029
|
+
"examplePrompts": [],
|
|
1030
|
+
"argsType": "CurveHandle",
|
|
1031
|
+
"resultType": "CurveHandle[]"
|
|
1032
|
+
},
|
|
936
1033
|
{
|
|
937
1034
|
"path": "core.geom.create.line",
|
|
938
1035
|
"namespace": "core.geom.create",
|
|
@@ -965,10 +1062,22 @@
|
|
|
965
1062
|
"argsType": "Vec3Handle[]",
|
|
966
1063
|
"resultType": "ProfileHandle"
|
|
967
1064
|
},
|
|
1065
|
+
{
|
|
1066
|
+
"path": "core.geom.create.profileFromSplinePoints",
|
|
1067
|
+
"namespace": "core.geom.create",
|
|
1068
|
+
"summary": "Create a CLOSED smooth profile passing through each point, in order, with the loop closed smoothly back from the last point to the first (do NOT repeat the first point). Host API call — returns a handle. This is the closed counterpart of {@linkcode PluginGeomCreateApi.splineFromPoints} and the one-call route from points to an extrudable outline: wrap in `contourFromProfile` and extrude/loft/sweep as usual.",
|
|
1069
|
+
"examplePrompts": [
|
|
1070
|
+
"Make a blob-shaped floor plate through these points",
|
|
1071
|
+
"Organic curved outline through these corners",
|
|
1072
|
+
"Freeform podium profile\n\n# Example\n```ts\nconst profile = await snaptrude.core.geom.create.profileFromSplinePoints([p0, p1, p2, p3, p4])\nconst contour = await snaptrude.core.geom.create.contourFromProfile(profile)\nconst brep = await snaptrude.core.geom.create.brepFromExtrusion(contour, { x: 0, y: 1, z: 0 }, 3)\nconst podium = await snaptrude.design.create.massFromBrep(brep, \"Podium\")\n```"
|
|
1073
|
+
],
|
|
1074
|
+
"argsType": "Vec3Handle[]",
|
|
1075
|
+
"resultType": "ProfileHandle"
|
|
1076
|
+
},
|
|
968
1077
|
{
|
|
969
1078
|
"path": "core.geom.create.profileRect",
|
|
970
1079
|
"namespace": "core.geom.create",
|
|
971
|
-
"summary": "Create an axis-aligned **rectangle** profile
|
|
1080
|
+
"summary": "Create an axis-aligned **rectangle** profile in the XZ plane, `width` × `depth`, centred at `center` (defaults to the origin). Host API call — returns a handle.",
|
|
972
1081
|
"examplePrompts": [
|
|
973
1082
|
"Draw a 4m by 3m rectangle",
|
|
974
1083
|
"Make a rectangular outline for a room footprint"
|
|
@@ -976,6 +1085,28 @@
|
|
|
976
1085
|
"argsType": "number",
|
|
977
1086
|
"resultType": "ProfileHandle"
|
|
978
1087
|
},
|
|
1088
|
+
{
|
|
1089
|
+
"path": "core.geom.create.splineFromControlPoints",
|
|
1090
|
+
"namespace": "core.geom.create",
|
|
1091
|
+
"summary": "Create an open NURBS curve DEFINED BY control points — the curve is pulled TOWARD the interior points, not through them; it starts at the first point and ends at the last. Knots are computed for you (clamped, uniform) — there is no knot-vector argument. For a curve that must pass THROUGH given points use {@linkcode PluginGeomCreateApi.splineFromPoints}.",
|
|
1092
|
+
"examplePrompts": [
|
|
1093
|
+
"Draw a smooth curve controlled by these four points\n\n# Example\n```ts\nconst curve = await snaptrude.core.geom.create.splineFromControlPoints([p0, p1, p2, p3])\n// Quadratic instead of the default cubic\nconst tighter = await snaptrude.core.geom.create.splineFromControlPoints(\n[p0, p1, p2, p3],\n{ degree: 2 },\n)\n```"
|
|
1094
|
+
],
|
|
1095
|
+
"argsType": "Vec3Handle[]",
|
|
1096
|
+
"resultType": "SplineHandle"
|
|
1097
|
+
},
|
|
1098
|
+
{
|
|
1099
|
+
"path": "core.geom.create.splineFromPoints",
|
|
1100
|
+
"namespace": "core.geom.create",
|
|
1101
|
+
"summary": "Create an open NURBS curve passing exactly THROUGH each point, in order (centripetal Catmull-Rom fit → clamped cubic B-spline; C1-smooth, no cusps on uneven spacing). Host API call — returns a handle. The points are interpolated, NOT control points. For a CLOSED smooth loop use {@linkcode PluginGeomCreateApi.profileFromSplinePoints} — closed splines exist only as profiles, never as a single curve handle.",
|
|
1102
|
+
"examplePrompts": [
|
|
1103
|
+
"Draw a smooth curve through these points",
|
|
1104
|
+
"Make a wavy edge that passes through A, B, C and D",
|
|
1105
|
+
"Freeform curved wall path through these clicks\n\n# Example\n```ts\nconst spline = await snaptrude.core.geom.create.splineFromPoints([p0, p1, p2, p3])\n// Mixed profile: smooth top, straight closing base\nconst base = await snaptrude.core.geom.create.line(p3, p0)\nconst profile = await snaptrude.core.geom.create.profileFromCurves([spline, base])\n```"
|
|
1106
|
+
],
|
|
1107
|
+
"argsType": "Vec3Handle[]",
|
|
1108
|
+
"resultType": "SplineHandle"
|
|
1109
|
+
},
|
|
979
1110
|
{
|
|
980
1111
|
"path": "core.geom.delete.contour",
|
|
981
1112
|
"namespace": "core.geom.delete",
|
|
@@ -1057,7 +1188,7 @@
|
|
|
1057
1188
|
{
|
|
1058
1189
|
"path": "core.geom.query.brep.getCentroid",
|
|
1059
1190
|
"namespace": "core.geom.query.brep",
|
|
1060
|
-
"summary": "Get the centroid
|
|
1191
|
+
"summary": "Get the centroid of a brep: the mean of its vertex positions for planar and cylinder-sided solids; for a solid with sphere, cone, torus or spline geometry, its exact centre of mass (integrated over the surfaces; the vertex mean again if the kernel cannot integrate it, e.g. an open brep).",
|
|
1061
1192
|
"examplePrompts": [
|
|
1062
1193
|
"Find the centre point of this shape",
|
|
1063
1194
|
"What is the centroid of the selected object?\n\n# Example\n```ts\nconst [mass] = await snaptrude.design.query.listMasses()\nconst brep = await snaptrude.design.query.geometry.getBrep(mass)\nif (brep) {\nconst centroid = await snaptrude.core.geom.query.brep.getCentroid(brep)\nconsole.log(centroid.x, centroid.y, centroid.z)\n}\n```"
|
|
@@ -1068,7 +1199,7 @@
|
|
|
1068
1199
|
{
|
|
1069
1200
|
"path": "core.geom.query.brep.getDistance",
|
|
1070
1201
|
"namespace": "core.geom.query.brep",
|
|
1071
|
-
"summary": "Measures the minimum distance between two solids, with the closest
|
|
1202
|
+
"summary": "Measures the minimum distance between two solids, with the closest point on each. Touching or overlapping solids report a distance of 0 with contact points.",
|
|
1072
1203
|
"examplePrompts": [
|
|
1073
1204
|
"What is the clearance between these two masses?",
|
|
1074
1205
|
"How far apart are the tower and the neighbouring building?",
|
|
@@ -1101,10 +1232,11 @@
|
|
|
1101
1232
|
"Read the radius of this curved edge",
|
|
1102
1233
|
"Is this edge straight or an arc?",
|
|
1103
1234
|
"Get the exact start and end points of this edge",
|
|
1104
|
-
"Measure the length of each edge of this mass
|
|
1235
|
+
"Measure the length of each edge of this mass",
|
|
1236
|
+
"Read the control points of this curved edge\n\n# Example\n```ts\nconst [mass] = await snaptrude.design.query.listMasses()\nconst brep = await snaptrude.design.query.geometry.getBrep(mass)\nif (brep) {\nconst edges = await snaptrude.core.geom.query.brep.listEdges(brep)\nfor (const edge of edges) {\nconst curve = await snaptrude.core.geom.query.brep.getEdgeCurve(brep, edge)\nif (curve.type === \"arc\") console.log(\"arc radius:\", curve.radius)\n}\n}\n```"
|
|
1105
1237
|
],
|
|
1106
1238
|
"argsType": "BrepHandle",
|
|
1107
|
-
"resultType": "| { type: \"line\"; startPoint: Vec3Components; endPoint: Vec3Components; length: number }\n | {\n type: \"arc\"\n startPoint: Vec3Components\n endPoint: Vec3Components\n centre: Vec3Components\n axis: Vec3Components\n radius: number\n length: number\n }\n | {\n type: \"circle\"\n centre: Vec3Components\n axis: Vec3Components\n radius: number\n length: number\n }"
|
|
1239
|
+
"resultType": "| { type: \"line\"; startPoint: Vec3Components; endPoint: Vec3Components; length: number }\n | {\n type: \"arc\"\n startPoint: Vec3Components\n endPoint: Vec3Components\n centre: Vec3Components\n axis: Vec3Components\n radius: number\n length: number\n }\n | {\n type: \"circle\"\n centre: Vec3Components\n axis: Vec3Components\n radius: number\n length: number\n }\n | {\n type: \"spline\"\n startPoint: Vec3Components\n endPoint: Vec3Components\n degree: number\n controlPoints: Vec3Components[]\n /** Expanded by multiplicity: `controlPoints.length + degree + 1` entries. */\n knots: number[]\n length: number\n }"
|
|
1108
1240
|
},
|
|
1109
1241
|
{
|
|
1110
1242
|
"path": "core.geom.query.brep.getFaceCount",
|
|
@@ -1138,6 +1270,18 @@
|
|
|
1138
1270
|
"argsType": "BrepHandle",
|
|
1139
1271
|
"resultType": "Vec3Components"
|
|
1140
1272
|
},
|
|
1273
|
+
{
|
|
1274
|
+
"path": "core.geom.query.brep.getVolume",
|
|
1275
|
+
"namespace": "core.geom.query.brep",
|
|
1276
|
+
"summary": "Get the enclosed **volume** of a closed solid, integrated from its exact surfaces. Curved faces are measured analytically, not from their tessellation — a real sphere of radius 5 reports 523.6, whatever its triangle count. That makes this the reliable way to confirm a solid is the shape you intended (a torus should measure 2·π²·R·r²).",
|
|
1277
|
+
"examplePrompts": [
|
|
1278
|
+
"What is the volume of this mass?",
|
|
1279
|
+
"How much concrete is in this shape?",
|
|
1280
|
+
"Check the volume of the dome I just made\n\n# Example\n```ts\nconst [mass] = await snaptrude.design.query.listMasses()\nconst brep = await snaptrude.design.query.geometry.getBrep(mass)\nif (brep) {\nconst volume = await snaptrude.core.geom.query.brep.getVolume(brep)\nconsole.log(\"volume:\", volume)\n}\n```"
|
|
1281
|
+
],
|
|
1282
|
+
"argsType": "BrepHandle",
|
|
1283
|
+
"resultType": "number"
|
|
1284
|
+
},
|
|
1141
1285
|
{
|
|
1142
1286
|
"path": "core.geom.query.brep.hasEdge",
|
|
1143
1287
|
"namespace": "core.geom.query.brep",
|
|
@@ -1742,7 +1886,7 @@
|
|
|
1742
1886
|
{
|
|
1743
1887
|
"path": "core.geom.query.edge.getCurve",
|
|
1744
1888
|
"namespace": "core.geom.query.edge",
|
|
1745
|
-
"summary": "Get the underlying curve geometry of an edge (a line or
|
|
1889
|
+
"summary": "Get the underlying curve geometry of an edge (a line, arc or spline).",
|
|
1746
1890
|
"examplePrompts": [],
|
|
1747
1891
|
"argsType": "EdgeHandle",
|
|
1748
1892
|
"resultType": "CurveHandle | null"
|
|
@@ -1779,6 +1923,28 @@
|
|
|
1779
1923
|
"argsType": "EdgeHandle",
|
|
1780
1924
|
"resultType": "VertexHandle[]"
|
|
1781
1925
|
},
|
|
1926
|
+
{
|
|
1927
|
+
"path": "core.geom.query.face.getArea",
|
|
1928
|
+
"namespace": "core.geom.query.face",
|
|
1929
|
+
"summary": "Exact surface area of one face of `brep`, in internal length units SQUARED — integrated off the face's own surface, not its facets, so a curved patch reads exactly rather than as its triangles. Needs the parent brep: a face handle cannot name its own solid.",
|
|
1930
|
+
"examplePrompts": [
|
|
1931
|
+
"How big is this roof patch?",
|
|
1932
|
+
"Which face of this mass has the largest area?\n\n# Example\n```ts\nconst [mass] = await snaptrude.design.query.listMasses()\nconst brep = await snaptrude.design.query.geometry.getBrep(mass)\nif (brep) {\nconst faces = await snaptrude.core.geom.query.brep.listFaces(brep)\nconst areas = await Promise.all(\nfaces.map((f) => snaptrude.core.geom.query.face.getArea(f, brep)),\n)\n}\n```"
|
|
1933
|
+
],
|
|
1934
|
+
"argsType": "FaceHandle",
|
|
1935
|
+
"resultType": "number"
|
|
1936
|
+
},
|
|
1937
|
+
{
|
|
1938
|
+
"path": "core.geom.query.face.getCentroid",
|
|
1939
|
+
"namespace": "core.geom.query.face",
|
|
1940
|
+
"summary": "Centre of area of one face of `brep`, as a point in that brep's frame (internal length units). On a solid whose every face reads `\"spline\"` this is the read that tells two patches apart — the top of a thickened patch from its bottom, one quarter of a closed surface from the next.",
|
|
1941
|
+
"examplePrompts": [
|
|
1942
|
+
"Where is the middle of this face?",
|
|
1943
|
+
"Pick the topmost face of this curved mass\n\n# Example\n```ts\nconst centre = await snaptrude.core.geom.query.face.getCentroid(face, brep)\n```"
|
|
1944
|
+
],
|
|
1945
|
+
"argsType": "FaceHandle",
|
|
1946
|
+
"resultType": "Vec3Components"
|
|
1947
|
+
},
|
|
1782
1948
|
{
|
|
1783
1949
|
"path": "core.geom.query.face.getHalfEdge",
|
|
1784
1950
|
"namespace": "core.geom.query.face",
|
|
@@ -1819,6 +1985,19 @@
|
|
|
1819
1985
|
"argsType": "FaceHandle",
|
|
1820
1986
|
"resultType": "number"
|
|
1821
1987
|
},
|
|
1988
|
+
{
|
|
1989
|
+
"path": "core.geom.query.face.getSurfaceKind",
|
|
1990
|
+
"namespace": "core.geom.query.face",
|
|
1991
|
+
"summary": "Read what KIND of surface a face lies on. This is the one read that tells a genuinely curved face from a faceted approximation of one: every face of a 200-triangle \"dome\" answers `\"plane\"`, while a real dome has faces answering `\"sphere\"`. Use it to confirm a curved solid actually came out curved.",
|
|
1992
|
+
"examplePrompts": [
|
|
1993
|
+
"Is this face flat or curved?",
|
|
1994
|
+
"Check that this dome is a real sphere, not a faceted approximation",
|
|
1995
|
+
"What kind of surface is this face?",
|
|
1996
|
+
"How many curved faces does this mass have?\n\n# Example\n```ts\nconst [mass] = await snaptrude.design.query.listMasses()\nconst brep = await snaptrude.design.query.geometry.getBrep(mass)\nif (brep) {\nconst faces = await snaptrude.core.geom.query.brep.listFaces(brep)\nconst kinds = []\nfor (const face of faces) kinds.push(await snaptrude.core.geom.query.face.getSurfaceKind(face))\nconsole.log(\"spherical faces:\", kinds.filter((k) => k === \"sphere\").length)\n}\n```"
|
|
1997
|
+
],
|
|
1998
|
+
"argsType": "FaceHandle",
|
|
1999
|
+
"resultType": "\"plane\" | \"cylinder\" | \"cone\" | \"sphere\" | \"torus\" | \"spline\" | null"
|
|
2000
|
+
},
|
|
1822
2001
|
{
|
|
1823
2002
|
"path": "core.geom.query.face.hasHoles",
|
|
1824
2003
|
"namespace": "core.geom.query.face",
|
|
@@ -3070,14 +3249,55 @@
|
|
|
3070
3249
|
"argsType": "UnderlayHandle",
|
|
3071
3250
|
"resultType": "{ scaleFactor: number }"
|
|
3072
3251
|
},
|
|
3252
|
+
{
|
|
3253
|
+
"path": "core.layers.assign",
|
|
3254
|
+
"namespace": "core.layers",
|
|
3255
|
+
"summary": "Move objects onto a layer (picking a layer in the object properties panel).",
|
|
3256
|
+
"examplePrompts": [
|
|
3257
|
+
"Move the selected objects to the BIM layer",
|
|
3258
|
+
"Move the selected objects to the Furniture layer",
|
|
3259
|
+
"Assign the generated walls to the Structure layer",
|
|
3260
|
+
"Put these masses on layer 3f2a…\n\n# Example\n```ts\nconst { assigned, skipped } = await snaptrude.core.layers.assign(ids, layerId)\n```"
|
|
3261
|
+
],
|
|
3262
|
+
"argsType": "ComponentHandle[]",
|
|
3263
|
+
"resultType": "PluginCoreLayersAssignResult"
|
|
3264
|
+
},
|
|
3265
|
+
{
|
|
3266
|
+
"path": "core.layers.create",
|
|
3267
|
+
"namespace": "core.layers",
|
|
3268
|
+
"summary": "Create a new layer in the Layers panel (the panel's \"Add new layer\" button followed by naming it).",
|
|
3269
|
+
"examplePrompts": [
|
|
3270
|
+
"Create a new layer called Furniture",
|
|
3271
|
+
"Add a layer called Landscape",
|
|
3272
|
+
"Add a layer named Landscape to the Layers panel",
|
|
3273
|
+
"Make a new layer for the facade elements",
|
|
3274
|
+
"Create layers named Structure and Services\n\n# Example\n```ts\nconst layer = await snaptrude.core.layers.create(\"Furniture\")\nawait snaptrude.core.layers.setActive(layer.id)\n```"
|
|
3275
|
+
],
|
|
3276
|
+
"argsType": "string",
|
|
3277
|
+
"resultType": "PluginCoreLayersCreateResult"
|
|
3278
|
+
},
|
|
3279
|
+
{
|
|
3280
|
+
"path": "core.layers.delete",
|
|
3281
|
+
"namespace": "core.layers",
|
|
3282
|
+
"summary": "Delete a layer (the panel row's \"Delete layer\").",
|
|
3283
|
+
"examplePrompts": [
|
|
3284
|
+
"Delete the Furniture layer and everything on it",
|
|
3285
|
+
"Delete the Furniture layer and move its objects to Default",
|
|
3286
|
+
"Remove layer 3f2a… and move its objects to the default layer",
|
|
3287
|
+
"Merge the Services layer into Structure and delete it",
|
|
3288
|
+
"Delete every empty layer\n\n# Example\n```ts\nawait snaptrude.core.layers.delete(layerId, { deleteObjects: true })\nconst { layers } = await snaptrude.core.layers.list()\nconst def = layers.find((l) => l.isDefault)!\nawait snaptrude.core.layers.delete(otherId, { targetLayerId: def.id })\n```"
|
|
3289
|
+
],
|
|
3290
|
+
"argsType": "string",
|
|
3291
|
+
"resultType": "PluginCoreLayersDeleteResult"
|
|
3292
|
+
},
|
|
3073
3293
|
{
|
|
3074
3294
|
"path": "core.layers.get",
|
|
3075
3295
|
"namespace": "core.layers",
|
|
3076
|
-
"summary": "Get
|
|
3296
|
+
"summary": "Get one Layers-panel layer by id, including layers owned by other design options.",
|
|
3077
3297
|
"examplePrompts": [
|
|
3078
|
-
"Get the
|
|
3079
|
-
"Is layer
|
|
3080
|
-
"
|
|
3298
|
+
"Get the Layers-panel layer with id 3f2a…",
|
|
3299
|
+
"Is the Furniture layer locked or hidden?",
|
|
3300
|
+
"How many objects are on layer 3f2a…?\n\n# Example\n```ts\nconst layer = await snaptrude.core.layers.get(layerId)\nif (layer) console.log(layer.name, layer.objectCount)\n```"
|
|
3081
3301
|
],
|
|
3082
3302
|
"argsType": "string",
|
|
3083
3303
|
"resultType": "PluginCoreLayersGetResult"
|
|
@@ -3085,35 +3305,51 @@
|
|
|
3085
3305
|
{
|
|
3086
3306
|
"path": "core.layers.getActive",
|
|
3087
3307
|
"namespace": "core.layers",
|
|
3088
|
-
"summary": "Get the active
|
|
3308
|
+
"summary": "Get the active Layers-panel layer: the one new objects land on.",
|
|
3089
3309
|
"examplePrompts": [
|
|
3090
|
-
"Which
|
|
3091
|
-
"
|
|
3092
|
-
"What layer
|
|
3310
|
+
"Which layer is active?",
|
|
3311
|
+
"Which layer in the Layers panel is active?",
|
|
3312
|
+
"What layer will new objects go on?",
|
|
3313
|
+
"Which layer are new walls and masses being added to?\n\n# Example\n```ts\nconst active = await snaptrude.core.layers.getActive()\nif (active) console.log(active.name)\n```"
|
|
3093
3314
|
],
|
|
3094
|
-
"argsType":
|
|
3315
|
+
"argsType": null,
|
|
3095
3316
|
"resultType": "PluginCoreLayersGetActiveResult"
|
|
3096
3317
|
},
|
|
3097
3318
|
{
|
|
3098
3319
|
"path": "core.layers.list",
|
|
3099
3320
|
"namespace": "core.layers",
|
|
3100
|
-
"summary": "List the
|
|
3321
|
+
"summary": "List the layers in the Layers panel: the active design option's layers, default layer first, then in creation order.",
|
|
3101
3322
|
"examplePrompts": [
|
|
3102
|
-
"List the
|
|
3103
|
-
"Show
|
|
3104
|
-
"What
|
|
3323
|
+
"List all the layers in the Layers panel",
|
|
3324
|
+
"Show me the layers in the left sidebar",
|
|
3325
|
+
"What layers does this project have?",
|
|
3326
|
+
"Show every layer with whether it is locked or hidden",
|
|
3327
|
+
"Which layer is the default layer?",
|
|
3328
|
+
"Which layers are empty?\n\n# Example\n```ts\nconst { layers } = await snaptrude.core.layers.list()\nfor (const l of layers) console.log(l.name, l.objectCount, l.locked, l.hidden)\n```"
|
|
3105
3329
|
],
|
|
3106
|
-
"argsType":
|
|
3330
|
+
"argsType": null,
|
|
3107
3331
|
"resultType": "PluginCoreLayersListResult"
|
|
3108
3332
|
},
|
|
3333
|
+
{
|
|
3334
|
+
"path": "core.layers.rename",
|
|
3335
|
+
"namespace": "core.layers",
|
|
3336
|
+
"summary": "Rename a layer (the panel row's \"Rename layer\").",
|
|
3337
|
+
"examplePrompts": [
|
|
3338
|
+
"Rename the Furniture layer to Loose furniture",
|
|
3339
|
+
"Rename layer 3f2a… to Existing building",
|
|
3340
|
+
"Change the name of the Landscape layer\n\n# Example\n```ts\nawait snaptrude.core.layers.rename(layerId, \"Loose furniture\")\n```"
|
|
3341
|
+
],
|
|
3342
|
+
"argsType": "string",
|
|
3343
|
+
"resultType": "PluginCoreLayersRenameResult"
|
|
3344
|
+
},
|
|
3109
3345
|
{
|
|
3110
3346
|
"path": "core.layers.setActive",
|
|
3111
3347
|
"namespace": "core.layers",
|
|
3112
|
-
"summary": "Make a
|
|
3348
|
+
"summary": "Make a layer the active layer (clicking its row in the Layers panel).",
|
|
3113
3349
|
"examplePrompts": [
|
|
3114
|
-
"
|
|
3115
|
-
"Make
|
|
3116
|
-
"Switch the active layer to
|
|
3350
|
+
"Put new objects on the Furniture layer",
|
|
3351
|
+
"Make the Structure layer the active layer in the Layers panel",
|
|
3352
|
+
"Switch the active layer to Landscape\n\n# Example\n```ts\nawait snaptrude.core.layers.setActive(layerId)\n```"
|
|
3117
3353
|
],
|
|
3118
3354
|
"argsType": "string",
|
|
3119
3355
|
"resultType": "PluginCoreLayersSetActiveResult"
|
|
@@ -3121,11 +3357,12 @@
|
|
|
3121
3357
|
{
|
|
3122
3358
|
"path": "core.layers.update",
|
|
3123
3359
|
"namespace": "core.layers",
|
|
3124
|
-
"summary": "
|
|
3360
|
+
"summary": "Lock/unlock or show/hide a layer (the panel row's padlock and eye).",
|
|
3125
3361
|
"examplePrompts": [
|
|
3126
|
-
"
|
|
3127
|
-
"
|
|
3128
|
-
"Hide
|
|
3362
|
+
"Lock the Default layer",
|
|
3363
|
+
"Lock the Structure layer",
|
|
3364
|
+
"Hide the Landscape layer in the Layers panel",
|
|
3365
|
+
"Unlock layer 3f2a… and show it again\n\n# Example\n```ts\nawait snaptrude.core.layers.update(layerId, { locked: true, hidden: false })\n```"
|
|
3129
3366
|
],
|
|
3130
3367
|
"argsType": "string",
|
|
3131
3368
|
"resultType": "PluginCoreLayersUpdateResult"
|
|
@@ -3403,7 +3640,8 @@
|
|
|
3403
3640
|
"examplePrompts": [
|
|
3404
3641
|
"Switch to present mode",
|
|
3405
3642
|
"Open BIM mode",
|
|
3406
|
-
"Go back to design mode
|
|
3643
|
+
"Go back to design mode",
|
|
3644
|
+
"Open program mode\n\n# Example\n```ts\nawait snaptrude.core.mode.set(\"present\")\n// ... presentation work ...\nawait snaptrude.core.mode.set(\"design\")\n```"
|
|
3407
3645
|
],
|
|
3408
3646
|
"argsType": "PluginAppMode",
|
|
3409
3647
|
"resultType": "PluginCoreModeSetResult"
|
|
@@ -3854,6 +4092,66 @@
|
|
|
3854
4092
|
"argsType": null,
|
|
3855
4093
|
"resultType": "number"
|
|
3856
4094
|
},
|
|
4095
|
+
{
|
|
4096
|
+
"path": "core.storeys.layers.get",
|
|
4097
|
+
"namespace": "core.storeys.layers",
|
|
4098
|
+
"summary": "Get a single storey layer by id.",
|
|
4099
|
+
"examplePrompts": [
|
|
4100
|
+
"Get the storey drawing layer with id ly_5",
|
|
4101
|
+
"Is storey layer ly_5 hidden?",
|
|
4102
|
+
"Look up a storey underlay layer by id\n\n# Example\n```ts\nconst layer = await snaptrude.core.storeys.layers.get(\"ly_5\")\nif (layer) console.log(layer.name, layer.hidden, layer.locked)\n```"
|
|
4103
|
+
],
|
|
4104
|
+
"argsType": "string",
|
|
4105
|
+
"resultType": "PluginCoreStoreysLayersGetResult"
|
|
4106
|
+
},
|
|
4107
|
+
{
|
|
4108
|
+
"path": "core.storeys.layers.getActive",
|
|
4109
|
+
"namespace": "core.storeys.layers",
|
|
4110
|
+
"summary": "Get the active storey layer of a storey.",
|
|
4111
|
+
"examplePrompts": [
|
|
4112
|
+
"Which sketch surface (Wall/Rough) is active on this storey?",
|
|
4113
|
+
"Get the active storey drawing layer on st_2",
|
|
4114
|
+
"Which storey layer is new sketch geometry drawn onto?\n\n# Example\n```ts\nconst active = await snaptrude.core.storeys.layers.getActive(\"st_2\")\nif (active) console.log(active.name)\n```"
|
|
4115
|
+
],
|
|
4116
|
+
"argsType": "string",
|
|
4117
|
+
"resultType": "PluginCoreStoreysLayersGetActiveResult"
|
|
4118
|
+
},
|
|
4119
|
+
{
|
|
4120
|
+
"path": "core.storeys.layers.list",
|
|
4121
|
+
"namespace": "core.storeys.layers",
|
|
4122
|
+
"summary": "List the storey layers of a storey.",
|
|
4123
|
+
"examplePrompts": [
|
|
4124
|
+
"List the sketch surfaces and underlays on this storey",
|
|
4125
|
+
"Show all the PDF underlays on storey st_2",
|
|
4126
|
+
"What CAD layers are on the ground floor?\n\n# Example\n```ts\nconst { layers } = await snaptrude.core.storeys.layers.list(\"st_2\")\nfor (const l of layers) console.log(l.name, l.layerType, l.hidden)\n```"
|
|
4127
|
+
],
|
|
4128
|
+
"argsType": "string",
|
|
4129
|
+
"resultType": "PluginCoreStoreysLayersListResult"
|
|
4130
|
+
},
|
|
4131
|
+
{
|
|
4132
|
+
"path": "core.storeys.layers.setActive",
|
|
4133
|
+
"namespace": "core.storeys.layers",
|
|
4134
|
+
"summary": "Make a storey layer the active layer of its storey.",
|
|
4135
|
+
"examplePrompts": [
|
|
4136
|
+
"Switch this storey's sketch surface to the Rough layer",
|
|
4137
|
+
"Make storey layer ly_5 the active sketch surface",
|
|
4138
|
+
"Switch the active storey layer to the CAD underlay\n\n# Example\n```ts\nawait snaptrude.core.storeys.layers.setActive(\"ly_5\")\n```"
|
|
4139
|
+
],
|
|
4140
|
+
"argsType": "string",
|
|
4141
|
+
"resultType": "PluginCoreStoreysLayersSetActiveResult"
|
|
4142
|
+
},
|
|
4143
|
+
{
|
|
4144
|
+
"path": "core.storeys.layers.update",
|
|
4145
|
+
"namespace": "core.storeys.layers",
|
|
4146
|
+
"summary": "Update a storey layer's visibility.",
|
|
4147
|
+
"examplePrompts": [
|
|
4148
|
+
"Hide the PDF underlay layer",
|
|
4149
|
+
"Show the CAD underlay again",
|
|
4150
|
+
"Hide storey layer ly_5\n\n# Example\n```ts\nconst layer = await snaptrude.core.storeys.layers.update(\"ly_5\", true)\n```"
|
|
4151
|
+
],
|
|
4152
|
+
"argsType": "string",
|
|
4153
|
+
"resultType": "PluginCoreStoreysLayersUpdateResult"
|
|
4154
|
+
},
|
|
3857
4155
|
{
|
|
3858
4156
|
"path": "core.storeys.list",
|
|
3859
4157
|
"namespace": "core.storeys",
|
|
@@ -4038,6 +4336,19 @@
|
|
|
4038
4336
|
"argsType": "ComponentHandle",
|
|
4039
4337
|
"resultType": "PluginCoreTagsGetTagsForComponentResult"
|
|
4040
4338
|
},
|
|
4339
|
+
{
|
|
4340
|
+
"path": "core.tags.listForComponents",
|
|
4341
|
+
"namespace": "core.tags",
|
|
4342
|
+
"summary": "List the tags carried by many components in one call.",
|
|
4343
|
+
"examplePrompts": [
|
|
4344
|
+
"Get the tags of every space with their colors",
|
|
4345
|
+
"List the tags on all rooms so I can color them by Occupancy",
|
|
4346
|
+
"Which tag does each selected space carry?\n\n# Example\n```ts\nconst { components } = await snaptrude.core.tags.listForComponents()\nfor (const c of components) {\nconst occupancy = c.tags.find((t) => t.categoryName === \"Occupancy\")\nif (occupancy) paint(c.componentId, occupancy.color)\n}\n```"
|
|
4347
|
+
],
|
|
4348
|
+
"argsType": "ComponentHandle[]",
|
|
4349
|
+
"resultType": "PluginCoreTagsListForComponentsResult",
|
|
4350
|
+
"performance": "One round-trip for any number of components — use this instead of a `listForComponent` loop."
|
|
4351
|
+
},
|
|
4041
4352
|
{
|
|
4042
4353
|
"path": "core.tags.unassign",
|
|
4043
4354
|
"namespace": "core.tags",
|
|
@@ -4274,6 +4585,17 @@
|
|
|
4274
4585
|
"argsType": "Vec3Handle",
|
|
4275
4586
|
"resultType": "ComponentHandle"
|
|
4276
4587
|
},
|
|
4588
|
+
{
|
|
4589
|
+
"path": "design.create.columnsFromGrids",
|
|
4590
|
+
"namespace": "design.create",
|
|
4591
|
+
"summary": "Create **columns at every grid-line intersection** of the given grid groups, sized `width` × `depth` and oriented to the grid axes, on the grids' storey. All columns commit as ONE undoable unit.",
|
|
4592
|
+
"examplePrompts": [
|
|
4593
|
+
"Generate columns on this grid",
|
|
4594
|
+
"Place 450mm square columns at every grid intersection\n\n# Example\n```ts\nconst grids = await snaptrude.design.query.listGrids()\nconst columns = await snaptrude.design.create.columnsFromGrids(grids, 0.45, 0.45)\n```"
|
|
4595
|
+
],
|
|
4596
|
+
"argsType": "ComponentHandle[]",
|
|
4597
|
+
"resultType": "ComponentHandle[]"
|
|
4598
|
+
},
|
|
4277
4599
|
{
|
|
4278
4600
|
"path": "design.create.copy",
|
|
4279
4601
|
"namespace": "design.create",
|
|
@@ -4299,10 +4621,27 @@
|
|
|
4299
4621
|
"Put a door from the catalog at this point on the wall",
|
|
4300
4622
|
"Insert the entrance door into this wall",
|
|
4301
4623
|
"Add a door to the wall and call it Entry-01",
|
|
4302
|
-
"Add a door that opens into the living room
|
|
4624
|
+
"Add a door that opens into the living room",
|
|
4625
|
+
"Put a door here hinged on the north jamb\n\n# Example\n```ts\nconst [wall] = await snaptrude.design.query.listWalls({ isSelected: true })\nconst [entry] = await snaptrude.design.doors.listCatalog()\nconst door = await snaptrude.design.create.door(\nentry.id,\nwall,\nawait snaptrude.core.math.vec3.new(3, 0, 5),\n{ label: \"Entry-01\" },\n)\n// …facing a specific side of the wall (pass a point inside that room):\nconst intoKitchen = await snaptrude.design.create.door(\nentry.id,\nwall,\nawait snaptrude.core.math.vec3.new(3, 0, 5),\nundefined,\nawait snaptrude.core.math.vec3.new(3, 0, 9),\n)\n// …and hinged on the jamb nearest a point (here the +x end of the opening):\nconst hingedRight = await snaptrude.design.create.door(\nentry.id,\nwall,\nawait snaptrude.core.math.vec3.new(3, 0, 5),\n{ hinge: await snaptrude.core.math.vec3.new(3.5, 0, 5) },\nawait snaptrude.core.math.vec3.new(3, 0, 9),\n)\n```"
|
|
4303
4626
|
],
|
|
4304
4627
|
"argsType": "string",
|
|
4305
|
-
"resultType": "ComponentHandle"
|
|
4628
|
+
"resultType": "ComponentHandle",
|
|
4629
|
+
"performance": "For MORE THAN ONE door, call `design.create.doors(items[])` — one host round-trip and ONE undo entry, with each host wall re-cut once per opening inside that single call. Looping this single-door creator is N round-trips."
|
|
4630
|
+
},
|
|
4631
|
+
{
|
|
4632
|
+
"path": "design.create.doors",
|
|
4633
|
+
"namespace": "design.create",
|
|
4634
|
+
"summary": "Place **many doors** into host walls in one undoable operation (bulk plural of {@linkcode door}). Each item carries its own catalog id, host wall, world position, and optional `facing`, `label`, `width` and `height` — the same fields as a `\"door\"` {@linkcode PluginDesignCreateOpeningOptions}. Validate-all-or-throw; one command.",
|
|
4635
|
+
"examplePrompts": [
|
|
4636
|
+
"Add doors to all of these walls at once",
|
|
4637
|
+
"Place a door in every room in one operation",
|
|
4638
|
+
"Bulk add the entrance doors from this schedule",
|
|
4639
|
+
"Put three doors on this wall in a single undo step",
|
|
4640
|
+
"Add all the doors for this floor plan together"
|
|
4641
|
+
],
|
|
4642
|
+
"argsType": "PluginCreateDoorItem[]",
|
|
4643
|
+
"resultType": "ComponentHandle[]",
|
|
4644
|
+
"performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry, and each distinct catalog source loads once. Always prefer this over calling `design.create.door` in a loop: build the full `items[]` array first (all host walls and points up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const [wall] = await snaptrude.design.query.listWalls({ isSelected: true }) const [entry] = await snaptrude.design.doors.listCatalog() const [front, side] = await snaptrude.design.create.doors([ { catalogId: entry.id, hostWall: wall, position: await v.new(2, 0, 5), label: \"D-01\" }, { catalogId: entry.id, hostWall: wall, position: await v.new(6, 0, 5), width: 1.2 }, ]) // `wall` was re-cut twice and no longer resolves — ask the opening for its host: const currentWall = await snaptrude.design.query.getHost(front) ```"
|
|
4306
4645
|
},
|
|
4307
4646
|
{
|
|
4308
4647
|
"path": "design.create.floor",
|
|
@@ -4315,7 +4654,23 @@
|
|
|
4315
4654
|
"Put a floor at this position with 150mm thickness\n\n# Example\n```ts\nconst rect = await snaptrude.core.geom.create.profileRect(5, 4)\nconst contour = await snaptrude.core.geom.create.contourFromProfile(rect)\nconst floor = await snaptrude.design.create.floor(contour, 0.1)\n```"
|
|
4316
4655
|
],
|
|
4317
4656
|
"argsType": "ContourHandle",
|
|
4318
|
-
"resultType": "ComponentHandle"
|
|
4657
|
+
"resultType": "ComponentHandle",
|
|
4658
|
+
"performance": "For MORE THAN ONE floor, call `design.create.floors(items[])` — one host round-trip and ONE undo entry for the whole batch. Looping this single-floor creator is N round-trips and N undo entries."
|
|
4659
|
+
},
|
|
4660
|
+
{
|
|
4661
|
+
"path": "design.create.floors",
|
|
4662
|
+
"namespace": "design.create",
|
|
4663
|
+
"summary": "Create **many floors** in one undoable operation (bulk plural of {@linkcode floor}). Each item extrudes its own footprint contour (outer profile + holes) upward by its own `thickness`, at its own optional position offset. Validate-all-or-throw; one command.",
|
|
4664
|
+
"examplePrompts": [
|
|
4665
|
+
"Create floors for all these room outlines at once",
|
|
4666
|
+
"Add a floor to every space in one operation",
|
|
4667
|
+
"Bulk create the floor plates for this building",
|
|
4668
|
+
"Lay 100mm floors across these five footprints in one undo step",
|
|
4669
|
+
"Create the ground and first floor slabs together"
|
|
4670
|
+
],
|
|
4671
|
+
"argsType": "PluginCreateFloorItem[]",
|
|
4672
|
+
"resultType": "ComponentHandle[]",
|
|
4673
|
+
"performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry. Always prefer this over calling `design.create.floor` in a loop: build the full `items[]` array first (all contours and offsets up front), then make one call. # Example ```ts const rect = await snaptrude.core.geom.create.profileRect(5, 4) const contour = await snaptrude.core.geom.create.contourFromProfile(rect) const [ground, upper] = await snaptrude.design.create.floors([ { contour, thickness: 0.1 }, { contour, thickness: 0.1, position: await snaptrude.core.math.vec3.new(0, 3, 0) }, ]) ```"
|
|
4319
4674
|
},
|
|
4320
4675
|
{
|
|
4321
4676
|
"path": "design.create.furniture",
|
|
@@ -4330,8 +4685,60 @@
|
|
|
4330
4685
|
"Place a chair here rotated 90 degrees\n\n# Example\n```ts\nconst chair = await snaptrude.design.create.furniture(\n\"6620f1a…\", // from design.furniture.listCatalog()\nawait snaptrude.core.math.vec3.new(3, 0, 5),\n{ label: \"Chair-01\" },\n)\n// …placed already turned 90° about the vertical axis:\nconst turned = await snaptrude.design.create.furniture(\n\"6620f1a…\",\nawait snaptrude.core.math.vec3.new(3, 0, 5),\nundefined,\n90,\n)\n```"
|
|
4331
4686
|
],
|
|
4332
4687
|
"argsType": "string",
|
|
4688
|
+
"resultType": "ComponentHandle",
|
|
4689
|
+
"performance": "For MORE THAN ONE item, call `design.create.furnitureItems(items[])` — one host round-trip and ONE undo entry, and a catalog source shared by several items is fetched once. Looping this single-item creator is N round-trips."
|
|
4690
|
+
},
|
|
4691
|
+
{
|
|
4692
|
+
"path": "design.create.furnitureItems",
|
|
4693
|
+
"namespace": "design.create",
|
|
4694
|
+
"summary": "Place **many furniture items** in one undoable operation (bulk plural of {@linkcode furniture}). Each item names a catalog id and an absolute world position (`position.y` is the REST elevation — the same grounding contract as the singular creator), with optional label and rotation. A catalog source shared by several items is fetched and recorded once for the whole batch, so the host — not the caller — owns source persistence (there is no per-item `createNewSourceMesh`). Validate-all-or-throw; one command.",
|
|
4695
|
+
"examplePrompts": [
|
|
4696
|
+
"Place all the desks for this office at once",
|
|
4697
|
+
"Furnish every bedroom in one operation",
|
|
4698
|
+
"Bulk place these chairs around the table",
|
|
4699
|
+
"Add the whole furniture layout in a single undo step",
|
|
4700
|
+
"Drop twenty copies of this chair at these positions"
|
|
4701
|
+
],
|
|
4702
|
+
"argsType": "PluginCreateFurnitureItem[]",
|
|
4703
|
+
"resultType": "ComponentHandle[]",
|
|
4704
|
+
"performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry, and each distinct catalog source loads once. Always prefer this over calling `design.create.furniture` in a loop: build the full `items[]` array first (all positions and angles up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const [chair] = await snaptrude.design.furniture.listCatalog() const placed = await snaptrude.design.create.furnitureItems([ { catalogId: chair.id, position: await v.new(3, 0, 5), label: \"Chair-01\" }, { catalogId: chair.id, position: await v.new(4, 0, 5), angleInDegrees: 90 }, { catalogId: chair.id, position: await v.new(5, 0, 5), angleInDegrees: 180 }, ]) ```"
|
|
4705
|
+
},
|
|
4706
|
+
{
|
|
4707
|
+
"path": "design.create.grid",
|
|
4708
|
+
"namespace": "design.create",
|
|
4709
|
+
"summary": "Create a free rectangular **structural grid** — one grid group with two perpendicular line families (`linesX` lines spaced `spacingX` apart, and `linesY` lines spaced `spacingY` apart) on the active storey. One undoable creation.",
|
|
4710
|
+
"examplePrompts": [
|
|
4711
|
+
"Create a 5 by 8 structural grid with 6 metre spacing",
|
|
4712
|
+
"Add a column grid rotated 30 degrees",
|
|
4713
|
+
"Set up a structural grid at the site origin\n\n# Example\n```ts\nconst centre = await snaptrude.core.math.vec3.new(0, 0, 0)\nconst grid = await snaptrude.design.create.grid(5, 8, 6, 6, { center: centre })\n```"
|
|
4714
|
+
],
|
|
4715
|
+
"argsType": "number",
|
|
4716
|
+
"resultType": "ComponentHandle"
|
|
4717
|
+
},
|
|
4718
|
+
{
|
|
4719
|
+
"path": "design.create.gridFromCurve",
|
|
4720
|
+
"namespace": "design.create",
|
|
4721
|
+
"summary": "Create a **structural grid from a single curve** — one grid group holding one wing with one line (the draw tool's output). The curve may be a line or an arc; circles are rejected with `VALIDATION`. Undoable.",
|
|
4722
|
+
"examplePrompts": [
|
|
4723
|
+
"Draw a grid line from A to B",
|
|
4724
|
+
"Add a curved grid line through these points",
|
|
4725
|
+
"Create grid line \"C\" along this wall\n\n# Example\n```ts\nconst { vec3 } = snaptrude.core.math\nconst from = await vec3.new(0, 0, 0)\nconst to = await vec3.new(30, 0, 0)\nconst curve = await snaptrude.core.geom.create.line(from, to)\nconst grid = await snaptrude.design.create.gridFromCurve(curve, { tag: \"A\" })\n```"
|
|
4726
|
+
],
|
|
4727
|
+
"argsType": "CurveHandle",
|
|
4333
4728
|
"resultType": "ComponentHandle"
|
|
4334
4729
|
},
|
|
4730
|
+
{
|
|
4731
|
+
"path": "design.create.gridsFromMasses",
|
|
4732
|
+
"namespace": "design.create",
|
|
4733
|
+
"summary": "Generate **structural grids fitted to mass footprints** — one grid group per footprint cluster, with counts and orientation derived from each footprint's geometry and the given spacings. All created groups commit as ONE undoable unit.",
|
|
4734
|
+
"examplePrompts": [
|
|
4735
|
+
"Generate grids for the selected masses",
|
|
4736
|
+
"Auto-generate a 6m structural grid on this building",
|
|
4737
|
+
"Fit column grids to every mass on this storey\n\n# Example\n```ts\nconst masses = await snaptrude.design.query.listMasses({ storeys: [1] })\nconst grids = await snaptrude.design.create.gridsFromMasses(masses, 6, 6)\n```"
|
|
4738
|
+
],
|
|
4739
|
+
"argsType": "ComponentHandle[]",
|
|
4740
|
+
"resultType": "ComponentHandle[]"
|
|
4741
|
+
},
|
|
4335
4742
|
{
|
|
4336
4743
|
"path": "design.create.mass",
|
|
4337
4744
|
"namespace": "design.create",
|
|
@@ -4367,7 +4774,7 @@
|
|
|
4367
4774
|
],
|
|
4368
4775
|
"argsType": "PluginDesignCreateOpeningOptions",
|
|
4369
4776
|
"resultType": "ComponentHandle",
|
|
4370
|
-
"performance": "Single-opening creator — use it for one hosted opening.
|
|
4777
|
+
"performance": "Single-opening creator — use it for one hosted opening. For MORE THAN ONE, call `design.create.doors(items[])` / `design.create.windows(items[])`: the same per-item fields, one host round-trip, ONE undo entry. # Example ```ts const opening = await snaptrude.design.create.opening({ kind: \"window\", catalogId: windowType.id, hostWall: wall, position: await snaptrude.core.math.vec3.new(3, 0, 5), width: 1.2, height: 1.5, sillHeight: 0.9, }) ```"
|
|
4371
4778
|
},
|
|
4372
4779
|
{
|
|
4373
4780
|
"path": "design.create.referenceLines",
|
|
@@ -4469,6 +4876,22 @@
|
|
|
4469
4876
|
"argsType": "PluginStaircasePreset",
|
|
4470
4877
|
"resultType": "ComponentHandle"
|
|
4471
4878
|
},
|
|
4879
|
+
{
|
|
4880
|
+
"path": "design.create.wallRuns",
|
|
4881
|
+
"namespace": "design.create",
|
|
4882
|
+
"summary": "Create **many wall runs** in one undoable operation (bulk plural of {@linkcode walls}). Each item is one full run — a wall per curve in that item's profile chain, mitred at shared endpoints. Junctions resolve within a run, not between runs. Each item carries its own dimensions, `wallType` and `storey`, so a single call can build a whole floor plate or several storeys at once. Per-curve `topProfiles` make raked or gabled walls (see {@linkcode PluginWallTopProfile}). Validate-all-or-throw; one command.",
|
|
4883
|
+
"examplePrompts": [
|
|
4884
|
+
"Draw all the walls of this floor plan at once",
|
|
4885
|
+
"Build every room's perimeter in one operation",
|
|
4886
|
+
"Bulk create wall runs from these centerlines",
|
|
4887
|
+
"Create the walls for both storeys in a single undo step",
|
|
4888
|
+
"Turn these polylines into 200mm brick walls together",
|
|
4889
|
+
"Import these raked walls with their top profiles in one go"
|
|
4890
|
+
],
|
|
4891
|
+
"argsType": "PluginCreateWallRunItem[]",
|
|
4892
|
+
"resultType": "ComponentHandle[][]",
|
|
4893
|
+
"performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry. Always prefer this over calling `design.create.walls` in a loop: build the full `items[]` array first (all profiles up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const ground = await snaptrude.core.geom.create.profileFromLinePoints([ await v.new(0, 0, 0), await v.new(8, 0, 0), await v.new(8, 0, 6), ]) const upper = await snaptrude.core.geom.create.profileFromLinePoints([ await v.new(0, 0, 0), await v.new(8, 0, 0), ]) const [groundWalls, upperWalls] = await snaptrude.design.create.wallRuns([ { profile: ground, height: 3, thickness: 0.2 }, { profile: upper, height: 3, storey: 2 }, // one gable wall: 3m at both ends, 5m ridge in the middle { profile: upper, thickness: 0.2, storey: 3, topProfiles: [[{ along: 0, height: 3 }, { along: 0.5, height: 5 }, { along: 1, height: 3 }]] }, ]) console.log(groundWalls.length, \"walls on the ground floor\") ```"
|
|
4894
|
+
},
|
|
4472
4895
|
{
|
|
4473
4896
|
"path": "design.create.walls",
|
|
4474
4897
|
"namespace": "design.create",
|
|
@@ -4480,10 +4903,14 @@
|
|
|
4480
4903
|
"Turn this polyline sketch into walls",
|
|
4481
4904
|
"Add walls with mitred corners along the path",
|
|
4482
4905
|
"Draw brick walls with plaster along this outline",
|
|
4483
|
-
"Build the perimeter in exposed concrete walls
|
|
4906
|
+
"Build the perimeter in exposed concrete walls",
|
|
4907
|
+
"Create a raked wall that slopes from 3m to 5m",
|
|
4908
|
+
"Build a gable end wall with the ridge in the middle",
|
|
4909
|
+
"Draw a wall with a sloped top edge\n\n# Example\n```ts\nconst v = snaptrude.core.math.vec3\nconst centerlines = await snaptrude.core.geom.create.profileFromLinePoints([\nawait v.new(0, 0, 0),\nawait v.new(8, 0, 0),\nawait v.new(8, 0, 6),\n])\nconst walls = await snaptrude.design.create.walls(centerlines, 3, 0.2)\n// …built as a specific wall type (layers/material/thickness from the type):\nconst [brick] = await snaptrude.design.types.list(\"wall\")\nconst brickWalls = await snaptrude.design.create.walls(\ncenterlines, 3, undefined, brick.label,\n)\n// …a raked wall (3m at the start, 5m at the end) on a single centerline:\nconst run = await snaptrude.core.geom.create.profileFromCurves([\nawait snaptrude.core.geom.create.line(await v.new(0, 0, 10), await v.new(8, 0, 10)),\n])\nconst [raked] = await snaptrude.design.create.walls(run, undefined, 0.2, undefined, undefined, [\n[{ along: 0, height: 3 }, { along: 1, height: 5 }],\n])\n```"
|
|
4484
4910
|
],
|
|
4485
4911
|
"argsType": "ProfileHandle",
|
|
4486
|
-
"resultType": "ComponentHandle[]"
|
|
4912
|
+
"resultType": "ComponentHandle[]",
|
|
4913
|
+
"performance": "For MORE THAN ONE run, call `design.create.wallRuns(items[])` — one host round-trip and ONE undo entry for every run in the batch. Looping this single-run creator is N round-trips and N undo entries."
|
|
4487
4914
|
},
|
|
4488
4915
|
{
|
|
4489
4916
|
"path": "design.create.window",
|
|
@@ -4498,7 +4925,23 @@
|
|
|
4498
4925
|
"Add a casement window opening toward the garden side\n\n# Example\n```ts\nconst [wall] = await snaptrude.design.query.listWalls({ isSelected: true })\nconst [entry] = await snaptrude.design.windows.listCatalog()\nconst window = await snaptrude.design.create.window(\nentry.id,\nwall,\nawait snaptrude.core.math.vec3.new(3, 0, 5),\n{ label: \"Win-01\" },\n)\n```"
|
|
4499
4926
|
],
|
|
4500
4927
|
"argsType": "string",
|
|
4501
|
-
"resultType": "ComponentHandle"
|
|
4928
|
+
"resultType": "ComponentHandle",
|
|
4929
|
+
"performance": "For MORE THAN ONE window, call `design.create.windows(items[])` — one host round-trip and ONE undo entry, with each host wall re-cut once per opening inside that single call. Looping this single-window creator is N round-trips."
|
|
4930
|
+
},
|
|
4931
|
+
{
|
|
4932
|
+
"path": "design.create.windows",
|
|
4933
|
+
"namespace": "design.create",
|
|
4934
|
+
"summary": "Place **many windows** into host walls in one undoable operation (bulk plural of {@linkcode window}). Each item carries its own catalog id, host wall, world position, and optional `facing`, `label`, `width`, `height` and `sillHeight` — the same fields as a `\"window\"` {@linkcode PluginDesignCreateOpeningOptions}. `sillHeight` is measured from the host wall base to the BOTTOM of the window. Validate-all-or-throw; one command.",
|
|
4935
|
+
"examplePrompts": [
|
|
4936
|
+
"Add windows along this whole facade at once",
|
|
4937
|
+
"Place a window in every bedroom in one operation",
|
|
4938
|
+
"Bulk add the windows from this schedule",
|
|
4939
|
+
"Put four windows on this wall in a single undo step",
|
|
4940
|
+
"Add all the windows with a 0.9m sill height together"
|
|
4941
|
+
],
|
|
4942
|
+
"argsType": "PluginCreateWindowItem[]",
|
|
4943
|
+
"resultType": "ComponentHandle[]",
|
|
4944
|
+
"performance": "Bulk creator — the whole batch is ONE host round-trip and ONE undo entry, and each distinct catalog source loads once. Always prefer this over calling `design.create.window` in a loop: build the full `items[]` array first (all host walls and points up front), then make one call. # Example ```ts const v = snaptrude.core.math.vec3 const [wall] = await snaptrude.design.query.listWalls({ isSelected: true }) const [casement] = await snaptrude.design.windows.listCatalog() const placed = await snaptrude.design.create.windows([ { catalogId: casement.id, hostWall: wall, position: await v.new(2, 0, 5), sillHeight: 0.9 }, { catalogId: casement.id, hostWall: wall, position: await v.new(5, 0, 5), sillHeight: 0.9 }, ]) const currentWall = await snaptrude.design.query.getHost(placed[0]) ```"
|
|
4502
4945
|
},
|
|
4503
4946
|
{
|
|
4504
4947
|
"path": "design.delete.entities",
|
|
@@ -4515,6 +4958,82 @@
|
|
|
4515
4958
|
"resultType": "PluginDesignChangeResult",
|
|
4516
4959
|
"performance": "Array delete — pass every target in one call (one host round-trip). There is no per-item delete; collect the whole set and never loop this per entity. # Example ```ts // Hard-delete every furniture item on storey 2 (a single undo entry) const furniture = await snaptrude.design.query.listFurniture({ storeys: [2] }) if (furniture.length > 0) { const { affected } = await snaptrude.design.delete.entities(furniture) } ```"
|
|
4517
4960
|
},
|
|
4961
|
+
{
|
|
4962
|
+
"path": "design.dimensions.create",
|
|
4963
|
+
"namespace": "design.dimensions",
|
|
4964
|
+
"summary": "Draw one dimension line between two world points, anchored to a component.",
|
|
4965
|
+
"examplePrompts": [
|
|
4966
|
+
"Dimension every wall on level 2",
|
|
4967
|
+
"Add a dimension line along this wall",
|
|
4968
|
+
"Measure the width of this room and label it on the plan\n\n# Example\n```ts\nconst { design, core } = snaptrude\nconst v = core.math.vec3\nconst curve = core.geom.query.curve\nfor (const wall of await design.query.listWalls({ storeys: [2] })) {\nconst cl = await design.query.geometry.getCenterline(wall)\nif (!cl) continue\nconst a = await curve.getStartPoint(cl)\nconst b = await curve.getEndPoint(cl)\nawait design.dimensions.create(\nawait v.new(a.x, a.y, a.z),\nawait v.new(b.x, b.y, b.z),\nwall,\n)\n}\n```"
|
|
4969
|
+
],
|
|
4970
|
+
"argsType": "Vec3Handle",
|
|
4971
|
+
"resultType": "DimensionHandle"
|
|
4972
|
+
},
|
|
4973
|
+
{
|
|
4974
|
+
"path": "design.dimensions.delete",
|
|
4975
|
+
"namespace": "design.dimensions",
|
|
4976
|
+
"summary": "Delete dimension lines — the same hard removal as selecting them and pressing Delete. Undoable as a **single** entry for the whole batch.",
|
|
4977
|
+
"examplePrompts": [
|
|
4978
|
+
"Remove all dimension lines",
|
|
4979
|
+
"Delete the dimensions on this wall",
|
|
4980
|
+
"Clear the measurements I added to level 2"
|
|
4981
|
+
],
|
|
4982
|
+
"argsType": "DimensionHandle[]",
|
|
4983
|
+
"resultType": "PluginDimensionsChangeResult",
|
|
4984
|
+
"performance": "Array API — pass the whole set in one call (one host round-trip, one undo entry). Never loop this per dimension. # Example ```ts const dims = snaptrude.design.dimensions const onWall = await dims.list({ anchors: [wall] }) if (onWall.length > 0) await dims.delete(onWall.map((d) => d.id)) ```"
|
|
4985
|
+
},
|
|
4986
|
+
{
|
|
4987
|
+
"path": "design.dimensions.get",
|
|
4988
|
+
"namespace": "design.dimensions",
|
|
4989
|
+
"summary": "Read one dimension line by handle.",
|
|
4990
|
+
"examplePrompts": [
|
|
4991
|
+
"Read the dimension line I just created",
|
|
4992
|
+
"How long is this dimension and what does its label say?",
|
|
4993
|
+
"Check whether that dimension line still exists\n\n# Example\n```ts\nconst dim = await snaptrude.design.dimensions.get(handle)\nif (dim) console.log(dim.label, dim.length, dim.storey)\n```"
|
|
4994
|
+
],
|
|
4995
|
+
"argsType": "DimensionHandle",
|
|
4996
|
+
"resultType": "PluginDimensionLine | null"
|
|
4997
|
+
},
|
|
4998
|
+
{
|
|
4999
|
+
"path": "design.dimensions.hide",
|
|
5000
|
+
"namespace": "design.dimensions",
|
|
5001
|
+
"summary": "Hide dimension lines from the viewport — the same as the right-click \"Hide\" action (it sets the user Hide flag, `isHidden`). Undoable. Already-hidden dimensions are skipped and are not reported in `affected`.",
|
|
5002
|
+
"examplePrompts": [
|
|
5003
|
+
"Hide the dimensions on this storey",
|
|
5004
|
+
"Hide every dimension line while I present",
|
|
5005
|
+
"Temporarily hide the measurements on level 3"
|
|
5006
|
+
],
|
|
5007
|
+
"argsType": "DimensionHandle[]",
|
|
5008
|
+
"resultType": "PluginDimensionsChangeResult",
|
|
5009
|
+
"performance": "Array API — one host round-trip and one undo entry for the whole set. # Example ```ts const dims = snaptrude.design.dimensions const onLevel3 = await dims.list({ storeys: [3] }) const { affected } = await dims.hide(onLevel3.map((d) => d.id)) ```"
|
|
5010
|
+
},
|
|
5011
|
+
{
|
|
5012
|
+
"path": "design.dimensions.list",
|
|
5013
|
+
"namespace": "design.dimensions",
|
|
5014
|
+
"summary": "List the dimension lines in the project as full records.",
|
|
5015
|
+
"examplePrompts": [
|
|
5016
|
+
"List all the dimension lines in this model",
|
|
5017
|
+
"Which dimensions are on level 3?",
|
|
5018
|
+
"Flag any dimension line shorter than 600 mm"
|
|
5019
|
+
],
|
|
5020
|
+
"argsType": "{\n storeys?: number[]\n anchors?: ComponentHandle[]\n isHidden?: boolean\n }",
|
|
5021
|
+
"resultType": "PluginDimensionLine[]",
|
|
5022
|
+
"performance": "Array read — one host round-trip returns every record. Filter in one call rather than calling `get` per dimension. # Example ```ts const units = snaptrude.core.units const min = await units.convert(600, \"millimeters\", await units.getBabylonType()) const short = (await snaptrude.design.dimensions.list()).filter( (d) => d.length < min, ) console.log(short.map((d) => `${d.label} on storey ${d.storey}`)) ```"
|
|
5023
|
+
},
|
|
5024
|
+
{
|
|
5025
|
+
"path": "design.dimensions.show",
|
|
5026
|
+
"namespace": "design.dimensions",
|
|
5027
|
+
"summary": "Reveal hidden dimension lines — clear the user Hide flag, the inverse of {@linkcode PluginDesignDimensionsApi.hide}. Undoable. Already-visible dimensions are skipped and are not reported in `affected`.",
|
|
5028
|
+
"examplePrompts": [
|
|
5029
|
+
"Show the dimension lines again",
|
|
5030
|
+
"Unhide all the hidden dimensions",
|
|
5031
|
+
"Bring back the measurements I hid on this storey"
|
|
5032
|
+
],
|
|
5033
|
+
"argsType": "DimensionHandle[]",
|
|
5034
|
+
"resultType": "PluginDimensionsChangeResult",
|
|
5035
|
+
"performance": "Array API — one host round-trip and one undo entry for the whole set. # Example ```ts const dims = snaptrude.design.dimensions const hidden = await dims.list({ isHidden: true }) await dims.show(hidden.map((d) => d.id)) ```"
|
|
5036
|
+
},
|
|
4518
5037
|
{
|
|
4519
5038
|
"path": "design.doors.exists",
|
|
4520
5039
|
"namespace": "design.doors",
|
|
@@ -4596,7 +5115,7 @@
|
|
|
4596
5115
|
{
|
|
4597
5116
|
"path": "design.doors.getSwingDirection",
|
|
4598
5117
|
"namespace": "design.doors",
|
|
4599
|
-
"summary": "Get a door's swing (hinge) handedness
|
|
5118
|
+
"summary": "Get a door's swing (hinge) handedness. Stand on the side the door swings open to, facing the door: `'left'` when the hinged jamb is on your left, `'right'` when it is on your right. Derived from the placed mesh's orientation (the same reflection `mirror` and the `hinge` placement option apply), not a persisted field.",
|
|
4600
5119
|
"examplePrompts": [
|
|
4601
5120
|
"Which way does this door swing?",
|
|
4602
5121
|
"Is the selected door left-handed or right-handed?",
|
|
@@ -4661,13 +5180,13 @@
|
|
|
4661
5180
|
{
|
|
4662
5181
|
"path": "design.doors.mirror",
|
|
4663
5182
|
"namespace": "design.doors",
|
|
4664
|
-
"summary": "Mirror a door
|
|
5183
|
+
"summary": "Mirror a door about its own axes. `'x'` (default) flips the swing side — the door opens to the other side of the wall; `'z'` swaps the hinged jamb (left-hand ↔ right-hand, same swing side); `'y'` turns it upside down. Undoable as a single command.",
|
|
4665
5184
|
"examplePrompts": [
|
|
4666
5185
|
"Flip this door's swing",
|
|
4667
5186
|
"Mirror the selected door",
|
|
4668
5187
|
"Make this door open the other way",
|
|
4669
5188
|
"Reverse the hinge side of the entrance door",
|
|
4670
|
-
"Change the door to swing from the other side\n\n# Example\n```ts\n// Flip the selected door's swing — axis defaults to \"x\"
|
|
5189
|
+
"Change the door to swing from the other side\n\n# Example\n```ts\n// Flip the selected door's swing side — axis defaults to \"x\"\nconst [door] = await snaptrude.design.query.listDoors({ isSelected: true })\nconst { affected } = await snaptrude.design.doors.mirror(door)\n// …or swap the hinged jamb instead (keeps the swing side)\nawait snaptrude.design.doors.mirror(door, \"z\")\n```"
|
|
4671
5190
|
],
|
|
4672
5191
|
"argsType": "ComponentHandle",
|
|
4673
5192
|
"resultType": "PluginDesignChangeResult"
|
|
@@ -4742,7 +5261,7 @@
|
|
|
4742
5261
|
{
|
|
4743
5262
|
"path": "design.family.create",
|
|
4744
5263
|
"namespace": "design.family",
|
|
4745
|
-
"summary": "
|
|
5264
|
+
"summary": "Save the prepared bundle to the library — the user's personal library unless `teamId` is given. {@linkcode PluginDesignFamilyApi.place} already saves, so `create` is for sharing with a team. When nothing of the family is in the model yet, one instance is also dropped at the centre of the current view on the active storey (`placed: true`), so a save is never invisible.",
|
|
4746
5265
|
"examplePrompts": [
|
|
4747
5266
|
"Save this as a family called Vertical Louvre",
|
|
4748
5267
|
"Add it to my library\n\n# Example\n```ts\nconst { definitionId } = await snaptrude.design.family.create({ name: \"Louvre Screen\" })\n```"
|
|
@@ -4750,6 +5269,17 @@
|
|
|
4750
5269
|
"argsType": "PluginDesignFamilyCreateArgs",
|
|
4751
5270
|
"resultType": "PluginFamilyCreateResult"
|
|
4752
5271
|
},
|
|
5272
|
+
{
|
|
5273
|
+
"path": "design.family.delete",
|
|
5274
|
+
"namespace": "design.family",
|
|
5275
|
+
"summary": "Remove a family from the library: its catalog row is archived, so it leaves the Families panel. Placed instances are untouched — in this project and every other — because archived pins keep resolving. Pass `instances: true` to ALSO delete this project's instances in one undoable command; do that only when the user asks for the instances to go.",
|
|
5276
|
+
"examplePrompts": [
|
|
5277
|
+
"Delete the Louvre Screen family from my library",
|
|
5278
|
+
"Get rid of that bollard and every copy of it in here\n\n# Example\n```ts\nawait snaptrude.design.family.delete({ id: \"revit:steel-bollard~bef047\" })\nawait snaptrude.design.family.delete({ id: \"revit:steel-bollard~bef047\", instances: true })\n```"
|
|
5279
|
+
],
|
|
5280
|
+
"argsType": "PluginDesignFamilyDeleteArgs",
|
|
5281
|
+
"resultType": "PluginFamilyDeleteResult"
|
|
5282
|
+
},
|
|
4753
5283
|
{
|
|
4754
5284
|
"path": "design.family.flex",
|
|
4755
5285
|
"namespace": "design.family",
|
|
@@ -4816,11 +5346,12 @@
|
|
|
4816
5346
|
{
|
|
4817
5347
|
"path": "design.family.prepare",
|
|
4818
5348
|
"namespace": "design.family",
|
|
4819
|
-
"summary": "Validate, compile and preview a family spec. Nothing is committed to the model or the library — call {@linkcode PluginDesignFamilyApi.place}
|
|
5349
|
+
"summary": "Validate, compile and preview a family spec. Nothing is committed to the model or the library — call {@linkcode PluginDesignFamilyApi.place} to put it in the model, which also saves it.",
|
|
4820
5350
|
"examplePrompts": [
|
|
4821
5351
|
"Make a louvre screen with adjustable blade count and tilt",
|
|
4822
5352
|
"Design a curtain wall panel family with 8 bays",
|
|
4823
|
-
"Create a railing family I can adjust
|
|
5353
|
+
"Create a railing family I can adjust",
|
|
5354
|
+
"Make a pendant lamp family with a domed shade I can resize\n\n# Example\n```ts\nconst r = await snaptrude.design.family.prepare({ bundle })\nif (!r.ok) console.error(r.errors[0].path, r.errors[0].message)\n```"
|
|
4824
5355
|
],
|
|
4825
5356
|
"argsType": "PluginDesignFamilyPrepareArgs",
|
|
4826
5357
|
"resultType": "PluginFamilyPrepareResult"
|
|
@@ -4927,6 +5458,51 @@
|
|
|
4927
5458
|
"argsType": "ComponentHandle",
|
|
4928
5459
|
"resultType": "PluginDesignChangeResult"
|
|
4929
5460
|
},
|
|
5461
|
+
{
|
|
5462
|
+
"path": "design.grids.addLine",
|
|
5463
|
+
"namespace": "design.grids",
|
|
5464
|
+
"summary": "Insert a parallel grid line into a wing at an explicit position along the wing's spacing axis (Snaptrude units, wing-local — line 0's position can be read from its curve). Sibling lines do not shift; the wing's tag sequence is renumbered. Undoable.",
|
|
5465
|
+
"examplePrompts": [
|
|
5466
|
+
"Add a grid line between lines 2 and 3",
|
|
5467
|
+
"Insert an extra grid line 4 metres from line A\n\n# Example\n```ts\nawait snaptrude.design.grids.addLine(grid, 0, 12.5)\n```"
|
|
5468
|
+
],
|
|
5469
|
+
"argsType": "ComponentHandle",
|
|
5470
|
+
"resultType": "boolean"
|
|
5471
|
+
},
|
|
5472
|
+
{
|
|
5473
|
+
"path": "design.grids.removeLines",
|
|
5474
|
+
"namespace": "design.grids",
|
|
5475
|
+
"summary": "Remove grid lines by positional address, as ONE undoable step. With `tagPolicy: \"rewrite\"` (default) each affected wing renumbers its tag sequence; `\"preserve\"` keeps surviving tags unchanged. A wing emptied of lines is dropped from the group.",
|
|
5476
|
+
"examplePrompts": [
|
|
5477
|
+
"Delete grid line B",
|
|
5478
|
+
"Remove the last two lines of this grid without renumbering\n\n# Example\n```ts\nawait snaptrude.design.grids.removeLines(grid, [{ wing: 0, line: 2 }], \"preserve\")\n```"
|
|
5479
|
+
],
|
|
5480
|
+
"argsType": "ComponentHandle",
|
|
5481
|
+
"resultType": "boolean"
|
|
5482
|
+
},
|
|
5483
|
+
{
|
|
5484
|
+
"path": "design.grids.updateLines",
|
|
5485
|
+
"namespace": "design.grids",
|
|
5486
|
+
"summary": "Update one or more **lines** of a grid with sparse per-line entries — `tag`, `distanceToPrevious`/`distanceToNext` (typed distance to the neighbour on that side; mutually exclusive), `props` (per-line style overrides), and `visible: false` (hide). Every change routes through the exact setters the native panel uses — each changed field commits its own undoable command, identical to editing that field in the panel.",
|
|
5487
|
+
"examplePrompts": [
|
|
5488
|
+
"Rename grid line 2 to \"B\"",
|
|
5489
|
+
"Move this grid line 4 metres from its neighbour",
|
|
5490
|
+
"Hide grid line 3 on this grid\n\n# Example\n```ts\nawait snaptrude.design.grids.updateLines(grid, [\n{ wing: 0, line: 1, tag: \"B\", distanceToPrevious: 4 },\n])\n```"
|
|
5491
|
+
],
|
|
5492
|
+
"argsType": "ComponentHandle",
|
|
5493
|
+
"resultType": "boolean"
|
|
5494
|
+
},
|
|
5495
|
+
{
|
|
5496
|
+
"path": "design.grids.updateWings",
|
|
5497
|
+
"namespace": "design.grids",
|
|
5498
|
+
"summary": "Update one or more **wings** of a grid with sparse per-wing entries — `spacing` (uniform re-space), `count` (grow/truncate + tag renumber), `spanMin`/`spanMax` (family length handles). Every change routes through the exact setters the native panel uses — each changed field commits its own undoable command, identical to editing that field in the panel.",
|
|
5499
|
+
"examplePrompts": [
|
|
5500
|
+
"Change this grid's spacing to 8 metres",
|
|
5501
|
+
"Make this grid 10 by 12 lines\n\n# Example\n```ts\nawait snaptrude.design.grids.updateWings(grid, [{ wing: 0, spacing: 8, count: 10 }])\n```"
|
|
5502
|
+
],
|
|
5503
|
+
"argsType": "ComponentHandle",
|
|
5504
|
+
"resultType": "boolean"
|
|
5505
|
+
},
|
|
4930
5506
|
{
|
|
4931
5507
|
"path": "design.isAreaLocked",
|
|
4932
5508
|
"namespace": "design",
|
|
@@ -5230,6 +5806,7 @@
|
|
|
5230
5806
|
"summary": "Get the boundary representation (B-rep) of a scene component — the solid geometry (faces, edges, vertices) behind a wall, slab, room or any other scene entity, as a reusable {@linkcode BrepHandle} for the `core.geom.query.brep.*` reads.",
|
|
5231
5807
|
"examplePrompts": [
|
|
5232
5808
|
"Get the 3D solid geometry of the selected wall",
|
|
5809
|
+
"Round the top rim of this column and put it back where it is",
|
|
5233
5810
|
"How many faces does this mass have?",
|
|
5234
5811
|
"Inspect the mesh of this slab so I can look at its faces and edges",
|
|
5235
5812
|
"Read the vertices of the selected column's geometry"
|
|
@@ -5254,7 +5831,7 @@
|
|
|
5254
5831
|
{
|
|
5255
5832
|
"path": "design.query.geometry.getTriangulatedMeshes",
|
|
5256
5833
|
"namespace": "design.query.geometry",
|
|
5257
|
-
"summary": "Get the **triangulated render meshes** of scene components as plain, serializable arrays — flat world-space vertex `positions` (`[x0, y0, z0, x1, …]`) and triangle `indices` (three per triangle), one record per requested component.",
|
|
5834
|
+
"summary": "Get the **triangulated render meshes** of scene components as plain, serializable arrays — flat world-space vertex `positions` (`[x0, y0, z0, x1, …]`) and triangle `indices` (three per triangle), one record per requested component. The result is `{ meshes }`, not a bare array — destructure it before iterating.",
|
|
5258
5835
|
"examplePrompts": [
|
|
5259
5836
|
"Export the selected masses as a triangle mesh",
|
|
5260
5837
|
"Get the raw vertices and triangles of this wall in world coordinates",
|
|
@@ -5341,6 +5918,19 @@
|
|
|
5341
5918
|
"argsType": "ComponentHandle",
|
|
5342
5919
|
"resultType": "string"
|
|
5343
5920
|
},
|
|
5921
|
+
{
|
|
5922
|
+
"path": "design.query.getParameters",
|
|
5923
|
+
"namespace": "design.query",
|
|
5924
|
+
"summary": "Read a mass's creation-parameter record — the recipe it was built from (`kind` plus the values that constructor was called with). Present on masses committed from a `core.geom.create` brep constructor that carries a recipe: {@linkcode MassParametersRecord} covers the four primitives (sphere, cylinder, cone, torus), extrusions, revolutions, lofts and sweeps.",
|
|
5925
|
+
"examplePrompts": [
|
|
5926
|
+
"What radius is this sphere?",
|
|
5927
|
+
"Is this mass parametric?",
|
|
5928
|
+
"Read back the dome's creation parameters",
|
|
5929
|
+
"How tall was this cylinder made?\n\n# Example\n```ts\nconst [mass] = await snaptrude.design.query.listMasses({ isSelected: true })\nconst params = await snaptrude.design.query.getParameters(mass)\nif (params?.kind === \"sphere\") console.log(\"radius:\", params.values.radius)\n```"
|
|
5930
|
+
],
|
|
5931
|
+
"argsType": "ComponentHandle",
|
|
5932
|
+
"resultType": "MassParametersRecord | null"
|
|
5933
|
+
},
|
|
5344
5934
|
{
|
|
5345
5935
|
"path": "design.query.getProperties",
|
|
5346
5936
|
"namespace": "design.query",
|
|
@@ -5369,6 +5959,19 @@
|
|
|
5369
5959
|
"argsType": "ComponentHandle",
|
|
5370
5960
|
"resultType": "PluginStaircaseParams | null"
|
|
5371
5961
|
},
|
|
5962
|
+
{
|
|
5963
|
+
"path": "design.query.grids.get",
|
|
5964
|
+
"namespace": "design.query.grids",
|
|
5965
|
+
"summary": "Get properties of a grid by its ID.",
|
|
5966
|
+
"examplePrompts": [
|
|
5967
|
+
"What is the spacing of this grid?",
|
|
5968
|
+
"Read the grid line tags on this structural grid",
|
|
5969
|
+
"Get the geometry of every line in this grid",
|
|
5970
|
+
"Which storeys is this grid hidden on?\n\n# Example\n```ts\nconst [grid] = await snaptrude.design.query.listGrids()\nconst { wings } = await snaptrude.design.query.grids.get(grid, [\"wings\"])\n// wings[0].lines[0].curve is an opaque CurveHandle in world space;\n// read its coordinates via `snaptrude.core.geom.curve`.\n```"
|
|
5971
|
+
],
|
|
5972
|
+
"argsType": "string",
|
|
5973
|
+
"resultType": "PluginGridGetResult"
|
|
5974
|
+
},
|
|
5372
5975
|
{
|
|
5373
5976
|
"path": "design.query.listBeams",
|
|
5374
5977
|
"namespace": "design.query",
|
|
@@ -5487,6 +6090,19 @@
|
|
|
5487
6090
|
"argsType": "PluginEntityFilter",
|
|
5488
6091
|
"resultType": "ComponentHandle[]"
|
|
5489
6092
|
},
|
|
6093
|
+
{
|
|
6094
|
+
"path": "design.query.listGrids",
|
|
6095
|
+
"namespace": "design.query",
|
|
6096
|
+
"summary": "List all the structural grids (grid groups) in the project, optionally filtered by storey, building, selection state, or region.",
|
|
6097
|
+
"examplePrompts": [
|
|
6098
|
+
"List all the structural grids in the model",
|
|
6099
|
+
"How many grids are on the ground floor?",
|
|
6100
|
+
"Show the grids on this storey",
|
|
6101
|
+
"Which grids are currently selected?\n\n# Example\n```ts\nconst groundFloorGrids = await snaptrude.design.query.listGrids({ storeys: [1] })\n```"
|
|
6102
|
+
],
|
|
6103
|
+
"argsType": "PluginEntityFilter",
|
|
6104
|
+
"resultType": "ComponentHandle[]"
|
|
6105
|
+
},
|
|
5490
6106
|
{
|
|
5491
6107
|
"path": "design.query.listMasses",
|
|
5492
6108
|
"namespace": "design.query",
|
|
@@ -5918,6 +6534,31 @@
|
|
|
5918
6534
|
"argsType": "ComponentHandle",
|
|
5919
6535
|
"resultType": "PluginDesignChangeResult"
|
|
5920
6536
|
},
|
|
6537
|
+
{
|
|
6538
|
+
"path": "design.update.grid",
|
|
6539
|
+
"namespace": "design.update",
|
|
6540
|
+
"summary": "Update a structural grid's **group-level** fields with a sparse patch — default line styling, absolute angle, and per-storey 2D visibility. Only provided fields change. Wing- and line-level updates live on the grids entity family: {@linkcode PluginDesignGridsApi.updateWings} / {@linkcode PluginDesignGridsApi.updateLines}.",
|
|
6541
|
+
"examplePrompts": [
|
|
6542
|
+
"Rotate the grid to 45 degrees",
|
|
6543
|
+
"Make this grid's lines dashed and grey",
|
|
6544
|
+
"Hide this grid on storey 3's plan\n\n# Example\n```ts\nconst [grid] = await snaptrude.design.query.listGrids()\nawait snaptrude.design.update.grid(grid, { angle: 45, props: { style: \"DASHED\" } })\n```"
|
|
6545
|
+
],
|
|
6546
|
+
"argsType": "ComponentHandle",
|
|
6547
|
+
"resultType": "boolean"
|
|
6548
|
+
},
|
|
6549
|
+
{
|
|
6550
|
+
"path": "design.update.parameters",
|
|
6551
|
+
"namespace": "design.update",
|
|
6552
|
+
"summary": "Edit a parametric mass by patching its creation recipe and rebuilding the solid in place — the mass keeps its id, storey, materials, position and linked copies; only the geometry changes. Read the current record with `design.query.getParameters` first.",
|
|
6553
|
+
"examplePrompts": [
|
|
6554
|
+
"Make the dome's radius 8 metres",
|
|
6555
|
+
"Raise the podium to 5 m",
|
|
6556
|
+
"Widen the vase — move its profile points 20 cm outward",
|
|
6557
|
+
"Change the fillet on the rounded column to 300 mm\n\n# Example\n```ts\n// { kind: \"sphere\", values: { centre, radius: 19.685 }, … }\nconst before = await snaptrude.design.query.getParameters(dome)\nconst after = await snaptrude.design.update.parameters(dome, { radius: 31.496 }) // 8 m in internal units\n\n// Fillet radius on a recorded result: read → edit → send the array back\nconst rec = await snaptrude.design.query.getParameters(column)\nconst operations = rec?.operations ?? []\nif (operations[0]?.op === \"fillet\") {\noperations[0].radius = 1.181\nawait snaptrude.design.update.parameters(column, { operations })\n}\n```"
|
|
6558
|
+
],
|
|
6559
|
+
"argsType": "ComponentHandle",
|
|
6560
|
+
"resultType": "MassParametersRecord"
|
|
6561
|
+
},
|
|
5921
6562
|
{
|
|
5922
6563
|
"path": "design.update.roof",
|
|
5923
6564
|
"namespace": "design.update",
|
|
@@ -5970,6 +6611,21 @@
|
|
|
5970
6611
|
"argsType": "ComponentHandle",
|
|
5971
6612
|
"resultType": "boolean"
|
|
5972
6613
|
},
|
|
6614
|
+
{
|
|
6615
|
+
"path": "design.update.setObjectType",
|
|
6616
|
+
"namespace": "design.update",
|
|
6617
|
+
"summary": "Change the **object type** of one or more masses — turn a mass into a real wall, roof, slab or floor: the properties panel's Object Type dropdown, headless. The geometry is kept exactly as it is (a wedge stays a wedge; nothing is flattened to a default thickness), so a sloped mass built with `design.create.massFromBrep` becomes a sloped roof or a raked wall. The component keeps its handle, label and storey; it gains the target type's construction layers and properties, and the type's default material when the mass still wore the default. One undoable operation for the whole list; undo turns them back into masses.",
|
|
6618
|
+
"examplePrompts": [
|
|
6619
|
+
"Convert this mass into a wall",
|
|
6620
|
+
"Turn the sloped mass into a roof",
|
|
6621
|
+
"Make these masses real slabs",
|
|
6622
|
+
"Change the object type of the selection to wall",
|
|
6623
|
+
"Convert the wedge I built into a raked wall",
|
|
6624
|
+
"Turn this mass into a floor\n\n# Example\n```ts\nconst brep = await snaptrude.core.geom.create.brepFromFaces(wedgeFaces)\nconst wedge = await snaptrude.design.create.massFromBrep(brep, \"Gable end\")\nconst { affected } = await snaptrude.design.update.setObjectType([wedge], \"wall\")\nconsole.log(await snaptrude.design.query.getEntityType(affected[0])) // \"wall\"\n```"
|
|
6625
|
+
],
|
|
6626
|
+
"argsType": "ComponentHandle[]",
|
|
6627
|
+
"resultType": "PluginDesignChangeResult"
|
|
6628
|
+
},
|
|
5973
6629
|
{
|
|
5974
6630
|
"path": "design.update.setStorey",
|
|
5975
6631
|
"namespace": "design.update",
|
|
@@ -6679,6 +7335,70 @@
|
|
|
6679
7335
|
"argsType": "string",
|
|
6680
7336
|
"resultType": "PluginPresentationAnnotateTextResult"
|
|
6681
7337
|
},
|
|
7338
|
+
{
|
|
7339
|
+
"path": "presentation.camera.capture",
|
|
7340
|
+
"namespace": "presentation.camera",
|
|
7341
|
+
"summary": "Screenshot what the Present canvas currently shows.",
|
|
7342
|
+
"examplePrompts": [
|
|
7343
|
+
"Take a screenshot of the Present canvas",
|
|
7344
|
+
"Capture what I am looking at in Present mode",
|
|
7345
|
+
"Screenshot the presentation canvas as a JPEG",
|
|
7346
|
+
"Grab a high-res image of the current sheet view\n\n# Example\n```ts\nconst { image, width, height } = await snaptrude.presentation.camera.capture({\nformat: \"png\",\npixelRatio: 2,\n})\n```"
|
|
7347
|
+
],
|
|
7348
|
+
"argsType": "{\n format?: PluginPresentationImageFormat\n pixelRatio?: number\n }",
|
|
7349
|
+
"resultType": "PluginPresentationCameraCaptureResult"
|
|
7350
|
+
},
|
|
7351
|
+
{
|
|
7352
|
+
"path": "presentation.camera.get",
|
|
7353
|
+
"namespace": "presentation.camera",
|
|
7354
|
+
"summary": "Read the Present camera: pan, zoom, the visible page-space rectangle and the sheet under the centre of the view.",
|
|
7355
|
+
"examplePrompts": [
|
|
7356
|
+
"Where is the Present canvas camera?",
|
|
7357
|
+
"What zoom level is Present mode at?",
|
|
7358
|
+
"Which sheet is on screen right now?",
|
|
7359
|
+
"Read the visible area of the presentation canvas\n\n# Example\n```ts\nconst { zoom, sheetId } = await snaptrude.presentation.camera.get()\n```"
|
|
7360
|
+
],
|
|
7361
|
+
"argsType": null,
|
|
7362
|
+
"resultType": "PluginPresentationCameraState"
|
|
7363
|
+
},
|
|
7364
|
+
{
|
|
7365
|
+
"path": "presentation.camera.set",
|
|
7366
|
+
"namespace": "presentation.camera",
|
|
7367
|
+
"summary": "Pan and/or zoom the Present canvas. Fields left out keep their current value, so `{ zoom: 2 }` changes only the zoom (the page point at the viewport's top-left corner stays put) and `{ x, y }` pans at the current zoom. `zoom` is clamped to the editor's range (1% to 1000%); the requested `x`/`y` are always honoured. Immediate (no animation). View-state only — not undoable.",
|
|
7368
|
+
"examplePrompts": [
|
|
7369
|
+
"Zoom the Present canvas to 50%",
|
|
7370
|
+
"Pan the presentation canvas to the right",
|
|
7371
|
+
"Restore the Present camera I saved earlier",
|
|
7372
|
+
"Set the Present zoom to 200% without moving\n\n# Example\n```ts\nconst saved = await snaptrude.presentation.camera.get()\nawait snaptrude.presentation.camera.set({ zoom: 0.5 })\n// …later, restore the exact framing\nawait snaptrude.presentation.camera.set({ x: saved.x, y: saved.y, zoom: saved.zoom })\n```"
|
|
7373
|
+
],
|
|
7374
|
+
"argsType": "{\n x?: number\n y?: number\n zoom?: number\n }",
|
|
7375
|
+
"resultType": "PluginPresentationCameraState"
|
|
7376
|
+
},
|
|
7377
|
+
{
|
|
7378
|
+
"path": "presentation.camera.zoomTo",
|
|
7379
|
+
"namespace": "presentation.camera",
|
|
7380
|
+
"summary": "Frame one shape on the Present canvas: a sheet, a placed view, a keyed shape or an annotation — any id the other `presentation` namespaces hand out. Pair with {@linkcode PluginPresentationCameraApi.capture} to screenshot a single sheet or placed view as it appears on screen. Immediate, unlike `sheets.setActive`, which animates its move over half a second. View-state only — not undoable.",
|
|
7381
|
+
"examplePrompts": [
|
|
7382
|
+
"Zoom in on sheet 2 in Present mode",
|
|
7383
|
+
"Frame this placed view on the Present canvas",
|
|
7384
|
+
"Go to the cover sheet and screenshot it",
|
|
7385
|
+
"Centre the presentation view on that table\n\n# Example\n```ts\nconst { sheets } = await snaptrude.presentation.sheets.list()\nawait snaptrude.presentation.camera.zoomTo(sheets[1].id)\nconst { image } = await snaptrude.presentation.camera.capture()\n```"
|
|
7386
|
+
],
|
|
7387
|
+
"argsType": "string",
|
|
7388
|
+
"resultType": "PluginPresentationCameraState"
|
|
7389
|
+
},
|
|
7390
|
+
{
|
|
7391
|
+
"path": "presentation.camera.zoomToFit",
|
|
7392
|
+
"namespace": "presentation.camera",
|
|
7393
|
+
"summary": "Frame everything on the Present canvas — every sheet and loose shape — the Present-mode \"zoom to fit\". View-state only — not undoable.",
|
|
7394
|
+
"examplePrompts": [
|
|
7395
|
+
"Zoom out to see all the sheets",
|
|
7396
|
+
"Fit the whole presentation in the Present view",
|
|
7397
|
+
"Zoom to fit in Present mode\n\n# Example\n```ts\nawait snaptrude.presentation.camera.zoomToFit()\n```"
|
|
7398
|
+
],
|
|
7399
|
+
"argsType": null,
|
|
7400
|
+
"resultType": "PluginPresentationCameraState"
|
|
7401
|
+
},
|
|
6682
7402
|
{
|
|
6683
7403
|
"path": "presentation.diagrams.generateProgram",
|
|
6684
7404
|
"namespace": "presentation.diagrams",
|
|
@@ -7602,6 +8322,18 @@
|
|
|
7602
8322
|
"argsType": "string",
|
|
7603
8323
|
"resultType": "PluginProgramDepartmentsSetTargetAreaResult"
|
|
7604
8324
|
},
|
|
8325
|
+
{
|
|
8326
|
+
"path": "program.departments.setTargetCount",
|
|
8327
|
+
"namespace": "program.departments",
|
|
8328
|
+
"summary": "Set a department's target unit count.",
|
|
8329
|
+
"examplePrompts": [
|
|
8330
|
+
"Set the Bedrooms department unit count to 12",
|
|
8331
|
+
"The program needs 4 clinic blocks — update the department count",
|
|
8332
|
+
"Update the target count for department dep_123\n\n# Example\n```ts\nawait snaptrude.program.departments.setTargetCount(\"dep_123\", 12)\n```"
|
|
8333
|
+
],
|
|
8334
|
+
"argsType": "string",
|
|
8335
|
+
"resultType": "PluginProgramDepartmentsSetTargetCountResult"
|
|
8336
|
+
},
|
|
7605
8337
|
{
|
|
7606
8338
|
"path": "program.departments.unassign",
|
|
7607
8339
|
"namespace": "program.departments",
|
|
@@ -7628,6 +8360,65 @@
|
|
|
7628
8360
|
"argsType": "string",
|
|
7629
8361
|
"resultType": "PluginProgramDepartmentsUpdateResult"
|
|
7630
8362
|
},
|
|
8363
|
+
{
|
|
8364
|
+
"path": "program.labels.create",
|
|
8365
|
+
"namespace": "program.labels",
|
|
8366
|
+
"summary": "Create labels (program rows), optionally creating their spaces too.",
|
|
8367
|
+
"examplePrompts": [
|
|
8368
|
+
"Add program rows for 4 exam rooms of 120 sqft each",
|
|
8369
|
+
"Create the labels from this interpreted program",
|
|
8370
|
+
"Add an Office label with a 2000 sqft target to the Admin department",
|
|
8371
|
+
"Create program rows and their spaces on the canvas\n\n# Example\n```ts\nconst { labelIds } = await snaptrude.program.labels.create(\n[{ name: \"Exam Room\", targetArea: 480, targetCount: 4, departmentName: \"Clinic\" }],\n{ units: \"ft2\" },\n)\n```"
|
|
8372
|
+
],
|
|
8373
|
+
"argsType": "PluginProgramLabelCreateItem[]",
|
|
8374
|
+
"resultType": "PluginProgramLabelsCreateResult"
|
|
8375
|
+
},
|
|
8376
|
+
{
|
|
8377
|
+
"path": "program.labels.get",
|
|
8378
|
+
"namespace": "program.labels",
|
|
8379
|
+
"summary": "Get a single label by id.",
|
|
8380
|
+
"examplePrompts": [
|
|
8381
|
+
"Get the label with id lbl_12",
|
|
8382
|
+
"What is the target area of this program row?\n\n# Example\n```ts\nconst label = await snaptrude.program.labels.get(\"lbl_12\")\nif (label) console.log(label.name, label.targetArea, label.units)\n```"
|
|
8383
|
+
],
|
|
8384
|
+
"argsType": "string",
|
|
8385
|
+
"resultType": "PluginProgramLabelsGetResult"
|
|
8386
|
+
},
|
|
8387
|
+
{
|
|
8388
|
+
"path": "program.labels.list",
|
|
8389
|
+
"namespace": "program.labels",
|
|
8390
|
+
"summary": "List the labels (program rows) of the active program.",
|
|
8391
|
+
"examplePrompts": [
|
|
8392
|
+
"List all the program rows with their target areas",
|
|
8393
|
+
"What space labels are in the program and how many of each?",
|
|
8394
|
+
"Show every label with its department and target\n\n# Example\n```ts\nconst { units, labels } = await snaptrude.program.labels.list()\nfor (const l of labels) console.log(l.name, l.targetArea, units, l.targetCount)\n```"
|
|
8395
|
+
],
|
|
8396
|
+
"argsType": null,
|
|
8397
|
+
"resultType": "PluginProgramLabelsListResult"
|
|
8398
|
+
},
|
|
8399
|
+
{
|
|
8400
|
+
"path": "program.labels.setTargetArea",
|
|
8401
|
+
"namespace": "program.labels",
|
|
8402
|
+
"summary": "Set a label's total target area.",
|
|
8403
|
+
"examplePrompts": [
|
|
8404
|
+
"Set the Exam Room target area to 480 sqft",
|
|
8405
|
+
"Give the Corridor program row a 150 sqm target",
|
|
8406
|
+
"Update the area target for label lbl_12\n\n# Example\n```ts\nawait snaptrude.program.labels.setTargetArea(\"lbl_12\", 480, \"ft2\")\n```"
|
|
8407
|
+
],
|
|
8408
|
+
"argsType": "string",
|
|
8409
|
+
"resultType": "PluginProgramLabelsSetTargetAreaResult"
|
|
8410
|
+
},
|
|
8411
|
+
{
|
|
8412
|
+
"path": "program.labels.setTargetCount",
|
|
8413
|
+
"namespace": "program.labels",
|
|
8414
|
+
"summary": "Set a label's target unit count (how many of this space the program calls for).",
|
|
8415
|
+
"examplePrompts": [
|
|
8416
|
+
"Set the Exam Room count to 6",
|
|
8417
|
+
"The program needs 12 patient rooms — update the count\n\n# Example\n```ts\nawait snaptrude.program.labels.setTargetCount(\"lbl_12\", 6)\n```"
|
|
8418
|
+
],
|
|
8419
|
+
"argsType": "string",
|
|
8420
|
+
"resultType": "PluginProgramLabelsSetTargetCountResult"
|
|
8421
|
+
},
|
|
7631
8422
|
{
|
|
7632
8423
|
"path": "program.layout.applySolution",
|
|
7633
8424
|
"namespace": "program.layout",
|
|
@@ -7701,6 +8492,81 @@
|
|
|
7701
8492
|
"argsType": null,
|
|
7702
8493
|
"resultType": "PluginProgramLayoutStackResult"
|
|
7703
8494
|
},
|
|
8495
|
+
{
|
|
8496
|
+
"path": "program.metadata.createHeader",
|
|
8497
|
+
"namespace": "program.metadata",
|
|
8498
|
+
"summary": "Create a metadata header (a custom column on the Program Data sheet).",
|
|
8499
|
+
"examplePrompts": [
|
|
8500
|
+
"Add a custom column called Occupancy to the program sheet",
|
|
8501
|
+
"Create a metadata header named Department Code",
|
|
8502
|
+
"Make a new program-mode column for Finish Level\n\n# Example\n```ts\nconst header = await snaptrude.program.metadata.createHeader(\"Occupancy\", {\ndescription: \"People per room\",\n})\n```"
|
|
8503
|
+
],
|
|
8504
|
+
"argsType": "string",
|
|
8505
|
+
"resultType": "PluginProgramMetadataCreateHeaderResult"
|
|
8506
|
+
},
|
|
8507
|
+
{
|
|
8508
|
+
"path": "program.metadata.get",
|
|
8509
|
+
"namespace": "program.metadata",
|
|
8510
|
+
"summary": "Get one space's metadata values, keyed by header id.",
|
|
8511
|
+
"examplePrompts": [
|
|
8512
|
+
"Get the metadata on this space",
|
|
8513
|
+
"Read the custom column values for space sp_12",
|
|
8514
|
+
"What is this room's Occupancy metadata?\n\n# Example\n```ts\nconst record = await snaptrude.program.metadata.get(\"sp_12\")\nif (record) console.log(record.values)\n```"
|
|
8515
|
+
],
|
|
8516
|
+
"argsType": "ComponentHandle",
|
|
8517
|
+
"resultType": "PluginProgramMetadataGetResult"
|
|
8518
|
+
},
|
|
8519
|
+
{
|
|
8520
|
+
"path": "program.metadata.list",
|
|
8521
|
+
"namespace": "program.metadata",
|
|
8522
|
+
"summary": "List metadata values for many spaces at once.",
|
|
8523
|
+
"examplePrompts": [
|
|
8524
|
+
"List the metadata of every space",
|
|
8525
|
+
"Read the custom column values for all rooms",
|
|
8526
|
+
"Get the metadata for these three spaces in one call\n\n# Example\n```ts\nconst { records } = await snaptrude.program.metadata.list()\nconst byId = Object.fromEntries(records.map((r) => [r.spaceId, r.values]))\n```"
|
|
8527
|
+
],
|
|
8528
|
+
"argsType": "ComponentHandle[]",
|
|
8529
|
+
"resultType": "PluginProgramMetadataListResult",
|
|
8530
|
+
"performance": "One round-trip for any number of spaces — use this instead of a `get` loop."
|
|
8531
|
+
},
|
|
8532
|
+
{
|
|
8533
|
+
"path": "program.metadata.listHeaders",
|
|
8534
|
+
"namespace": "program.metadata",
|
|
8535
|
+
"summary": "List the metadata headers (custom columns) of the Program Data sheet.",
|
|
8536
|
+
"examplePrompts": [
|
|
8537
|
+
"List the custom metadata columns in program mode",
|
|
8538
|
+
"What metadata headers does the program sheet have?",
|
|
8539
|
+
"Show every custom column with its id\n\n# Example\n```ts\nconst { headers } = await snaptrude.program.metadata.listHeaders()\nfor (const h of headers) console.log(h.headerId, h.name)\n```"
|
|
8540
|
+
],
|
|
8541
|
+
"argsType": null,
|
|
8542
|
+
"resultType": "PluginProgramMetadataListHeadersResult"
|
|
8543
|
+
},
|
|
8544
|
+
{
|
|
8545
|
+
"path": "program.metadata.update",
|
|
8546
|
+
"namespace": "program.metadata",
|
|
8547
|
+
"summary": "Update a space's metadata values (sparse).",
|
|
8548
|
+
"examplePrompts": [
|
|
8549
|
+
"Set the Occupancy metadata of this space to 4",
|
|
8550
|
+
"Store a department code on the selected rooms",
|
|
8551
|
+
"Write custom column values onto space sp_12",
|
|
8552
|
+
"Clear the Finish Level metadata on this space\n\n# Example\n```ts\nconst header = await snaptrude.program.metadata.createHeader(\"Occupancy\")\nawait snaptrude.program.metadata.update(\"sp_12\", { [header.headerId]: 4 })\n```"
|
|
8553
|
+
],
|
|
8554
|
+
"argsType": "ComponentHandle",
|
|
8555
|
+
"resultType": "PluginProgramMetadataUpdateResult"
|
|
8556
|
+
},
|
|
8557
|
+
{
|
|
8558
|
+
"path": "program.metadata.updateMany",
|
|
8559
|
+
"namespace": "program.metadata",
|
|
8560
|
+
"summary": "Update metadata values on many spaces in one undoable step.",
|
|
8561
|
+
"examplePrompts": [
|
|
8562
|
+
"Fill the Occupancy column for all bedrooms",
|
|
8563
|
+
"Write metadata onto every selected space at once",
|
|
8564
|
+
"Bulk-update custom column values\n\n# Example\n```ts\nawait snaptrude.program.metadata.updateMany([\n{ spaceId: \"sp_12\", values: { [headerId]: 4 } },\n{ spaceId: \"sp_13\", values: { [headerId]: 2 } },\n])\n```"
|
|
8565
|
+
],
|
|
8566
|
+
"argsType": "PluginProgramMetadataUpdateItem[]",
|
|
8567
|
+
"resultType": "PluginProgramMetadataUpdateManyResult",
|
|
8568
|
+
"performance": "One round-trip and one undo step for up to 1000 spaces — use this instead of an `update` loop."
|
|
8569
|
+
},
|
|
7704
8570
|
{
|
|
7705
8571
|
"path": "program.metrics.get",
|
|
7706
8572
|
"namespace": "program.metrics",
|
|
@@ -7939,6 +8805,19 @@
|
|
|
7939
8805
|
"argsType": "{\n name?: string\n }",
|
|
7940
8806
|
"resultType": "PluginProgramSpreadsheetBindingsRefreshResult"
|
|
7941
8807
|
},
|
|
8808
|
+
{
|
|
8809
|
+
"path": "program.spreadsheet.createCustomSheet",
|
|
8810
|
+
"namespace": "program.spreadsheet",
|
|
8811
|
+
"summary": "Create a **custom program sheet** — a live view of the program grouped by a configurable hierarchy (the Program tab's \"Custom\" sheet with *Organize → Group by*).",
|
|
8812
|
+
"examplePrompts": [
|
|
8813
|
+
"Create a custom sheet grouped by department then sub-department",
|
|
8814
|
+
"Make a program view grouped by storey and label",
|
|
8815
|
+
"Build a grouped program sheet for the healthcare hierarchy",
|
|
8816
|
+
"Add a custom sheet with a department → room type group-by\n\n# Example\n```ts\nconst { headers } = await snaptrude.program.metadata.listHeaders()\nconst subDept = headers.find((h) => h.name === \"Sub-department\")\nawait snaptrude.program.spreadsheet.createCustomSheet(\"Clinical Program\", {\ngroupBy: [\"departmentName\", subDept.headerId, \"label\"],\nproperties: [\"label\", \"count\", \"areas\", \"netAreaAchieved\"],\n})\n```"
|
|
8817
|
+
],
|
|
8818
|
+
"argsType": "string",
|
|
8819
|
+
"resultType": "PluginProgramSpreadsheetCustomSheetResult"
|
|
8820
|
+
},
|
|
7942
8821
|
{
|
|
7943
8822
|
"path": "program.spreadsheet.createSheet",
|
|
7944
8823
|
"namespace": "program.spreadsheet",
|
|
@@ -8004,6 +8883,17 @@
|
|
|
8004
8883
|
"argsType": "{\n limit?: number\n }",
|
|
8005
8884
|
"resultType": "PluginProgramSpreadsheetGetAuditLogResult"
|
|
8006
8885
|
},
|
|
8886
|
+
{
|
|
8887
|
+
"path": "program.spreadsheet.getCustomSheet",
|
|
8888
|
+
"namespace": "program.spreadsheet",
|
|
8889
|
+
"summary": "Get a custom program sheet's configuration.",
|
|
8890
|
+
"examplePrompts": [
|
|
8891
|
+
"How is the Clinical Program sheet grouped?",
|
|
8892
|
+
"Get the group-by configuration of this custom sheet\n\n# Example\n```ts\nconst cfg = await snaptrude.program.spreadsheet.getCustomSheet(\"Clinical Program\")\nif (cfg) console.log(cfg.groupBy, cfg.properties)\n```"
|
|
8893
|
+
],
|
|
8894
|
+
"argsType": "string",
|
|
8895
|
+
"resultType": "PluginProgramSpreadsheetGetCustomSheetResult"
|
|
8896
|
+
},
|
|
8007
8897
|
{
|
|
8008
8898
|
"path": "program.spreadsheet.getMaterialTakeoff",
|
|
8009
8899
|
"namespace": "program.spreadsheet",
|
|
@@ -8070,6 +8960,28 @@
|
|
|
8070
8960
|
"argsType": "string",
|
|
8071
8961
|
"resultType": "PluginProgramSpreadsheetHighlightCellsResult"
|
|
8072
8962
|
},
|
|
8963
|
+
{
|
|
8964
|
+
"path": "program.spreadsheet.listCustomSheetProperties",
|
|
8965
|
+
"namespace": "program.spreadsheet",
|
|
8966
|
+
"summary": "List the property ids a custom program sheet can show as columns or group by.",
|
|
8967
|
+
"examplePrompts": [
|
|
8968
|
+
"What can I group a custom program sheet by?",
|
|
8969
|
+
"List the columns available for a custom sheet\n\n# Example\n```ts\nconst { properties } = await snaptrude.program.spreadsheet.listCustomSheetProperties()\nconst groupable = properties.filter((p) => p.groupable).map((p) => p.id)\n```"
|
|
8970
|
+
],
|
|
8971
|
+
"argsType": null,
|
|
8972
|
+
"resultType": "PluginProgramSpreadsheetListCustomSheetPropertiesResult"
|
|
8973
|
+
},
|
|
8974
|
+
{
|
|
8975
|
+
"path": "program.spreadsheet.listCustomSheets",
|
|
8976
|
+
"namespace": "program.spreadsheet",
|
|
8977
|
+
"summary": "List the custom program sheets in the workbook with their configurations.",
|
|
8978
|
+
"examplePrompts": [
|
|
8979
|
+
"List the custom program sheets",
|
|
8980
|
+
"Which sheets are grouped program views?\n\n# Example\n```ts\nconst { sheets } = await snaptrude.program.spreadsheet.listCustomSheets()\n```"
|
|
8981
|
+
],
|
|
8982
|
+
"argsType": null,
|
|
8983
|
+
"resultType": "PluginProgramSpreadsheetListCustomSheetsResult"
|
|
8984
|
+
},
|
|
8073
8985
|
{
|
|
8074
8986
|
"path": "program.spreadsheet.listSheets",
|
|
8075
8987
|
"namespace": "program.spreadsheet",
|
|
@@ -8246,6 +9158,18 @@
|
|
|
8246
9158
|
"argsType": "PluginSpreadsheetTransactionOp[]",
|
|
8247
9159
|
"resultType": "PluginProgramSpreadsheetTransactionResult"
|
|
8248
9160
|
},
|
|
9161
|
+
{
|
|
9162
|
+
"path": "program.spreadsheet.updateCustomSheet",
|
|
9163
|
+
"namespace": "program.spreadsheet",
|
|
9164
|
+
"summary": "Update a custom program sheet's group-by hierarchy, columns, or group colors.",
|
|
9165
|
+
"examplePrompts": [
|
|
9166
|
+
"Change the custom sheet to group by storey first",
|
|
9167
|
+
"Add the Occupancy column to my grouped program sheet",
|
|
9168
|
+
"Regroup the Clinical Program sheet by department only\n\n# Example\n```ts\nawait snaptrude.program.spreadsheet.updateCustomSheet(\"Clinical Program\", {\ngroupBy: [\"storey\", \"departmentName\"],\n})\n```"
|
|
9169
|
+
],
|
|
9170
|
+
"argsType": "string",
|
|
9171
|
+
"resultType": "PluginProgramSpreadsheetCustomSheetResult"
|
|
9172
|
+
},
|
|
8249
9173
|
{
|
|
8250
9174
|
"path": "workspace.closePresentMode",
|
|
8251
9175
|
"namespace": "workspace",
|
|
@@ -8258,6 +9182,17 @@
|
|
|
8258
9182
|
"argsType": null,
|
|
8259
9183
|
"resultType": "void"
|
|
8260
9184
|
},
|
|
9185
|
+
{
|
|
9186
|
+
"path": "workspace.closeProgramMode",
|
|
9187
|
+
"namespace": "workspace",
|
|
9188
|
+
"summary": "Close the Program tab.",
|
|
9189
|
+
"examplePrompts": [
|
|
9190
|
+
"Close program mode",
|
|
9191
|
+
"Close the Program tab\n\n# Example\n```ts\nawait snaptrude.workspace.closeProgramMode()\n```"
|
|
9192
|
+
],
|
|
9193
|
+
"argsType": null,
|
|
9194
|
+
"resultType": "void"
|
|
9195
|
+
},
|
|
8261
9196
|
{
|
|
8262
9197
|
"path": "workspace.openPresentMode",
|
|
8263
9198
|
"namespace": "workspace",
|
|
@@ -8270,6 +9205,18 @@
|
|
|
8270
9205
|
"argsType": null,
|
|
8271
9206
|
"resultType": "void"
|
|
8272
9207
|
},
|
|
9208
|
+
{
|
|
9209
|
+
"path": "workspace.openProgramMode",
|
|
9210
|
+
"namespace": "workspace",
|
|
9211
|
+
"summary": "Open Program mode — the Program tab the `program.spreadsheet.*` calls run in.",
|
|
9212
|
+
"examplePrompts": [
|
|
9213
|
+
"Open program mode",
|
|
9214
|
+
"Open the Program tab so I can build a custom sheet",
|
|
9215
|
+
"Switch to the program spreadsheet\n\n# Example\n```ts\nawait snaptrude.workspace.openProgramMode()\nconst { sheets } = await snaptrude.program.spreadsheet.listSheets()\n```"
|
|
9216
|
+
],
|
|
9217
|
+
"argsType": null,
|
|
9218
|
+
"resultType": "void"
|
|
9219
|
+
},
|
|
8273
9220
|
{
|
|
8274
9221
|
"path": "workspace.projects.copy",
|
|
8275
9222
|
"namespace": "workspace.projects",
|