@snaptrude/plugin-core 0.0.0-dev-20260921132444 → 0.0.0-surfaces-20260923052616
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 +1 -1
- package/api-manifest.json +767 -31
- package/dist/api/core/geom/create/index.d.ts +924 -100
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/brep.d.ts +55 -1
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/geom/query/curve.d.ts +58 -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/curve.d.ts +5 -5
- package/dist/api/core/geom/update/profile.d.ts +1 -1
- package/dist/api/design/create/grids.d.ts +2 -2
- package/dist/api/design/create/grids.d.ts.map +1 -1
- package/dist/api/design/family.d.ts +65 -8
- 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 +4 -3
- package/dist/api/design/query/grids.d.ts.map +1 -1
- 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/update/index.d.ts +87 -0
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +2 -2
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +5 -4
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +4 -4
- package/dist/api/program/site.d.ts +4 -4
- package/dist/api/program/spreadsheet.d.ts +4 -4
- package/dist/handles.d.ts +12 -3
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +3413 -2943
- 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 +3366 -2943
- 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 +137 -0
- package/dist/massParameters.ops.d.ts.map +1 -0
- package/package.json +13 -13
- package/src/api/core/geom/create/index.ts +1019 -101
- package/src/api/core/geom/query/brep.ts +56 -1
- package/src/api/core/geom/query/curve.ts +25 -2
- package/src/api/core/geom/query/edge.ts +2 -2
- package/src/api/core/geom/query/face.ts +109 -4
- package/src/api/design/family.ts +66 -8
- 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 +94 -0
- package/src/handles.ts +15 -3
- package/src/index.ts +2 -0
- package/src/massParameters.ops.ts +245 -0
- package/src/massParameters.ts +427 -0
- package/test/massParameters.test.mjs +938 -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.25,\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],\n0.3,\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 (cylindrical) surface 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```"
|
|
878
934
|
],
|
|
879
935
|
"argsType": "ContourHandle",
|
|
880
936
|
"resultType": "BrepHandle"
|
|
881
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.",
|
|
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```"
|
|
946
|
+
],
|
|
947
|
+
"argsType": "ContourHandle",
|
|
948
|
+
"resultType": "BrepHandle"
|
|
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,29 @@
|
|
|
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",
|
|
1094
|
+
"Rebuild this edge from its control polygon\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```"
|
|
1095
|
+
],
|
|
1096
|
+
"argsType": "Vec3Handle[]",
|
|
1097
|
+
"resultType": "SplineHandle"
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
"path": "core.geom.create.splineFromPoints",
|
|
1101
|
+
"namespace": "core.geom.create",
|
|
1102
|
+
"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.",
|
|
1103
|
+
"examplePrompts": [
|
|
1104
|
+
"Draw a smooth curve through these points",
|
|
1105
|
+
"Make a wavy edge that passes through A, B, C and D",
|
|
1106
|
+
"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```"
|
|
1107
|
+
],
|
|
1108
|
+
"argsType": "Vec3Handle[]",
|
|
1109
|
+
"resultType": "SplineHandle"
|
|
1110
|
+
},
|
|
979
1111
|
{
|
|
980
1112
|
"path": "core.geom.delete.contour",
|
|
981
1113
|
"namespace": "core.geom.delete",
|
|
@@ -1068,7 +1200,7 @@
|
|
|
1068
1200
|
{
|
|
1069
1201
|
"path": "core.geom.query.brep.getDistance",
|
|
1070
1202
|
"namespace": "core.geom.query.brep",
|
|
1071
|
-
"summary": "Measures the minimum distance between two solids, with the closest
|
|
1203
|
+
"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
1204
|
"examplePrompts": [
|
|
1073
1205
|
"What is the clearance between these two masses?",
|
|
1074
1206
|
"How far apart are the tower and the neighbouring building?",
|
|
@@ -1101,10 +1233,11 @@
|
|
|
1101
1233
|
"Read the radius of this curved edge",
|
|
1102
1234
|
"Is this edge straight or an arc?",
|
|
1103
1235
|
"Get the exact start and end points of this edge",
|
|
1104
|
-
"Measure the length of each edge of this mass
|
|
1236
|
+
"Measure the length of each edge of this mass",
|
|
1237
|
+
"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
1238
|
],
|
|
1106
1239
|
"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 }"
|
|
1240
|
+
"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
1241
|
},
|
|
1109
1242
|
{
|
|
1110
1243
|
"path": "core.geom.query.brep.getFaceCount",
|
|
@@ -1138,6 +1271,18 @@
|
|
|
1138
1271
|
"argsType": "BrepHandle",
|
|
1139
1272
|
"resultType": "Vec3Components"
|
|
1140
1273
|
},
|
|
1274
|
+
{
|
|
1275
|
+
"path": "core.geom.query.brep.getVolume",
|
|
1276
|
+
"namespace": "core.geom.query.brep",
|
|
1277
|
+
"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²).",
|
|
1278
|
+
"examplePrompts": [
|
|
1279
|
+
"What is the volume of this mass?",
|
|
1280
|
+
"How much concrete is in this shape?",
|
|
1281
|
+
"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```"
|
|
1282
|
+
],
|
|
1283
|
+
"argsType": "BrepHandle",
|
|
1284
|
+
"resultType": "number"
|
|
1285
|
+
},
|
|
1141
1286
|
{
|
|
1142
1287
|
"path": "core.geom.query.brep.hasEdge",
|
|
1143
1288
|
"namespace": "core.geom.query.brep",
|
|
@@ -1742,7 +1887,7 @@
|
|
|
1742
1887
|
{
|
|
1743
1888
|
"path": "core.geom.query.edge.getCurve",
|
|
1744
1889
|
"namespace": "core.geom.query.edge",
|
|
1745
|
-
"summary": "Get the underlying curve geometry of an edge (a line or
|
|
1890
|
+
"summary": "Get the underlying curve geometry of an edge (a line, arc or spline).",
|
|
1746
1891
|
"examplePrompts": [],
|
|
1747
1892
|
"argsType": "EdgeHandle",
|
|
1748
1893
|
"resultType": "CurveHandle | null"
|
|
@@ -1779,6 +1924,28 @@
|
|
|
1779
1924
|
"argsType": "EdgeHandle",
|
|
1780
1925
|
"resultType": "VertexHandle[]"
|
|
1781
1926
|
},
|
|
1927
|
+
{
|
|
1928
|
+
"path": "core.geom.query.face.getArea",
|
|
1929
|
+
"namespace": "core.geom.query.face",
|
|
1930
|
+
"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.",
|
|
1931
|
+
"examplePrompts": [
|
|
1932
|
+
"How big is this roof patch?",
|
|
1933
|
+
"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```"
|
|
1934
|
+
],
|
|
1935
|
+
"argsType": "FaceHandle",
|
|
1936
|
+
"resultType": "number"
|
|
1937
|
+
},
|
|
1938
|
+
{
|
|
1939
|
+
"path": "core.geom.query.face.getCentroid",
|
|
1940
|
+
"namespace": "core.geom.query.face",
|
|
1941
|
+
"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.",
|
|
1942
|
+
"examplePrompts": [
|
|
1943
|
+
"Where is the middle of this face?",
|
|
1944
|
+
"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```"
|
|
1945
|
+
],
|
|
1946
|
+
"argsType": "FaceHandle",
|
|
1947
|
+
"resultType": "Vec3Components"
|
|
1948
|
+
},
|
|
1782
1949
|
{
|
|
1783
1950
|
"path": "core.geom.query.face.getHalfEdge",
|
|
1784
1951
|
"namespace": "core.geom.query.face",
|
|
@@ -1819,6 +1986,19 @@
|
|
|
1819
1986
|
"argsType": "FaceHandle",
|
|
1820
1987
|
"resultType": "number"
|
|
1821
1988
|
},
|
|
1989
|
+
{
|
|
1990
|
+
"path": "core.geom.query.face.getSurfaceKind",
|
|
1991
|
+
"namespace": "core.geom.query.face",
|
|
1992
|
+
"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.",
|
|
1993
|
+
"examplePrompts": [
|
|
1994
|
+
"Is this face flat or curved?",
|
|
1995
|
+
"Check that this dome is a real sphere, not a faceted approximation",
|
|
1996
|
+
"What kind of surface is this face?",
|
|
1997
|
+
"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```"
|
|
1998
|
+
],
|
|
1999
|
+
"argsType": "FaceHandle",
|
|
2000
|
+
"resultType": "\"plane\" | \"cylinder\" | \"cone\" | \"sphere\" | \"torus\" | \"spline\" | null"
|
|
2001
|
+
},
|
|
1822
2002
|
{
|
|
1823
2003
|
"path": "core.geom.query.face.hasHoles",
|
|
1824
2004
|
"namespace": "core.geom.query.face",
|
|
@@ -3403,7 +3583,8 @@
|
|
|
3403
3583
|
"examplePrompts": [
|
|
3404
3584
|
"Switch to present mode",
|
|
3405
3585
|
"Open BIM mode",
|
|
3406
|
-
"Go back to design mode
|
|
3586
|
+
"Go back to design mode",
|
|
3587
|
+
"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
3588
|
],
|
|
3408
3589
|
"argsType": "PluginAppMode",
|
|
3409
3590
|
"resultType": "PluginCoreModeSetResult"
|
|
@@ -4038,6 +4219,19 @@
|
|
|
4038
4219
|
"argsType": "ComponentHandle",
|
|
4039
4220
|
"resultType": "PluginCoreTagsGetTagsForComponentResult"
|
|
4040
4221
|
},
|
|
4222
|
+
{
|
|
4223
|
+
"path": "core.tags.listForComponents",
|
|
4224
|
+
"namespace": "core.tags",
|
|
4225
|
+
"summary": "List the tags carried by many components in one call.",
|
|
4226
|
+
"examplePrompts": [
|
|
4227
|
+
"Get the tags of every space with their colors",
|
|
4228
|
+
"List the tags on all rooms so I can color them by Occupancy",
|
|
4229
|
+
"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```"
|
|
4230
|
+
],
|
|
4231
|
+
"argsType": "ComponentHandle[]",
|
|
4232
|
+
"resultType": "PluginCoreTagsListForComponentsResult",
|
|
4233
|
+
"performance": "One round-trip for any number of components — use this instead of a `listForComponent` loop."
|
|
4234
|
+
},
|
|
4041
4235
|
{
|
|
4042
4236
|
"path": "core.tags.unassign",
|
|
4043
4237
|
"namespace": "core.tags",
|
|
@@ -4274,6 +4468,17 @@
|
|
|
4274
4468
|
"argsType": "Vec3Handle",
|
|
4275
4469
|
"resultType": "ComponentHandle"
|
|
4276
4470
|
},
|
|
4471
|
+
{
|
|
4472
|
+
"path": "design.create.columnsFromGrids",
|
|
4473
|
+
"namespace": "design.create",
|
|
4474
|
+
"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.",
|
|
4475
|
+
"examplePrompts": [
|
|
4476
|
+
"Generate columns on this grid",
|
|
4477
|
+
"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```"
|
|
4478
|
+
],
|
|
4479
|
+
"argsType": "ComponentHandle[]",
|
|
4480
|
+
"resultType": "ComponentHandle[]"
|
|
4481
|
+
},
|
|
4277
4482
|
{
|
|
4278
4483
|
"path": "design.create.copy",
|
|
4279
4484
|
"namespace": "design.create",
|
|
@@ -4299,10 +4504,27 @@
|
|
|
4299
4504
|
"Put a door from the catalog at this point on the wall",
|
|
4300
4505
|
"Insert the entrance door into this wall",
|
|
4301
4506
|
"Add a door to the wall and call it Entry-01",
|
|
4302
|
-
"Add a door that opens into the living room
|
|
4507
|
+
"Add a door that opens into the living room",
|
|
4508
|
+
"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
4509
|
],
|
|
4304
4510
|
"argsType": "string",
|
|
4305
|
-
"resultType": "ComponentHandle"
|
|
4511
|
+
"resultType": "ComponentHandle",
|
|
4512
|
+
"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."
|
|
4513
|
+
},
|
|
4514
|
+
{
|
|
4515
|
+
"path": "design.create.doors",
|
|
4516
|
+
"namespace": "design.create",
|
|
4517
|
+
"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.",
|
|
4518
|
+
"examplePrompts": [
|
|
4519
|
+
"Add doors to all of these walls at once",
|
|
4520
|
+
"Place a door in every room in one operation",
|
|
4521
|
+
"Bulk add the entrance doors from this schedule",
|
|
4522
|
+
"Put three doors on this wall in a single undo step",
|
|
4523
|
+
"Add all the doors for this floor plan together"
|
|
4524
|
+
],
|
|
4525
|
+
"argsType": "PluginCreateDoorItem[]",
|
|
4526
|
+
"resultType": "ComponentHandle[]",
|
|
4527
|
+
"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
4528
|
},
|
|
4307
4529
|
{
|
|
4308
4530
|
"path": "design.create.floor",
|
|
@@ -4315,7 +4537,23 @@
|
|
|
4315
4537
|
"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
4538
|
],
|
|
4317
4539
|
"argsType": "ContourHandle",
|
|
4318
|
-
"resultType": "ComponentHandle"
|
|
4540
|
+
"resultType": "ComponentHandle",
|
|
4541
|
+
"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."
|
|
4542
|
+
},
|
|
4543
|
+
{
|
|
4544
|
+
"path": "design.create.floors",
|
|
4545
|
+
"namespace": "design.create",
|
|
4546
|
+
"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.",
|
|
4547
|
+
"examplePrompts": [
|
|
4548
|
+
"Create floors for all these room outlines at once",
|
|
4549
|
+
"Add a floor to every space in one operation",
|
|
4550
|
+
"Bulk create the floor plates for this building",
|
|
4551
|
+
"Lay 100mm floors across these five footprints in one undo step",
|
|
4552
|
+
"Create the ground and first floor slabs together"
|
|
4553
|
+
],
|
|
4554
|
+
"argsType": "PluginCreateFloorItem[]",
|
|
4555
|
+
"resultType": "ComponentHandle[]",
|
|
4556
|
+
"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
4557
|
},
|
|
4320
4558
|
{
|
|
4321
4559
|
"path": "design.create.furniture",
|
|
@@ -4330,8 +4568,60 @@
|
|
|
4330
4568
|
"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
4569
|
],
|
|
4332
4570
|
"argsType": "string",
|
|
4571
|
+
"resultType": "ComponentHandle",
|
|
4572
|
+
"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."
|
|
4573
|
+
},
|
|
4574
|
+
{
|
|
4575
|
+
"path": "design.create.furnitureItems",
|
|
4576
|
+
"namespace": "design.create",
|
|
4577
|
+
"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.",
|
|
4578
|
+
"examplePrompts": [
|
|
4579
|
+
"Place all the desks for this office at once",
|
|
4580
|
+
"Furnish every bedroom in one operation",
|
|
4581
|
+
"Bulk place these chairs around the table",
|
|
4582
|
+
"Add the whole furniture layout in a single undo step",
|
|
4583
|
+
"Drop twenty copies of this chair at these positions"
|
|
4584
|
+
],
|
|
4585
|
+
"argsType": "PluginCreateFurnitureItem[]",
|
|
4586
|
+
"resultType": "ComponentHandle[]",
|
|
4587
|
+
"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 }, ]) ```"
|
|
4588
|
+
},
|
|
4589
|
+
{
|
|
4590
|
+
"path": "design.create.grid",
|
|
4591
|
+
"namespace": "design.create",
|
|
4592
|
+
"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.",
|
|
4593
|
+
"examplePrompts": [
|
|
4594
|
+
"Create a 5 by 8 structural grid with 6 metre spacing",
|
|
4595
|
+
"Add a column grid rotated 30 degrees",
|
|
4596
|
+
"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```"
|
|
4597
|
+
],
|
|
4598
|
+
"argsType": "number",
|
|
4599
|
+
"resultType": "ComponentHandle"
|
|
4600
|
+
},
|
|
4601
|
+
{
|
|
4602
|
+
"path": "design.create.gridFromCurve",
|
|
4603
|
+
"namespace": "design.create",
|
|
4604
|
+
"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.",
|
|
4605
|
+
"examplePrompts": [
|
|
4606
|
+
"Draw a grid line from A to B",
|
|
4607
|
+
"Add a curved grid line through these points",
|
|
4608
|
+
"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```"
|
|
4609
|
+
],
|
|
4610
|
+
"argsType": "CurveHandle",
|
|
4333
4611
|
"resultType": "ComponentHandle"
|
|
4334
4612
|
},
|
|
4613
|
+
{
|
|
4614
|
+
"path": "design.create.gridsFromMasses",
|
|
4615
|
+
"namespace": "design.create",
|
|
4616
|
+
"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.",
|
|
4617
|
+
"examplePrompts": [
|
|
4618
|
+
"Generate grids for the selected masses",
|
|
4619
|
+
"Auto-generate a 6m structural grid on this building",
|
|
4620
|
+
"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```"
|
|
4621
|
+
],
|
|
4622
|
+
"argsType": "ComponentHandle[]",
|
|
4623
|
+
"resultType": "ComponentHandle[]"
|
|
4624
|
+
},
|
|
4335
4625
|
{
|
|
4336
4626
|
"path": "design.create.mass",
|
|
4337
4627
|
"namespace": "design.create",
|
|
@@ -4367,7 +4657,7 @@
|
|
|
4367
4657
|
],
|
|
4368
4658
|
"argsType": "PluginDesignCreateOpeningOptions",
|
|
4369
4659
|
"resultType": "ComponentHandle",
|
|
4370
|
-
"performance": "Single-opening creator — use it for one hosted opening.
|
|
4660
|
+
"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
4661
|
},
|
|
4372
4662
|
{
|
|
4373
4663
|
"path": "design.create.referenceLines",
|
|
@@ -4469,6 +4759,21 @@
|
|
|
4469
4759
|
"argsType": "PluginStaircasePreset",
|
|
4470
4760
|
"resultType": "ComponentHandle"
|
|
4471
4761
|
},
|
|
4762
|
+
{
|
|
4763
|
+
"path": "design.create.wallRuns",
|
|
4764
|
+
"namespace": "design.create",
|
|
4765
|
+
"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. Validate-all-or-throw; one command.",
|
|
4766
|
+
"examplePrompts": [
|
|
4767
|
+
"Draw all the walls of this floor plan at once",
|
|
4768
|
+
"Build every room's perimeter in one operation",
|
|
4769
|
+
"Bulk create wall runs from these centerlines",
|
|
4770
|
+
"Create the walls for both storeys in a single undo step",
|
|
4771
|
+
"Turn these polylines into 200mm brick walls together"
|
|
4772
|
+
],
|
|
4773
|
+
"argsType": "PluginCreateWallRunItem[]",
|
|
4774
|
+
"resultType": "ComponentHandle[][]",
|
|
4775
|
+
"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 }, ]) console.log(groundWalls.length, \"walls on the ground floor\") ```"
|
|
4776
|
+
},
|
|
4472
4777
|
{
|
|
4473
4778
|
"path": "design.create.walls",
|
|
4474
4779
|
"namespace": "design.create",
|
|
@@ -4483,7 +4788,8 @@
|
|
|
4483
4788
|
"Build the perimeter in exposed concrete walls\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```"
|
|
4484
4789
|
],
|
|
4485
4790
|
"argsType": "ProfileHandle",
|
|
4486
|
-
"resultType": "ComponentHandle[]"
|
|
4791
|
+
"resultType": "ComponentHandle[]",
|
|
4792
|
+
"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
4793
|
},
|
|
4488
4794
|
{
|
|
4489
4795
|
"path": "design.create.window",
|
|
@@ -4498,7 +4804,23 @@
|
|
|
4498
4804
|
"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
4805
|
],
|
|
4500
4806
|
"argsType": "string",
|
|
4501
|
-
"resultType": "ComponentHandle"
|
|
4807
|
+
"resultType": "ComponentHandle",
|
|
4808
|
+
"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."
|
|
4809
|
+
},
|
|
4810
|
+
{
|
|
4811
|
+
"path": "design.create.windows",
|
|
4812
|
+
"namespace": "design.create",
|
|
4813
|
+
"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.",
|
|
4814
|
+
"examplePrompts": [
|
|
4815
|
+
"Add windows along this whole facade at once",
|
|
4816
|
+
"Place a window in every bedroom in one operation",
|
|
4817
|
+
"Bulk add the windows from this schedule",
|
|
4818
|
+
"Put four windows on this wall in a single undo step",
|
|
4819
|
+
"Add all the windows with a 0.9m sill height together"
|
|
4820
|
+
],
|
|
4821
|
+
"argsType": "PluginCreateWindowItem[]",
|
|
4822
|
+
"resultType": "ComponentHandle[]",
|
|
4823
|
+
"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
4824
|
},
|
|
4503
4825
|
{
|
|
4504
4826
|
"path": "design.delete.entities",
|
|
@@ -4515,6 +4837,82 @@
|
|
|
4515
4837
|
"resultType": "PluginDesignChangeResult",
|
|
4516
4838
|
"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
4839
|
},
|
|
4840
|
+
{
|
|
4841
|
+
"path": "design.dimensions.create",
|
|
4842
|
+
"namespace": "design.dimensions",
|
|
4843
|
+
"summary": "Draw one dimension line between two world points, anchored to a component.",
|
|
4844
|
+
"examplePrompts": [
|
|
4845
|
+
"Dimension every wall on level 2",
|
|
4846
|
+
"Add a dimension line along this wall",
|
|
4847
|
+
"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```"
|
|
4848
|
+
],
|
|
4849
|
+
"argsType": "Vec3Handle",
|
|
4850
|
+
"resultType": "DimensionHandle"
|
|
4851
|
+
},
|
|
4852
|
+
{
|
|
4853
|
+
"path": "design.dimensions.delete",
|
|
4854
|
+
"namespace": "design.dimensions",
|
|
4855
|
+
"summary": "Delete dimension lines — the same hard removal as selecting them and pressing Delete. Undoable as a **single** entry for the whole batch.",
|
|
4856
|
+
"examplePrompts": [
|
|
4857
|
+
"Remove all dimension lines",
|
|
4858
|
+
"Delete the dimensions on this wall",
|
|
4859
|
+
"Clear the measurements I added to level 2"
|
|
4860
|
+
],
|
|
4861
|
+
"argsType": "DimensionHandle[]",
|
|
4862
|
+
"resultType": "PluginDimensionsChangeResult",
|
|
4863
|
+
"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)) ```"
|
|
4864
|
+
},
|
|
4865
|
+
{
|
|
4866
|
+
"path": "design.dimensions.get",
|
|
4867
|
+
"namespace": "design.dimensions",
|
|
4868
|
+
"summary": "Read one dimension line by handle.",
|
|
4869
|
+
"examplePrompts": [
|
|
4870
|
+
"Read the dimension line I just created",
|
|
4871
|
+
"How long is this dimension and what does its label say?",
|
|
4872
|
+
"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```"
|
|
4873
|
+
],
|
|
4874
|
+
"argsType": "DimensionHandle",
|
|
4875
|
+
"resultType": "PluginDimensionLine | null"
|
|
4876
|
+
},
|
|
4877
|
+
{
|
|
4878
|
+
"path": "design.dimensions.hide",
|
|
4879
|
+
"namespace": "design.dimensions",
|
|
4880
|
+
"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`.",
|
|
4881
|
+
"examplePrompts": [
|
|
4882
|
+
"Hide the dimensions on this storey",
|
|
4883
|
+
"Hide every dimension line while I present",
|
|
4884
|
+
"Temporarily hide the measurements on level 3"
|
|
4885
|
+
],
|
|
4886
|
+
"argsType": "DimensionHandle[]",
|
|
4887
|
+
"resultType": "PluginDimensionsChangeResult",
|
|
4888
|
+
"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)) ```"
|
|
4889
|
+
},
|
|
4890
|
+
{
|
|
4891
|
+
"path": "design.dimensions.list",
|
|
4892
|
+
"namespace": "design.dimensions",
|
|
4893
|
+
"summary": "List the dimension lines in the project as full records.",
|
|
4894
|
+
"examplePrompts": [
|
|
4895
|
+
"List all the dimension lines in this model",
|
|
4896
|
+
"Which dimensions are on level 3?",
|
|
4897
|
+
"Flag any dimension line shorter than 600 mm"
|
|
4898
|
+
],
|
|
4899
|
+
"argsType": "{\n storeys?: number[]\n anchors?: ComponentHandle[]\n isHidden?: boolean\n }",
|
|
4900
|
+
"resultType": "PluginDimensionLine[]",
|
|
4901
|
+
"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}`)) ```"
|
|
4902
|
+
},
|
|
4903
|
+
{
|
|
4904
|
+
"path": "design.dimensions.show",
|
|
4905
|
+
"namespace": "design.dimensions",
|
|
4906
|
+
"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`.",
|
|
4907
|
+
"examplePrompts": [
|
|
4908
|
+
"Show the dimension lines again",
|
|
4909
|
+
"Unhide all the hidden dimensions",
|
|
4910
|
+
"Bring back the measurements I hid on this storey"
|
|
4911
|
+
],
|
|
4912
|
+
"argsType": "DimensionHandle[]",
|
|
4913
|
+
"resultType": "PluginDimensionsChangeResult",
|
|
4914
|
+
"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)) ```"
|
|
4915
|
+
},
|
|
4518
4916
|
{
|
|
4519
4917
|
"path": "design.doors.exists",
|
|
4520
4918
|
"namespace": "design.doors",
|
|
@@ -4596,7 +4994,7 @@
|
|
|
4596
4994
|
{
|
|
4597
4995
|
"path": "design.doors.getSwingDirection",
|
|
4598
4996
|
"namespace": "design.doors",
|
|
4599
|
-
"summary": "Get a door's swing (hinge) handedness
|
|
4997
|
+
"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
4998
|
"examplePrompts": [
|
|
4601
4999
|
"Which way does this door swing?",
|
|
4602
5000
|
"Is the selected door left-handed or right-handed?",
|
|
@@ -4661,13 +5059,13 @@
|
|
|
4661
5059
|
{
|
|
4662
5060
|
"path": "design.doors.mirror",
|
|
4663
5061
|
"namespace": "design.doors",
|
|
4664
|
-
"summary": "Mirror a door
|
|
5062
|
+
"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
5063
|
"examplePrompts": [
|
|
4666
5064
|
"Flip this door's swing",
|
|
4667
5065
|
"Mirror the selected door",
|
|
4668
5066
|
"Make this door open the other way",
|
|
4669
5067
|
"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\"
|
|
5068
|
+
"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
5069
|
],
|
|
4672
5070
|
"argsType": "ComponentHandle",
|
|
4673
5071
|
"resultType": "PluginDesignChangeResult"
|
|
@@ -4742,7 +5140,7 @@
|
|
|
4742
5140
|
{
|
|
4743
5141
|
"path": "design.family.create",
|
|
4744
5142
|
"namespace": "design.family",
|
|
4745
|
-
"summary": "Commit the prepared bundle to the project's parametric-definition library, so it survives the session and appears in the Families panel.",
|
|
5143
|
+
"summary": "Commit the prepared bundle to the project's parametric-definition library, so it survives the session and appears in the Families panel. Call it BEFORE {@linkcode PluginDesignFamilyApi.place} — only a created family can be placed; `place()` without `id` then places the saved family.",
|
|
4746
5144
|
"examplePrompts": [
|
|
4747
5145
|
"Save this as a family called Vertical Louvre",
|
|
4748
5146
|
"Add it to my library\n\n# Example\n```ts\nconst { definitionId } = await snaptrude.design.family.create({ name: \"Louvre Screen\" })\n```"
|
|
@@ -4816,11 +5214,12 @@
|
|
|
4816
5214
|
{
|
|
4817
5215
|
"path": "design.family.prepare",
|
|
4818
5216
|
"namespace": "design.family",
|
|
4819
|
-
"summary": "Validate, compile and preview a family spec. Nothing is committed to the model or the library — call {@linkcode PluginDesignFamilyApi.
|
|
5217
|
+
"summary": "Validate, compile and preview a family spec. Nothing is committed to the model or the library — call {@linkcode PluginDesignFamilyApi.create} to save it, then {@linkcode PluginDesignFamilyApi.place} to put it in the model.",
|
|
4820
5218
|
"examplePrompts": [
|
|
4821
5219
|
"Make a louvre screen with adjustable blade count and tilt",
|
|
4822
5220
|
"Design a curtain wall panel family with 8 bays",
|
|
4823
|
-
"Create a railing family I can adjust
|
|
5221
|
+
"Create a railing family I can adjust",
|
|
5222
|
+
"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
5223
|
],
|
|
4825
5224
|
"argsType": "PluginDesignFamilyPrepareArgs",
|
|
4826
5225
|
"resultType": "PluginFamilyPrepareResult"
|
|
@@ -4927,6 +5326,51 @@
|
|
|
4927
5326
|
"argsType": "ComponentHandle",
|
|
4928
5327
|
"resultType": "PluginDesignChangeResult"
|
|
4929
5328
|
},
|
|
5329
|
+
{
|
|
5330
|
+
"path": "design.grids.addLine",
|
|
5331
|
+
"namespace": "design.grids",
|
|
5332
|
+
"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.",
|
|
5333
|
+
"examplePrompts": [
|
|
5334
|
+
"Add a grid line between lines 2 and 3",
|
|
5335
|
+
"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```"
|
|
5336
|
+
],
|
|
5337
|
+
"argsType": "ComponentHandle",
|
|
5338
|
+
"resultType": "boolean"
|
|
5339
|
+
},
|
|
5340
|
+
{
|
|
5341
|
+
"path": "design.grids.removeLines",
|
|
5342
|
+
"namespace": "design.grids",
|
|
5343
|
+
"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.",
|
|
5344
|
+
"examplePrompts": [
|
|
5345
|
+
"Delete grid line B",
|
|
5346
|
+
"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```"
|
|
5347
|
+
],
|
|
5348
|
+
"argsType": "ComponentHandle",
|
|
5349
|
+
"resultType": "boolean"
|
|
5350
|
+
},
|
|
5351
|
+
{
|
|
5352
|
+
"path": "design.grids.updateLines",
|
|
5353
|
+
"namespace": "design.grids",
|
|
5354
|
+
"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.",
|
|
5355
|
+
"examplePrompts": [
|
|
5356
|
+
"Rename grid line 2 to \"B\"",
|
|
5357
|
+
"Move this grid line 4 metres from its neighbour",
|
|
5358
|
+
"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```"
|
|
5359
|
+
],
|
|
5360
|
+
"argsType": "ComponentHandle",
|
|
5361
|
+
"resultType": "boolean"
|
|
5362
|
+
},
|
|
5363
|
+
{
|
|
5364
|
+
"path": "design.grids.updateWings",
|
|
5365
|
+
"namespace": "design.grids",
|
|
5366
|
+
"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.",
|
|
5367
|
+
"examplePrompts": [
|
|
5368
|
+
"Change this grid's spacing to 8 metres",
|
|
5369
|
+
"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```"
|
|
5370
|
+
],
|
|
5371
|
+
"argsType": "ComponentHandle",
|
|
5372
|
+
"resultType": "boolean"
|
|
5373
|
+
},
|
|
4930
5374
|
{
|
|
4931
5375
|
"path": "design.isAreaLocked",
|
|
4932
5376
|
"namespace": "design",
|
|
@@ -5230,6 +5674,7 @@
|
|
|
5230
5674
|
"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
5675
|
"examplePrompts": [
|
|
5232
5676
|
"Get the 3D solid geometry of the selected wall",
|
|
5677
|
+
"Round the top rim of this column and put it back where it is",
|
|
5233
5678
|
"How many faces does this mass have?",
|
|
5234
5679
|
"Inspect the mesh of this slab so I can look at its faces and edges",
|
|
5235
5680
|
"Read the vertices of the selected column's geometry"
|
|
@@ -5254,7 +5699,7 @@
|
|
|
5254
5699
|
{
|
|
5255
5700
|
"path": "design.query.geometry.getTriangulatedMeshes",
|
|
5256
5701
|
"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.",
|
|
5702
|
+
"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
5703
|
"examplePrompts": [
|
|
5259
5704
|
"Export the selected masses as a triangle mesh",
|
|
5260
5705
|
"Get the raw vertices and triangles of this wall in world coordinates",
|
|
@@ -5341,6 +5786,19 @@
|
|
|
5341
5786
|
"argsType": "ComponentHandle",
|
|
5342
5787
|
"resultType": "string"
|
|
5343
5788
|
},
|
|
5789
|
+
{
|
|
5790
|
+
"path": "design.query.getParameters",
|
|
5791
|
+
"namespace": "design.query",
|
|
5792
|
+
"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.",
|
|
5793
|
+
"examplePrompts": [
|
|
5794
|
+
"What radius is this sphere?",
|
|
5795
|
+
"Is this mass parametric?",
|
|
5796
|
+
"Read back the dome's creation parameters",
|
|
5797
|
+
"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```"
|
|
5798
|
+
],
|
|
5799
|
+
"argsType": "ComponentHandle",
|
|
5800
|
+
"resultType": "MassParametersRecord | null"
|
|
5801
|
+
},
|
|
5344
5802
|
{
|
|
5345
5803
|
"path": "design.query.getProperties",
|
|
5346
5804
|
"namespace": "design.query",
|
|
@@ -5369,6 +5827,19 @@
|
|
|
5369
5827
|
"argsType": "ComponentHandle",
|
|
5370
5828
|
"resultType": "PluginStaircaseParams | null"
|
|
5371
5829
|
},
|
|
5830
|
+
{
|
|
5831
|
+
"path": "design.query.grids.get",
|
|
5832
|
+
"namespace": "design.query.grids",
|
|
5833
|
+
"summary": "Get properties of a grid by its ID.",
|
|
5834
|
+
"examplePrompts": [
|
|
5835
|
+
"What is the spacing of this grid?",
|
|
5836
|
+
"Read the grid line tags on this structural grid",
|
|
5837
|
+
"Get the geometry of every line in this grid",
|
|
5838
|
+
"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```"
|
|
5839
|
+
],
|
|
5840
|
+
"argsType": "string",
|
|
5841
|
+
"resultType": "PluginGridGetResult"
|
|
5842
|
+
},
|
|
5372
5843
|
{
|
|
5373
5844
|
"path": "design.query.listBeams",
|
|
5374
5845
|
"namespace": "design.query",
|
|
@@ -5487,6 +5958,19 @@
|
|
|
5487
5958
|
"argsType": "PluginEntityFilter",
|
|
5488
5959
|
"resultType": "ComponentHandle[]"
|
|
5489
5960
|
},
|
|
5961
|
+
{
|
|
5962
|
+
"path": "design.query.listGrids",
|
|
5963
|
+
"namespace": "design.query",
|
|
5964
|
+
"summary": "List all the structural grids (grid groups) in the project, optionally filtered by storey, building, selection state, or region.",
|
|
5965
|
+
"examplePrompts": [
|
|
5966
|
+
"List all the structural grids in the model",
|
|
5967
|
+
"How many grids are on the ground floor?",
|
|
5968
|
+
"Show the grids on this storey",
|
|
5969
|
+
"Which grids are currently selected?\n\n# Example\n```ts\nconst groundFloorGrids = await snaptrude.design.query.listGrids({ storeys: [1] })\n```"
|
|
5970
|
+
],
|
|
5971
|
+
"argsType": "PluginEntityFilter",
|
|
5972
|
+
"resultType": "ComponentHandle[]"
|
|
5973
|
+
},
|
|
5490
5974
|
{
|
|
5491
5975
|
"path": "design.query.listMasses",
|
|
5492
5976
|
"namespace": "design.query",
|
|
@@ -5918,6 +6402,31 @@
|
|
|
5918
6402
|
"argsType": "ComponentHandle",
|
|
5919
6403
|
"resultType": "PluginDesignChangeResult"
|
|
5920
6404
|
},
|
|
6405
|
+
{
|
|
6406
|
+
"path": "design.update.grid",
|
|
6407
|
+
"namespace": "design.update",
|
|
6408
|
+
"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}.",
|
|
6409
|
+
"examplePrompts": [
|
|
6410
|
+
"Rotate the grid to 45 degrees",
|
|
6411
|
+
"Make this grid's lines dashed and grey",
|
|
6412
|
+
"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```"
|
|
6413
|
+
],
|
|
6414
|
+
"argsType": "ComponentHandle",
|
|
6415
|
+
"resultType": "boolean"
|
|
6416
|
+
},
|
|
6417
|
+
{
|
|
6418
|
+
"path": "design.update.parameters",
|
|
6419
|
+
"namespace": "design.update",
|
|
6420
|
+
"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.",
|
|
6421
|
+
"examplePrompts": [
|
|
6422
|
+
"Make the dome's radius 8 metres",
|
|
6423
|
+
"Raise the podium to 5 m",
|
|
6424
|
+
"Widen the vase — move its profile points 20 cm outward",
|
|
6425
|
+
"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```"
|
|
6426
|
+
],
|
|
6427
|
+
"argsType": "ComponentHandle",
|
|
6428
|
+
"resultType": "MassParametersRecord"
|
|
6429
|
+
},
|
|
5921
6430
|
{
|
|
5922
6431
|
"path": "design.update.roof",
|
|
5923
6432
|
"namespace": "design.update",
|
|
@@ -7602,6 +8111,18 @@
|
|
|
7602
8111
|
"argsType": "string",
|
|
7603
8112
|
"resultType": "PluginProgramDepartmentsSetTargetAreaResult"
|
|
7604
8113
|
},
|
|
8114
|
+
{
|
|
8115
|
+
"path": "program.departments.setTargetCount",
|
|
8116
|
+
"namespace": "program.departments",
|
|
8117
|
+
"summary": "Set a department's target unit count.",
|
|
8118
|
+
"examplePrompts": [
|
|
8119
|
+
"Set the Bedrooms department unit count to 12",
|
|
8120
|
+
"The program needs 4 clinic blocks — update the department count",
|
|
8121
|
+
"Update the target count for department dep_123\n\n# Example\n```ts\nawait snaptrude.program.departments.setTargetCount(\"dep_123\", 12)\n```"
|
|
8122
|
+
],
|
|
8123
|
+
"argsType": "string",
|
|
8124
|
+
"resultType": "PluginProgramDepartmentsSetTargetCountResult"
|
|
8125
|
+
},
|
|
7605
8126
|
{
|
|
7606
8127
|
"path": "program.departments.unassign",
|
|
7607
8128
|
"namespace": "program.departments",
|
|
@@ -7628,6 +8149,65 @@
|
|
|
7628
8149
|
"argsType": "string",
|
|
7629
8150
|
"resultType": "PluginProgramDepartmentsUpdateResult"
|
|
7630
8151
|
},
|
|
8152
|
+
{
|
|
8153
|
+
"path": "program.labels.create",
|
|
8154
|
+
"namespace": "program.labels",
|
|
8155
|
+
"summary": "Create labels (program rows), optionally creating their spaces too.",
|
|
8156
|
+
"examplePrompts": [
|
|
8157
|
+
"Add program rows for 4 exam rooms of 120 sqft each",
|
|
8158
|
+
"Create the labels from this interpreted program",
|
|
8159
|
+
"Add an Office label with a 2000 sqft target to the Admin department",
|
|
8160
|
+
"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```"
|
|
8161
|
+
],
|
|
8162
|
+
"argsType": "PluginProgramLabelCreateItem[]",
|
|
8163
|
+
"resultType": "PluginProgramLabelsCreateResult"
|
|
8164
|
+
},
|
|
8165
|
+
{
|
|
8166
|
+
"path": "program.labels.get",
|
|
8167
|
+
"namespace": "program.labels",
|
|
8168
|
+
"summary": "Get a single label by id.",
|
|
8169
|
+
"examplePrompts": [
|
|
8170
|
+
"Get the label with id lbl_12",
|
|
8171
|
+
"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```"
|
|
8172
|
+
],
|
|
8173
|
+
"argsType": "string",
|
|
8174
|
+
"resultType": "PluginProgramLabelsGetResult"
|
|
8175
|
+
},
|
|
8176
|
+
{
|
|
8177
|
+
"path": "program.labels.list",
|
|
8178
|
+
"namespace": "program.labels",
|
|
8179
|
+
"summary": "List the labels (program rows) of the active program.",
|
|
8180
|
+
"examplePrompts": [
|
|
8181
|
+
"List all the program rows with their target areas",
|
|
8182
|
+
"What space labels are in the program and how many of each?",
|
|
8183
|
+
"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```"
|
|
8184
|
+
],
|
|
8185
|
+
"argsType": null,
|
|
8186
|
+
"resultType": "PluginProgramLabelsListResult"
|
|
8187
|
+
},
|
|
8188
|
+
{
|
|
8189
|
+
"path": "program.labels.setTargetArea",
|
|
8190
|
+
"namespace": "program.labels",
|
|
8191
|
+
"summary": "Set a label's total target area.",
|
|
8192
|
+
"examplePrompts": [
|
|
8193
|
+
"Set the Exam Room target area to 480 sqft",
|
|
8194
|
+
"Give the Corridor program row a 150 sqm target",
|
|
8195
|
+
"Update the area target for label lbl_12\n\n# Example\n```ts\nawait snaptrude.program.labels.setTargetArea(\"lbl_12\", 480, \"ft2\")\n```"
|
|
8196
|
+
],
|
|
8197
|
+
"argsType": "string",
|
|
8198
|
+
"resultType": "PluginProgramLabelsSetTargetAreaResult"
|
|
8199
|
+
},
|
|
8200
|
+
{
|
|
8201
|
+
"path": "program.labels.setTargetCount",
|
|
8202
|
+
"namespace": "program.labels",
|
|
8203
|
+
"summary": "Set a label's target unit count (how many of this space the program calls for).",
|
|
8204
|
+
"examplePrompts": [
|
|
8205
|
+
"Set the Exam Room count to 6",
|
|
8206
|
+
"The program needs 12 patient rooms — update the count\n\n# Example\n```ts\nawait snaptrude.program.labels.setTargetCount(\"lbl_12\", 6)\n```"
|
|
8207
|
+
],
|
|
8208
|
+
"argsType": "string",
|
|
8209
|
+
"resultType": "PluginProgramLabelsSetTargetCountResult"
|
|
8210
|
+
},
|
|
7631
8211
|
{
|
|
7632
8212
|
"path": "program.layout.applySolution",
|
|
7633
8213
|
"namespace": "program.layout",
|
|
@@ -7701,6 +8281,81 @@
|
|
|
7701
8281
|
"argsType": null,
|
|
7702
8282
|
"resultType": "PluginProgramLayoutStackResult"
|
|
7703
8283
|
},
|
|
8284
|
+
{
|
|
8285
|
+
"path": "program.metadata.createHeader",
|
|
8286
|
+
"namespace": "program.metadata",
|
|
8287
|
+
"summary": "Create a metadata header (a custom column on the Program Data sheet).",
|
|
8288
|
+
"examplePrompts": [
|
|
8289
|
+
"Add a custom column called Occupancy to the program sheet",
|
|
8290
|
+
"Create a metadata header named Department Code",
|
|
8291
|
+
"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```"
|
|
8292
|
+
],
|
|
8293
|
+
"argsType": "string",
|
|
8294
|
+
"resultType": "PluginProgramMetadataCreateHeaderResult"
|
|
8295
|
+
},
|
|
8296
|
+
{
|
|
8297
|
+
"path": "program.metadata.get",
|
|
8298
|
+
"namespace": "program.metadata",
|
|
8299
|
+
"summary": "Get one space's metadata values, keyed by header id.",
|
|
8300
|
+
"examplePrompts": [
|
|
8301
|
+
"Get the metadata on this space",
|
|
8302
|
+
"Read the custom column values for space sp_12",
|
|
8303
|
+
"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```"
|
|
8304
|
+
],
|
|
8305
|
+
"argsType": "ComponentHandle",
|
|
8306
|
+
"resultType": "PluginProgramMetadataGetResult"
|
|
8307
|
+
},
|
|
8308
|
+
{
|
|
8309
|
+
"path": "program.metadata.list",
|
|
8310
|
+
"namespace": "program.metadata",
|
|
8311
|
+
"summary": "List metadata values for many spaces at once.",
|
|
8312
|
+
"examplePrompts": [
|
|
8313
|
+
"List the metadata of every space",
|
|
8314
|
+
"Read the custom column values for all rooms",
|
|
8315
|
+
"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```"
|
|
8316
|
+
],
|
|
8317
|
+
"argsType": "ComponentHandle[]",
|
|
8318
|
+
"resultType": "PluginProgramMetadataListResult",
|
|
8319
|
+
"performance": "One round-trip for any number of spaces — use this instead of a `get` loop."
|
|
8320
|
+
},
|
|
8321
|
+
{
|
|
8322
|
+
"path": "program.metadata.listHeaders",
|
|
8323
|
+
"namespace": "program.metadata",
|
|
8324
|
+
"summary": "List the metadata headers (custom columns) of the Program Data sheet.",
|
|
8325
|
+
"examplePrompts": [
|
|
8326
|
+
"List the custom metadata columns in program mode",
|
|
8327
|
+
"What metadata headers does the program sheet have?",
|
|
8328
|
+
"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```"
|
|
8329
|
+
],
|
|
8330
|
+
"argsType": null,
|
|
8331
|
+
"resultType": "PluginProgramMetadataListHeadersResult"
|
|
8332
|
+
},
|
|
8333
|
+
{
|
|
8334
|
+
"path": "program.metadata.update",
|
|
8335
|
+
"namespace": "program.metadata",
|
|
8336
|
+
"summary": "Update a space's metadata values (sparse).",
|
|
8337
|
+
"examplePrompts": [
|
|
8338
|
+
"Set the Occupancy metadata of this space to 4",
|
|
8339
|
+
"Store a department code on the selected rooms",
|
|
8340
|
+
"Write custom column values onto space sp_12",
|
|
8341
|
+
"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```"
|
|
8342
|
+
],
|
|
8343
|
+
"argsType": "ComponentHandle",
|
|
8344
|
+
"resultType": "PluginProgramMetadataUpdateResult"
|
|
8345
|
+
},
|
|
8346
|
+
{
|
|
8347
|
+
"path": "program.metadata.updateMany",
|
|
8348
|
+
"namespace": "program.metadata",
|
|
8349
|
+
"summary": "Update metadata values on many spaces in one undoable step.",
|
|
8350
|
+
"examplePrompts": [
|
|
8351
|
+
"Fill the Occupancy column for all bedrooms",
|
|
8352
|
+
"Write metadata onto every selected space at once",
|
|
8353
|
+
"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```"
|
|
8354
|
+
],
|
|
8355
|
+
"argsType": "PluginProgramMetadataUpdateItem[]",
|
|
8356
|
+
"resultType": "PluginProgramMetadataUpdateManyResult",
|
|
8357
|
+
"performance": "One round-trip and one undo step for up to 1000 spaces — use this instead of an `update` loop."
|
|
8358
|
+
},
|
|
7704
8359
|
{
|
|
7705
8360
|
"path": "program.metrics.get",
|
|
7706
8361
|
"namespace": "program.metrics",
|
|
@@ -7939,6 +8594,19 @@
|
|
|
7939
8594
|
"argsType": "{\n name?: string\n }",
|
|
7940
8595
|
"resultType": "PluginProgramSpreadsheetBindingsRefreshResult"
|
|
7941
8596
|
},
|
|
8597
|
+
{
|
|
8598
|
+
"path": "program.spreadsheet.createCustomSheet",
|
|
8599
|
+
"namespace": "program.spreadsheet",
|
|
8600
|
+
"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*).",
|
|
8601
|
+
"examplePrompts": [
|
|
8602
|
+
"Create a custom sheet grouped by department then sub-department",
|
|
8603
|
+
"Make a program view grouped by storey and label",
|
|
8604
|
+
"Build a grouped program sheet for the healthcare hierarchy",
|
|
8605
|
+
"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```"
|
|
8606
|
+
],
|
|
8607
|
+
"argsType": "string",
|
|
8608
|
+
"resultType": "PluginProgramSpreadsheetCustomSheetResult"
|
|
8609
|
+
},
|
|
7942
8610
|
{
|
|
7943
8611
|
"path": "program.spreadsheet.createSheet",
|
|
7944
8612
|
"namespace": "program.spreadsheet",
|
|
@@ -8004,6 +8672,17 @@
|
|
|
8004
8672
|
"argsType": "{\n limit?: number\n }",
|
|
8005
8673
|
"resultType": "PluginProgramSpreadsheetGetAuditLogResult"
|
|
8006
8674
|
},
|
|
8675
|
+
{
|
|
8676
|
+
"path": "program.spreadsheet.getCustomSheet",
|
|
8677
|
+
"namespace": "program.spreadsheet",
|
|
8678
|
+
"summary": "Get a custom program sheet's configuration.",
|
|
8679
|
+
"examplePrompts": [
|
|
8680
|
+
"How is the Clinical Program sheet grouped?",
|
|
8681
|
+
"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```"
|
|
8682
|
+
],
|
|
8683
|
+
"argsType": "string",
|
|
8684
|
+
"resultType": "PluginProgramSpreadsheetGetCustomSheetResult"
|
|
8685
|
+
},
|
|
8007
8686
|
{
|
|
8008
8687
|
"path": "program.spreadsheet.getMaterialTakeoff",
|
|
8009
8688
|
"namespace": "program.spreadsheet",
|
|
@@ -8070,6 +8749,28 @@
|
|
|
8070
8749
|
"argsType": "string",
|
|
8071
8750
|
"resultType": "PluginProgramSpreadsheetHighlightCellsResult"
|
|
8072
8751
|
},
|
|
8752
|
+
{
|
|
8753
|
+
"path": "program.spreadsheet.listCustomSheetProperties",
|
|
8754
|
+
"namespace": "program.spreadsheet",
|
|
8755
|
+
"summary": "List the property ids a custom program sheet can show as columns or group by.",
|
|
8756
|
+
"examplePrompts": [
|
|
8757
|
+
"What can I group a custom program sheet by?",
|
|
8758
|
+
"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```"
|
|
8759
|
+
],
|
|
8760
|
+
"argsType": null,
|
|
8761
|
+
"resultType": "PluginProgramSpreadsheetListCustomSheetPropertiesResult"
|
|
8762
|
+
},
|
|
8763
|
+
{
|
|
8764
|
+
"path": "program.spreadsheet.listCustomSheets",
|
|
8765
|
+
"namespace": "program.spreadsheet",
|
|
8766
|
+
"summary": "List the custom program sheets in the workbook with their configurations.",
|
|
8767
|
+
"examplePrompts": [
|
|
8768
|
+
"List the custom program sheets",
|
|
8769
|
+
"Which sheets are grouped program views?\n\n# Example\n```ts\nconst { sheets } = await snaptrude.program.spreadsheet.listCustomSheets()\n```"
|
|
8770
|
+
],
|
|
8771
|
+
"argsType": null,
|
|
8772
|
+
"resultType": "PluginProgramSpreadsheetListCustomSheetsResult"
|
|
8773
|
+
},
|
|
8073
8774
|
{
|
|
8074
8775
|
"path": "program.spreadsheet.listSheets",
|
|
8075
8776
|
"namespace": "program.spreadsheet",
|
|
@@ -8246,6 +8947,18 @@
|
|
|
8246
8947
|
"argsType": "PluginSpreadsheetTransactionOp[]",
|
|
8247
8948
|
"resultType": "PluginProgramSpreadsheetTransactionResult"
|
|
8248
8949
|
},
|
|
8950
|
+
{
|
|
8951
|
+
"path": "program.spreadsheet.updateCustomSheet",
|
|
8952
|
+
"namespace": "program.spreadsheet",
|
|
8953
|
+
"summary": "Update a custom program sheet's group-by hierarchy, columns, or group colors.",
|
|
8954
|
+
"examplePrompts": [
|
|
8955
|
+
"Change the custom sheet to group by storey first",
|
|
8956
|
+
"Add the Occupancy column to my grouped program sheet",
|
|
8957
|
+
"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```"
|
|
8958
|
+
],
|
|
8959
|
+
"argsType": "string",
|
|
8960
|
+
"resultType": "PluginProgramSpreadsheetCustomSheetResult"
|
|
8961
|
+
},
|
|
8249
8962
|
{
|
|
8250
8963
|
"path": "workspace.closePresentMode",
|
|
8251
8964
|
"namespace": "workspace",
|
|
@@ -8258,6 +8971,17 @@
|
|
|
8258
8971
|
"argsType": null,
|
|
8259
8972
|
"resultType": "void"
|
|
8260
8973
|
},
|
|
8974
|
+
{
|
|
8975
|
+
"path": "workspace.closeProgramMode",
|
|
8976
|
+
"namespace": "workspace",
|
|
8977
|
+
"summary": "Close the Program tab.",
|
|
8978
|
+
"examplePrompts": [
|
|
8979
|
+
"Close program mode",
|
|
8980
|
+
"Close the Program tab\n\n# Example\n```ts\nawait snaptrude.workspace.closeProgramMode()\n```"
|
|
8981
|
+
],
|
|
8982
|
+
"argsType": null,
|
|
8983
|
+
"resultType": "void"
|
|
8984
|
+
},
|
|
8261
8985
|
{
|
|
8262
8986
|
"path": "workspace.openPresentMode",
|
|
8263
8987
|
"namespace": "workspace",
|
|
@@ -8270,6 +8994,18 @@
|
|
|
8270
8994
|
"argsType": null,
|
|
8271
8995
|
"resultType": "void"
|
|
8272
8996
|
},
|
|
8997
|
+
{
|
|
8998
|
+
"path": "workspace.openProgramMode",
|
|
8999
|
+
"namespace": "workspace",
|
|
9000
|
+
"summary": "Open Program mode — the Program tab the `program.spreadsheet.*` calls run in.",
|
|
9001
|
+
"examplePrompts": [
|
|
9002
|
+
"Open program mode",
|
|
9003
|
+
"Open the Program tab so I can build a custom sheet",
|
|
9004
|
+
"Switch to the program spreadsheet\n\n# Example\n```ts\nawait snaptrude.workspace.openProgramMode()\nconst { sheets } = await snaptrude.program.spreadsheet.listSheets()\n```"
|
|
9005
|
+
],
|
|
9006
|
+
"argsType": null,
|
|
9007
|
+
"resultType": "void"
|
|
9008
|
+
},
|
|
8273
9009
|
{
|
|
8274
9010
|
"path": "workspace.projects.copy",
|
|
8275
9011
|
"namespace": "workspace.projects",
|