@snaptrude/plugin-core 0.9.4 → 0.10.0
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.json +95 -0
- package/dist/api/core/io/underlay/index.d.ts +519 -0
- package/dist/api/core/io/underlay/index.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +127 -0
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/index.cjs +194 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +173 -0
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
- package/src/api/core/io/underlay/index.ts +418 -8
- package/src/api/design/query/index.ts +99 -0
- package/api-manifest.full.json +0 -8133
package/CHANGELOG.md
CHANGED
package/api-manifest.json
CHANGED
|
@@ -2907,6 +2907,19 @@
|
|
|
2907
2907
|
"argsType": "number",
|
|
2908
2908
|
"resultType": "void"
|
|
2909
2909
|
},
|
|
2910
|
+
{
|
|
2911
|
+
"path": "core.io.underlay.classifyArcs",
|
|
2912
|
+
"namespace": "core.io.underlay",
|
|
2913
|
+
"summary": "Classify one retained AutoCAD layer's **arcs as door swings** — the deterministic tracing primitive behind CAD-to-BIM door placement. A door swing is drawn as a ~90° arc whose radius IS the leaf width and whose centre IS the hinge point. This filters the layer's arcs by plausible radius and sweep (rejecting inch-scale fillets, full-circle symbols and long shallow curves), reads each survivor as a door candidate (hinge, leaf width, swing direction, hosting wall direction), merges mirrored pairs sharing a chord line into double doors, and returns a radius histogram — real drawings use a handful of standard door sizes, so the histogram's clusters are the drawing's door widths (sanity-check them against the catalog; distrust arcs in no cluster).",
|
|
2914
|
+
"examplePrompts": [
|
|
2915
|
+
"Find the doors on the a-door CAD layer",
|
|
2916
|
+
"Classify the door swing arcs in the imported drawing",
|
|
2917
|
+
"What door sizes does this DWG use?",
|
|
2918
|
+
"Read hinge points and leaf widths from the CAD door layer\n\n# Example\n```ts\nconst [cad] = await snaptrude.core.io.underlay.list()\nconst r = await snaptrude.core.io.underlay.classifyArcs(cad, \"a-door\")\nif (r) {\nconsole.log(`${r.doors.length} doors; sizes:`,\nr.radiusHistogram.filter((b) => b.count > 1))\n}\n```"
|
|
2919
|
+
],
|
|
2920
|
+
"argsType": "UnderlayHandle",
|
|
2921
|
+
"resultType": "PluginCadArcClassifyResult | null"
|
|
2922
|
+
},
|
|
2910
2923
|
{
|
|
2911
2924
|
"path": "core.io.underlay.delete",
|
|
2912
2925
|
"namespace": "core.io.underlay",
|
|
@@ -2920,6 +2933,19 @@
|
|
|
2920
2933
|
"argsType": "UnderlayHandle",
|
|
2921
2934
|
"resultType": "void"
|
|
2922
2935
|
},
|
|
2936
|
+
{
|
|
2937
|
+
"path": "core.io.underlay.extractCenterlines",
|
|
2938
|
+
"namespace": "core.io.underlay",
|
|
2939
|
+
"summary": "Extract **continuous wall centrelines** from one retained AutoCAD layer's double-line wall faces — the deterministic tracing primitive behind CAD-to-BIM wall conversion. Instead of paging raw curves and re-deriving the geometry in worker code, this reads the whole layer and runs the vetted pipeline: cull fragments, dedupe, merge collinear runs into *faces*, pair parallel faces a wall-thickness apart into centrelines (midline = axis, separation = thickness), bridge collinear gaps up to `bridgeOpenings.maxWidth` into ONE continuous centreline while recording each bridged span as an opening, then snap near-touching endpoints at junctions.",
|
|
2940
|
+
"examplePrompts": [
|
|
2941
|
+
"Trace the walls from the a-wall CAD layer",
|
|
2942
|
+
"Convert the AutoCAD wall linework into Snaptrude walls",
|
|
2943
|
+
"Extract wall centrelines with thickness from the imported DWG",
|
|
2944
|
+
"Find the glazing runs on the a-glazing layer\n\n# Example\n```ts\nconst [cad] = await snaptrude.core.io.underlay.list()\nconst r = await snaptrude.core.io.underlay.extractCenterlines(cad, \"a-wall\")\nif (r) {\nconst items = r.centerlines.map((c) => ({\nprofile: [c.start, c.end],\nthickness: c.thickness,\n}))\nconsole.log(`${items.length} walls, ${r.unpaired.length} unpaired faces`)\n}\n```"
|
|
2945
|
+
],
|
|
2946
|
+
"argsType": "UnderlayHandle",
|
|
2947
|
+
"resultType": "PluginCadCenterlinesResult | null"
|
|
2948
|
+
},
|
|
2923
2949
|
{
|
|
2924
2950
|
"path": "core.io.underlay.getBounds",
|
|
2925
2951
|
"namespace": "core.io.underlay",
|
|
@@ -2933,6 +2959,17 @@
|
|
|
2933
2959
|
"argsType": "UnderlayHandle",
|
|
2934
2960
|
"resultType": "BBoxComponents | null"
|
|
2935
2961
|
},
|
|
2962
|
+
{
|
|
2963
|
+
"path": "core.io.underlay.getCadLayerGeometry",
|
|
2964
|
+
"namespace": "core.io.underlay",
|
|
2965
|
+
"summary": "Read one original AutoCAD layer's retained line and arc geometry in **Snaptrude world space** and Snaptrude internal units. Results are paged so large drawings can be inspected without returning the whole DWG at once.",
|
|
2966
|
+
"examplePrompts": [
|
|
2967
|
+
"Read the wall geometry from the A-WALL layer in this CAD underlay",
|
|
2968
|
+
"Get the next 500 curves from the structural CAD layer\n\n# Example\n```ts\nconst page = await snaptrude.core.io.underlay.getCadLayerGeometry(\ncad,\n\"A-WALL\",\n{ offset: 0, limit: 500 },\n)\nif (page) console.log(`${page.curves.length} of ${page.total} curves`)\n```"
|
|
2969
|
+
],
|
|
2970
|
+
"argsType": "UnderlayHandle",
|
|
2971
|
+
"resultType": "PluginCadLayerGeometryPage | null"
|
|
2972
|
+
},
|
|
2936
2973
|
{
|
|
2937
2974
|
"path": "core.io.underlay.getOpacity",
|
|
2938
2975
|
"namespace": "core.io.underlay",
|
|
@@ -2972,6 +3009,17 @@
|
|
|
2972
3009
|
"argsType": "number",
|
|
2973
3010
|
"resultType": "UnderlayHandle[]"
|
|
2974
3011
|
},
|
|
3012
|
+
{
|
|
3013
|
+
"path": "core.io.underlay.listCadLayers",
|
|
3014
|
+
"namespace": "core.io.underlay",
|
|
3015
|
+
"summary": "List the distinct original AutoCAD layer names retained by a placed CAD underlay. Returns `[]` for non-CAD underlays, legacy imports created before source-layer retention, missing underlays, or CAD drawings without layer tags.",
|
|
3016
|
+
"examplePrompts": [
|
|
3017
|
+
"List the original AutoCAD layers in this imported drawing",
|
|
3018
|
+
"Which CAD layers are available in this underlay?\n\n# Example\n```ts\nconst layers = await snaptrude.core.io.underlay.listCadLayers(cad)\nconsole.log(layers)\n```"
|
|
3019
|
+
],
|
|
3020
|
+
"argsType": "UnderlayHandle",
|
|
3021
|
+
"resultType": "string[]"
|
|
3022
|
+
},
|
|
2975
3023
|
{
|
|
2976
3024
|
"path": "core.io.underlay.resetScale",
|
|
2977
3025
|
"namespace": "core.io.underlay",
|
|
@@ -4274,6 +4322,18 @@
|
|
|
4274
4322
|
"argsType": "BrepHandle",
|
|
4275
4323
|
"resultType": "ComponentHandle"
|
|
4276
4324
|
},
|
|
4325
|
+
{
|
|
4326
|
+
"path": "design.create.opening",
|
|
4327
|
+
"namespace": "design.create",
|
|
4328
|
+
"summary": "Place a catalog **door or window** into a host wall with optional size overrides.",
|
|
4329
|
+
"examplePrompts": [
|
|
4330
|
+
"Add a 1m wide door to this wall here",
|
|
4331
|
+
"Place a window with a 0.9m sill height on the selected wall"
|
|
4332
|
+
],
|
|
4333
|
+
"argsType": "PluginDesignCreateOpeningOptions",
|
|
4334
|
+
"resultType": "ComponentHandle",
|
|
4335
|
+
"performance": "Single-opening creator — use it for one hosted opening. A plural API is intentionally unavailable until host placement can be atomic. # 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, }) ```"
|
|
4336
|
+
},
|
|
4277
4337
|
{
|
|
4278
4338
|
"path": "design.create.referenceLines",
|
|
4279
4339
|
"namespace": "design.create",
|
|
@@ -5471,6 +5531,19 @@
|
|
|
5471
5531
|
"argsType": "ComponentHandle",
|
|
5472
5532
|
"resultType": "ContourHandle | null"
|
|
5473
5533
|
},
|
|
5534
|
+
{
|
|
5535
|
+
"path": "design.query.storeyOutline",
|
|
5536
|
+
"namespace": "design.query",
|
|
5537
|
+
"summary": "Compute the plan **outline of what is built on a storey** — the union of the storey's wall (by default) footprints as polygons-with-holes. This is the footprint-from-the-built-model query: by the time slabs are needed the walls exist, and the engine's own solids (snapped, joined and mitred at creation) are the cleanest wall network available — no CAD re-tracing.",
|
|
5538
|
+
"examplePrompts": [
|
|
5539
|
+
"What is the building footprint on the ground floor?",
|
|
5540
|
+
"Create a floor slab covering the whole storey",
|
|
5541
|
+
"Get the outline of the walls on storey 1",
|
|
5542
|
+
"How much area do the ground-floor walls enclose?\n\n# Example\n```ts\nconst r = await snaptrude.design.query.storeyOutline({ storey: 1 })\nconst main = r.footprints.find((f) => f.enclosed)\nif (main) {\nconst profile = await snaptrude.core.geom.create.profileFromLinePoints(\nmain.outline.map((p) => ({ x: p.x, y: 0, z: p.z })),\n)\n// → design.create.slab with the profile's contour\n}\n```"
|
|
5543
|
+
],
|
|
5544
|
+
"argsType": "PluginStoreyOutlineOptions",
|
|
5545
|
+
"resultType": "PluginStoreyOutlineResult"
|
|
5546
|
+
},
|
|
5474
5547
|
{
|
|
5475
5548
|
"path": "design.selection.add",
|
|
5476
5549
|
"namespace": "design.selection",
|
|
@@ -7551,6 +7624,17 @@
|
|
|
7551
7624
|
"argsType": null,
|
|
7552
7625
|
"resultType": "PluginProgramSiteNorthAngleResult"
|
|
7553
7626
|
},
|
|
7627
|
+
{
|
|
7628
|
+
"path": "program.site.getSiteAnalysis",
|
|
7629
|
+
"namespace": "program.site",
|
|
7630
|
+
"summary": "Read the persisted Site Analysis sheet for the active proposal.",
|
|
7631
|
+
"examplePrompts": [
|
|
7632
|
+
"Read the current Site Analysis sheet",
|
|
7633
|
+
"What zoning constraints are recorded for this proposal?\n\n# Example\n```ts\nconst analysis = await snaptrude.program.site.getSiteAnalysis()\nif (analysis) console.log(analysis.sheetName, analysis.rows)\n```"
|
|
7634
|
+
],
|
|
7635
|
+
"argsType": null,
|
|
7636
|
+
"resultType": "PluginProgramSiteAnalysisResult"
|
|
7637
|
+
},
|
|
7554
7638
|
{
|
|
7555
7639
|
"path": "program.site.getTimezone",
|
|
7556
7640
|
"namespace": "program.site",
|
|
@@ -7615,6 +7699,17 @@
|
|
|
7615
7699
|
"argsType": null,
|
|
7616
7700
|
"resultType": "PluginProgramSiteListPolygonsResult"
|
|
7617
7701
|
},
|
|
7702
|
+
{
|
|
7703
|
+
"path": "program.site.updateSiteAnalysis",
|
|
7704
|
+
"namespace": "program.site",
|
|
7705
|
+
"summary": "Merge sourced site/zoning constraints into the active proposal's persisted Site Analysis sheet.",
|
|
7706
|
+
"examplePrompts": [
|
|
7707
|
+
"Save these zoning constraints to Site Analysis",
|
|
7708
|
+
"Update the FAR and setbacks in the Site Analysis sheet\n\n# Example\n```ts\nconst result = await snaptrude.program.site.updateSiteAnalysis([\n{ category: \"FAR\", description: \"Floor Area Ratio\", quantity: 3.5, unit: \"ratio\" },\n{ category: \"Set backs\", description: \"Front setbacks\", quantity: 6, unit: \"m\" },\n])\nconsole.log(result.sheetName, result.updatedRows, result.appendedRows)\n```"
|
|
7709
|
+
],
|
|
7710
|
+
"argsType": "PluginSiteAnalysisRow[]",
|
|
7711
|
+
"resultType": "PluginProgramSiteAnalysisUpdateResult"
|
|
7712
|
+
},
|
|
7618
7713
|
{
|
|
7619
7714
|
"path": "program.spreadsheet.addChart",
|
|
7620
7715
|
"namespace": "program.spreadsheet",
|