@snaptrude/plugin-core 0.3.0 → 0.5.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.
Files changed (266) hide show
  1. package/AGENTS.md +130 -48
  2. package/CHANGELOG.md +111 -0
  3. package/api-manifest.full.json +3999 -0
  4. package/api-manifest.json +3845 -0
  5. package/dist/api/core/buildings.d.ts +427 -0
  6. package/dist/api/core/buildings.d.ts.map +1 -0
  7. package/dist/api/core/comment/index.d.ts +230 -0
  8. package/dist/api/core/comment/index.d.ts.map +1 -0
  9. package/dist/api/core/geom/create/index.d.ts +247 -0
  10. package/dist/api/core/geom/create/index.d.ts.map +1 -0
  11. package/dist/api/core/geom/delete/index.d.ts +72 -0
  12. package/dist/api/core/geom/delete/index.d.ts.map +1 -0
  13. package/dist/api/core/geom/index.d.ts +24 -23
  14. package/dist/api/core/geom/index.d.ts.map +1 -1
  15. package/dist/api/core/geom/query/arc.d.ts +169 -0
  16. package/dist/api/core/geom/query/arc.d.ts.map +1 -0
  17. package/dist/api/core/geom/query/brep.d.ts +402 -0
  18. package/dist/api/core/geom/query/brep.d.ts.map +1 -0
  19. package/dist/api/core/geom/query/circle.d.ts +378 -0
  20. package/dist/api/core/geom/query/circle.d.ts.map +1 -0
  21. package/dist/api/core/geom/query/contour.d.ts +450 -0
  22. package/dist/api/core/geom/query/contour.d.ts.map +1 -0
  23. package/dist/api/core/geom/query/curve.d.ts +918 -0
  24. package/dist/api/core/geom/query/curve.d.ts.map +1 -0
  25. package/dist/api/core/geom/query/edge.d.ts +128 -0
  26. package/dist/api/core/geom/query/edge.d.ts.map +1 -0
  27. package/dist/api/core/geom/query/face.d.ts +363 -0
  28. package/dist/api/core/geom/query/face.d.ts.map +1 -0
  29. package/dist/api/core/geom/query/halfedge.d.ts +206 -0
  30. package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
  31. package/dist/api/core/geom/query/index.d.ts +61 -0
  32. package/dist/api/core/geom/query/index.d.ts.map +1 -0
  33. package/dist/api/core/geom/query/profile.d.ts +410 -0
  34. package/dist/api/core/geom/query/profile.d.ts.map +1 -0
  35. package/dist/api/core/geom/query/vertex.d.ts +187 -0
  36. package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
  37. package/dist/api/core/geom/update/contour.d.ts +272 -0
  38. package/dist/api/core/geom/update/contour.d.ts.map +1 -0
  39. package/dist/api/core/geom/update/curve.d.ts +180 -0
  40. package/dist/api/core/geom/update/curve.d.ts.map +1 -0
  41. package/dist/api/core/geom/update/index.d.ts +27 -0
  42. package/dist/api/core/geom/update/index.d.ts.map +1 -0
  43. package/dist/api/core/geom/update/profile.d.ts +329 -0
  44. package/dist/api/core/geom/update/profile.d.ts.map +1 -0
  45. package/dist/api/core/groups.d.ts +485 -0
  46. package/dist/api/core/groups.d.ts.map +1 -0
  47. package/dist/api/core/history/index.d.ts +78 -0
  48. package/dist/api/core/history/index.d.ts.map +1 -0
  49. package/dist/api/core/index.d.ts +46 -1
  50. package/dist/api/core/index.d.ts.map +1 -1
  51. package/dist/api/core/layers.d.ts +402 -0
  52. package/dist/api/core/layers.d.ts.map +1 -0
  53. package/dist/api/core/math/quat.d.ts +111 -128
  54. package/dist/api/core/math/quat.d.ts.map +1 -1
  55. package/dist/api/core/math/vec3.d.ts +120 -102
  56. package/dist/api/core/math/vec3.d.ts.map +1 -1
  57. package/dist/api/core/project/index.d.ts +399 -0
  58. package/dist/api/core/project/index.d.ts.map +1 -0
  59. package/dist/api/core/tags.d.ts +755 -0
  60. package/dist/api/core/tags.d.ts.map +1 -0
  61. package/dist/api/core/units/index.d.ts +175 -0
  62. package/dist/api/core/units/index.d.ts.map +1 -0
  63. package/dist/api/core/zoom/index.d.ts +45 -0
  64. package/dist/api/core/zoom/index.d.ts.map +1 -0
  65. package/dist/api/design/boolean/index.d.ts +168 -0
  66. package/dist/api/design/boolean/index.d.ts.map +1 -0
  67. package/dist/api/design/create/index.d.ts +828 -0
  68. package/dist/api/design/create/index.d.ts.map +1 -0
  69. package/dist/api/design/delete/index.d.ts +63 -0
  70. package/dist/api/design/delete/index.d.ts.map +1 -0
  71. package/dist/api/design/doors/index.d.ts +268 -0
  72. package/dist/api/design/doors/index.d.ts.map +1 -0
  73. package/dist/api/design/edit/index.d.ts +49 -0
  74. package/dist/api/design/edit/index.d.ts.map +1 -0
  75. package/dist/api/design/erase/index.d.ts +160 -0
  76. package/dist/api/design/erase/index.d.ts.map +1 -0
  77. package/dist/api/design/furniture/index.d.ts +123 -0
  78. package/dist/api/design/furniture/index.d.ts.map +1 -0
  79. package/dist/api/design/index.d.ts +153 -0
  80. package/dist/api/design/index.d.ts.map +1 -0
  81. package/dist/api/design/lock.d.ts +41 -0
  82. package/dist/api/design/lock.d.ts.map +1 -0
  83. package/dist/api/design/materials/index.d.ts +297 -0
  84. package/dist/api/design/materials/index.d.ts.map +1 -0
  85. package/dist/api/design/query/geometry/index.d.ts +140 -0
  86. package/dist/api/design/query/geometry/index.d.ts.map +1 -0
  87. package/dist/api/design/query/index.d.ts +1011 -0
  88. package/dist/api/design/query/index.d.ts.map +1 -0
  89. package/dist/api/design/query/spaces.d.ts +221 -0
  90. package/dist/api/design/query/spaces.d.ts.map +1 -0
  91. package/dist/api/design/selection/index.d.ts +138 -0
  92. package/dist/api/design/selection/index.d.ts.map +1 -0
  93. package/dist/api/design/shared.d.ts +38 -0
  94. package/dist/api/design/shared.d.ts.map +1 -0
  95. package/dist/api/design/transform/index.d.ts +87 -0
  96. package/dist/api/design/transform/index.d.ts.map +1 -0
  97. package/dist/api/design/update/index.d.ts +178 -0
  98. package/dist/api/design/update/index.d.ts.map +1 -0
  99. package/dist/api/design/windows/index.d.ts +189 -0
  100. package/dist/api/design/windows/index.d.ts.map +1 -0
  101. package/dist/api/entity/buildableEnvelope.d.ts +261 -0
  102. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
  103. package/dist/api/entity/department.d.ts +0 -98
  104. package/dist/api/entity/department.d.ts.map +1 -1
  105. package/dist/api/entity/index.d.ts +9 -9
  106. package/dist/api/entity/index.d.ts.map +1 -1
  107. package/dist/api/entity/referenceLine.d.ts +49 -106
  108. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  109. package/dist/api/entity/space.d.ts +482 -249
  110. package/dist/api/entity/space.d.ts.map +1 -1
  111. package/dist/api/entity/story.d.ts +49 -39
  112. package/dist/api/entity/story.d.ts.map +1 -1
  113. package/dist/api/index.d.ts +17 -12
  114. package/dist/api/index.d.ts.map +1 -1
  115. package/dist/api/presentation/aiInspiration.d.ts +440 -0
  116. package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
  117. package/dist/api/presentation/diagrams.d.ts +81 -0
  118. package/dist/api/presentation/diagrams.d.ts.map +1 -0
  119. package/dist/api/presentation/import.d.ts +113 -0
  120. package/dist/api/presentation/import.d.ts.map +1 -0
  121. package/dist/api/presentation/index.d.ts +46 -0
  122. package/dist/api/presentation/index.d.ts.map +1 -0
  123. package/dist/api/presentation/sheets.d.ts +176 -0
  124. package/dist/api/presentation/sheets.d.ts.map +1 -0
  125. package/dist/api/presentation/views.d.ts +296 -0
  126. package/dist/api/presentation/views.d.ts.map +1 -0
  127. package/dist/api/program/adjacency.d.ts +155 -0
  128. package/dist/api/program/adjacency.d.ts.map +1 -0
  129. package/dist/api/program/areas.d.ts +360 -0
  130. package/dist/api/program/areas.d.ts.map +1 -0
  131. package/dist/api/program/classification.d.ts +135 -0
  132. package/dist/api/program/classification.d.ts.map +1 -0
  133. package/dist/api/program/cores.d.ts +174 -0
  134. package/dist/api/program/cores.d.ts.map +1 -0
  135. package/dist/api/program/departments.d.ts +431 -0
  136. package/dist/api/program/departments.d.ts.map +1 -0
  137. package/dist/api/program/index.d.ts +69 -0
  138. package/dist/api/program/index.d.ts.map +1 -0
  139. package/dist/api/program/layout.d.ts +63 -0
  140. package/dist/api/program/layout.d.ts.map +1 -0
  141. package/dist/api/program/metrics.d.ts +108 -0
  142. package/dist/api/program/metrics.d.ts.map +1 -0
  143. package/dist/api/program/site.d.ts +367 -0
  144. package/dist/api/program/site.d.ts.map +1 -0
  145. package/dist/api/program/spreadsheet.d.ts +2041 -0
  146. package/dist/api/program/spreadsheet.d.ts.map +1 -0
  147. package/dist/handles.d.ts +138 -0
  148. package/dist/handles.d.ts.map +1 -0
  149. package/dist/host-utils.d.ts +7 -5
  150. package/dist/host-utils.d.ts.map +1 -1
  151. package/dist/index.cjs +4001 -904
  152. package/dist/index.cjs.map +1 -1
  153. package/dist/index.d.ts +1 -0
  154. package/dist/index.d.ts.map +1 -1
  155. package/dist/index.js +3392 -870
  156. package/dist/index.js.map +1 -1
  157. package/package.json +6 -2
  158. package/scripts/generate-manifest.mjs +193 -0
  159. package/scripts/generate-manifest.test.mjs +193 -0
  160. package/src/api/core/buildings.ts +485 -0
  161. package/src/api/core/comment/index.ts +258 -0
  162. package/src/api/core/geom/create/index.ts +293 -0
  163. package/src/api/core/geom/delete/index.ts +78 -0
  164. package/src/api/core/geom/index.ts +24 -23
  165. package/src/api/core/geom/query/arc.ts +169 -0
  166. package/src/api/core/geom/query/brep.ts +444 -0
  167. package/src/api/core/geom/query/circle.ts +404 -0
  168. package/src/api/core/geom/query/contour.ts +540 -0
  169. package/src/api/core/geom/query/curve.ts +1078 -0
  170. package/src/api/core/geom/query/edge.ts +130 -0
  171. package/src/api/core/geom/query/face.ts +403 -0
  172. package/src/api/core/geom/query/halfedge.ts +210 -0
  173. package/src/api/core/geom/query/index.ts +63 -0
  174. package/src/api/core/geom/query/profile.ts +473 -0
  175. package/src/api/core/geom/query/vertex.ts +205 -0
  176. package/src/api/core/geom/update/contour.ts +315 -0
  177. package/src/api/core/geom/update/curve.ts +209 -0
  178. package/src/api/core/geom/update/index.ts +29 -0
  179. package/src/api/core/geom/update/profile.ts +377 -0
  180. package/src/api/core/groups.ts +521 -0
  181. package/src/api/core/history/index.ts +84 -0
  182. package/src/api/core/index.ts +46 -1
  183. package/src/api/core/layers.ts +333 -0
  184. package/src/api/core/math/quat.ts +112 -235
  185. package/src/api/core/math/vec3.ts +124 -159
  186. package/src/api/core/project/index.ts +418 -0
  187. package/src/api/core/tags.ts +808 -0
  188. package/src/api/core/units/index.ts +164 -0
  189. package/src/api/core/zoom/index.ts +47 -0
  190. package/src/api/design/boolean/index.ts +179 -0
  191. package/src/api/design/create/index.ts +886 -0
  192. package/src/api/design/delete/index.ts +67 -0
  193. package/src/api/design/doors/index.ts +285 -0
  194. package/src/api/design/edit/index.ts +54 -0
  195. package/src/api/design/erase/index.ts +151 -0
  196. package/src/api/design/furniture/index.ts +130 -0
  197. package/src/api/design/index.ts +162 -0
  198. package/src/api/design/lock.ts +42 -0
  199. package/src/api/design/materials/index.ts +301 -0
  200. package/src/api/design/query/geometry/index.ts +166 -0
  201. package/src/api/design/query/index.ts +937 -0
  202. package/src/api/design/query/spaces.ts +132 -0
  203. package/src/api/design/selection/index.ts +144 -0
  204. package/src/api/design/shared.ts +40 -0
  205. package/src/api/design/transform/index.ts +93 -0
  206. package/src/api/design/update/index.ts +117 -0
  207. package/src/api/design/windows/index.ts +207 -0
  208. package/src/api/entity/buildableEnvelope.ts +318 -0
  209. package/src/api/entity/department.ts +0 -113
  210. package/src/api/entity/index.ts +9 -9
  211. package/src/api/entity/referenceLine.ts +50 -38
  212. package/src/api/entity/space.ts +285 -226
  213. package/src/api/entity/story.ts +53 -42
  214. package/src/api/index.ts +17 -12
  215. package/src/api/presentation/aiInspiration.ts +362 -0
  216. package/src/api/presentation/diagrams.ts +84 -0
  217. package/src/api/presentation/import.ts +112 -0
  218. package/src/api/presentation/index.ts +48 -0
  219. package/src/api/presentation/sheets.ts +198 -0
  220. package/src/api/presentation/views.ts +303 -0
  221. package/src/api/program/adjacency.ts +164 -0
  222. package/src/api/program/areas.ts +335 -0
  223. package/src/api/program/classification.ts +138 -0
  224. package/src/api/program/cores.ts +171 -0
  225. package/src/api/program/departments.ts +465 -0
  226. package/src/api/program/index.ts +71 -0
  227. package/src/api/program/layout.ts +68 -0
  228. package/src/api/program/metrics.ts +120 -0
  229. package/src/api/program/site.ts +326 -0
  230. package/src/api/program/spreadsheet.ts +2075 -0
  231. package/src/handles.ts +148 -0
  232. package/src/host-utils.ts +10 -6
  233. package/src/index.ts +1 -0
  234. package/dist/api/core/geom/arc.d.ts +0 -81
  235. package/dist/api/core/geom/arc.d.ts.map +0 -1
  236. package/dist/api/core/geom/curve.d.ts +0 -70
  237. package/dist/api/core/geom/curve.d.ts.map +0 -1
  238. package/dist/api/core/geom/line.d.ts +0 -56
  239. package/dist/api/core/geom/line.d.ts.map +0 -1
  240. package/dist/api/core/geom/profile.d.ts +0 -121
  241. package/dist/api/core/geom/profile.d.ts.map +0 -1
  242. package/dist/api/tools/copy.d.ts +0 -59
  243. package/dist/api/tools/copy.d.ts.map +0 -1
  244. package/dist/api/tools/index.d.ts +0 -33
  245. package/dist/api/tools/index.d.ts.map +0 -1
  246. package/dist/api/tools/material.d.ts +0 -51
  247. package/dist/api/tools/material.d.ts.map +0 -1
  248. package/dist/api/tools/offset.d.ts +0 -43
  249. package/dist/api/tools/offset.d.ts.map +0 -1
  250. package/dist/api/tools/selection.d.ts +0 -48
  251. package/dist/api/tools/selection.d.ts.map +0 -1
  252. package/dist/api/tools/transform.d.ts +0 -114
  253. package/dist/api/tools/transform.d.ts.map +0 -1
  254. package/dist/api/units/index.d.ts +0 -163
  255. package/dist/api/units/index.d.ts.map +0 -1
  256. package/src/api/core/geom/arc.ts +0 -70
  257. package/src/api/core/geom/curve.ts +0 -41
  258. package/src/api/core/geom/line.ts +0 -53
  259. package/src/api/core/geom/profile.ts +0 -94
  260. package/src/api/tools/copy.ts +0 -55
  261. package/src/api/tools/index.ts +0 -39
  262. package/src/api/tools/material.ts +0 -49
  263. package/src/api/tools/offset.ts +0 -43
  264. package/src/api/tools/selection.ts +0 -51
  265. package/src/api/tools/transform.ts +0 -117
  266. package/src/api/units/index.ts +0 -163
@@ -0,0 +1,404 @@
1
+ import * as z from "zod"
2
+ import { PluginApiReturn } from "../../../../types"
3
+ import { CircleHandle, Vec3Handle, Vec3Components } from "../../../../handles"
4
+
5
+ /**
6
+ * Circle-specific geometry queries — read closed-circle properties as plain values
7
+ * (all-handle model, §11). A circle is a closed curve with its own namespace
8
+ * (mirroring {@linkcode PluginGeomQueryArcApi}); it is NOT part of the shared
9
+ * {@linkcode CurveHandle} line/arc surface.
10
+ *
11
+ * Every method takes an opaque {@linkcode CircleHandle} (plus a point handle where
12
+ * relevant) and returns plain values — numbers, {@linkcode Vec3Components},
13
+ * predicates as `boolean`. No query mutates its inputs.
14
+ *
15
+ * Accessed via `snaptrude.core.geom.query.circle`.
16
+ */
17
+ export abstract class PluginGeomQueryCircleApi {
18
+ constructor() {}
19
+
20
+ /**
21
+ * Read the radius of a circle.
22
+ * @param circle The circle to query
23
+ * @returns The radius as a `number`
24
+ *
25
+ * @examplePrompt What is the radius of this circle?
26
+ * @examplePrompt Measure the radius of the circular column grid
27
+ *
28
+ * # Example
29
+ * ```ts
30
+ * const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
31
+ * const up = await snaptrude.core.math.vec3.new(0, 1, 0)
32
+ * const circle = await snaptrude.core.geom.create.circle(origin, up, 5)
33
+ * const radius = await snaptrude.core.geom.query.circle.getRadius(circle)
34
+ * ```
35
+ */
36
+ public abstract getRadius(circle: CircleHandle): PluginApiReturn<number>
37
+
38
+ /**
39
+ * Read the centre point of a circle.
40
+ * @param circle The circle to query
41
+ * @returns The centre as {@linkcode Vec3Components}
42
+ *
43
+ * @examplePrompt Where is the centre of this circle?
44
+ * @examplePrompt Find the center point of the circular courtyard outline
45
+ *
46
+ * # Example
47
+ * ```ts
48
+ * const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
49
+ * const up = await snaptrude.core.math.vec3.new(0, 1, 0)
50
+ * const circle = await snaptrude.core.geom.create.circle(origin, up, 5)
51
+ * const centre = await snaptrude.core.geom.query.circle.getCentre(circle)
52
+ * console.log(centre.x, centre.y, centre.z)
53
+ * ```
54
+ */
55
+ public abstract getCentre(circle: CircleHandle): PluginApiReturn<Vec3Components>
56
+
57
+ /**
58
+ * Read the axis (plane normal) of a circle.
59
+ * @param circle The circle to query
60
+ * @returns The axis as {@linkcode Vec3Components}
61
+ *
62
+ * # Example
63
+ * ```ts
64
+ * const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
65
+ * const up = await snaptrude.core.math.vec3.new(0, 1, 0)
66
+ * const circle = await snaptrude.core.geom.create.circle(origin, up, 5)
67
+ * const axis = await snaptrude.core.geom.query.circle.getAxis(circle)
68
+ * console.log(axis.x, axis.y, axis.z)
69
+ * ```
70
+ */
71
+ public abstract getAxis(circle: CircleHandle): PluginApiReturn<Vec3Components>
72
+
73
+ /**
74
+ * Read the length (circumference, `2πr`) of a circle.
75
+ * @param circle The circle to query
76
+ * @returns The circumference as a `number`
77
+ *
78
+ * @examplePrompt What is the circumference of this circle?
79
+ * @examplePrompt How long is the circular path around the courtyard?
80
+ *
81
+ * # Example
82
+ * ```ts
83
+ * const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
84
+ * const up = await snaptrude.core.math.vec3.new(0, 1, 0)
85
+ * const circle = await snaptrude.core.geom.create.circle(origin, up, 5)
86
+ * const circumference = await snaptrude.core.geom.query.circle.getLength(circle)
87
+ * ```
88
+ */
89
+ public abstract getLength(circle: CircleHandle): PluginApiReturn<number>
90
+
91
+ /**
92
+ * Check whether a circle is geometrically valid (non-degenerate axis + positive radius).
93
+ * @param circle The circle to query
94
+ * @returns `true` if the circle is valid, otherwise `false`
95
+ *
96
+ * # Example
97
+ * ```ts
98
+ * const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
99
+ * const up = await snaptrude.core.math.vec3.new(0, 1, 0)
100
+ * const circle = await snaptrude.core.geom.create.circle(origin, up, 5)
101
+ * const ok = await snaptrude.core.geom.query.circle.isValid(circle)
102
+ * ```
103
+ */
104
+ public abstract isValid(circle: CircleHandle): PluginApiReturn<boolean>
105
+
106
+ /**
107
+ * Get the point on a circle nearest to an arbitrary point.
108
+ * @param circle The circle to query
109
+ * @param point The reference point
110
+ * @returns The nearest point as {@linkcode Vec3Components}
111
+ *
112
+ * @examplePrompt Find the point on the circle closest to this column
113
+ *
114
+ * # Example
115
+ * ```ts
116
+ * const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
117
+ * const up = await snaptrude.core.math.vec3.new(0, 1, 0)
118
+ * const circle = await snaptrude.core.geom.create.circle(origin, up, 5)
119
+ * const target = await snaptrude.core.math.vec3.new(8, 0, 2)
120
+ * const nearest = await snaptrude.core.geom.query.circle.getNearestPoint(circle, target)
121
+ * console.log(nearest.x, nearest.y, nearest.z)
122
+ * ```
123
+ */
124
+ public abstract getNearestPoint(
125
+ circle: CircleHandle,
126
+ point: Vec3Handle
127
+ ): PluginApiReturn<Vec3Components>
128
+
129
+ /**
130
+ * Test whether a point lies on a circle.
131
+ * @param circle The circle to query
132
+ * @param point The point to test
133
+ * @returns `true` if the point is on the circle, otherwise `false`
134
+ *
135
+ * @examplePrompt Check whether this point sits on the circle
136
+ *
137
+ * # Example
138
+ * ```ts
139
+ * const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
140
+ * const up = await snaptrude.core.math.vec3.new(0, 1, 0)
141
+ * const circle = await snaptrude.core.geom.create.circle(origin, up, 5)
142
+ * const pt = await snaptrude.core.math.vec3.new(5, 0, 0)
143
+ * const onCircle = await snaptrude.core.geom.query.circle.hasPoint(circle, pt)
144
+ * ```
145
+ */
146
+ public abstract hasPoint(circle: CircleHandle, point: Vec3Handle): PluginApiReturn<boolean>
147
+
148
+ /**
149
+ * Get the tangent direction of a circle at a point on it.
150
+ * @param circle The circle to query
151
+ * @param point A point on the circle
152
+ * @returns The tangent as {@linkcode Vec3Components}
153
+ *
154
+ * # Example
155
+ * ```ts
156
+ * const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
157
+ * const up = await snaptrude.core.math.vec3.new(0, 1, 0)
158
+ * const circle = await snaptrude.core.geom.create.circle(origin, up, 5)
159
+ * const pt = await snaptrude.core.math.vec3.new(5, 0, 0)
160
+ * const tangent = await snaptrude.core.geom.query.circle.getTangent(circle, pt)
161
+ * console.log(tangent.x, tangent.y, tangent.z)
162
+ * ```
163
+ */
164
+ public abstract getTangent(circle: CircleHandle, point: Vec3Handle): PluginApiReturn<Vec3Components>
165
+
166
+ /**
167
+ * Get the (in-plane, radial) normal direction of a circle at a point on it.
168
+ * @param circle The circle to query
169
+ * @param point A point on the circle
170
+ * @returns The radial normal as {@linkcode Vec3Components}
171
+ *
172
+ * # Example
173
+ * ```ts
174
+ * const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
175
+ * const up = await snaptrude.core.math.vec3.new(0, 1, 0)
176
+ * const circle = await snaptrude.core.geom.create.circle(origin, up, 5)
177
+ * const pt = await snaptrude.core.math.vec3.new(5, 0, 0)
178
+ * const normal = await snaptrude.core.geom.query.circle.getNormal(circle, pt)
179
+ * console.log(normal.x, normal.y, normal.z)
180
+ * ```
181
+ */
182
+ public abstract getNormal(circle: CircleHandle, point: Vec3Handle): PluginApiReturn<Vec3Components>
183
+
184
+ /**
185
+ * Get the point reached by travelling a signed arc-distance along the circle from
186
+ * a reference point that lies on it.
187
+ * @param circle The circle to query
188
+ * @param referencePoint A point on the circle to travel from
189
+ * @param distance Arc distance to travel
190
+ * @param forward Travel direction (optional; default forward)
191
+ * @returns The resulting point as {@linkcode Vec3Components}
192
+ *
193
+ * @examplePrompt Mark a point 2 metres along the circle from this point
194
+ *
195
+ * # Example
196
+ * ```ts
197
+ * const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
198
+ * const up = await snaptrude.core.math.vec3.new(0, 1, 0)
199
+ * const circle = await snaptrude.core.geom.create.circle(origin, up, 5)
200
+ * const ref = await snaptrude.core.math.vec3.new(5, 0, 0)
201
+ * const ahead = await snaptrude.core.geom.query.circle.getPointAtDistance(circle, ref, 2)
202
+ * const behind = await snaptrude.core.geom.query.circle.getPointAtDistance(circle, ref, 2, false)
203
+ * ```
204
+ */
205
+ public abstract getPointAtDistance(
206
+ circle: CircleHandle,
207
+ referencePoint: Vec3Handle,
208
+ distance: number,
209
+ forward?: boolean
210
+ ): PluginApiReturn<Vec3Components>
211
+
212
+ /**
213
+ * Test whether two circles are geometrically equal.
214
+ * @param circleA First circle
215
+ * @param circleB Second circle
216
+ * @returns `true` if the circles are equal, otherwise `false`
217
+ *
218
+ * # Example
219
+ * ```ts
220
+ * const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
221
+ * const up = await snaptrude.core.math.vec3.new(0, 1, 0)
222
+ * const a = await snaptrude.core.geom.create.circle(origin, up, 5)
223
+ * const b = await snaptrude.core.geom.create.circle(origin, up, 3)
224
+ * const same = await snaptrude.core.geom.query.circle.isEqual(a, b)
225
+ * ```
226
+ */
227
+ public abstract isEqual(circleA: CircleHandle, circleB: CircleHandle): PluginApiReturn<boolean>
228
+
229
+ /**
230
+ * Sample a circle into an ordered list of points.
231
+ * @param circle The circle to query
232
+ * @param resolution Number of segments to sample (optional)
233
+ * @returns The sampled points as {@linkcode Vec3Components}`[]`
234
+ *
235
+ * @examplePrompt Divide this circle into 12 equal points
236
+ * @examplePrompt Get evenly spaced points around the circle to place columns
237
+ *
238
+ * # Example
239
+ * ```ts
240
+ * const origin = await snaptrude.core.math.vec3.new(0, 0, 0)
241
+ * const up = await snaptrude.core.math.vec3.new(0, 1, 0)
242
+ * const circle = await snaptrude.core.geom.create.circle(origin, up, 5)
243
+ * const points = await snaptrude.core.geom.query.circle.listPoints(circle, 12)
244
+ * for (const p of points) console.log(p.x, p.y, p.z)
245
+ * ```
246
+ */
247
+ public abstract listPoints(circle: CircleHandle, resolution?: number): PluginApiReturn<Vec3Components[]>
248
+ }
249
+
250
+ /**
251
+ * Arguments for {@linkcode PluginGeomQueryCircleApi.getRadius}.
252
+ *
253
+ * | Property | Type | Description |
254
+ * |---|---|---|
255
+ * | `circle` | {@linkcode CircleHandle} | The circle to query |
256
+ */
257
+ export const PluginGeomQueryCircleGetRadiusArgs = z.object({ circle: CircleHandle })
258
+ export type PluginGeomQueryCircleGetRadiusArgs = z.infer<typeof PluginGeomQueryCircleGetRadiusArgs>
259
+
260
+ /**
261
+ * Arguments for {@linkcode PluginGeomQueryCircleApi.getCentre}.
262
+ *
263
+ * | Property | Type | Description |
264
+ * |---|---|---|
265
+ * | `circle` | {@linkcode CircleHandle} | The circle to query |
266
+ */
267
+ export const PluginGeomQueryCircleGetCentreArgs = z.object({ circle: CircleHandle })
268
+ export type PluginGeomQueryCircleGetCentreArgs = z.infer<typeof PluginGeomQueryCircleGetCentreArgs>
269
+
270
+ /**
271
+ * Arguments for {@linkcode PluginGeomQueryCircleApi.getAxis}.
272
+ *
273
+ * | Property | Type | Description |
274
+ * |---|---|---|
275
+ * | `circle` | {@linkcode CircleHandle} | The circle to query |
276
+ */
277
+ export const PluginGeomQueryCircleGetAxisArgs = z.object({ circle: CircleHandle })
278
+ export type PluginGeomQueryCircleGetAxisArgs = z.infer<typeof PluginGeomQueryCircleGetAxisArgs>
279
+
280
+ /**
281
+ * Arguments for {@linkcode PluginGeomQueryCircleApi.getLength}.
282
+ *
283
+ * | Property | Type | Description |
284
+ * |---|---|---|
285
+ * | `circle` | {@linkcode CircleHandle} | The circle to query |
286
+ */
287
+ export const PluginGeomQueryCircleGetLengthArgs = z.object({ circle: CircleHandle })
288
+ export type PluginGeomQueryCircleGetLengthArgs = z.infer<typeof PluginGeomQueryCircleGetLengthArgs>
289
+
290
+ /**
291
+ * Arguments for {@linkcode PluginGeomQueryCircleApi.isValid}.
292
+ *
293
+ * | Property | Type | Description |
294
+ * |---|---|---|
295
+ * | `circle` | {@linkcode CircleHandle} | The circle to query |
296
+ */
297
+ export const PluginGeomQueryCircleIsValidArgs = z.object({ circle: CircleHandle })
298
+ export type PluginGeomQueryCircleIsValidArgs = z.infer<typeof PluginGeomQueryCircleIsValidArgs>
299
+
300
+ /**
301
+ * Arguments for {@linkcode PluginGeomQueryCircleApi.getNearestPoint}.
302
+ *
303
+ * | Property | Type | Description |
304
+ * |---|---|---|
305
+ * | `circle` | {@linkcode CircleHandle} | The circle to query |
306
+ * | `point` | {@linkcode Vec3Handle} | The reference point |
307
+ */
308
+ export const PluginGeomQueryCircleGetNearestPointArgs = z.object({
309
+ circle: CircleHandle,
310
+ point: Vec3Handle,
311
+ })
312
+ export type PluginGeomQueryCircleGetNearestPointArgs = z.infer<
313
+ typeof PluginGeomQueryCircleGetNearestPointArgs
314
+ >
315
+
316
+ /**
317
+ * Arguments for {@linkcode PluginGeomQueryCircleApi.hasPoint}.
318
+ *
319
+ * | Property | Type | Description |
320
+ * |---|---|---|
321
+ * | `circle` | {@linkcode CircleHandle} | The circle to query |
322
+ * | `point` | {@linkcode Vec3Handle} | The point to test |
323
+ */
324
+ export const PluginGeomQueryCircleHasPointArgs = z.object({
325
+ circle: CircleHandle,
326
+ point: Vec3Handle,
327
+ })
328
+ export type PluginGeomQueryCircleHasPointArgs = z.infer<typeof PluginGeomQueryCircleHasPointArgs>
329
+
330
+ /**
331
+ * Arguments for {@linkcode PluginGeomQueryCircleApi.getTangent}.
332
+ *
333
+ * | Property | Type | Description |
334
+ * |---|---|---|
335
+ * | `circle` | {@linkcode CircleHandle} | The circle to query |
336
+ * | `point` | {@linkcode Vec3Handle} | A point on the circle |
337
+ */
338
+ export const PluginGeomQueryCircleGetTangentArgs = z.object({
339
+ circle: CircleHandle,
340
+ point: Vec3Handle,
341
+ })
342
+ export type PluginGeomQueryCircleGetTangentArgs = z.infer<typeof PluginGeomQueryCircleGetTangentArgs>
343
+
344
+ /**
345
+ * Arguments for {@linkcode PluginGeomQueryCircleApi.getNormal}.
346
+ *
347
+ * | Property | Type | Description |
348
+ * |---|---|---|
349
+ * | `circle` | {@linkcode CircleHandle} | The circle to query |
350
+ * | `point` | {@linkcode Vec3Handle} | A point on the circle |
351
+ */
352
+ export const PluginGeomQueryCircleGetNormalArgs = z.object({
353
+ circle: CircleHandle,
354
+ point: Vec3Handle,
355
+ })
356
+ export type PluginGeomQueryCircleGetNormalArgs = z.infer<typeof PluginGeomQueryCircleGetNormalArgs>
357
+
358
+ /**
359
+ * Arguments for {@linkcode PluginGeomQueryCircleApi.getPointAtDistance}.
360
+ *
361
+ * | Property | Type | Description |
362
+ * |---|---|---|
363
+ * | `circle` | {@linkcode CircleHandle} | The circle to query |
364
+ * | `referencePoint` | {@linkcode Vec3Handle} | A point on the circle to travel from |
365
+ * | `distance` | `number` | Arc distance to travel |
366
+ * | `forward` | `boolean` | Travel direction (optional; default forward) |
367
+ */
368
+ export const PluginGeomQueryCircleGetPointAtDistanceArgs = z.object({
369
+ circle: CircleHandle,
370
+ referencePoint: Vec3Handle,
371
+ distance: z.number(),
372
+ forward: z.boolean().optional(),
373
+ })
374
+ export type PluginGeomQueryCircleGetPointAtDistanceArgs = z.infer<
375
+ typeof PluginGeomQueryCircleGetPointAtDistanceArgs
376
+ >
377
+
378
+ /**
379
+ * Arguments for {@linkcode PluginGeomQueryCircleApi.isEqual}.
380
+ *
381
+ * | Property | Type | Description |
382
+ * |---|---|---|
383
+ * | `circleA` | {@linkcode CircleHandle} | First circle |
384
+ * | `circleB` | {@linkcode CircleHandle} | Second circle |
385
+ */
386
+ export const PluginGeomQueryCircleIsEqualArgs = z.object({
387
+ circleA: CircleHandle,
388
+ circleB: CircleHandle,
389
+ })
390
+ export type PluginGeomQueryCircleIsEqualArgs = z.infer<typeof PluginGeomQueryCircleIsEqualArgs>
391
+
392
+ /**
393
+ * Arguments for {@linkcode PluginGeomQueryCircleApi.listPoints}.
394
+ *
395
+ * | Property | Type | Description |
396
+ * |---|---|---|
397
+ * | `circle` | {@linkcode CircleHandle} | The circle to query |
398
+ * | `resolution` | `number` | Number of segments to sample (optional) |
399
+ */
400
+ export const PluginGeomQueryCircleListPointsArgs = z.object({
401
+ circle: CircleHandle,
402
+ resolution: z.number().optional(),
403
+ })
404
+ export type PluginGeomQueryCircleListPointsArgs = z.infer<typeof PluginGeomQueryCircleListPointsArgs>