@snaptrude/plugin-core 0.9.1 → 0.9.2
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 +6 -0
- package/api-manifest.full.json +411 -2
- package/api-manifest.json +100 -3
- package/dist/api/core/geom/create/index.d.ts +406 -11
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/brep.d.ts +44 -0
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/io/terrain/index.d.ts +4 -1
- package/dist/api/core/io/terrain/index.d.ts.map +1 -1
- package/dist/index.cjs +61 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +53 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/core/geom/create/index.ts +445 -10
- package/src/api/core/geom/query/brep.ts +45 -0
- package/src/api/core/io/terrain/index.ts +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @snaptrude/plugin-core
|
|
2
2
|
|
|
3
|
+
## 0.9.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5b91c7b: OCC geometry batch: new `core.geom.create` brep constructors — `brepFromFillet`, `brepFromChamfer`, `brepFromOffset`, `brepFromShell`, `brepsFromSplit`, `brepFromSweep`, `brepFromRevolution`; `brepFromLoft` widened with optional `intermediateContours` (multi-section lofts); new `core.geom.query.brep.getDistance` (minimum distance between two solids with witness points).
|
|
8
|
+
|
|
3
9
|
## 0.9.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/api-manifest.full.json
CHANGED
|
@@ -715,6 +715,18 @@
|
|
|
715
715
|
"argsType": "Vec3Handle",
|
|
716
716
|
"resultType": "ArcHandle"
|
|
717
717
|
},
|
|
718
|
+
{
|
|
719
|
+
"path": "core.geom.create.brepFromChamfer",
|
|
720
|
+
"namespace": "core.geom.create",
|
|
721
|
+
"summary": "Bevels the given straight edges of a solid with a symmetric planar cut. Host API call — returns a new {@linkcode BrepHandle}; the input brep is read-only.",
|
|
722
|
+
"examplePrompts": [
|
|
723
|
+
"Bevel these edges by 100mm",
|
|
724
|
+
"Chamfer the top edges of the plinth",
|
|
725
|
+
"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```"
|
|
726
|
+
],
|
|
727
|
+
"argsType": "BrepHandle",
|
|
728
|
+
"resultType": "BrepHandle"
|
|
729
|
+
},
|
|
718
730
|
{
|
|
719
731
|
"path": "core.geom.create.brepFromExtrusion",
|
|
720
732
|
"namespace": "core.geom.create",
|
|
@@ -739,6 +751,18 @@
|
|
|
739
751
|
"argsType": "Vec3Components[][]",
|
|
740
752
|
"resultType": "BrepHandle"
|
|
741
753
|
},
|
|
754
|
+
{
|
|
755
|
+
"path": "core.geom.create.brepFromFillet",
|
|
756
|
+
"namespace": "core.geom.create",
|
|
757
|
+
"summary": "Rounds the given straight edges of a solid with a constant radius. Host API call — returns a new {@linkcode BrepHandle}; the input brep is read-only.",
|
|
758
|
+
"examplePrompts": [
|
|
759
|
+
"Round the edges of this mass",
|
|
760
|
+
"Fillet the corners of the podium with a 0.5m radius",
|
|
761
|
+
"Soften the vertical edges of this tower\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 rounded = await snaptrude.core.geom.create.brepFromFillet(brep, [edges[0]], 0.3)\n```"
|
|
762
|
+
],
|
|
763
|
+
"argsType": "BrepHandle",
|
|
764
|
+
"resultType": "BrepHandle"
|
|
765
|
+
},
|
|
742
766
|
{
|
|
743
767
|
"path": "core.geom.create.brepFromIntersection",
|
|
744
768
|
"namespace": "core.geom.create",
|
|
@@ -754,11 +778,12 @@
|
|
|
754
778
|
{
|
|
755
779
|
"path": "core.geom.create.brepFromLoft",
|
|
756
780
|
"namespace": "core.geom.create",
|
|
757
|
-
"summary": "Create a closed solid **B-rep** by lofting between a bottom and a top contour. Host API call — returns a {@linkcode BrepHandle}.
|
|
781
|
+
"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}. All sections must have the same number of edges; side faces connect corresponding edges by authored index. Corresponding edges must stay coplanar segment to segment (matching hole counts allowed in the two-section form) — a twisted loft would produce non-planar side faces and is rejected. 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.",
|
|
758
782
|
"examplePrompts": [
|
|
759
783
|
"Make a tapered tower from these two outlines",
|
|
760
784
|
"Loft between a large base and a smaller top",
|
|
761
|
-
"Create a frustum from two squares
|
|
785
|
+
"Create a frustum from two squares",
|
|
786
|
+
"Loft the tower through these three floor outlines\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```"
|
|
762
787
|
],
|
|
763
788
|
"argsType": "ContourHandle",
|
|
764
789
|
"resultType": "BrepHandle"
|
|
@@ -775,6 +800,42 @@
|
|
|
775
800
|
"argsType": "Vec3Components[]",
|
|
776
801
|
"resultType": "BrepHandle"
|
|
777
802
|
},
|
|
803
|
+
{
|
|
804
|
+
"path": "core.geom.create.brepFromOffset",
|
|
805
|
+
"namespace": "core.geom.create",
|
|
806
|
+
"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.",
|
|
807
|
+
"examplePrompts": [
|
|
808
|
+
"Grow this solid by 0.5m in every direction",
|
|
809
|
+
"Shrink this mass by 200mm",
|
|
810
|
+
"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```"
|
|
811
|
+
],
|
|
812
|
+
"argsType": "BrepHandle",
|
|
813
|
+
"resultType": "BrepHandle"
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
"path": "core.geom.create.brepFromRevolution",
|
|
817
|
+
"namespace": "core.geom.create",
|
|
818
|
+
"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. Profile segments must stay parallel or perpendicular to the axis — inclined or arc segments would revolve into surfaces Snaptrude cannot represent.",
|
|
819
|
+
"examplePrompts": [
|
|
820
|
+
"Create a dome from this section",
|
|
821
|
+
"Revolve this profile 360 degrees around the vertical axis",
|
|
822
|
+
"Build a rotunda by revolving this wall section\n\n# Example\n```ts\n// A cylinder: revolve a 2m-wide, 3m-tall rectangle about the Y axis at its edge\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```"
|
|
823
|
+
],
|
|
824
|
+
"argsType": "ContourHandle",
|
|
825
|
+
"resultType": "BrepHandle"
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
"path": "core.geom.create.brepFromShell",
|
|
829
|
+
"namespace": "core.geom.create",
|
|
830
|
+
"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.",
|
|
831
|
+
"examplePrompts": [
|
|
832
|
+
"Hollow this mass into 200mm walls",
|
|
833
|
+
"Shell this form with the top face open",
|
|
834
|
+
"Turn this solid tower into a tube open at both ends\n\n# Example\n```ts\nconst brep = await snaptrude.core.geom.create.brepFromExtrusion(contour, { x: 0, y: 1, z: 0 }, 3)\nconst faces = await snaptrude.core.geom.query.brep.listFaces(brep)\nconst hollow = await snaptrude.core.geom.create.brepFromShell(brep, [faces[0]], 0.2)\n```"
|
|
835
|
+
],
|
|
836
|
+
"argsType": "BrepHandle",
|
|
837
|
+
"resultType": "BrepHandle"
|
|
838
|
+
},
|
|
778
839
|
{
|
|
779
840
|
"path": "core.geom.create.brepFromSubtraction",
|
|
780
841
|
"namespace": "core.geom.create",
|
|
@@ -787,6 +848,18 @@
|
|
|
787
848
|
"argsType": "BrepHandle",
|
|
788
849
|
"resultType": "BrepHandle"
|
|
789
850
|
},
|
|
851
|
+
{
|
|
852
|
+
"path": "core.geom.create.brepFromSweep",
|
|
853
|
+
"namespace": "core.geom.create",
|
|
854
|
+
"summary": "Sweeps a planar profile along an open 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.",
|
|
855
|
+
"examplePrompts": [
|
|
856
|
+
"Sweep this profile along the corridor path",
|
|
857
|
+
"Extrude the railing section along this route",
|
|
858
|
+
"Run a duct profile through these points\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```"
|
|
859
|
+
],
|
|
860
|
+
"argsType": "ContourHandle",
|
|
861
|
+
"resultType": "BrepHandle"
|
|
862
|
+
},
|
|
790
863
|
{
|
|
791
864
|
"path": "core.geom.create.brepFromUnion",
|
|
792
865
|
"namespace": "core.geom.create",
|
|
@@ -799,6 +872,18 @@
|
|
|
799
872
|
"argsType": "BrepHandle",
|
|
800
873
|
"resultType": "BrepHandle"
|
|
801
874
|
},
|
|
875
|
+
{
|
|
876
|
+
"path": "core.geom.create.brepsFromSplit",
|
|
877
|
+
"namespace": "core.geom.create",
|
|
878
|
+
"summary": "Cuts a solid by an infinite plane and returns one brep per resulting piece — a single piece if the plane misses the solid. Host API call — returns new {@linkcode BrepHandle}s; the input brep is read-only. The plane is defined by a point on it and its normal direction.",
|
|
879
|
+
"examplePrompts": [
|
|
880
|
+
"Cut this building at 12m height",
|
|
881
|
+
"Split the tower from the podium with a horizontal plane",
|
|
882
|
+
"Slice this mass along a vertical plane\n\n# Example\n```ts\nconst pieces = await snaptrude.core.geom.create.brepsFromSplit(\ntowerBrep,\n{ x: 0, y: 12, z: 0 },\n{ x: 0, y: 1, z: 0 },\n)\nconsole.log(\"pieces:\", pieces.length)\n```"
|
|
883
|
+
],
|
|
884
|
+
"argsType": "BrepHandle",
|
|
885
|
+
"resultType": "BrepHandle[]"
|
|
886
|
+
},
|
|
802
887
|
{
|
|
803
888
|
"path": "core.geom.create.circle",
|
|
804
889
|
"namespace": "core.geom.create",
|
|
@@ -961,6 +1046,18 @@
|
|
|
961
1046
|
"argsType": "BrepHandle",
|
|
962
1047
|
"resultType": "Vec3Components"
|
|
963
1048
|
},
|
|
1049
|
+
{
|
|
1050
|
+
"path": "core.geom.query.brep.getDistance",
|
|
1051
|
+
"namespace": "core.geom.query.brep",
|
|
1052
|
+
"summary": "Measures the minimum distance between two solids, with the closest witness point on each. Touching or overlapping solids report a distance of 0 with contact points.",
|
|
1053
|
+
"examplePrompts": [
|
|
1054
|
+
"What is the clearance between these two masses?",
|
|
1055
|
+
"How far apart are the tower and the neighbouring building?",
|
|
1056
|
+
"Find the closest points between these two solids\n\n# Example\n```ts\nconst [a, b] = await snaptrude.design.query.listMasses()\nconst brepA = await snaptrude.design.query.geometry.getBrep(a)\nconst brepB = await snaptrude.design.query.geometry.getBrep(b)\nif (brepA && brepB) {\nconst { distance, pointA, pointB } = await snaptrude.core.geom.query.brep.getDistance(brepA, brepB)\nconsole.log(\"clearance:\", distance)\n}\n```"
|
|
1057
|
+
],
|
|
1058
|
+
"argsType": "BrepHandle",
|
|
1059
|
+
"resultType": "{ distance: number; pointA: Vec3Components; pointB: Vec3Components }"
|
|
1060
|
+
},
|
|
964
1061
|
{
|
|
965
1062
|
"path": "core.geom.query.brep.getEdge",
|
|
966
1063
|
"namespace": "core.geom.query.brep",
|
|
@@ -2750,6 +2847,19 @@
|
|
|
2750
2847
|
"argsType": null,
|
|
2751
2848
|
"resultType": "boolean | null"
|
|
2752
2849
|
},
|
|
2850
|
+
{
|
|
2851
|
+
"path": "core.io.terrain.replaceMesh",
|
|
2852
|
+
"namespace": "core.io.terrain",
|
|
2853
|
+
"summary": "Replace the terrain surface with a caller-supplied triangle mesh. Undoable (one step), and the replacement persists with the project. The returned promise resolves only after the surface is fully applied and recorded — it is safe to toggle terrain resolution or read the surface back the moment it resolves.",
|
|
2854
|
+
"examplePrompts": [
|
|
2855
|
+
"Replace the terrain with this surveyed mesh",
|
|
2856
|
+
"Flatten a building pad into the site surface",
|
|
2857
|
+
"Load a custom DEM surface onto the terrain",
|
|
2858
|
+
"Regrade the terrain from these points\n\n# Example\n```ts\n// Projects with no terrain yet: import first, then replace.\nif (!(await snaptrude.core.io.terrain.exists())) {\nawait snaptrude.core.io.import.terrain(40.7128, -74.006, 300, 300)\n}\nconst result = await snaptrude.core.io.terrain.replaceMesh(\npositions, // [x0, y0, z0, x1, y1, z1, …] — world space\nindices, // [a0, b0, c0, a1, b1, c1, …]\n\"meters\",\n{\ncoordinateSpace: \"world\",\nexpectedTerrain: await snaptrude.core.io.terrain.get(),\nbaseline: \"make-replacement-original\",\npreserve: { datum: true, geolocation: true, satellite: true, material: true },\nclientMutationId: \"survey-2026-08-05-r1\",\n},\n)\n// result.modelRevision — pass back as expectedModelRevision on the next call\n```"
|
|
2859
|
+
],
|
|
2860
|
+
"argsType": "number[]",
|
|
2861
|
+
"resultType": "PluginTerrainReplaceMeshResult"
|
|
2862
|
+
},
|
|
2753
2863
|
{
|
|
2754
2864
|
"path": "core.io.terrain.setDatum",
|
|
2755
2865
|
"namespace": "core.io.terrain",
|
|
@@ -6332,6 +6442,18 @@
|
|
|
6332
6442
|
"argsType": null,
|
|
6333
6443
|
"resultType": "PluginPresentationDiagramsGenerateResult"
|
|
6334
6444
|
},
|
|
6445
|
+
{
|
|
6446
|
+
"path": "presentation.diagrams.generateSite",
|
|
6447
|
+
"namespace": "presentation.diagrams",
|
|
6448
|
+
"summary": "Generate the site diagrams (location, streetview, climate) for the current model, creating new layout sheets.",
|
|
6449
|
+
"examplePrompts": [
|
|
6450
|
+
"Generate the site diagrams for this project",
|
|
6451
|
+
"Create the location, streetview and climate sheets",
|
|
6452
|
+
"Add a climate diagram sheet to the presentation\n\n# Example\n```ts\nconst { sheetIds } = await snaptrude.presentation.diagrams.generateSite({\ntypes: [\"location\", \"climate\"],\n})\n```"
|
|
6453
|
+
],
|
|
6454
|
+
"argsType": "{\n types?: PluginPresentationSiteDiagramType[]\n }",
|
|
6455
|
+
"resultType": "PluginPresentationDiagramsGenerateResult"
|
|
6456
|
+
},
|
|
6335
6457
|
{
|
|
6336
6458
|
"path": "presentation.diagrams.place",
|
|
6337
6459
|
"namespace": "presentation.diagrams",
|
|
@@ -6397,6 +6519,18 @@
|
|
|
6397
6519
|
"argsType": "{ url?: string; dataUrl?: string }",
|
|
6398
6520
|
"resultType": "PluginPresentationImportResult"
|
|
6399
6521
|
},
|
|
6522
|
+
{
|
|
6523
|
+
"path": "presentation.placedViews.deleteShapes",
|
|
6524
|
+
"namespace": "presentation.placedViews",
|
|
6525
|
+
"summary": "Delete Present-canvas shapes. One undoable step for the whole batch, and the batch is atomic — if any id is rejected, nothing is deleted.",
|
|
6526
|
+
"examplePrompts": [
|
|
6527
|
+
"Delete the old AI renders from the sheet",
|
|
6528
|
+
"Remove that placed view",
|
|
6529
|
+
"Clear the diagram images I placed\n\n# Example\n```ts\nconst { deleted } = await snaptrude.presentation.placedViews.deleteShapes([\nout1.shapeId,\nout2.shapeId,\n])\n```"
|
|
6530
|
+
],
|
|
6531
|
+
"argsType": "string[]",
|
|
6532
|
+
"resultType": "PluginCanvasShapesDeleteResult"
|
|
6533
|
+
},
|
|
6400
6534
|
{
|
|
6401
6535
|
"path": "presentation.placedViews.get",
|
|
6402
6536
|
"namespace": "presentation.placedViews",
|
|
@@ -6409,6 +6543,29 @@
|
|
|
6409
6543
|
"argsType": "string",
|
|
6410
6544
|
"resultType": "PluginPlacedView"
|
|
6411
6545
|
},
|
|
6546
|
+
{
|
|
6547
|
+
"path": "presentation.placedViews.getShape",
|
|
6548
|
+
"namespace": "presentation.placedViews",
|
|
6549
|
+
"summary": "Get one Present-canvas shape by id — works for any top-level shape (placed view, AI output, diagram image, plugin shape, annotation), unlike `get` which requires a placed view. Requires Present mode to be open.",
|
|
6550
|
+
"examplePrompts": [
|
|
6551
|
+
"Inspect the AI render I just generated",
|
|
6552
|
+
"Get the bounds of that diagram image"
|
|
6553
|
+
],
|
|
6554
|
+
"argsType": "string",
|
|
6555
|
+
"resultType": "PluginCanvasShape"
|
|
6556
|
+
},
|
|
6557
|
+
{
|
|
6558
|
+
"path": "presentation.placedViews.getStyles",
|
|
6559
|
+
"namespace": "presentation.placedViews",
|
|
6560
|
+
"summary": "Read a placed view's (or sheet's) per-category presentation styles.",
|
|
6561
|
+
"examplePrompts": [
|
|
6562
|
+
"What line weights is this placed plan using?",
|
|
6563
|
+
"Read the styling of the placed view",
|
|
6564
|
+
"Which categories can I restyle on this sheet?\n\n# Example\n```ts\nconst styles = await snaptrude.presentation.placedViews.getStyles(shapeId)\nconst space = styles.categories.find((c) => c.category === \"Space\")\nconsole.log(space?.settings.cutWidth, space?.settings.lineStyle)\n```"
|
|
6565
|
+
],
|
|
6566
|
+
"argsType": "string",
|
|
6567
|
+
"resultType": "PluginPlacedViewStylesResult"
|
|
6568
|
+
},
|
|
6412
6569
|
{
|
|
6413
6570
|
"path": "presentation.placedViews.list",
|
|
6414
6571
|
"namespace": "presentation.placedViews",
|
|
@@ -6422,6 +6579,30 @@
|
|
|
6422
6579
|
"argsType": "string",
|
|
6423
6580
|
"resultType": "PluginPresentationPlacedViewsListResult"
|
|
6424
6581
|
},
|
|
6582
|
+
{
|
|
6583
|
+
"path": "presentation.placedViews.listLabels",
|
|
6584
|
+
"namespace": "presentation.placedViews",
|
|
6585
|
+
"summary": "List a placed view's labels — the text children generated from the view's content (space names, departments, areas, dimension texts). Each label is individually addressable: it can be moved and hidden. Returns `[]` when the view has no labels. Requires Present mode to be open.",
|
|
6586
|
+
"examplePrompts": [
|
|
6587
|
+
"List the labels on this placed plan",
|
|
6588
|
+
"Where are the space labels on this view?",
|
|
6589
|
+
"Show every label with its position\n\n# Example\n```ts\nconst { labels } = await snaptrude.presentation.placedViews.listLabels(shapeId)\nfor (const l of labels) console.log(l.text, l.position, l.hidden)\n```"
|
|
6590
|
+
],
|
|
6591
|
+
"argsType": "string",
|
|
6592
|
+
"resultType": "PluginPlacedViewLabelsResult"
|
|
6593
|
+
},
|
|
6594
|
+
{
|
|
6595
|
+
"path": "presentation.placedViews.listShapes",
|
|
6596
|
+
"namespace": "presentation.placedViews",
|
|
6597
|
+
"summary": "List the top-level shapes on the Present canvas — not just placed views: AI-generated outputs, placed diagram images, plugin-created shapes, and annotations, each with an `origin` classification. Sheets (frames) are not listed — use `sheets.list`. Pass `sheetId` to list only shapes on that sheet. Returns `[]` when Present mode is closed.",
|
|
6598
|
+
"examplePrompts": [
|
|
6599
|
+
"List everything on the Present canvas",
|
|
6600
|
+
"What AI outputs are on this sheet?",
|
|
6601
|
+
"Show all the shapes with their positions\n\n# Example\n```ts\nconst { shapes } = await snaptrude.presentation.placedViews.listShapes()\nconst aiOutputs = shapes.filter((s) => s.origin === \"aiOutput\")\n```"
|
|
6602
|
+
],
|
|
6603
|
+
"argsType": "string",
|
|
6604
|
+
"resultType": "PluginCanvasShapesListResult"
|
|
6605
|
+
},
|
|
6425
6606
|
{
|
|
6426
6607
|
"path": "presentation.placedViews.move",
|
|
6427
6608
|
"namespace": "presentation.placedViews",
|
|
@@ -6434,6 +6615,64 @@
|
|
|
6434
6615
|
"argsType": "string",
|
|
6435
6616
|
"resultType": "PluginPlacedView"
|
|
6436
6617
|
},
|
|
6618
|
+
{
|
|
6619
|
+
"path": "presentation.placedViews.moveLabel",
|
|
6620
|
+
"namespace": "presentation.placedViews",
|
|
6621
|
+
"summary": "Move a label to a new position (coordinates relative to its placed view, the same space `listLabels` reports). The manual position survives style changes. Undoable. Requires Present mode to be open.",
|
|
6622
|
+
"examplePrompts": [
|
|
6623
|
+
"Move the kitchen label out of the hatched area",
|
|
6624
|
+
"Nudge this label 20 units right",
|
|
6625
|
+
"Reposition the area text"
|
|
6626
|
+
],
|
|
6627
|
+
"argsType": "string",
|
|
6628
|
+
"resultType": "PluginPlacedViewLabel"
|
|
6629
|
+
},
|
|
6630
|
+
{
|
|
6631
|
+
"path": "presentation.placedViews.moveShape",
|
|
6632
|
+
"namespace": "presentation.placedViews",
|
|
6633
|
+
"summary": "Move any Present-canvas shape (AI outputs, diagram images, plugin shapes, annotations — placed views too). Same coordinate semantics as `move`: sheet-local when on a sheet, page coordinates otherwise; pass `options.sheetId` to reparent onto a sheet. Undoable. Requires Present mode to be open.",
|
|
6634
|
+
"examplePrompts": [
|
|
6635
|
+
"Move the AI render to the top of the sheet",
|
|
6636
|
+
"Put the diagram image at 100, 200"
|
|
6637
|
+
],
|
|
6638
|
+
"argsType": "string",
|
|
6639
|
+
"resultType": "PluginCanvasShape"
|
|
6640
|
+
},
|
|
6641
|
+
{
|
|
6642
|
+
"path": "presentation.placedViews.resetStyles",
|
|
6643
|
+
"namespace": "presentation.placedViews",
|
|
6644
|
+
"summary": "Reset a placed view's styling to defaults — the sidebar's Reset button: clears every per-category override and view-style restyle, resets font styles, and un-hides labels hidden by styling. Undoable. Requires Present mode to be open.",
|
|
6645
|
+
"examplePrompts": [
|
|
6646
|
+
"Reset this view's styling",
|
|
6647
|
+
"Clear all the style overrides on the placed plan",
|
|
6648
|
+
"Put the sheet styles back to default"
|
|
6649
|
+
],
|
|
6650
|
+
"argsType": "string",
|
|
6651
|
+
"resultType": "void"
|
|
6652
|
+
},
|
|
6653
|
+
{
|
|
6654
|
+
"path": "presentation.placedViews.resizeShape",
|
|
6655
|
+
"namespace": "presentation.placedViews",
|
|
6656
|
+
"summary": "Resize any Present-canvas shape by a uniform factor about its top-left corner (aspect ratio held) — the generic counterpart of `scale`, which requires a placed view. Undoable. Requires Present mode to be open.",
|
|
6657
|
+
"examplePrompts": [
|
|
6658
|
+
"Make the AI output half its size",
|
|
6659
|
+
"Double the size of that image"
|
|
6660
|
+
],
|
|
6661
|
+
"argsType": "string",
|
|
6662
|
+
"resultType": "PluginCanvasShape"
|
|
6663
|
+
},
|
|
6664
|
+
{
|
|
6665
|
+
"path": "presentation.placedViews.rotateShape",
|
|
6666
|
+
"namespace": "presentation.placedViews",
|
|
6667
|
+
"summary": "Rotate any Present-canvas shape (AI outputs, diagram images, plugin shapes, annotations — placed views too) — the generic counterpart of `setRotation`, same target rules as `moveShape`. Same semantics: **absolute** angle in radians (tldraw convention) about the shape's bounds center, canonicalized into `[0, 2π)` (pass values in that range for an exact round-trip via `getShape`), one undo step. A placed view passed here falls under the same 3D-only rule as `setRotation`: 2D and site-plan views cannot rotate and are refused with a typed `PRECONDITION_FAILED`. Requires Present mode to be open.",
|
|
6668
|
+
"examplePrompts": [
|
|
6669
|
+
"Rotate the AI render 15 degrees",
|
|
6670
|
+
"Turn that image sideways",
|
|
6671
|
+
"Reset the diagram image's rotation"
|
|
6672
|
+
],
|
|
6673
|
+
"argsType": "string",
|
|
6674
|
+
"resultType": "PluginCanvasShape"
|
|
6675
|
+
},
|
|
6437
6676
|
{
|
|
6438
6677
|
"path": "presentation.placedViews.scale",
|
|
6439
6678
|
"namespace": "presentation.placedViews",
|
|
@@ -6458,6 +6697,51 @@
|
|
|
6458
6697
|
"argsType": "string",
|
|
6459
6698
|
"resultType": "PluginPlacedView"
|
|
6460
6699
|
},
|
|
6700
|
+
{
|
|
6701
|
+
"path": "presentation.placedViews.setLabelHidden",
|
|
6702
|
+
"namespace": "presentation.placedViews",
|
|
6703
|
+
"summary": "Hide or show a single label (independent of the category-level label visibility). Undoable. Requires Present mode to be open.",
|
|
6704
|
+
"examplePrompts": [
|
|
6705
|
+
"Hide the corridor label",
|
|
6706
|
+
"Show that label again"
|
|
6707
|
+
],
|
|
6708
|
+
"argsType": "string",
|
|
6709
|
+
"resultType": "PluginPlacedViewLabel"
|
|
6710
|
+
},
|
|
6711
|
+
{
|
|
6712
|
+
"path": "presentation.placedViews.setMask",
|
|
6713
|
+
"namespace": "presentation.placedViews",
|
|
6714
|
+
"summary": "Toggle \"mask context buildings\" on a placed view — mutes the inactive proposal buildings in the view (the sidebar checkbox). Views only. Undoable. Requires Present mode to be open.",
|
|
6715
|
+
"examplePrompts": [
|
|
6716
|
+
"Mask the context buildings in this view",
|
|
6717
|
+
"Show the neighboring proposals again in the placed view"
|
|
6718
|
+
],
|
|
6719
|
+
"argsType": "string",
|
|
6720
|
+
"resultType": "void"
|
|
6721
|
+
},
|
|
6722
|
+
{
|
|
6723
|
+
"path": "presentation.placedViews.setOpacity",
|
|
6724
|
+
"namespace": "presentation.placedViews",
|
|
6725
|
+
"summary": "Set a Present-canvas shape's opacity (`0` transparent .. `1` opaque) — the sidebar's whole-shape opacity slider (distinct from the per-category fill opacity in `updateStyles`). Works for any top-level shape. Undoable. Requires Present mode to be open.",
|
|
6726
|
+
"examplePrompts": [
|
|
6727
|
+
"Fade the placed view to 50%",
|
|
6728
|
+
"Make the AI render semi-transparent"
|
|
6729
|
+
],
|
|
6730
|
+
"argsType": "string",
|
|
6731
|
+
"resultType": "void"
|
|
6732
|
+
},
|
|
6733
|
+
{
|
|
6734
|
+
"path": "presentation.placedViews.setRotation",
|
|
6735
|
+
"namespace": "presentation.placedViews",
|
|
6736
|
+
"summary": "Set a placed view's rotation.",
|
|
6737
|
+
"examplePrompts": [
|
|
6738
|
+
"Rotate the placed plan 90 degrees",
|
|
6739
|
+
"Set this view's rotation to 45 degrees",
|
|
6740
|
+
"Straighten the placed view back to zero rotation\n\n# Example\n```ts\nawait snaptrude.presentation.placedViews.setRotation(shapeId, Math.PI / 2)\n```"
|
|
6741
|
+
],
|
|
6742
|
+
"argsType": "string",
|
|
6743
|
+
"resultType": "PluginPlacedView"
|
|
6744
|
+
},
|
|
6461
6745
|
{
|
|
6462
6746
|
"path": "presentation.placedViews.setScale",
|
|
6463
6747
|
"namespace": "presentation.placedViews",
|
|
@@ -6470,6 +6754,32 @@
|
|
|
6470
6754
|
"argsType": "string",
|
|
6471
6755
|
"resultType": "PluginPlacedView"
|
|
6472
6756
|
},
|
|
6757
|
+
{
|
|
6758
|
+
"path": "presentation.placedViews.updateFontStyles",
|
|
6759
|
+
"namespace": "presentation.placedViews",
|
|
6760
|
+
"summary": "Update a category's label typography on a placed view (or sheet) — the configure panel's Text tab.",
|
|
6761
|
+
"examplePrompts": [
|
|
6762
|
+
"Set the space labels to Roboto 24px bold",
|
|
6763
|
+
"Hide the area values on this plan",
|
|
6764
|
+
"Make the department labels italic\n\n# Example\n```ts\nawait snaptrude.presentation.placedViews.updateFontStyles(shapeId, \"Space\", {\nobjectLabels: { fontFamily: \"Roboto\", fontWeight: \"700\", fontSize: 24 },\nvisibleTypes: [\"objectLabels\", \"areas\"],\n})\n```"
|
|
6765
|
+
],
|
|
6766
|
+
"argsType": "string",
|
|
6767
|
+
"resultType": "void"
|
|
6768
|
+
},
|
|
6769
|
+
{
|
|
6770
|
+
"path": "presentation.placedViews.updateStyles",
|
|
6771
|
+
"namespace": "presentation.placedViews",
|
|
6772
|
+
"summary": "Update one style category on a placed view (or sheet) — the same writes the Present sidebar's per-category configure panel performs.",
|
|
6773
|
+
"examplePrompts": [
|
|
6774
|
+
"Set the Space cut line weight to 0.5 mm",
|
|
6775
|
+
"Make the Department lines dashed",
|
|
6776
|
+
"Color the plan by department",
|
|
6777
|
+
"Hide the dimension lines on this view",
|
|
6778
|
+
"Round the space corners with a 2 ft radius\n\n# Example\n```ts\nawait snaptrude.presentation.placedViews.updateStyles(shapeId, \"Space\", {\ncutWidth: 0.5,\nprojectionWidth: 0.18,\nlineStyle: \"dashed\",\ncolorMode: \"department\",\n})\n```"
|
|
6779
|
+
],
|
|
6780
|
+
"argsType": "string",
|
|
6781
|
+
"resultType": "PluginPlacedViewCategoryStyles"
|
|
6782
|
+
},
|
|
6473
6783
|
{
|
|
6474
6784
|
"path": "presentation.shapes.list",
|
|
6475
6785
|
"namespace": "presentation.shapes",
|
|
@@ -6619,6 +6929,18 @@
|
|
|
6619
6929
|
"argsType": "string",
|
|
6620
6930
|
"resultType": "PluginPresentationSheet"
|
|
6621
6931
|
},
|
|
6932
|
+
{
|
|
6933
|
+
"path": "presentation.sheets.setMargin",
|
|
6934
|
+
"namespace": "presentation.sheets",
|
|
6935
|
+
"summary": "Set a sheet's print margin.",
|
|
6936
|
+
"examplePrompts": [
|
|
6937
|
+
"Set the sheet margin to half an inch",
|
|
6938
|
+
"Remove the margins on sheet_1",
|
|
6939
|
+
"Give the cover sheet a 10mm margin\n\n# Example\n```ts\nconst sheet = await snaptrude.presentation.sheets.setMargin(\"sheet_1\", 0.5)\n```"
|
|
6940
|
+
],
|
|
6941
|
+
"argsType": "string",
|
|
6942
|
+
"resultType": "PluginPresentationSheet"
|
|
6943
|
+
},
|
|
6622
6944
|
{
|
|
6623
6945
|
"path": "presentation.sheets.setSize",
|
|
6624
6946
|
"namespace": "presentation.sheets",
|
|
@@ -6644,6 +6966,56 @@
|
|
|
6644
6966
|
"argsType": "{\n sheetId?: string\n }",
|
|
6645
6967
|
"resultType": "PluginPresentationSheetsUpdatePlacedViewResult"
|
|
6646
6968
|
},
|
|
6969
|
+
{
|
|
6970
|
+
"path": "presentation.slideshow.getState",
|
|
6971
|
+
"namespace": "presentation.slideshow",
|
|
6972
|
+
"summary": "Read the slideshow state.",
|
|
6973
|
+
"examplePrompts": [
|
|
6974
|
+
"Is the slideshow running?",
|
|
6975
|
+
"Which slide is the presentation on?",
|
|
6976
|
+
"Check the slideshow state\n\n# Example\n```ts\nconst { running, index } = await snaptrude.presentation.slideshow.getState()\n```"
|
|
6977
|
+
],
|
|
6978
|
+
"argsType": null,
|
|
6979
|
+
"resultType": "PluginPresentationSlideshowState"
|
|
6980
|
+
},
|
|
6981
|
+
{
|
|
6982
|
+
"path": "presentation.slideshow.start",
|
|
6983
|
+
"namespace": "presentation.slideshow",
|
|
6984
|
+
"summary": "Start the slideshow.",
|
|
6985
|
+
"examplePrompts": [
|
|
6986
|
+
"Start the slideshow",
|
|
6987
|
+
"Present the sheets from the beginning",
|
|
6988
|
+
"Start the slideshow on sheet 3",
|
|
6989
|
+
"Play the presentation starting at the cover sheet\n\n# Example\n```ts\nconst state = await snaptrude.presentation.slideshow.start({ startIndex: 2 })\nconsole.log(state.running, state.index) // true, 2\n```"
|
|
6990
|
+
],
|
|
6991
|
+
"argsType": "{\n sheetIds?: string[]\n startIndex?: number\n }",
|
|
6992
|
+
"resultType": "PluginPresentationSlideshowState"
|
|
6993
|
+
},
|
|
6994
|
+
{
|
|
6995
|
+
"path": "presentation.slideshow.stop",
|
|
6996
|
+
"namespace": "presentation.slideshow",
|
|
6997
|
+
"summary": "Stop the slideshow.",
|
|
6998
|
+
"examplePrompts": [
|
|
6999
|
+
"Stop the slideshow",
|
|
7000
|
+
"Exit the presentation",
|
|
7001
|
+
"Close the slideshow and go back to the sheets\n\n# Example\n```ts\nawait snaptrude.presentation.slideshow.stop()\n```"
|
|
7002
|
+
],
|
|
7003
|
+
"argsType": null,
|
|
7004
|
+
"resultType": "PluginPresentationSlideshowState"
|
|
7005
|
+
},
|
|
7006
|
+
{
|
|
7007
|
+
"path": "presentation.tables.place",
|
|
7008
|
+
"namespace": "presentation.tables",
|
|
7009
|
+
"summary": "Place a table on a sheet.",
|
|
7010
|
+
"examplePrompts": [
|
|
7011
|
+
"Put the area schedule as a table on Sheet 1",
|
|
7012
|
+
"Add a table of the room programs to the cover sheet",
|
|
7013
|
+
"Paste this data as a table on the sheet",
|
|
7014
|
+
"Place a two-column table of space names and areas\n\n# Example\n```ts\nconst shape = await snaptrude.presentation.tables.place(\"sheet_1\", {\nrows: [\n[\"Room\", \"Area\"],\n[\"Kitchen\", \"12.4 m²\"],\n[\"Living\", \"28.0 m²\"],\n],\n}, { position: { x: 40, y: 40 } })\n```"
|
|
7015
|
+
],
|
|
7016
|
+
"argsType": "string",
|
|
7017
|
+
"resultType": "PluginCanvasShape"
|
|
7018
|
+
},
|
|
6647
7019
|
{
|
|
6648
7020
|
"path": "presentation.views.capture",
|
|
6649
7021
|
"namespace": "presentation.views",
|
|
@@ -7195,6 +7567,19 @@
|
|
|
7195
7567
|
"argsType": null,
|
|
7196
7568
|
"resultType": "PluginProgramSiteWeatherResult"
|
|
7197
7569
|
},
|
|
7570
|
+
{
|
|
7571
|
+
"path": "program.site.listEdges",
|
|
7572
|
+
"namespace": "program.site",
|
|
7573
|
+
"summary": "List each site parcel's boundary edges with their front / side / rear classification — the same per-edge roles the buildable-envelope setback pills show on canvas, so a plugin can pick up the user's edge tagging without asking them to set it up again.",
|
|
7574
|
+
"examplePrompts": [
|
|
7575
|
+
"Which edge of my site is the front?",
|
|
7576
|
+
"Read the front / side / rear edges of the plot",
|
|
7577
|
+
"What setback applies to each site edge?",
|
|
7578
|
+
"Get the site edges the way the setback pills show them\n\n# Example\n```ts\nconst { sites } = await snaptrude.program.site.listEdges()\nfor (const site of sites)\nfor (const e of site.edges)\nconsole.log(e.edgeIndex, e.role, e.roleSource, e.setbackMeters)\n```"
|
|
7579
|
+
],
|
|
7580
|
+
"argsType": null,
|
|
7581
|
+
"resultType": "PluginProgramSiteListEdgesResult"
|
|
7582
|
+
},
|
|
7198
7583
|
{
|
|
7199
7584
|
"path": "program.site.listGeoPolygons",
|
|
7200
7585
|
"namespace": "program.site",
|
|
@@ -7602,6 +7987,30 @@
|
|
|
7602
7987
|
"argsType": "PluginSpreadsheetTransactionOp[]",
|
|
7603
7988
|
"resultType": "PluginProgramSpreadsheetTransactionResult"
|
|
7604
7989
|
},
|
|
7990
|
+
{
|
|
7991
|
+
"path": "workspace.closePresentMode",
|
|
7992
|
+
"namespace": "workspace",
|
|
7993
|
+
"summary": "Close Present mode and return to the modeling canvas.",
|
|
7994
|
+
"examplePrompts": [
|
|
7995
|
+
"Close present mode",
|
|
7996
|
+
"Exit the presentation editor",
|
|
7997
|
+
"Go back to the modeling canvas\n\n# Example\n```ts\nawait snaptrude.workspace.closePresentMode()\n```"
|
|
7998
|
+
],
|
|
7999
|
+
"argsType": null,
|
|
8000
|
+
"resultType": "void"
|
|
8001
|
+
},
|
|
8002
|
+
{
|
|
8003
|
+
"path": "workspace.openPresentMode",
|
|
8004
|
+
"namespace": "workspace",
|
|
8005
|
+
"summary": "Open Present mode — the documentation editor the `presentation.*` namespaces operate on.",
|
|
8006
|
+
"examplePrompts": [
|
|
8007
|
+
"Open present mode",
|
|
8008
|
+
"Switch to the presentation editor",
|
|
8009
|
+
"Open the sheets so I can lay out views\n\n# Example\n```ts\nawait snaptrude.workspace.openPresentMode()\nconst { sheets } = await snaptrude.presentation.sheets.list()\n```"
|
|
8010
|
+
],
|
|
8011
|
+
"argsType": null,
|
|
8012
|
+
"resultType": "void"
|
|
8013
|
+
},
|
|
7605
8014
|
{
|
|
7606
8015
|
"path": "workspace.projects.copy",
|
|
7607
8016
|
"namespace": "workspace.projects",
|