@snaptrude/plugin-core 0.3.0 → 0.6.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/AGENTS.md +130 -48
- package/CHANGELOG.md +163 -0
- package/api-manifest.full.json +5600 -0
- package/api-manifest.json +5502 -0
- package/dist/api/analysis/heatmaps.d.ts +234 -0
- package/dist/api/analysis/heatmaps.d.ts.map +1 -0
- package/dist/api/analysis/illuminance.d.ts +145 -0
- package/dist/api/analysis/illuminance.d.ts.map +1 -0
- package/dist/api/analysis/index.d.ts +44 -0
- package/dist/api/analysis/index.d.ts.map +1 -0
- package/dist/api/analysis/shadows.d.ts +165 -0
- package/dist/api/analysis/shadows.d.ts.map +1 -0
- package/dist/api/analysis/sunlightHours.d.ts +208 -0
- package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
- package/dist/api/analysis/sunpath.d.ts +80 -0
- package/dist/api/analysis/sunpath.d.ts.map +1 -0
- package/dist/api/core/buildings.d.ts +427 -0
- package/dist/api/core/buildings.d.ts.map +1 -0
- package/dist/api/core/comment/index.d.ts +230 -0
- package/dist/api/core/comment/index.d.ts.map +1 -0
- package/dist/api/core/geom/create/index.d.ts +247 -0
- package/dist/api/core/geom/create/index.d.ts.map +1 -0
- package/dist/api/core/geom/delete/index.d.ts +72 -0
- package/dist/api/core/geom/delete/index.d.ts.map +1 -0
- package/dist/api/core/geom/index.d.ts +24 -23
- package/dist/api/core/geom/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/arc.d.ts +169 -0
- package/dist/api/core/geom/query/arc.d.ts.map +1 -0
- package/dist/api/core/geom/query/brep.d.ts +402 -0
- package/dist/api/core/geom/query/brep.d.ts.map +1 -0
- package/dist/api/core/geom/query/circle.d.ts +378 -0
- package/dist/api/core/geom/query/circle.d.ts.map +1 -0
- package/dist/api/core/geom/query/contour.d.ts +450 -0
- package/dist/api/core/geom/query/contour.d.ts.map +1 -0
- package/dist/api/core/geom/query/curve.d.ts +918 -0
- package/dist/api/core/geom/query/curve.d.ts.map +1 -0
- package/dist/api/core/geom/query/edge.d.ts +128 -0
- package/dist/api/core/geom/query/edge.d.ts.map +1 -0
- package/dist/api/core/geom/query/face.d.ts +363 -0
- package/dist/api/core/geom/query/face.d.ts.map +1 -0
- package/dist/api/core/geom/query/halfedge.d.ts +206 -0
- package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
- package/dist/api/core/geom/query/index.d.ts +61 -0
- package/dist/api/core/geom/query/index.d.ts.map +1 -0
- package/dist/api/core/geom/query/profile.d.ts +410 -0
- package/dist/api/core/geom/query/profile.d.ts.map +1 -0
- package/dist/api/core/geom/query/vertex.d.ts +187 -0
- package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
- package/dist/api/core/geom/update/contour.d.ts +272 -0
- package/dist/api/core/geom/update/contour.d.ts.map +1 -0
- package/dist/api/core/geom/update/curve.d.ts +180 -0
- package/dist/api/core/geom/update/curve.d.ts.map +1 -0
- package/dist/api/core/geom/update/index.d.ts +27 -0
- package/dist/api/core/geom/update/index.d.ts.map +1 -0
- package/dist/api/core/geom/update/profile.d.ts +329 -0
- package/dist/api/core/geom/update/profile.d.ts.map +1 -0
- package/dist/api/core/groups.d.ts +485 -0
- package/dist/api/core/groups.d.ts.map +1 -0
- package/dist/api/core/history/index.d.ts +78 -0
- package/dist/api/core/history/index.d.ts.map +1 -0
- package/dist/api/core/index.d.ts +51 -1
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/io/import/index.d.ts +392 -0
- package/dist/api/core/io/import/index.d.ts.map +1 -0
- package/dist/api/core/io/index.d.ts +35 -0
- package/dist/api/core/io/index.d.ts.map +1 -0
- package/dist/api/core/io/job/index.d.ts +139 -0
- package/dist/api/core/io/job/index.d.ts.map +1 -0
- package/dist/api/core/io/query/index.d.ts +74 -0
- package/dist/api/core/io/query/index.d.ts.map +1 -0
- package/dist/api/core/io/terrain/index.d.ts +206 -0
- package/dist/api/core/io/terrain/index.d.ts.map +1 -0
- package/dist/api/core/io/underlay/index.d.ts +286 -0
- package/dist/api/core/io/underlay/index.d.ts.map +1 -0
- package/dist/api/core/layers.d.ts +402 -0
- package/dist/api/core/layers.d.ts.map +1 -0
- package/dist/api/core/math/quat.d.ts +111 -128
- package/dist/api/core/math/quat.d.ts.map +1 -1
- package/dist/api/core/math/vec3.d.ts +120 -102
- package/dist/api/core/math/vec3.d.ts.map +1 -1
- package/dist/api/core/project/index.d.ts +399 -0
- package/dist/api/core/project/index.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +755 -0
- package/dist/api/core/tags.d.ts.map +1 -0
- package/dist/api/core/units/index.d.ts +175 -0
- package/dist/api/core/units/index.d.ts.map +1 -0
- package/dist/api/core/zoom/index.d.ts +45 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +168 -0
- package/dist/api/design/boolean/index.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +837 -0
- package/dist/api/design/create/index.d.ts.map +1 -0
- package/dist/api/design/delete/index.d.ts +63 -0
- package/dist/api/design/delete/index.d.ts.map +1 -0
- package/dist/api/design/doors/index.d.ts +268 -0
- package/dist/api/design/doors/index.d.ts.map +1 -0
- package/dist/api/design/edit/index.d.ts +49 -0
- package/dist/api/design/edit/index.d.ts.map +1 -0
- package/dist/api/design/erase/index.d.ts +160 -0
- package/dist/api/design/erase/index.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +123 -0
- package/dist/api/design/furniture/index.d.ts.map +1 -0
- package/dist/api/design/index.d.ts +153 -0
- package/dist/api/design/index.d.ts.map +1 -0
- package/dist/api/design/lock.d.ts +41 -0
- package/dist/api/design/lock.d.ts.map +1 -0
- package/dist/api/design/materials/index.d.ts +297 -0
- package/dist/api/design/materials/index.d.ts.map +1 -0
- package/dist/api/design/query/geometry/index.d.ts +140 -0
- package/dist/api/design/query/geometry/index.d.ts.map +1 -0
- package/dist/api/design/query/index.d.ts +1011 -0
- package/dist/api/design/query/index.d.ts.map +1 -0
- package/dist/api/design/query/spaces.d.ts +221 -0
- package/dist/api/design/query/spaces.d.ts.map +1 -0
- package/dist/api/design/selection/index.d.ts +282 -0
- package/dist/api/design/selection/index.d.ts.map +1 -0
- package/dist/api/design/shared.d.ts +38 -0
- package/dist/api/design/shared.d.ts.map +1 -0
- package/dist/api/design/transform/index.d.ts +87 -0
- package/dist/api/design/transform/index.d.ts.map +1 -0
- package/dist/api/design/update/index.d.ts +178 -0
- package/dist/api/design/update/index.d.ts.map +1 -0
- package/dist/api/design/windows/index.d.ts +189 -0
- package/dist/api/design/windows/index.d.ts.map +1 -0
- package/dist/api/entity/buildableEnvelope.d.ts +261 -0
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
- package/dist/api/entity/department.d.ts +0 -98
- package/dist/api/entity/department.d.ts.map +1 -1
- package/dist/api/entity/index.d.ts +9 -9
- package/dist/api/entity/index.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +49 -106
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +484 -251
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +49 -39
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +22 -12
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +440 -0
- package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
- package/dist/api/presentation/diagrams.d.ts +81 -0
- package/dist/api/presentation/diagrams.d.ts.map +1 -0
- package/dist/api/presentation/import.d.ts +113 -0
- package/dist/api/presentation/import.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +46 -0
- package/dist/api/presentation/index.d.ts.map +1 -0
- package/dist/api/presentation/sheets.d.ts +176 -0
- package/dist/api/presentation/sheets.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +296 -0
- package/dist/api/presentation/views.d.ts.map +1 -0
- package/dist/api/program/adjacency.d.ts +155 -0
- package/dist/api/program/adjacency.d.ts.map +1 -0
- package/dist/api/program/areas.d.ts +360 -0
- package/dist/api/program/areas.d.ts.map +1 -0
- package/dist/api/program/classification.d.ts +135 -0
- package/dist/api/program/classification.d.ts.map +1 -0
- package/dist/api/program/cores.d.ts +174 -0
- package/dist/api/program/cores.d.ts.map +1 -0
- package/dist/api/program/departments.d.ts +431 -0
- package/dist/api/program/departments.d.ts.map +1 -0
- package/dist/api/program/index.d.ts +69 -0
- package/dist/api/program/index.d.ts.map +1 -0
- package/dist/api/program/layout.d.ts +63 -0
- package/dist/api/program/layout.d.ts.map +1 -0
- package/dist/api/program/metrics.d.ts +108 -0
- package/dist/api/program/metrics.d.ts.map +1 -0
- package/dist/api/program/site.d.ts +451 -0
- package/dist/api/program/site.d.ts.map +1 -0
- package/dist/api/program/spreadsheet.d.ts +2041 -0
- package/dist/api/program/spreadsheet.d.ts.map +1 -0
- package/dist/handles.d.ts +171 -0
- package/dist/handles.d.ts.map +1 -0
- package/dist/host-utils.d.ts +7 -5
- package/dist/host-utils.d.ts.map +1 -1
- package/dist/index.cjs +4344 -899
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3682 -865
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
- package/scripts/generate-manifest.mjs +193 -0
- package/scripts/generate-manifest.test.mjs +215 -0
- package/src/api/analysis/heatmaps.ts +256 -0
- package/src/api/analysis/illuminance.ts +155 -0
- package/src/api/analysis/index.ts +46 -0
- package/src/api/analysis/shadows.ts +183 -0
- package/src/api/analysis/sunlightHours.ts +211 -0
- package/src/api/analysis/sunpath.ts +83 -0
- package/src/api/core/buildings.ts +485 -0
- package/src/api/core/comment/index.ts +258 -0
- package/src/api/core/geom/create/index.ts +293 -0
- package/src/api/core/geom/delete/index.ts +78 -0
- package/src/api/core/geom/index.ts +24 -23
- package/src/api/core/geom/query/arc.ts +169 -0
- package/src/api/core/geom/query/brep.ts +444 -0
- package/src/api/core/geom/query/circle.ts +404 -0
- package/src/api/core/geom/query/contour.ts +540 -0
- package/src/api/core/geom/query/curve.ts +1078 -0
- package/src/api/core/geom/query/edge.ts +130 -0
- package/src/api/core/geom/query/face.ts +403 -0
- package/src/api/core/geom/query/halfedge.ts +210 -0
- package/src/api/core/geom/query/index.ts +63 -0
- package/src/api/core/geom/query/profile.ts +473 -0
- package/src/api/core/geom/query/vertex.ts +205 -0
- package/src/api/core/geom/update/contour.ts +315 -0
- package/src/api/core/geom/update/curve.ts +209 -0
- package/src/api/core/geom/update/index.ts +29 -0
- package/src/api/core/geom/update/profile.ts +377 -0
- package/src/api/core/groups.ts +521 -0
- package/src/api/core/history/index.ts +84 -0
- package/src/api/core/index.ts +51 -1
- package/src/api/core/io/import/index.ts +432 -0
- package/src/api/core/io/index.ts +37 -0
- package/src/api/core/io/job/index.ts +140 -0
- package/src/api/core/io/query/index.ts +71 -0
- package/src/api/core/io/terrain/index.ts +214 -0
- package/src/api/core/io/underlay/index.ts +295 -0
- package/src/api/core/layers.ts +333 -0
- package/src/api/core/math/quat.ts +112 -235
- package/src/api/core/math/vec3.ts +124 -159
- package/src/api/core/project/index.ts +418 -0
- package/src/api/core/tags.ts +808 -0
- package/src/api/core/units/index.ts +164 -0
- package/src/api/core/zoom/index.ts +47 -0
- package/src/api/design/boolean/index.ts +179 -0
- package/src/api/design/create/index.ts +895 -0
- package/src/api/design/delete/index.ts +67 -0
- package/src/api/design/doors/index.ts +285 -0
- package/src/api/design/edit/index.ts +54 -0
- package/src/api/design/erase/index.ts +151 -0
- package/src/api/design/furniture/index.ts +130 -0
- package/src/api/design/index.ts +162 -0
- package/src/api/design/lock.ts +42 -0
- package/src/api/design/materials/index.ts +301 -0
- package/src/api/design/query/geometry/index.ts +166 -0
- package/src/api/design/query/index.ts +937 -0
- package/src/api/design/query/spaces.ts +132 -0
- package/src/api/design/selection/index.ts +273 -0
- package/src/api/design/shared.ts +40 -0
- package/src/api/design/transform/index.ts +93 -0
- package/src/api/design/update/index.ts +117 -0
- package/src/api/design/windows/index.ts +207 -0
- package/src/api/entity/buildableEnvelope.ts +318 -0
- package/src/api/entity/department.ts +0 -113
- package/src/api/entity/index.ts +9 -9
- package/src/api/entity/referenceLine.ts +50 -38
- package/src/api/entity/space.ts +285 -226
- package/src/api/entity/story.ts +53 -42
- package/src/api/index.ts +22 -12
- package/src/api/presentation/aiInspiration.ts +362 -0
- package/src/api/presentation/diagrams.ts +84 -0
- package/src/api/presentation/import.ts +112 -0
- package/src/api/presentation/index.ts +48 -0
- package/src/api/presentation/sheets.ts +198 -0
- package/src/api/presentation/views.ts +303 -0
- package/src/api/program/adjacency.ts +164 -0
- package/src/api/program/areas.ts +335 -0
- package/src/api/program/classification.ts +138 -0
- package/src/api/program/cores.ts +171 -0
- package/src/api/program/departments.ts +465 -0
- package/src/api/program/index.ts +71 -0
- package/src/api/program/layout.ts +68 -0
- package/src/api/program/metrics.ts +120 -0
- package/src/api/program/site.ts +419 -0
- package/src/api/program/spreadsheet.ts +2075 -0
- package/src/handles.ts +194 -0
- package/src/host-utils.ts +10 -6
- package/src/index.ts +1 -0
- package/dist/api/core/geom/arc.d.ts +0 -81
- package/dist/api/core/geom/arc.d.ts.map +0 -1
- package/dist/api/core/geom/curve.d.ts +0 -70
- package/dist/api/core/geom/curve.d.ts.map +0 -1
- package/dist/api/core/geom/line.d.ts +0 -56
- package/dist/api/core/geom/line.d.ts.map +0 -1
- package/dist/api/core/geom/profile.d.ts +0 -121
- package/dist/api/core/geom/profile.d.ts.map +0 -1
- package/dist/api/tools/copy.d.ts +0 -59
- package/dist/api/tools/copy.d.ts.map +0 -1
- package/dist/api/tools/index.d.ts +0 -33
- package/dist/api/tools/index.d.ts.map +0 -1
- package/dist/api/tools/material.d.ts +0 -51
- package/dist/api/tools/material.d.ts.map +0 -1
- package/dist/api/tools/offset.d.ts +0 -43
- package/dist/api/tools/offset.d.ts.map +0 -1
- package/dist/api/tools/selection.d.ts +0 -48
- package/dist/api/tools/selection.d.ts.map +0 -1
- package/dist/api/tools/transform.d.ts +0 -114
- package/dist/api/tools/transform.d.ts.map +0 -1
- package/dist/api/units/index.d.ts +0 -163
- package/dist/api/units/index.d.ts.map +0 -1
- package/src/api/core/geom/arc.ts +0 -70
- package/src/api/core/geom/curve.ts +0 -41
- package/src/api/core/geom/line.ts +0 -53
- package/src/api/core/geom/profile.ts +0 -94
- package/src/api/tools/copy.ts +0 -55
- package/src/api/tools/index.ts +0 -39
- package/src/api/tools/material.ts +0 -49
- package/src/api/tools/offset.ts +0 -43
- package/src/api/tools/selection.ts +0 -51
- package/src/api/tools/transform.ts +0 -117
- package/src/api/units/index.ts +0 -163
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { PluginApiReturn } from "../../../../types";
|
|
3
|
+
import { Vec3Handle, LineHandle, ArcHandle, CircleHandle, CurveHandle, ProfileHandle, ContourHandle } from "../../../../handles";
|
|
4
|
+
/**
|
|
5
|
+
* Curve creation — construct new geometric curves from point handles (all-handle
|
|
6
|
+
* model, §11).
|
|
7
|
+
*
|
|
8
|
+
* Each method takes point handles ({@linkcode Vec3Handle}) and returns an opaque
|
|
9
|
+
* curve handle ({@linkcode LineHandle} or {@linkcode ArcHandle}) that you pass to
|
|
10
|
+
* query, update, or entity-creation methods. Read geometry back as plain values
|
|
11
|
+
* via the `snaptrude.core.geom.query.*` methods.
|
|
12
|
+
*
|
|
13
|
+
* Accessed via `snaptrude.core.geom.create`.
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class PluginGeomCreateApi {
|
|
16
|
+
constructor();
|
|
17
|
+
/**
|
|
18
|
+
* Create a straight line segment between two point handles. Host API call —
|
|
19
|
+
* returns a handle.
|
|
20
|
+
*
|
|
21
|
+
* @param startPoint Start point of the line segment
|
|
22
|
+
* @param endPoint End point of the line segment
|
|
23
|
+
* @returns The new line as a {@linkcode LineHandle}
|
|
24
|
+
*
|
|
25
|
+
* @examplePrompt Draw a line from point A to point B
|
|
26
|
+
* @examplePrompt Draw a straight edge between these two points
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const line = snaptrude.core.geom.create.line(startPoint, endPoint)
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
abstract line(startPoint: Vec3Handle, endPoint: Vec3Handle): PluginApiReturn<LineHandle>;
|
|
34
|
+
/**
|
|
35
|
+
* Create a circular arc from its start, end, centre, and axis point handles.
|
|
36
|
+
* Host API call — returns a handle.
|
|
37
|
+
*
|
|
38
|
+
* @param startPoint Start point of the arc
|
|
39
|
+
* @param endPoint End point of the arc
|
|
40
|
+
* @param centrePoint Centre point of the arc
|
|
41
|
+
* @param axis Axis direction of the arc
|
|
42
|
+
* @returns The new arc as an {@linkcode ArcHandle}
|
|
43
|
+
*
|
|
44
|
+
* @examplePrompt Draw an arc between these two points around a centre
|
|
45
|
+
* @examplePrompt Add a curved segment from A to B
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const arc = snaptrude.core.geom.create.arc(startPoint, endPoint, centrePoint, axis)
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
abstract arc(startPoint: Vec3Handle, endPoint: Vec3Handle, centrePoint: Vec3Handle, axis: Vec3Handle): PluginApiReturn<ArcHandle>;
|
|
53
|
+
/**
|
|
54
|
+
* Create a circle from a centre point, an axis (plane normal), and a radius.
|
|
55
|
+
* Host API call — returns a handle. A circle is a closed curve; read it back via
|
|
56
|
+
* `snaptrude.core.geom.query.circle.*`.
|
|
57
|
+
*
|
|
58
|
+
* @param centrePoint Centre point of the circle
|
|
59
|
+
* @param axis Axis direction (plane normal) of the circle
|
|
60
|
+
* @param radius Radius of the circle
|
|
61
|
+
* @returns The new circle as a {@linkcode CircleHandle}
|
|
62
|
+
*
|
|
63
|
+
* @examplePrompt Make a circle of radius 2 at this point
|
|
64
|
+
* @examplePrompt Draw a circular outline 5m across
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const circle = snaptrude.core.geom.create.circle(centrePoint, axis, 2)
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
abstract circle(centrePoint: Vec3Handle, axis: Vec3Handle, radius: number): PluginApiReturn<CircleHandle>;
|
|
72
|
+
/**
|
|
73
|
+
* Create a closed profile from an ordered list of point handles connected by
|
|
74
|
+
* line segments (last auto-connected to first). Host API call — returns a handle.
|
|
75
|
+
*
|
|
76
|
+
* @param points Ordered vertex handles of the profile
|
|
77
|
+
* @returns The new profile as a {@linkcode ProfileHandle}
|
|
78
|
+
*
|
|
79
|
+
* @examplePrompt Draw a closed polygon through these corner points
|
|
80
|
+
* @examplePrompt Create an L-shaped outline from a list of points
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const profile = snaptrude.core.geom.create.profileFromLinePoints(points)
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
abstract profileFromLinePoints(points: Vec3Handle[]): PluginApiReturn<ProfileHandle>;
|
|
88
|
+
/**
|
|
89
|
+
* Create a profile from an ordered list of curve handles forming a closed loop.
|
|
90
|
+
* Host API call — returns a handle.
|
|
91
|
+
*
|
|
92
|
+
* @param curves Ordered curve handles forming a closed loop
|
|
93
|
+
* @returns The new profile as a {@linkcode ProfileHandle}
|
|
94
|
+
*
|
|
95
|
+
* @examplePrompt Join these lines and arcs into one closed shape
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* const profile = snaptrude.core.geom.create.profileFromCurves([line, arc])
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
abstract profileFromCurves(curves: CurveHandle[]): PluginApiReturn<ProfileHandle>;
|
|
103
|
+
/**
|
|
104
|
+
* Create an axis-aligned **rectangle** profile (XZ plane) of `width` × `depth`,
|
|
105
|
+
* centred at `center` (defaults to the origin). Host API call — returns a handle.
|
|
106
|
+
*
|
|
107
|
+
* Pair with `design.create.space` / `design.create.spaces` to author a rectangular
|
|
108
|
+
* (box) space — there is no dedicated rectangular-space creator; build the profile
|
|
109
|
+
* here, then extrude it.
|
|
110
|
+
*
|
|
111
|
+
* @param width Extent along X
|
|
112
|
+
* @param depth Extent along Z
|
|
113
|
+
* @param center Optional centre point (default origin)
|
|
114
|
+
* @returns The new rectangle profile as a {@linkcode ProfileHandle}
|
|
115
|
+
*
|
|
116
|
+
* @examplePrompt Draw a 4m by 3m rectangle
|
|
117
|
+
* @examplePrompt Make a rectangular outline for a room footprint
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* const rect = snaptrude.core.geom.create.profileRect(4, 3)
|
|
122
|
+
* const contour = snaptrude.core.geom.create.contourFromProfile(rect)
|
|
123
|
+
* const space = snaptrude.design.create.space(contour, 3)
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
abstract profileRect(width: number, depth: number, center?: Vec3Handle): PluginApiReturn<ProfileHandle>;
|
|
127
|
+
/**
|
|
128
|
+
* Create a contour (an outer profile loop, no holes). Host API call — returns a handle.
|
|
129
|
+
*
|
|
130
|
+
* @param outer The outer boundary loop
|
|
131
|
+
* @returns The new contour as a {@linkcode ContourHandle}
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* const contour = snaptrude.core.geom.create.contourFromProfile(outer)
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
abstract contourFromProfile(outer: ProfileHandle): PluginApiReturn<ContourHandle>;
|
|
138
|
+
/**
|
|
139
|
+
* Create a contour from an outer profile plus zero or more inner profiles (holes).
|
|
140
|
+
* Host API call — returns a handle.
|
|
141
|
+
*
|
|
142
|
+
* @param outer The outer boundary loop
|
|
143
|
+
* @param holes Optional inner hole loops
|
|
144
|
+
* @returns The new contour as a {@linkcode ContourHandle}
|
|
145
|
+
*
|
|
146
|
+
* @examplePrompt Make a shape with a hole in the middle
|
|
147
|
+
* @examplePrompt Cut a courtyard opening out of this floor outline
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* const contour = snaptrude.core.geom.create.contourFromProfiles(outer, [hole])
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
abstract contourFromProfiles(outer: ProfileHandle, holes?: ProfileHandle[]): PluginApiReturn<ContourHandle>;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Arguments for {@linkcode PluginGeomCreateApi.line}.
|
|
158
|
+
*
|
|
159
|
+
* | Property | Type | Description |
|
|
160
|
+
* |---|---|---|
|
|
161
|
+
* | `startPoint` | {@linkcode Vec3Handle} | Start point of the line segment |
|
|
162
|
+
* | `endPoint` | {@linkcode Vec3Handle} | End point of the line segment |
|
|
163
|
+
*/
|
|
164
|
+
export declare const PluginGeomCreateLineArgs: z.ZodObject<{
|
|
165
|
+
startPoint: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>;
|
|
166
|
+
endPoint: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
export type PluginGeomCreateLineArgs = z.infer<typeof PluginGeomCreateLineArgs>;
|
|
169
|
+
/**
|
|
170
|
+
* Arguments for {@linkcode PluginGeomCreateApi.arc}.
|
|
171
|
+
*
|
|
172
|
+
* | Property | Type | Description |
|
|
173
|
+
* |---|---|---|
|
|
174
|
+
* | `startPoint` | {@linkcode Vec3Handle} | Start point of the arc |
|
|
175
|
+
* | `endPoint` | {@linkcode Vec3Handle} | End point of the arc |
|
|
176
|
+
* | `centrePoint` | {@linkcode Vec3Handle} | Centre point of the arc |
|
|
177
|
+
* | `axis` | {@linkcode Vec3Handle} | Axis direction of the arc |
|
|
178
|
+
*/
|
|
179
|
+
export declare const PluginGeomCreateArcArgs: z.ZodObject<{
|
|
180
|
+
startPoint: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>;
|
|
181
|
+
endPoint: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>;
|
|
182
|
+
centrePoint: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>;
|
|
183
|
+
axis: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>;
|
|
184
|
+
}, z.core.$strip>;
|
|
185
|
+
export type PluginGeomCreateArcArgs = z.infer<typeof PluginGeomCreateArcArgs>;
|
|
186
|
+
/**
|
|
187
|
+
* Arguments for {@linkcode PluginGeomCreateApi.circle}.
|
|
188
|
+
*
|
|
189
|
+
* | Property | Type | Description |
|
|
190
|
+
* |---|---|---|
|
|
191
|
+
* | `centrePoint` | {@linkcode Vec3Handle} | Centre point of the circle |
|
|
192
|
+
* | `axis` | {@linkcode Vec3Handle} | Axis direction (plane normal) of the circle |
|
|
193
|
+
* | `radius` | `number` | Radius of the circle |
|
|
194
|
+
*/
|
|
195
|
+
export declare const PluginGeomCreateCircleArgs: z.ZodObject<{
|
|
196
|
+
centrePoint: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>;
|
|
197
|
+
axis: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>;
|
|
198
|
+
radius: z.ZodNumber;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
export type PluginGeomCreateCircleArgs = z.infer<typeof PluginGeomCreateCircleArgs>;
|
|
201
|
+
/**
|
|
202
|
+
* Arguments for {@linkcode PluginGeomCreateApi.profileFromLinePoints}.
|
|
203
|
+
*
|
|
204
|
+
* | Property | Type | Description |
|
|
205
|
+
* |---|---|---|
|
|
206
|
+
* | `points` | {@linkcode Vec3Handle}`[]` | Ordered vertex handles of the profile |
|
|
207
|
+
*/
|
|
208
|
+
export declare const PluginGeomCreateProfileFromLinePointsArgs: z.ZodObject<{
|
|
209
|
+
points: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>>;
|
|
210
|
+
}, z.core.$strip>;
|
|
211
|
+
export type PluginGeomCreateProfileFromLinePointsArgs = z.infer<typeof PluginGeomCreateProfileFromLinePointsArgs>;
|
|
212
|
+
/**
|
|
213
|
+
* Arguments for {@linkcode PluginGeomCreateApi.profileFromCurves}.
|
|
214
|
+
*
|
|
215
|
+
* | Property | Type | Description |
|
|
216
|
+
* |---|---|---|
|
|
217
|
+
* | `curves` | {@linkcode CurveHandle}`[]` | Ordered curve handles forming a closed loop |
|
|
218
|
+
*/
|
|
219
|
+
export declare const PluginGeomCreateProfileFromCurvesArgs: z.ZodObject<{
|
|
220
|
+
curves: z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"arc">, string>>]>>;
|
|
221
|
+
}, z.core.$strip>;
|
|
222
|
+
export type PluginGeomCreateProfileFromCurvesArgs = z.infer<typeof PluginGeomCreateProfileFromCurvesArgs>;
|
|
223
|
+
/**
|
|
224
|
+
* Arguments for {@linkcode PluginGeomCreateApi.contourFromProfile}.
|
|
225
|
+
*
|
|
226
|
+
* | Property | Type | Description |
|
|
227
|
+
* |---|---|---|
|
|
228
|
+
* | `outer` | {@linkcode ProfileHandle} | The outer boundary loop |
|
|
229
|
+
*/
|
|
230
|
+
export declare const PluginGeomCreateContourFromProfileArgs: z.ZodObject<{
|
|
231
|
+
outer: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"profile">, string>>;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
export type PluginGeomCreateContourFromProfileArgs = z.infer<typeof PluginGeomCreateContourFromProfileArgs>;
|
|
234
|
+
/**
|
|
235
|
+
* Arguments for {@linkcode PluginGeomCreateApi.contourFromProfiles}.
|
|
236
|
+
*
|
|
237
|
+
* | Property | Type | Description |
|
|
238
|
+
* |---|---|---|
|
|
239
|
+
* | `outer` | {@linkcode ProfileHandle} | The outer boundary loop |
|
|
240
|
+
* | `holes` | {@linkcode ProfileHandle}`[]` | Optional inner hole loops |
|
|
241
|
+
*/
|
|
242
|
+
export declare const PluginGeomCreateContourFromProfilesArgs: z.ZodObject<{
|
|
243
|
+
outer: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"profile">, string>>;
|
|
244
|
+
holes: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"profile">, string>>>>;
|
|
245
|
+
}, z.core.$strip>;
|
|
246
|
+
export type PluginGeomCreateContourFromProfilesArgs = z.infer<typeof PluginGeomCreateContourFromProfilesArgs>;
|
|
247
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/core/geom/create/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEhI;;;;;;;;;;GAUG;AACH,8BAAsB,mBAAmB;;IAGvC;;;;;;;;;;;;;;;OAeG;aACa,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,GAAG,eAAe,CAAC,UAAU,CAAC;IAE/F;;;;;;;;;;;;;;;;;OAiBG;aACa,GAAG,CACjB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,UAAU,EACvB,IAAI,EAAE,UAAU,GACf,eAAe,CAAC,SAAS,CAAC;IAE7B;;;;;;;;;;;;;;;;;OAiBG;aACa,MAAM,CACpB,WAAW,EAAE,UAAU,EACvB,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,GACb,eAAe,CAAC,YAAY,CAAC;IAEhC;;;;;;;;;;;;;;OAcG;aACa,qBAAqB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,eAAe,CAAC,aAAa,CAAC;IAE3F;;;;;;;;;;;;;OAaG;aACa,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,eAAe,CAAC,aAAa,CAAC;IAExF;;;;;;;;;;;;;;;;;;;;;;OAsBG;aACa,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,UAAU,GAClB,eAAe,CAAC,aAAa,CAAC;IAEjC;;;;;;;;;OASG;aACa,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,eAAe,CAAC,aAAa,CAAC;IAExF;;;;;;;;;;;;;;;OAeG;aACa,mBAAmB,CACjC,KAAK,EAAE,aAAa,EACpB,KAAK,CAAC,EAAE,aAAa,EAAE,GACtB,eAAe,CAAC,aAAa,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAA;AAEF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB;;;;;iBAKlC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B;;;;iBAIrC,CAAA;AAEF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEnF;;;;;;GAMG;AACH,eAAO,MAAM,yCAAyC;;iBAEpD,CAAA;AAEF,MAAM,MAAM,yCAAyC,GAAG,CAAC,CAAC,KAAK,CAC7D,OAAO,yCAAyC,CACjD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qCAAqC;;iBAEhD,CAAA;AAEF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,qCAAqC,CAC7C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sCAAsC;;iBAEjD,CAAA;AAEF,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,sCAAsC,CAC9C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,uCAAuC;;;iBAGlD,CAAA;AAEF,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAC3D,OAAO,uCAAuC,CAC/C,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { PluginApiReturn } from "../../../../types";
|
|
3
|
+
import { ProfileHandle, ContourHandle } from "../../../../handles";
|
|
4
|
+
/**
|
|
5
|
+
* Geometry deletion — release transient geometry resource handles (all-handle model, §11).
|
|
6
|
+
*
|
|
7
|
+
* Methods here free a handle's backing registry entry and reclaim its share of the
|
|
8
|
+
* plugin's resource quota. This is purely a handle-lifecycle operation: it does NOT
|
|
9
|
+
* tear down or delete any engine-side geometry. Once released, the handle is no
|
|
10
|
+
* longer resolvable and must not be reused.
|
|
11
|
+
*
|
|
12
|
+
* Accessed via `snaptrude.core.geom.delete`.
|
|
13
|
+
*/
|
|
14
|
+
export declare abstract class PluginGeomDeleteApi {
|
|
15
|
+
constructor();
|
|
16
|
+
/**
|
|
17
|
+
* Free a transient profile resource handle — releases its registry entry and
|
|
18
|
+
* reclaims its share of the plugin's resource quota. This is a handle-lifecycle
|
|
19
|
+
* operation only and does NOT tear down any engine-side geometry.
|
|
20
|
+
*
|
|
21
|
+
* @param profile The transient profile handle to release
|
|
22
|
+
* @returns Nothing
|
|
23
|
+
*
|
|
24
|
+
* # Example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const rect = await snaptrude.core.geom.create.profileRect(4, 3)
|
|
27
|
+
* const area = await snaptrude.core.geom.query.profile.getArea(rect)
|
|
28
|
+
* await snaptrude.core.geom.delete.profile(rect) // rect is no longer resolvable
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
abstract profile(profile: ProfileHandle): PluginApiReturn<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Free a transient contour resource handle — releases its registry entry and
|
|
34
|
+
* reclaims its share of the plugin's resource quota. Handle-lifecycle only; does
|
|
35
|
+
* NOT tear down engine-side geometry, nor the contour's child profile handles.
|
|
36
|
+
*
|
|
37
|
+
* @param contour The transient contour handle to release
|
|
38
|
+
* @returns Nothing
|
|
39
|
+
*
|
|
40
|
+
* # Example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const rect = await snaptrude.core.geom.create.profileRect(4, 3)
|
|
43
|
+
* const contour = await snaptrude.core.geom.create.contourFromProfile(rect)
|
|
44
|
+
* const area = await snaptrude.core.geom.query.contour.getArea(contour)
|
|
45
|
+
* await snaptrude.core.geom.delete.contour(contour) // contour freed; rect still valid
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
abstract contour(contour: ContourHandle): PluginApiReturn<void>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Arguments for {@linkcode PluginGeomDeleteApi.profile}.
|
|
52
|
+
*
|
|
53
|
+
* | Property | Type | Description |
|
|
54
|
+
* |---|---|---|
|
|
55
|
+
* | `profile` | {@linkcode ProfileHandle} | The transient profile handle to release |
|
|
56
|
+
*/
|
|
57
|
+
export declare const PluginGeomDeleteProfileArgs: z.ZodObject<{
|
|
58
|
+
profile: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"profile">, string>>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
export type PluginGeomDeleteProfileArgs = z.infer<typeof PluginGeomDeleteProfileArgs>;
|
|
61
|
+
/**
|
|
62
|
+
* Arguments for {@linkcode PluginGeomDeleteApi.contour}.
|
|
63
|
+
*
|
|
64
|
+
* | Property | Type | Description |
|
|
65
|
+
* |---|---|---|
|
|
66
|
+
* | `contour` | {@linkcode ContourHandle} | The transient contour handle to release |
|
|
67
|
+
*/
|
|
68
|
+
export declare const PluginGeomDeleteContourArgs: z.ZodObject<{
|
|
69
|
+
contour: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"contour">, string>>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export type PluginGeomDeleteContourArgs = z.infer<typeof PluginGeomDeleteContourArgs>;
|
|
72
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/core/geom/delete/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAElE;;;;;;;;;GASG;AACH,8BAAsB,mBAAmB;;IAGvC;;;;;;;;;;;;;;OAcG;aACa,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,eAAe,CAAC,IAAI,CAAC;IAEtE;;;;;;;;;;;;;;;OAeG;aACa,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,eAAe,CAAC,IAAI,CAAC;CACvE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B;;iBAEtC,CAAA;AAEF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAErF;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B;;iBAEtC,CAAA;AAEF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA"}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { PluginGeomCreateApi } from "./create";
|
|
2
|
+
import { PluginGeomQueryApi } from "./query";
|
|
3
|
+
import { PluginGeomUpdateApi } from "./update";
|
|
4
|
+
import { PluginGeomDeleteApi } from "./delete";
|
|
5
5
|
/**
|
|
6
|
-
* Geometry
|
|
6
|
+
* Geometry kernel — domain-free construction, query, editing, and disposal of
|
|
7
|
+
* curves (lines / arcs) and profiles. No BIM/AEC knowledge lives here; build
|
|
8
|
+
* geometry bottom-up: points ({@linkcode Vec3Handle}) → curves → profiles → entities.
|
|
9
|
+
*
|
|
10
|
+
* - {@linkcode PluginGeomApi.create} — construct lines, arcs, and profiles
|
|
11
|
+
* - {@linkcode PluginGeomApi.query} — read curve / arc / profile geometry and relationships
|
|
12
|
+
* - {@linkcode PluginGeomApi.update} — derive new curves / profiles (immutable edits)
|
|
13
|
+
* - {@linkcode PluginGeomApi.delete} — free a transient profile resource handle
|
|
7
14
|
*
|
|
8
|
-
* Build geometry bottom-up: points ({@linkcode PVec3}) → lines/arcs → curves → profiles.
|
|
9
15
|
* Profiles can then be used with entity creation methods like
|
|
10
16
|
* {@linkcode PluginSpaceApi.createFromProfile}.
|
|
11
|
-
*
|
|
12
|
-
* - {@linkcode PluginGeomApi.line} — Line segment construction
|
|
13
|
-
* - {@linkcode PluginGeomApi.arc} — Arc construction
|
|
14
|
-
* - {@linkcode PluginGeomApi.curve} — Unified curve wrapper (line or arc)
|
|
15
|
-
* - {@linkcode PluginGeomApi.profile} — Closed loop of curves
|
|
16
17
|
*/
|
|
17
18
|
export declare abstract class PluginGeomApi {
|
|
18
|
-
/**
|
|
19
|
-
abstract
|
|
20
|
-
/**
|
|
21
|
-
abstract
|
|
22
|
-
/**
|
|
23
|
-
abstract
|
|
24
|
-
/**
|
|
25
|
-
abstract
|
|
19
|
+
/** Curve and profile construction. See {@linkcode PluginGeomCreateApi}. */
|
|
20
|
+
abstract create: PluginGeomCreateApi;
|
|
21
|
+
/** Curve, arc, and profile queries. See {@linkcode PluginGeomQueryApi}. */
|
|
22
|
+
abstract query: PluginGeomQueryApi;
|
|
23
|
+
/** Curve and profile editing (derive-new). See {@linkcode PluginGeomUpdateApi}. */
|
|
24
|
+
abstract update: PluginGeomUpdateApi;
|
|
25
|
+
/** Resource-handle disposal (profile). See {@linkcode PluginGeomDeleteApi}. */
|
|
26
|
+
abstract delete: PluginGeomDeleteApi;
|
|
26
27
|
constructor();
|
|
27
28
|
}
|
|
28
|
-
export * from "./
|
|
29
|
-
export * from "./
|
|
30
|
-
export * from "./
|
|
31
|
-
export * from "./
|
|
29
|
+
export * from "./create";
|
|
30
|
+
export * from "./query";
|
|
31
|
+
export * from "./update";
|
|
32
|
+
export * from "./delete";
|
|
32
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/geom/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/geom/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAE9C;;;;;;;;;;;;GAYG;AACH,8BAAsB,aAAa;IACjC,2EAA2E;IAC3E,SAAgB,MAAM,EAAE,mBAAmB,CAAA;IAC3C,2EAA2E;IAC3E,SAAgB,KAAK,EAAE,kBAAkB,CAAA;IACzC,mFAAmF;IACnF,SAAgB,MAAM,EAAE,mBAAmB,CAAA;IAC3C,+EAA+E;IAC/E,SAAgB,MAAM,EAAE,mBAAmB,CAAA;;CAG5C;AAED,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { PluginApiReturn } from "../../../../types";
|
|
3
|
+
import { ArcHandle, Vec3Components } from "../../../../handles";
|
|
4
|
+
/**
|
|
5
|
+
* Arc-specific geometry queries — read circular-arc properties as plain values.
|
|
6
|
+
*
|
|
7
|
+
* Every method takes an opaque {@linkcode ArcHandle} and returns plain values
|
|
8
|
+
* (numbers or {@linkcode Vec3Components}), never a handle. Use these to inspect
|
|
9
|
+
* the radius, centre, axis, sweep angle, and validity of an arc handle obtained
|
|
10
|
+
* from {@linkcode PluginGeomCreateApi.arc} or another query.
|
|
11
|
+
*
|
|
12
|
+
* Accessed via `snaptrude.core.geom.query.arc`.
|
|
13
|
+
*/
|
|
14
|
+
export declare abstract class PluginGeomQueryArcApi {
|
|
15
|
+
constructor();
|
|
16
|
+
/**
|
|
17
|
+
* Read the radius of an arc.
|
|
18
|
+
*
|
|
19
|
+
* @param arc The arc to query
|
|
20
|
+
* @returns The arc radius as a `number`
|
|
21
|
+
*
|
|
22
|
+
* @examplePrompt What is the radius of this curved wall segment?
|
|
23
|
+
* @examplePrompt Measure the radius of the selected arc
|
|
24
|
+
*
|
|
25
|
+
* # Example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const start = await snaptrude.core.math.vec3.new(5, 0, 0)
|
|
28
|
+
* const end = await snaptrude.core.math.vec3.new(0, 0, 5)
|
|
29
|
+
* const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
|
|
30
|
+
* const up = await snaptrude.core.math.vec3.new(0, 1, 0)
|
|
31
|
+
* const arc = await snaptrude.core.geom.create.arc(start, end, origin, up)
|
|
32
|
+
* const radius = await snaptrude.core.geom.query.arc.getRadius(arc)
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
abstract getRadius(arc: ArcHandle): PluginApiReturn<number>;
|
|
36
|
+
/**
|
|
37
|
+
* Read the centre point of an arc.
|
|
38
|
+
*
|
|
39
|
+
* @param arc The arc to query
|
|
40
|
+
* @returns The arc centre as {@linkcode Vec3Components}
|
|
41
|
+
*
|
|
42
|
+
* @examplePrompt Where is the centre of this arc?
|
|
43
|
+
* @examplePrompt Find the center point of the curved wall
|
|
44
|
+
*
|
|
45
|
+
* # Example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const start = await snaptrude.core.math.vec3.new(5, 0, 0)
|
|
48
|
+
* const end = await snaptrude.core.math.vec3.new(0, 0, 5)
|
|
49
|
+
* const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
|
|
50
|
+
* const up = await snaptrude.core.math.vec3.new(0, 1, 0)
|
|
51
|
+
* const arc = await snaptrude.core.geom.create.arc(start, end, origin, up)
|
|
52
|
+
* const centre = await snaptrude.core.geom.query.arc.getCentre(arc)
|
|
53
|
+
* console.log(centre.x, centre.y, centre.z)
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
abstract getCentre(arc: ArcHandle): PluginApiReturn<Vec3Components>;
|
|
57
|
+
/**
|
|
58
|
+
* Read the rotation axis of an arc.
|
|
59
|
+
*
|
|
60
|
+
* @param arc The arc to query
|
|
61
|
+
* @returns The arc axis as {@linkcode Vec3Components}
|
|
62
|
+
*
|
|
63
|
+
* # Example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const start = await snaptrude.core.math.vec3.new(5, 0, 0)
|
|
66
|
+
* const end = await snaptrude.core.math.vec3.new(0, 0, 5)
|
|
67
|
+
* const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
|
|
68
|
+
* const up = await snaptrude.core.math.vec3.new(0, 1, 0)
|
|
69
|
+
* const arc = await snaptrude.core.geom.create.arc(start, end, origin, up)
|
|
70
|
+
* const axis = await snaptrude.core.geom.query.arc.getAxis(arc)
|
|
71
|
+
* console.log(axis.x, axis.y, axis.z)
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
abstract getAxis(arc: ArcHandle): PluginApiReturn<Vec3Components>;
|
|
75
|
+
/**
|
|
76
|
+
* Read the sweep angle of an arc (the angle subtended at its centre).
|
|
77
|
+
*
|
|
78
|
+
* @param arc The arc to query
|
|
79
|
+
* @returns The sweep angle in radians as a `number`
|
|
80
|
+
*
|
|
81
|
+
* @examplePrompt What angle does this arc sweep through?
|
|
82
|
+
* @examplePrompt How many degrees does this curved wall turn?
|
|
83
|
+
*
|
|
84
|
+
* # Example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const start = await snaptrude.core.math.vec3.new(5, 0, 0)
|
|
87
|
+
* const end = await snaptrude.core.math.vec3.new(0, 0, 5)
|
|
88
|
+
* const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
|
|
89
|
+
* const up = await snaptrude.core.math.vec3.new(0, 1, 0)
|
|
90
|
+
* const arc = await snaptrude.core.geom.create.arc(start, end, origin, up)
|
|
91
|
+
* const sweep = await snaptrude.core.geom.query.arc.getSweepAngle(arc)
|
|
92
|
+
* console.log("degrees:", (sweep * 180) / Math.PI)
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
abstract getSweepAngle(arc: ArcHandle): PluginApiReturn<number>;
|
|
96
|
+
/**
|
|
97
|
+
* Check whether an arc is geometrically valid.
|
|
98
|
+
*
|
|
99
|
+
* @param arc The arc to query
|
|
100
|
+
* @returns `true` if the arc is valid as a `boolean`
|
|
101
|
+
*
|
|
102
|
+
* # Example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const start = await snaptrude.core.math.vec3.new(5, 0, 0)
|
|
105
|
+
* const end = await snaptrude.core.math.vec3.new(0, 0, 5)
|
|
106
|
+
* const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
|
|
107
|
+
* const up = await snaptrude.core.math.vec3.new(0, 1, 0)
|
|
108
|
+
* const arc = await snaptrude.core.geom.create.arc(start, end, origin, up)
|
|
109
|
+
* const ok = await snaptrude.core.geom.query.arc.isValid(arc)
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
abstract isValid(arc: ArcHandle): PluginApiReturn<boolean>;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Arguments for {@linkcode PluginGeomQueryArcApi.getRadius}.
|
|
116
|
+
*
|
|
117
|
+
* | Property | Type | Description |
|
|
118
|
+
* |---|---|---|
|
|
119
|
+
* | `arc` | {@linkcode ArcHandle} | The arc to query |
|
|
120
|
+
*/
|
|
121
|
+
export declare const PluginGeomQueryArcGetRadiusArgs: z.ZodObject<{
|
|
122
|
+
arc: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"arc">, string>>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
export type PluginGeomQueryArcGetRadiusArgs = z.infer<typeof PluginGeomQueryArcGetRadiusArgs>;
|
|
125
|
+
/**
|
|
126
|
+
* Arguments for {@linkcode PluginGeomQueryArcApi.getCentre}.
|
|
127
|
+
*
|
|
128
|
+
* | Property | Type | Description |
|
|
129
|
+
* |---|---|---|
|
|
130
|
+
* | `arc` | {@linkcode ArcHandle} | The arc to query |
|
|
131
|
+
*/
|
|
132
|
+
export declare const PluginGeomQueryArcGetCentreArgs: z.ZodObject<{
|
|
133
|
+
arc: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"arc">, string>>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
export type PluginGeomQueryArcGetCentreArgs = z.infer<typeof PluginGeomQueryArcGetCentreArgs>;
|
|
136
|
+
/**
|
|
137
|
+
* Arguments for {@linkcode PluginGeomQueryArcApi.getAxis}.
|
|
138
|
+
*
|
|
139
|
+
* | Property | Type | Description |
|
|
140
|
+
* |---|---|---|
|
|
141
|
+
* | `arc` | {@linkcode ArcHandle} | The arc to query |
|
|
142
|
+
*/
|
|
143
|
+
export declare const PluginGeomQueryArcGetAxisArgs: z.ZodObject<{
|
|
144
|
+
arc: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"arc">, string>>;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
export type PluginGeomQueryArcGetAxisArgs = z.infer<typeof PluginGeomQueryArcGetAxisArgs>;
|
|
147
|
+
/**
|
|
148
|
+
* Arguments for {@linkcode PluginGeomQueryArcApi.getSweepAngle}.
|
|
149
|
+
*
|
|
150
|
+
* | Property | Type | Description |
|
|
151
|
+
* |---|---|---|
|
|
152
|
+
* | `arc` | {@linkcode ArcHandle} | The arc to query |
|
|
153
|
+
*/
|
|
154
|
+
export declare const PluginGeomQueryArcGetSweepAngleArgs: z.ZodObject<{
|
|
155
|
+
arc: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"arc">, string>>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
export type PluginGeomQueryArcGetSweepAngleArgs = z.infer<typeof PluginGeomQueryArcGetSweepAngleArgs>;
|
|
158
|
+
/**
|
|
159
|
+
* Arguments for {@linkcode PluginGeomQueryArcApi.isValid}.
|
|
160
|
+
*
|
|
161
|
+
* | Property | Type | Description |
|
|
162
|
+
* |---|---|---|
|
|
163
|
+
* | `arc` | {@linkcode ArcHandle} | The arc to query |
|
|
164
|
+
*/
|
|
165
|
+
export declare const PluginGeomQueryArcIsValidArgs: z.ZodObject<{
|
|
166
|
+
arc: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../../..").Handle<"arc">, string>>;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
export type PluginGeomQueryArcIsValidArgs = z.infer<typeof PluginGeomQueryArcIsValidArgs>;
|
|
169
|
+
//# sourceMappingURL=arc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arc.d.ts","sourceRoot":"","sources":["../../../../../src/api/core/geom/query/arc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAE/D;;;;;;;;;GASG;AACH,8BAAsB,qBAAqB;;IAGzC;;;;;;;;;;;;;;;;;;OAkBG;aACa,SAAS,CAAC,GAAG,EAAE,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC;IAElE;;;;;;;;;;;;;;;;;;;OAmBG;aACa,SAAS,CAAC,GAAG,EAAE,SAAS,GAAG,eAAe,CAAC,cAAc,CAAC;IAE1E;;;;;;;;;;;;;;;;OAgBG;aACa,OAAO,CAAC,GAAG,EAAE,SAAS,GAAG,eAAe,CAAC,cAAc,CAAC;IAExE;;;;;;;;;;;;;;;;;;;OAmBG;aACa,aAAa,CAAC,GAAG,EAAE,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC;IAEtE;;;;;;;;;;;;;;;OAeG;aACa,OAAO,CAAC,GAAG,EAAE,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC;CAClE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B;;iBAA+B,CAAA;AAC3E,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B;;iBAA+B,CAAA;AAC3E,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B;;iBAA+B,CAAA;AACzE,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAEzF;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC;;iBAA+B,CAAA;AAC/E,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAA;AAErG;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B;;iBAA+B,CAAA;AACzE,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA"}
|