@snaptrude/plugin-core 0.0.0-dev-20260907135026 → 0.0.0-dev-20260911064951
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/api-manifest.json +12 -151
- package/dist/api/core/geom/create/index.d.ts +86 -559
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/brep.d.ts +0 -50
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/geom/query/curve.d.ts +35 -58
- 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 +0 -45
- 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/core/io/import/index.d.ts +3 -1
- package/dist/api/core/io/import/index.d.ts.map +1 -1
- package/dist/api/design/create/bulk-items.d.ts +185 -0
- package/dist/api/design/create/bulk-items.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +310 -22
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/create/opening-fields.d.ts +37 -0
- package/dist/api/design/create/opening-fields.d.ts.map +1 -0
- package/dist/api/design/delete/index.d.ts +4 -0
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/dimensions.d.ts +427 -0
- package/dist/api/design/dimensions.d.ts.map +1 -0
- package/dist/api/design/doors/index.d.ts +20 -13
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +5 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/query/geometry/index.d.ts +1 -27
- package/dist/api/design/query/geometry/index.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +0 -47
- 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 +0 -87
- 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 +4 -5
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +4 -4
- package/dist/api/presentation/annotate.d.ts +2 -2
- package/dist/api/presentation/shapes.d.ts +2 -2
- package/dist/api/program/spreadsheet.d.ts +4 -4
- package/dist/handles.d.ts +22 -12
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +2867 -3040
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2844 -3006
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/core/geom/create/index.ts +84 -588
- package/src/api/core/geom/query/brep.ts +0 -51
- package/src/api/core/geom/query/curve.ts +2 -25
- package/src/api/core/geom/query/edge.ts +2 -2
- package/src/api/core/geom/query/face.ts +0 -49
- package/src/api/core/io/import/index.ts +11 -3
- package/src/api/design/create/bulk-items.ts +186 -0
- package/src/api/design/create/index.ts +335 -38
- package/src/api/design/create/opening-fields.ts +37 -0
- package/src/api/design/delete/index.ts +4 -0
- package/src/api/design/dimensions.ts +453 -0
- package/src/api/design/doors/index.ts +20 -13
- package/src/api/design/index.ts +5 -0
- package/src/api/design/query/geometry/index.ts +0 -29
- package/src/api/design/query/index.ts +0 -50
- package/src/api/design/update/index.ts +0 -94
- package/src/handles.ts +27 -15
- package/src/index.ts +0 -1
- package/dist/massParameters.d.ts +0 -319
- package/dist/massParameters.d.ts.map +0 -1
- package/src/massParameters.ts +0 -472
- package/test/massParameters.test.mjs +0 -500
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @snaptrude/plugin-core
|
|
2
2
|
|
|
3
|
+
## 0.0.0-dev-20260911064951
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6e4a055: added param comps
|
|
8
|
+
- 7fd374e: Add `hinge` to `design.create.door` / `window` (in `options`), `doors[]` / `windows[]` items and `opening`: a world point near the jamb the leaf is hinged on; the placed item is reflected along the wall when the catalog item's authored hinge side would land on the other jamb — one undo entry, no extra command.
|
|
9
|
+
|
|
10
|
+
**BEHAVIOUR FIX — `facing`.** The host placed the swing on the side OPPOSITE the `facing` point (the interactive tool's cursor convention) while the contract said "the room it opens into". The host now matches the contract: the leaf swings open toward `facing`. Callers that passed a point on the room side get the documented result; nothing in the contract changed shape.
|
|
11
|
+
|
|
12
|
+
`design.doors.getSwingDirection` is now derived from the placed mesh's orientation (hand as seen standing on the swing side facing the door); it previously read a scaling sign that placement never sets and reported `"left"` for every door. `mirror` axis docs now say what each axis does to a door (`'x'` swing side, `'z'` hinged jamb, `'y'` upside down); behaviour unchanged.
|
|
13
|
+
|
|
14
|
+
## 0.9.7
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 6e60c61: Add bulk `design.create` creators — `wallRuns`, `floors`, `doors`, `windows`, `furnitureItems`: one host round-trip and one undo entry per batch.
|
|
19
|
+
|
|
20
|
+
Singular creators, fixes shipped alongside (behaviour changes for existing callers):
|
|
21
|
+
- `floor`, `slab`, `roof`, `ceiling`, `column`, `beam`: contour holes are now cut (holed contours previously failed or lost their holes).
|
|
22
|
+
- `floor`: the `position` offset is applied before the creation snapshot, so it survives redo and reload and drives storey assignment.
|
|
23
|
+
- `furniture`: `options.label` is now also the readable label (`design.query.getLabel`); `createNewSourceMesh` can no longer skip recording a source this call brought in (the host owns source persistence, recorded exactly once across concurrent calls); refuses with `PRECONDITION_FAILED` (`engineCode: "TOOL_ACTIVE"`) while the interactive furniture tool is active. The same refusal applies to `core.io.import.model` furniture placement.
|
|
24
|
+
- `door`, `window`: published as one save document instead of five; undo granularity unchanged.
|
|
25
|
+
|
|
26
|
+
- 2f10e6b: Add `design.dimensions` — dimension lines (Measuring Tape): `create`, `list`, `get`, `delete`, `hide`, `show`, plus the new `DimensionHandle`.
|
|
27
|
+
|
|
3
28
|
## 0.9.6
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/api-manifest.json
CHANGED
|
@@ -729,9 +729,8 @@
|
|
|
729
729
|
{
|
|
730
730
|
"path": "core.geom.create.brepFromChamfer",
|
|
731
731
|
"namespace": "core.geom.create",
|
|
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.",
|
|
732
|
+
"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.",
|
|
733
733
|
"examplePrompts": [
|
|
734
|
-
"Chamfer the top edge of the cylinder",
|
|
735
734
|
"Bevel these edges by 100mm",
|
|
736
735
|
"Chamfer the top edges of the plinth",
|
|
737
736
|
"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```"
|
|
@@ -739,28 +738,6 @@
|
|
|
739
738
|
"argsType": "BrepHandle",
|
|
740
739
|
"resultType": "BrepHandle"
|
|
741
740
|
},
|
|
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
|
-
},
|
|
764
741
|
{
|
|
765
742
|
"path": "core.geom.create.brepFromExtrusion",
|
|
766
743
|
"namespace": "core.geom.create",
|
|
@@ -788,12 +765,11 @@
|
|
|
788
765
|
{
|
|
789
766
|
"path": "core.geom.create.brepFromFillet",
|
|
790
767
|
"namespace": "core.geom.create",
|
|
791
|
-
"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.",
|
|
768
|
+
"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.",
|
|
792
769
|
"examplePrompts": [
|
|
793
|
-
"Round the
|
|
794
|
-
"Soften where the dome meets the wall",
|
|
770
|
+
"Round the edges of this mass",
|
|
795
771
|
"Fillet the corners of the podium with a 0.5m radius",
|
|
796
|
-
"Soften the vertical edges of this tower\n\n# Example\n```ts\
|
|
772
|
+
"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```"
|
|
797
773
|
],
|
|
798
774
|
"argsType": "BrepHandle",
|
|
799
775
|
"resultType": "BrepHandle"
|
|
@@ -844,7 +820,6 @@
|
|
|
844
820
|
"namespace": "core.geom.create",
|
|
845
821
|
"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.",
|
|
846
822
|
"examplePrompts": [
|
|
847
|
-
"Thicken the torus ring by 100 mm",
|
|
848
823
|
"Grow this solid by 0.5m in every direction",
|
|
849
824
|
"Shrink this mass by 200mm",
|
|
850
825
|
"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```"
|
|
@@ -855,13 +830,11 @@
|
|
|
855
830
|
{
|
|
856
831
|
"path": "core.geom.create.brepFromRevolution",
|
|
857
832
|
"namespace": "core.geom.create",
|
|
858
|
-
"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
|
|
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. Profile segments must stay parallel or perpendicular to the axis — inclined or arc segments would revolve into surfaces Snaptrude cannot represent.",
|
|
859
834
|
"examplePrompts": [
|
|
860
835
|
"Create a dome from this section",
|
|
861
836
|
"Revolve this profile 360 degrees around the vertical axis",
|
|
862
|
-
"Build a rotunda by revolving this wall section"
|
|
863
|
-
"Make a dome by revolving a quarter-circle about the vertical axis",
|
|
864
|
-
"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```"
|
|
837
|
+
"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```"
|
|
865
838
|
],
|
|
866
839
|
"argsType": "ContourHandle",
|
|
867
840
|
"resultType": "BrepHandle"
|
|
@@ -871,25 +844,13 @@
|
|
|
871
844
|
"namespace": "core.geom.create",
|
|
872
845
|
"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.",
|
|
873
846
|
"examplePrompts": [
|
|
874
|
-
"Hollow the dome into a 300 mm shell, open at the base",
|
|
875
847
|
"Hollow this mass into 200mm walls",
|
|
876
848
|
"Shell this form with the top face open",
|
|
877
|
-
"Turn this solid tower into a tube open at both ends\n\n# Example\n```ts\
|
|
849
|
+
"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```"
|
|
878
850
|
],
|
|
879
851
|
"argsType": "BrepHandle",
|
|
880
852
|
"resultType": "BrepHandle"
|
|
881
853
|
},
|
|
882
|
-
{
|
|
883
|
-
"path": "core.geom.create.brepFromSphere",
|
|
884
|
-
"namespace": "core.geom.create",
|
|
885
|
-
"summary": "Create a solid **sphere** B-rep 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`.",
|
|
886
|
-
"examplePrompts": [
|
|
887
|
-
"Create a sphere of radius 5 at the origin",
|
|
888
|
-
"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```"
|
|
889
|
-
],
|
|
890
|
-
"argsType": "Vec3Components",
|
|
891
|
-
"resultType": "BrepHandle"
|
|
892
|
-
},
|
|
893
854
|
{
|
|
894
855
|
"path": "core.geom.create.brepFromSubtraction",
|
|
895
856
|
"namespace": "core.geom.create",
|
|
@@ -905,7 +866,7 @@
|
|
|
905
866
|
{
|
|
906
867
|
"path": "core.geom.create.brepFromSweep",
|
|
907
868
|
"namespace": "core.geom.create",
|
|
908
|
-
"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 today's sharp mitred bend;
|
|
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 today's sharp mitred bend; `{ 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 the varying-scale lane takes straight paths, so it never sees a corner.",
|
|
909
870
|
"examplePrompts": [
|
|
910
871
|
"Sweep this profile along the corridor path",
|
|
911
872
|
"Extrude the railing section along this route",
|
|
@@ -913,23 +874,11 @@
|
|
|
913
874
|
"Sweep a frame profile around a closed rectangular loop",
|
|
914
875
|
"Taper this duct from 1x1 to 2x2 along its run",
|
|
915
876
|
"Sweep a column section that narrows toward the top",
|
|
916
|
-
"Chamfer the corners of this swept frame by 200mm"
|
|
917
|
-
"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```"
|
|
877
|
+
"Chamfer the corners of this swept frame by 200mm\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```"
|
|
918
878
|
],
|
|
919
879
|
"argsType": "ContourHandle",
|
|
920
880
|
"resultType": "BrepHandle"
|
|
921
881
|
},
|
|
922
|
-
{
|
|
923
|
-
"path": "core.geom.create.brepFromTorus",
|
|
924
|
-
"namespace": "core.geom.create",
|
|
925
|
-
"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`.",
|
|
926
|
-
"examplePrompts": [
|
|
927
|
-
"Create a donut-shaped ring 10m across with a 1m tube",
|
|
928
|
-
"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```"
|
|
929
|
-
],
|
|
930
|
-
"argsType": "Vec3Components",
|
|
931
|
-
"resultType": "BrepHandle"
|
|
932
|
-
},
|
|
933
882
|
{
|
|
934
883
|
"path": "core.geom.create.brepFromUnion",
|
|
935
884
|
"namespace": "core.geom.create",
|
|
@@ -1016,18 +965,6 @@
|
|
|
1016
965
|
"argsType": "Vec3Handle[]",
|
|
1017
966
|
"resultType": "ProfileHandle"
|
|
1018
967
|
},
|
|
1019
|
-
{
|
|
1020
|
-
"path": "core.geom.create.profileFromSplinePoints",
|
|
1021
|
-
"namespace": "core.geom.create",
|
|
1022
|
-
"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.",
|
|
1023
|
-
"examplePrompts": [
|
|
1024
|
-
"Make a blob-shaped floor plate through these points",
|
|
1025
|
-
"Organic curved outline through these corners",
|
|
1026
|
-
"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```"
|
|
1027
|
-
],
|
|
1028
|
-
"argsType": "Vec3Handle[]",
|
|
1029
|
-
"resultType": "ProfileHandle"
|
|
1030
|
-
},
|
|
1031
968
|
{
|
|
1032
969
|
"path": "core.geom.create.profileRect",
|
|
1033
970
|
"namespace": "core.geom.create",
|
|
@@ -1039,29 +976,6 @@
|
|
|
1039
976
|
"argsType": "number",
|
|
1040
977
|
"resultType": "ProfileHandle"
|
|
1041
978
|
},
|
|
1042
|
-
{
|
|
1043
|
-
"path": "core.geom.create.splineFromControlPoints",
|
|
1044
|
-
"namespace": "core.geom.create",
|
|
1045
|
-
"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}.",
|
|
1046
|
-
"examplePrompts": [
|
|
1047
|
-
"Draw a smooth curve controlled by these four points",
|
|
1048
|
-
"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```"
|
|
1049
|
-
],
|
|
1050
|
-
"argsType": "Vec3Handle[]",
|
|
1051
|
-
"resultType": "SplineHandle"
|
|
1052
|
-
},
|
|
1053
|
-
{
|
|
1054
|
-
"path": "core.geom.create.splineFromPoints",
|
|
1055
|
-
"namespace": "core.geom.create",
|
|
1056
|
-
"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.",
|
|
1057
|
-
"examplePrompts": [
|
|
1058
|
-
"Draw a smooth curve through these points",
|
|
1059
|
-
"Make a wavy edge that passes through A, B, C and D",
|
|
1060
|
-
"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```"
|
|
1061
|
-
],
|
|
1062
|
-
"argsType": "Vec3Handle[]",
|
|
1063
|
-
"resultType": "SplineHandle"
|
|
1064
|
-
},
|
|
1065
979
|
{
|
|
1066
980
|
"path": "core.geom.delete.contour",
|
|
1067
981
|
"namespace": "core.geom.delete",
|
|
@@ -1187,11 +1101,10 @@
|
|
|
1187
1101
|
"Read the radius of this curved edge",
|
|
1188
1102
|
"Is this edge straight or an arc?",
|
|
1189
1103
|
"Get the exact start and end points of this edge",
|
|
1190
|
-
"Measure the length of each edge of this mass",
|
|
1191
|
-
"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```"
|
|
1104
|
+
"Measure the length of each edge of this mass\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```"
|
|
1192
1105
|
],
|
|
1193
1106
|
"argsType": "BrepHandle",
|
|
1194
|
-
"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 }
|
|
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 }"
|
|
1195
1108
|
},
|
|
1196
1109
|
{
|
|
1197
1110
|
"path": "core.geom.query.brep.getFaceCount",
|
|
@@ -1225,18 +1138,6 @@
|
|
|
1225
1138
|
"argsType": "BrepHandle",
|
|
1226
1139
|
"resultType": "Vec3Components"
|
|
1227
1140
|
},
|
|
1228
|
-
{
|
|
1229
|
-
"path": "core.geom.query.brep.getVolume",
|
|
1230
|
-
"namespace": "core.geom.query.brep",
|
|
1231
|
-
"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²).",
|
|
1232
|
-
"examplePrompts": [
|
|
1233
|
-
"What is the volume of this mass?",
|
|
1234
|
-
"How much concrete is in this shape?",
|
|
1235
|
-
"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```"
|
|
1236
|
-
],
|
|
1237
|
-
"argsType": "BrepHandle",
|
|
1238
|
-
"resultType": "number"
|
|
1239
|
-
},
|
|
1240
1141
|
{
|
|
1241
1142
|
"path": "core.geom.query.brep.hasEdge",
|
|
1242
1143
|
"namespace": "core.geom.query.brep",
|
|
@@ -1841,7 +1742,7 @@
|
|
|
1841
1742
|
{
|
|
1842
1743
|
"path": "core.geom.query.edge.getCurve",
|
|
1843
1744
|
"namespace": "core.geom.query.edge",
|
|
1844
|
-
"summary": "Get the underlying curve geometry of an edge (a line
|
|
1745
|
+
"summary": "Get the underlying curve geometry of an edge (a line or arc).",
|
|
1845
1746
|
"examplePrompts": [],
|
|
1846
1747
|
"argsType": "EdgeHandle",
|
|
1847
1748
|
"resultType": "CurveHandle | null"
|
|
@@ -1918,19 +1819,6 @@
|
|
|
1918
1819
|
"argsType": "FaceHandle",
|
|
1919
1820
|
"resultType": "number"
|
|
1920
1821
|
},
|
|
1921
|
-
{
|
|
1922
|
-
"path": "core.geom.query.face.getSurfaceKind",
|
|
1923
|
-
"namespace": "core.geom.query.face",
|
|
1924
|
-
"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.",
|
|
1925
|
-
"examplePrompts": [
|
|
1926
|
-
"Is this face flat or curved?",
|
|
1927
|
-
"Check that this dome is a real sphere, not a faceted approximation",
|
|
1928
|
-
"What kind of surface is this face?",
|
|
1929
|
-
"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```"
|
|
1930
|
-
],
|
|
1931
|
-
"argsType": "FaceHandle",
|
|
1932
|
-
"resultType": "\"plane\" | \"cylinder\" | \"cone\" | \"sphere\" | \"torus\" | \"spline\" | null"
|
|
1933
|
-
},
|
|
1934
1822
|
{
|
|
1935
1823
|
"path": "core.geom.query.face.hasHoles",
|
|
1936
1824
|
"namespace": "core.geom.query.face",
|
|
@@ -5342,7 +5230,6 @@
|
|
|
5342
5230
|
"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.",
|
|
5343
5231
|
"examplePrompts": [
|
|
5344
5232
|
"Get the 3D solid geometry of the selected wall",
|
|
5345
|
-
"Round the top rim of this column and put it back where it is",
|
|
5346
5233
|
"How many faces does this mass have?",
|
|
5347
5234
|
"Inspect the mesh of this slab so I can look at its faces and edges",
|
|
5348
5235
|
"Read the vertices of the selected column's geometry"
|
|
@@ -5454,19 +5341,6 @@
|
|
|
5454
5341
|
"argsType": "ComponentHandle",
|
|
5455
5342
|
"resultType": "string"
|
|
5456
5343
|
},
|
|
5457
|
-
{
|
|
5458
|
-
"path": "design.query.getParameters",
|
|
5459
|
-
"namespace": "design.query",
|
|
5460
|
-
"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.",
|
|
5461
|
-
"examplePrompts": [
|
|
5462
|
-
"What radius is this sphere?",
|
|
5463
|
-
"Is this mass parametric?",
|
|
5464
|
-
"Read back the dome's creation parameters",
|
|
5465
|
-
"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```"
|
|
5466
|
-
],
|
|
5467
|
-
"argsType": "ComponentHandle",
|
|
5468
|
-
"resultType": "MassParametersRecord | null"
|
|
5469
|
-
},
|
|
5470
5344
|
{
|
|
5471
5345
|
"path": "design.query.getProperties",
|
|
5472
5346
|
"namespace": "design.query",
|
|
@@ -6044,19 +5918,6 @@
|
|
|
6044
5918
|
"argsType": "ComponentHandle",
|
|
6045
5919
|
"resultType": "PluginDesignChangeResult"
|
|
6046
5920
|
},
|
|
6047
|
-
{
|
|
6048
|
-
"path": "design.update.parameters",
|
|
6049
|
-
"namespace": "design.update",
|
|
6050
|
-
"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.",
|
|
6051
|
-
"examplePrompts": [
|
|
6052
|
-
"Make the dome's radius 8 metres",
|
|
6053
|
-
"Raise the podium to 5 m",
|
|
6054
|
-
"Widen the vase — move its profile points 20 cm outward",
|
|
6055
|
-
"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```"
|
|
6056
|
-
],
|
|
6057
|
-
"argsType": "ComponentHandle",
|
|
6058
|
-
"resultType": "MassParametersRecord"
|
|
6059
|
-
},
|
|
6060
5921
|
{
|
|
6061
5922
|
"path": "design.update.roof",
|
|
6062
5923
|
"namespace": "design.update",
|