@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.
Files changed (302) hide show
  1. package/AGENTS.md +130 -48
  2. package/CHANGELOG.md +163 -0
  3. package/api-manifest.full.json +5600 -0
  4. package/api-manifest.json +5502 -0
  5. package/dist/api/analysis/heatmaps.d.ts +234 -0
  6. package/dist/api/analysis/heatmaps.d.ts.map +1 -0
  7. package/dist/api/analysis/illuminance.d.ts +145 -0
  8. package/dist/api/analysis/illuminance.d.ts.map +1 -0
  9. package/dist/api/analysis/index.d.ts +44 -0
  10. package/dist/api/analysis/index.d.ts.map +1 -0
  11. package/dist/api/analysis/shadows.d.ts +165 -0
  12. package/dist/api/analysis/shadows.d.ts.map +1 -0
  13. package/dist/api/analysis/sunlightHours.d.ts +208 -0
  14. package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
  15. package/dist/api/analysis/sunpath.d.ts +80 -0
  16. package/dist/api/analysis/sunpath.d.ts.map +1 -0
  17. package/dist/api/core/buildings.d.ts +427 -0
  18. package/dist/api/core/buildings.d.ts.map +1 -0
  19. package/dist/api/core/comment/index.d.ts +230 -0
  20. package/dist/api/core/comment/index.d.ts.map +1 -0
  21. package/dist/api/core/geom/create/index.d.ts +247 -0
  22. package/dist/api/core/geom/create/index.d.ts.map +1 -0
  23. package/dist/api/core/geom/delete/index.d.ts +72 -0
  24. package/dist/api/core/geom/delete/index.d.ts.map +1 -0
  25. package/dist/api/core/geom/index.d.ts +24 -23
  26. package/dist/api/core/geom/index.d.ts.map +1 -1
  27. package/dist/api/core/geom/query/arc.d.ts +169 -0
  28. package/dist/api/core/geom/query/arc.d.ts.map +1 -0
  29. package/dist/api/core/geom/query/brep.d.ts +402 -0
  30. package/dist/api/core/geom/query/brep.d.ts.map +1 -0
  31. package/dist/api/core/geom/query/circle.d.ts +378 -0
  32. package/dist/api/core/geom/query/circle.d.ts.map +1 -0
  33. package/dist/api/core/geom/query/contour.d.ts +450 -0
  34. package/dist/api/core/geom/query/contour.d.ts.map +1 -0
  35. package/dist/api/core/geom/query/curve.d.ts +918 -0
  36. package/dist/api/core/geom/query/curve.d.ts.map +1 -0
  37. package/dist/api/core/geom/query/edge.d.ts +128 -0
  38. package/dist/api/core/geom/query/edge.d.ts.map +1 -0
  39. package/dist/api/core/geom/query/face.d.ts +363 -0
  40. package/dist/api/core/geom/query/face.d.ts.map +1 -0
  41. package/dist/api/core/geom/query/halfedge.d.ts +206 -0
  42. package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
  43. package/dist/api/core/geom/query/index.d.ts +61 -0
  44. package/dist/api/core/geom/query/index.d.ts.map +1 -0
  45. package/dist/api/core/geom/query/profile.d.ts +410 -0
  46. package/dist/api/core/geom/query/profile.d.ts.map +1 -0
  47. package/dist/api/core/geom/query/vertex.d.ts +187 -0
  48. package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
  49. package/dist/api/core/geom/update/contour.d.ts +272 -0
  50. package/dist/api/core/geom/update/contour.d.ts.map +1 -0
  51. package/dist/api/core/geom/update/curve.d.ts +180 -0
  52. package/dist/api/core/geom/update/curve.d.ts.map +1 -0
  53. package/dist/api/core/geom/update/index.d.ts +27 -0
  54. package/dist/api/core/geom/update/index.d.ts.map +1 -0
  55. package/dist/api/core/geom/update/profile.d.ts +329 -0
  56. package/dist/api/core/geom/update/profile.d.ts.map +1 -0
  57. package/dist/api/core/groups.d.ts +485 -0
  58. package/dist/api/core/groups.d.ts.map +1 -0
  59. package/dist/api/core/history/index.d.ts +78 -0
  60. package/dist/api/core/history/index.d.ts.map +1 -0
  61. package/dist/api/core/index.d.ts +51 -1
  62. package/dist/api/core/index.d.ts.map +1 -1
  63. package/dist/api/core/io/import/index.d.ts +392 -0
  64. package/dist/api/core/io/import/index.d.ts.map +1 -0
  65. package/dist/api/core/io/index.d.ts +35 -0
  66. package/dist/api/core/io/index.d.ts.map +1 -0
  67. package/dist/api/core/io/job/index.d.ts +139 -0
  68. package/dist/api/core/io/job/index.d.ts.map +1 -0
  69. package/dist/api/core/io/query/index.d.ts +74 -0
  70. package/dist/api/core/io/query/index.d.ts.map +1 -0
  71. package/dist/api/core/io/terrain/index.d.ts +206 -0
  72. package/dist/api/core/io/terrain/index.d.ts.map +1 -0
  73. package/dist/api/core/io/underlay/index.d.ts +286 -0
  74. package/dist/api/core/io/underlay/index.d.ts.map +1 -0
  75. package/dist/api/core/layers.d.ts +402 -0
  76. package/dist/api/core/layers.d.ts.map +1 -0
  77. package/dist/api/core/math/quat.d.ts +111 -128
  78. package/dist/api/core/math/quat.d.ts.map +1 -1
  79. package/dist/api/core/math/vec3.d.ts +120 -102
  80. package/dist/api/core/math/vec3.d.ts.map +1 -1
  81. package/dist/api/core/project/index.d.ts +399 -0
  82. package/dist/api/core/project/index.d.ts.map +1 -0
  83. package/dist/api/core/tags.d.ts +755 -0
  84. package/dist/api/core/tags.d.ts.map +1 -0
  85. package/dist/api/core/units/index.d.ts +175 -0
  86. package/dist/api/core/units/index.d.ts.map +1 -0
  87. package/dist/api/core/zoom/index.d.ts +45 -0
  88. package/dist/api/core/zoom/index.d.ts.map +1 -0
  89. package/dist/api/design/boolean/index.d.ts +168 -0
  90. package/dist/api/design/boolean/index.d.ts.map +1 -0
  91. package/dist/api/design/create/index.d.ts +837 -0
  92. package/dist/api/design/create/index.d.ts.map +1 -0
  93. package/dist/api/design/delete/index.d.ts +63 -0
  94. package/dist/api/design/delete/index.d.ts.map +1 -0
  95. package/dist/api/design/doors/index.d.ts +268 -0
  96. package/dist/api/design/doors/index.d.ts.map +1 -0
  97. package/dist/api/design/edit/index.d.ts +49 -0
  98. package/dist/api/design/edit/index.d.ts.map +1 -0
  99. package/dist/api/design/erase/index.d.ts +160 -0
  100. package/dist/api/design/erase/index.d.ts.map +1 -0
  101. package/dist/api/design/furniture/index.d.ts +123 -0
  102. package/dist/api/design/furniture/index.d.ts.map +1 -0
  103. package/dist/api/design/index.d.ts +153 -0
  104. package/dist/api/design/index.d.ts.map +1 -0
  105. package/dist/api/design/lock.d.ts +41 -0
  106. package/dist/api/design/lock.d.ts.map +1 -0
  107. package/dist/api/design/materials/index.d.ts +297 -0
  108. package/dist/api/design/materials/index.d.ts.map +1 -0
  109. package/dist/api/design/query/geometry/index.d.ts +140 -0
  110. package/dist/api/design/query/geometry/index.d.ts.map +1 -0
  111. package/dist/api/design/query/index.d.ts +1011 -0
  112. package/dist/api/design/query/index.d.ts.map +1 -0
  113. package/dist/api/design/query/spaces.d.ts +221 -0
  114. package/dist/api/design/query/spaces.d.ts.map +1 -0
  115. package/dist/api/design/selection/index.d.ts +282 -0
  116. package/dist/api/design/selection/index.d.ts.map +1 -0
  117. package/dist/api/design/shared.d.ts +38 -0
  118. package/dist/api/design/shared.d.ts.map +1 -0
  119. package/dist/api/design/transform/index.d.ts +87 -0
  120. package/dist/api/design/transform/index.d.ts.map +1 -0
  121. package/dist/api/design/update/index.d.ts +178 -0
  122. package/dist/api/design/update/index.d.ts.map +1 -0
  123. package/dist/api/design/windows/index.d.ts +189 -0
  124. package/dist/api/design/windows/index.d.ts.map +1 -0
  125. package/dist/api/entity/buildableEnvelope.d.ts +261 -0
  126. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
  127. package/dist/api/entity/department.d.ts +0 -98
  128. package/dist/api/entity/department.d.ts.map +1 -1
  129. package/dist/api/entity/index.d.ts +9 -9
  130. package/dist/api/entity/index.d.ts.map +1 -1
  131. package/dist/api/entity/referenceLine.d.ts +49 -106
  132. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  133. package/dist/api/entity/space.d.ts +484 -251
  134. package/dist/api/entity/space.d.ts.map +1 -1
  135. package/dist/api/entity/story.d.ts +49 -39
  136. package/dist/api/entity/story.d.ts.map +1 -1
  137. package/dist/api/index.d.ts +22 -12
  138. package/dist/api/index.d.ts.map +1 -1
  139. package/dist/api/presentation/aiInspiration.d.ts +440 -0
  140. package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
  141. package/dist/api/presentation/diagrams.d.ts +81 -0
  142. package/dist/api/presentation/diagrams.d.ts.map +1 -0
  143. package/dist/api/presentation/import.d.ts +113 -0
  144. package/dist/api/presentation/import.d.ts.map +1 -0
  145. package/dist/api/presentation/index.d.ts +46 -0
  146. package/dist/api/presentation/index.d.ts.map +1 -0
  147. package/dist/api/presentation/sheets.d.ts +176 -0
  148. package/dist/api/presentation/sheets.d.ts.map +1 -0
  149. package/dist/api/presentation/views.d.ts +296 -0
  150. package/dist/api/presentation/views.d.ts.map +1 -0
  151. package/dist/api/program/adjacency.d.ts +155 -0
  152. package/dist/api/program/adjacency.d.ts.map +1 -0
  153. package/dist/api/program/areas.d.ts +360 -0
  154. package/dist/api/program/areas.d.ts.map +1 -0
  155. package/dist/api/program/classification.d.ts +135 -0
  156. package/dist/api/program/classification.d.ts.map +1 -0
  157. package/dist/api/program/cores.d.ts +174 -0
  158. package/dist/api/program/cores.d.ts.map +1 -0
  159. package/dist/api/program/departments.d.ts +431 -0
  160. package/dist/api/program/departments.d.ts.map +1 -0
  161. package/dist/api/program/index.d.ts +69 -0
  162. package/dist/api/program/index.d.ts.map +1 -0
  163. package/dist/api/program/layout.d.ts +63 -0
  164. package/dist/api/program/layout.d.ts.map +1 -0
  165. package/dist/api/program/metrics.d.ts +108 -0
  166. package/dist/api/program/metrics.d.ts.map +1 -0
  167. package/dist/api/program/site.d.ts +451 -0
  168. package/dist/api/program/site.d.ts.map +1 -0
  169. package/dist/api/program/spreadsheet.d.ts +2041 -0
  170. package/dist/api/program/spreadsheet.d.ts.map +1 -0
  171. package/dist/handles.d.ts +171 -0
  172. package/dist/handles.d.ts.map +1 -0
  173. package/dist/host-utils.d.ts +7 -5
  174. package/dist/host-utils.d.ts.map +1 -1
  175. package/dist/index.cjs +4344 -899
  176. package/dist/index.cjs.map +1 -1
  177. package/dist/index.d.ts +1 -0
  178. package/dist/index.d.ts.map +1 -1
  179. package/dist/index.js +3682 -865
  180. package/dist/index.js.map +1 -1
  181. package/package.json +6 -2
  182. package/scripts/generate-manifest.mjs +193 -0
  183. package/scripts/generate-manifest.test.mjs +215 -0
  184. package/src/api/analysis/heatmaps.ts +256 -0
  185. package/src/api/analysis/illuminance.ts +155 -0
  186. package/src/api/analysis/index.ts +46 -0
  187. package/src/api/analysis/shadows.ts +183 -0
  188. package/src/api/analysis/sunlightHours.ts +211 -0
  189. package/src/api/analysis/sunpath.ts +83 -0
  190. package/src/api/core/buildings.ts +485 -0
  191. package/src/api/core/comment/index.ts +258 -0
  192. package/src/api/core/geom/create/index.ts +293 -0
  193. package/src/api/core/geom/delete/index.ts +78 -0
  194. package/src/api/core/geom/index.ts +24 -23
  195. package/src/api/core/geom/query/arc.ts +169 -0
  196. package/src/api/core/geom/query/brep.ts +444 -0
  197. package/src/api/core/geom/query/circle.ts +404 -0
  198. package/src/api/core/geom/query/contour.ts +540 -0
  199. package/src/api/core/geom/query/curve.ts +1078 -0
  200. package/src/api/core/geom/query/edge.ts +130 -0
  201. package/src/api/core/geom/query/face.ts +403 -0
  202. package/src/api/core/geom/query/halfedge.ts +210 -0
  203. package/src/api/core/geom/query/index.ts +63 -0
  204. package/src/api/core/geom/query/profile.ts +473 -0
  205. package/src/api/core/geom/query/vertex.ts +205 -0
  206. package/src/api/core/geom/update/contour.ts +315 -0
  207. package/src/api/core/geom/update/curve.ts +209 -0
  208. package/src/api/core/geom/update/index.ts +29 -0
  209. package/src/api/core/geom/update/profile.ts +377 -0
  210. package/src/api/core/groups.ts +521 -0
  211. package/src/api/core/history/index.ts +84 -0
  212. package/src/api/core/index.ts +51 -1
  213. package/src/api/core/io/import/index.ts +432 -0
  214. package/src/api/core/io/index.ts +37 -0
  215. package/src/api/core/io/job/index.ts +140 -0
  216. package/src/api/core/io/query/index.ts +71 -0
  217. package/src/api/core/io/terrain/index.ts +214 -0
  218. package/src/api/core/io/underlay/index.ts +295 -0
  219. package/src/api/core/layers.ts +333 -0
  220. package/src/api/core/math/quat.ts +112 -235
  221. package/src/api/core/math/vec3.ts +124 -159
  222. package/src/api/core/project/index.ts +418 -0
  223. package/src/api/core/tags.ts +808 -0
  224. package/src/api/core/units/index.ts +164 -0
  225. package/src/api/core/zoom/index.ts +47 -0
  226. package/src/api/design/boolean/index.ts +179 -0
  227. package/src/api/design/create/index.ts +895 -0
  228. package/src/api/design/delete/index.ts +67 -0
  229. package/src/api/design/doors/index.ts +285 -0
  230. package/src/api/design/edit/index.ts +54 -0
  231. package/src/api/design/erase/index.ts +151 -0
  232. package/src/api/design/furniture/index.ts +130 -0
  233. package/src/api/design/index.ts +162 -0
  234. package/src/api/design/lock.ts +42 -0
  235. package/src/api/design/materials/index.ts +301 -0
  236. package/src/api/design/query/geometry/index.ts +166 -0
  237. package/src/api/design/query/index.ts +937 -0
  238. package/src/api/design/query/spaces.ts +132 -0
  239. package/src/api/design/selection/index.ts +273 -0
  240. package/src/api/design/shared.ts +40 -0
  241. package/src/api/design/transform/index.ts +93 -0
  242. package/src/api/design/update/index.ts +117 -0
  243. package/src/api/design/windows/index.ts +207 -0
  244. package/src/api/entity/buildableEnvelope.ts +318 -0
  245. package/src/api/entity/department.ts +0 -113
  246. package/src/api/entity/index.ts +9 -9
  247. package/src/api/entity/referenceLine.ts +50 -38
  248. package/src/api/entity/space.ts +285 -226
  249. package/src/api/entity/story.ts +53 -42
  250. package/src/api/index.ts +22 -12
  251. package/src/api/presentation/aiInspiration.ts +362 -0
  252. package/src/api/presentation/diagrams.ts +84 -0
  253. package/src/api/presentation/import.ts +112 -0
  254. package/src/api/presentation/index.ts +48 -0
  255. package/src/api/presentation/sheets.ts +198 -0
  256. package/src/api/presentation/views.ts +303 -0
  257. package/src/api/program/adjacency.ts +164 -0
  258. package/src/api/program/areas.ts +335 -0
  259. package/src/api/program/classification.ts +138 -0
  260. package/src/api/program/cores.ts +171 -0
  261. package/src/api/program/departments.ts +465 -0
  262. package/src/api/program/index.ts +71 -0
  263. package/src/api/program/layout.ts +68 -0
  264. package/src/api/program/metrics.ts +120 -0
  265. package/src/api/program/site.ts +419 -0
  266. package/src/api/program/spreadsheet.ts +2075 -0
  267. package/src/handles.ts +194 -0
  268. package/src/host-utils.ts +10 -6
  269. package/src/index.ts +1 -0
  270. package/dist/api/core/geom/arc.d.ts +0 -81
  271. package/dist/api/core/geom/arc.d.ts.map +0 -1
  272. package/dist/api/core/geom/curve.d.ts +0 -70
  273. package/dist/api/core/geom/curve.d.ts.map +0 -1
  274. package/dist/api/core/geom/line.d.ts +0 -56
  275. package/dist/api/core/geom/line.d.ts.map +0 -1
  276. package/dist/api/core/geom/profile.d.ts +0 -121
  277. package/dist/api/core/geom/profile.d.ts.map +0 -1
  278. package/dist/api/tools/copy.d.ts +0 -59
  279. package/dist/api/tools/copy.d.ts.map +0 -1
  280. package/dist/api/tools/index.d.ts +0 -33
  281. package/dist/api/tools/index.d.ts.map +0 -1
  282. package/dist/api/tools/material.d.ts +0 -51
  283. package/dist/api/tools/material.d.ts.map +0 -1
  284. package/dist/api/tools/offset.d.ts +0 -43
  285. package/dist/api/tools/offset.d.ts.map +0 -1
  286. package/dist/api/tools/selection.d.ts +0 -48
  287. package/dist/api/tools/selection.d.ts.map +0 -1
  288. package/dist/api/tools/transform.d.ts +0 -114
  289. package/dist/api/tools/transform.d.ts.map +0 -1
  290. package/dist/api/units/index.d.ts +0 -163
  291. package/dist/api/units/index.d.ts.map +0 -1
  292. package/src/api/core/geom/arc.ts +0 -70
  293. package/src/api/core/geom/curve.ts +0 -41
  294. package/src/api/core/geom/line.ts +0 -53
  295. package/src/api/core/geom/profile.ts +0 -94
  296. package/src/api/tools/copy.ts +0 -55
  297. package/src/api/tools/index.ts +0 -39
  298. package/src/api/tools/material.ts +0 -49
  299. package/src/api/tools/offset.ts +0 -43
  300. package/src/api/tools/selection.ts +0 -51
  301. package/src/api/tools/transform.ts +0 -117
  302. package/src/api/units/index.ts +0 -163
@@ -0,0 +1,1078 @@
1
+ import * as z from "zod"
2
+ import { PluginApiReturn } from "../../../../types"
3
+ import { Vec3Handle, CurveHandle, LineHandle, Vec3Components } from "../../../../handles"
4
+
5
+ /**
6
+ * Curve queries — read-only geometric questions about curves (lines and arcs)
7
+ * and the relationships between two curves (all-handle model, §11).
8
+ *
9
+ * Every method takes opaque curve handles ({@linkcode CurveHandle}/{@linkcode LineHandle})
10
+ * and point handles ({@linkcode Vec3Handle}) and returns plain values — points as
11
+ * {@linkcode Vec3Components}, lengths/distances/parameters as `number`, predicates as
12
+ * `boolean`. Relationship methods that produce a new curve return a
13
+ * {@linkcode CurveHandle} (or `null` when there is no result). No query mutates its
14
+ * inputs.
15
+ *
16
+ * Accessed via `snaptrude.core.geom.query.curve`.
17
+ */
18
+ export abstract class PluginGeomQueryCurveApi {
19
+ constructor() {}
20
+
21
+ /**
22
+ * Get the start point of a curve.
23
+ * @param curve The curve to query
24
+ * @returns The start point as {@linkcode Vec3Components}
25
+ *
26
+ * @examplePrompt Where does this wall edge start?
27
+ *
28
+ * # Example
29
+ * ```ts
30
+ * const [wall] = await snaptrude.design.query.listWalls()
31
+ * const centerline = await snaptrude.design.query.geometry.getCenterline(wall)
32
+ * if (centerline) {
33
+ * const start = await snaptrude.core.geom.query.curve.getStartPoint(centerline)
34
+ * console.log(start.x, start.y, start.z)
35
+ * }
36
+ * ```
37
+ */
38
+ public abstract getStartPoint(curve: CurveHandle): PluginApiReturn<Vec3Components>
39
+
40
+ /**
41
+ * Get the end point of a curve.
42
+ * @param curve The curve to query
43
+ * @returns The end point as {@linkcode Vec3Components}
44
+ *
45
+ * @examplePrompt Get the coordinates of the far end of this edge
46
+ *
47
+ * # Example
48
+ * ```ts
49
+ * const a = await snaptrude.core.math.vec3.new(0, 0, 0)
50
+ * const b = await snaptrude.core.math.vec3.new(5, 0, 0)
51
+ * const line = await snaptrude.core.geom.create.line(a, b)
52
+ * const end = await snaptrude.core.geom.query.curve.getEndPoint(line) // { x: 5, y: 0, z: 0 }
53
+ * ```
54
+ */
55
+ public abstract getEndPoint(curve: CurveHandle): PluginApiReturn<Vec3Components>
56
+
57
+ /**
58
+ * Get the mid point of a curve.
59
+ * @param curve The curve to query
60
+ * @returns The mid point as {@linkcode Vec3Components}
61
+ *
62
+ * @examplePrompt Find the midpoint of this wall edge
63
+ * @examplePrompt Where is the centre of this boundary line?
64
+ *
65
+ * # Example
66
+ * ```ts
67
+ * const [wall] = await snaptrude.design.query.listWalls()
68
+ * const centerline = await snaptrude.design.query.geometry.getCenterline(wall)
69
+ * if (centerline) {
70
+ * const mid = await snaptrude.core.geom.query.curve.getMidPoint(centerline)
71
+ * console.log(mid.x, mid.y, mid.z)
72
+ * }
73
+ * ```
74
+ */
75
+ public abstract getMidPoint(curve: CurveHandle): PluginApiReturn<Vec3Components>
76
+
77
+ /**
78
+ * Get the arc-length of a curve.
79
+ * @param curve The curve to query
80
+ * @returns The curve length as a `number`
81
+ *
82
+ * @examplePrompt How long is this wall edge?
83
+ * @examplePrompt Measure the length of this curved boundary
84
+ *
85
+ * # Example
86
+ * ```ts
87
+ * const [wall] = await snaptrude.design.query.listWalls()
88
+ * const centerline = await snaptrude.design.query.geometry.getCenterline(wall)
89
+ * if (centerline) {
90
+ * const length = await snaptrude.core.geom.query.curve.getLength(centerline)
91
+ * }
92
+ * ```
93
+ */
94
+ public abstract getLength(curve: CurveHandle): PluginApiReturn<number>
95
+
96
+ /**
97
+ * Get the straight-line chord length between a curve's endpoints.
98
+ * @param curve The curve to query
99
+ * @returns The chord length as a `number`
100
+ *
101
+ * @examplePrompt What is the straight-line distance between the two ends of this arc?
102
+ *
103
+ * # Example
104
+ * ```ts
105
+ * const start = await snaptrude.core.math.vec3.new(5, 0, 0)
106
+ * const end = await snaptrude.core.math.vec3.new(-5, 0, 0)
107
+ * const centre = await snaptrude.core.math.vec3.new(0, 0, 0)
108
+ * const axis = await snaptrude.core.math.vec3.new(0, 1, 0)
109
+ * const arc = await snaptrude.core.geom.create.arc(start, end, centre, axis)
110
+ * const chord = await snaptrude.core.geom.query.curve.getChordLength(arc) // 10 (getLength gives the arc length)
111
+ * ```
112
+ */
113
+ public abstract getChordLength(curve: CurveHandle): PluginApiReturn<number>
114
+
115
+ /**
116
+ * Get the unit tangent vector of a curve at a point on it.
117
+ * @param curve The curve to query
118
+ * @param point Point on the curve
119
+ * @returns The tangent vector as {@linkcode Vec3Components}
120
+ *
121
+ * # Example
122
+ * ```ts
123
+ * const a = await snaptrude.core.math.vec3.new(0, 0, 0)
124
+ * const b = await snaptrude.core.math.vec3.new(3, 0, 4)
125
+ * const line = await snaptrude.core.geom.create.line(a, b)
126
+ * const tangent = await snaptrude.core.geom.query.curve.getTangent(line, a) // { x: 0.6, y: 0, z: 0.8 }
127
+ * ```
128
+ */
129
+ public abstract getTangent(
130
+ curve: CurveHandle,
131
+ point: Vec3Handle,
132
+ ): PluginApiReturn<Vec3Components>
133
+
134
+ /**
135
+ * Get the unit normal vector of a curve at a point on it.
136
+ * @param curve The curve to query
137
+ * @param point Point on the curve
138
+ * @returns The normal vector as {@linkcode Vec3Components}
139
+ *
140
+ * # Example
141
+ * ```ts
142
+ * const a = await snaptrude.core.math.vec3.new(0, 0, 0)
143
+ * const b = await snaptrude.core.math.vec3.new(10, 0, 0)
144
+ * const line = await snaptrude.core.geom.create.line(a, b)
145
+ * const normal = await snaptrude.core.geom.query.curve.getNormal(line, a)
146
+ * ```
147
+ */
148
+ public abstract getNormal(
149
+ curve: CurveHandle,
150
+ point: Vec3Handle,
151
+ ): PluginApiReturn<Vec3Components>
152
+
153
+ /**
154
+ * Get the point on a curve nearest to an arbitrary point.
155
+ * @param curve The curve to query
156
+ * @param point The reference point
157
+ * @returns The nearest point on the curve as {@linkcode Vec3Components}
158
+ *
159
+ * @examplePrompt Find the point on this edge closest to the column
160
+ *
161
+ * # Example
162
+ * ```ts
163
+ * const [wall] = await snaptrude.design.query.listWalls()
164
+ * const centerline = await snaptrude.design.query.geometry.getCenterline(wall)
165
+ * const reference = await snaptrude.core.math.vec3.new(2, 0, 3)
166
+ * if (centerline) {
167
+ * const nearest = await snaptrude.core.geom.query.curve.getNearestPoint(centerline, reference)
168
+ * }
169
+ * ```
170
+ */
171
+ public abstract getNearestPoint(
172
+ curve: CurveHandle,
173
+ point: Vec3Handle,
174
+ ): PluginApiReturn<Vec3Components>
175
+
176
+ /**
177
+ * Project a point onto a curve.
178
+ * @param curve The curve to project onto
179
+ * @param point The point to project
180
+ * @returns The projected point as {@linkcode Vec3Components}
181
+ *
182
+ * # Example
183
+ * ```ts
184
+ * const a = await snaptrude.core.math.vec3.new(0, 0, 0)
185
+ * const b = await snaptrude.core.math.vec3.new(10, 0, 0)
186
+ * const line = await snaptrude.core.geom.create.line(a, b)
187
+ * const point = await snaptrude.core.math.vec3.new(3, 0, 4)
188
+ * const projected = await snaptrude.core.geom.query.curve.getProjection(line, point) // { x: 3, y: 0, z: 0 }
189
+ * ```
190
+ */
191
+ public abstract getProjection(
192
+ curve: CurveHandle,
193
+ point: Vec3Handle,
194
+ ): PluginApiReturn<Vec3Components>
195
+
196
+ /**
197
+ * Get the point at a given distance along a curve from a reference point.
198
+ * @param curve The curve to query
199
+ * @param referencePoint Point on the curve to measure from
200
+ * @param distance Distance along the curve from the reference point
201
+ * @param forward Optional direction along the curve (defaults to `true`)
202
+ * @returns The resulting point as {@linkcode Vec3Components}
203
+ *
204
+ * @examplePrompt Find the point 2 metres along this edge from the corner
205
+ * @examplePrompt Mark a spot 900mm from the start of the wall edge
206
+ *
207
+ * # Example
208
+ * ```ts
209
+ * const a = await snaptrude.core.math.vec3.new(0, 0, 0)
210
+ * const b = await snaptrude.core.math.vec3.new(10, 0, 0)
211
+ * const line = await snaptrude.core.geom.create.line(a, b)
212
+ * const p = await snaptrude.core.geom.query.curve.getPointAtDistance(line, a, 2) // { x: 2, y: 0, z: 0 }
213
+ * const q = await snaptrude.core.geom.query.curve.getPointAtDistance(line, b, 2, false) // measured backwards from the end
214
+ * ```
215
+ */
216
+ public abstract getPointAtDistance(
217
+ curve: CurveHandle,
218
+ referencePoint: Vec3Handle,
219
+ distance: number,
220
+ forward?: boolean,
221
+ ): PluginApiReturn<Vec3Components>
222
+
223
+ /**
224
+ * Get the curve parameter corresponding to a point on the curve.
225
+ * @param curve The curve to query
226
+ * @param point Point on the curve
227
+ * @returns The parameter as a `number`
228
+ *
229
+ * # Example
230
+ * ```ts
231
+ * const a = await snaptrude.core.math.vec3.new(0, 0, 0)
232
+ * const b = await snaptrude.core.math.vec3.new(8, 0, 0)
233
+ * const line = await snaptrude.core.geom.create.line(a, b)
234
+ * const t = await snaptrude.core.geom.query.curve.getParameterAtPoint(line, b)
235
+ * ```
236
+ */
237
+ public abstract getParameterAtPoint(
238
+ curve: CurveHandle,
239
+ point: Vec3Handle,
240
+ ): PluginApiReturn<number>
241
+
242
+ /**
243
+ * Get the curvature of a curve at a point on it.
244
+ * @param curve The curve to query
245
+ * @param point Point on the curve
246
+ * @returns The curvature as a `number`
247
+ *
248
+ * # Example
249
+ * ```ts
250
+ * const start = await snaptrude.core.math.vec3.new(2, 0, 0)
251
+ * const end = await snaptrude.core.math.vec3.new(-2, 0, 0)
252
+ * const centre = await snaptrude.core.math.vec3.new(0, 0, 0)
253
+ * const axis = await snaptrude.core.math.vec3.new(0, 1, 0)
254
+ * const arc = await snaptrude.core.geom.create.arc(start, end, centre, axis)
255
+ * const k = await snaptrude.core.geom.query.curve.getCurvature(arc, start) // 0.5 (1 / radius)
256
+ * ```
257
+ */
258
+ public abstract getCurvature(
259
+ curve: CurveHandle,
260
+ point: Vec3Handle,
261
+ ): PluginApiReturn<number>
262
+
263
+ /**
264
+ * Get the shortest distance from an arbitrary point to a curve.
265
+ * @param curve The curve to query
266
+ * @param point The point to measure from
267
+ * @returns The distance as a `number`
268
+ *
269
+ * @examplePrompt How far is this column from the wall edge?
270
+ * @examplePrompt What is the shortest distance from this point to the boundary line?
271
+ *
272
+ * # Example
273
+ * ```ts
274
+ * const [wall] = await snaptrude.design.query.listWalls()
275
+ * const centerline = await snaptrude.design.query.geometry.getCenterline(wall)
276
+ * const point = await snaptrude.core.math.vec3.new(2, 0, 3)
277
+ * if (centerline) {
278
+ * const distance = await snaptrude.core.geom.query.curve.getDistanceToPoint(centerline, point)
279
+ * }
280
+ * ```
281
+ */
282
+ public abstract getDistanceToPoint(
283
+ curve: CurveHandle,
284
+ point: Vec3Handle,
285
+ ): PluginApiReturn<number>
286
+
287
+ /**
288
+ * Get the arc-length distance along a curve between two points on it.
289
+ * @param curve The curve to query
290
+ * @param pointA First point on the curve
291
+ * @param pointB Second point on the curve
292
+ * @returns The distance along the curve as a `number`
293
+ *
294
+ * @examplePrompt How far apart are these two points measured along the curved wall?
295
+ *
296
+ * # Example
297
+ * ```ts
298
+ * const a = await snaptrude.core.math.vec3.new(0, 0, 0)
299
+ * const b = await snaptrude.core.math.vec3.new(10, 0, 0)
300
+ * const line = await snaptrude.core.geom.create.line(a, b)
301
+ * const mid = await snaptrude.core.math.vec3.new(5, 0, 0)
302
+ * const d = await snaptrude.core.geom.query.curve.getDistanceAlong(line, a, mid) // 5
303
+ * ```
304
+ */
305
+ public abstract getDistanceAlong(
306
+ curve: CurveHandle,
307
+ pointA: Vec3Handle,
308
+ pointB: Vec3Handle,
309
+ ): PluginApiReturn<number>
310
+
311
+ /**
312
+ * List sampled points along a curve.
313
+ * @param curve The curve to sample
314
+ * @param resolution Optional number of samples for arcs (defaults to `20`; ignored for lines)
315
+ * @returns The sampled points as {@linkcode Vec3Components}`[]`
316
+ *
317
+ * # Example
318
+ * ```ts
319
+ * const start = await snaptrude.core.math.vec3.new(5, 0, 0)
320
+ * const end = await snaptrude.core.math.vec3.new(0, 0, 5)
321
+ * const centre = await snaptrude.core.math.vec3.new(0, 0, 0)
322
+ * const axis = await snaptrude.core.math.vec3.new(0, 1, 0)
323
+ * const arc = await snaptrude.core.geom.create.arc(start, end, centre, axis)
324
+ * const points = await snaptrude.core.geom.query.curve.listPoints(arc, 40)
325
+ * for (const p of points) console.log(p.x, p.y, p.z)
326
+ * ```
327
+ */
328
+ public abstract listPoints(
329
+ curve: CurveHandle,
330
+ resolution?: number,
331
+ ): PluginApiReturn<Vec3Components[]>
332
+
333
+ /**
334
+ * List the points produced by subdividing a curve into equal segments.
335
+ * @param curve The curve to subdivide
336
+ * @param segments Number of equal segments to divide the curve into
337
+ * @returns The subdivision points as {@linkcode Vec3Components}`[]`
338
+ *
339
+ * @examplePrompt Divide this edge into 5 equal segments
340
+ * @examplePrompt Split the wall line into equal parts for placing columns
341
+ *
342
+ * # Example
343
+ * ```ts
344
+ * const [wall] = await snaptrude.design.query.listWalls()
345
+ * const centerline = await snaptrude.design.query.geometry.getCenterline(wall)
346
+ * if (centerline) {
347
+ * const points = await snaptrude.core.geom.query.curve.listSubdivisions(centerline, 5)
348
+ * }
349
+ * ```
350
+ */
351
+ public abstract listSubdivisions(
352
+ curve: CurveHandle,
353
+ segments: number,
354
+ ): PluginApiReturn<Vec3Components[]>
355
+
356
+ /**
357
+ * Test whether a curve is a straight line.
358
+ * @param curve The curve to query
359
+ * @returns `true` if the curve is linear, otherwise `false`
360
+ *
361
+ * @examplePrompt Is this edge straight or curved?
362
+ *
363
+ * # Example
364
+ * ```ts
365
+ * const [wall] = await snaptrude.design.query.listWalls()
366
+ * const centerline = await snaptrude.design.query.geometry.getCenterline(wall)
367
+ * if (centerline) {
368
+ * const straight = await snaptrude.core.geom.query.curve.isLinear(centerline)
369
+ * }
370
+ * ```
371
+ */
372
+ public abstract isLinear(curve: CurveHandle): PluginApiReturn<boolean>
373
+
374
+ /**
375
+ * Test whether a point lies on a curve within an optional threshold.
376
+ * @param curve The curve to query
377
+ * @param point The point to test
378
+ * @param threshold Optional distance tolerance (defaults to the engine default)
379
+ * @returns `true` if the point is on the curve, otherwise `false`
380
+ *
381
+ * @examplePrompt Check whether this point lies on the wall edge
382
+ *
383
+ * # Example
384
+ * ```ts
385
+ * const a = await snaptrude.core.math.vec3.new(0, 0, 0)
386
+ * const b = await snaptrude.core.math.vec3.new(10, 0, 0)
387
+ * const line = await snaptrude.core.geom.create.line(a, b)
388
+ * const point = await snaptrude.core.math.vec3.new(5, 0, 0.005)
389
+ * const on = await snaptrude.core.geom.query.curve.isOnCurve(line, point, 0.01) // true within tolerance
390
+ * ```
391
+ */
392
+ public abstract isOnCurve(
393
+ curve: CurveHandle,
394
+ point: Vec3Handle,
395
+ threshold?: number,
396
+ ): PluginApiReturn<boolean>
397
+
398
+ /**
399
+ * Test whether a curve contains a point, optionally including its endpoints.
400
+ * @param curve The curve to query
401
+ * @param point The point to test
402
+ * @param includeEndPoints Optional flag to count endpoints as contained (defaults to `true`)
403
+ * @returns `true` if the curve contains the point, otherwise `false`
404
+ *
405
+ * # Example
406
+ * ```ts
407
+ * const a = await snaptrude.core.math.vec3.new(0, 0, 0)
408
+ * const b = await snaptrude.core.math.vec3.new(10, 0, 0)
409
+ * const line = await snaptrude.core.geom.create.line(a, b)
410
+ * const atEnd = await snaptrude.core.geom.query.curve.hasPoint(line, b) // true (endpoints count by default)
411
+ * const interiorOnly = await snaptrude.core.geom.query.curve.hasPoint(line, b, false) // false
412
+ * ```
413
+ */
414
+ public abstract hasPoint(
415
+ curve: CurveHandle,
416
+ point: Vec3Handle,
417
+ includeEndPoints?: boolean,
418
+ ): PluginApiReturn<boolean>
419
+
420
+ /**
421
+ * Test whether two curves are geometrically equal.
422
+ * @param curveA First curve
423
+ * @param curveB Second curve
424
+ * @returns `true` if the curves are equal, otherwise `false`
425
+ *
426
+ * # Example
427
+ * ```ts
428
+ * const a = await snaptrude.core.math.vec3.new(0, 0, 0)
429
+ * const b = await snaptrude.core.math.vec3.new(10, 0, 0)
430
+ * const lineA = await snaptrude.core.geom.create.line(a, b)
431
+ * const lineB = await snaptrude.core.geom.create.line(a, b)
432
+ * const same = await snaptrude.core.geom.query.curve.isEqual(lineA, lineB) // true
433
+ * ```
434
+ */
435
+ public abstract isEqual(
436
+ curveA: CurveHandle,
437
+ curveB: CurveHandle,
438
+ ): PluginApiReturn<boolean>
439
+
440
+ /**
441
+ * Test whether two curves overlap (share a collinear/concentric span), optionally including their endpoints.
442
+ * @param curveA First curve
443
+ * @param curveB Second curve
444
+ * @param includeEndPoints Optional flag to count endpoint contact as overlap (defaults to `false`)
445
+ * @returns `true` if the curves overlap, otherwise `false`
446
+ *
447
+ * @examplePrompt Do these two wall edges overlap?
448
+ *
449
+ * # Example
450
+ * ```ts
451
+ * const p0 = await snaptrude.core.math.vec3.new(0, 0, 0)
452
+ * const p5 = await snaptrude.core.math.vec3.new(5, 0, 0)
453
+ * const p10 = await snaptrude.core.math.vec3.new(10, 0, 0)
454
+ * const p15 = await snaptrude.core.math.vec3.new(15, 0, 0)
455
+ * const lineA = await snaptrude.core.geom.create.line(p0, p10)
456
+ * const lineB = await snaptrude.core.geom.create.line(p5, p15)
457
+ * const overlaps = await snaptrude.core.geom.query.curve.isOverlapping(lineA, lineB) // true (share the 5..10 span)
458
+ * ```
459
+ */
460
+ public abstract isOverlapping(
461
+ curveA: CurveHandle,
462
+ curveB: CurveHandle,
463
+ includeEndPoints?: boolean,
464
+ ): PluginApiReturn<boolean>
465
+
466
+ /**
467
+ * Get the common (overlapping) part of two curves.
468
+ * @param curveA First curve
469
+ * @param curveB Second curve
470
+ * @returns The common part as a {@linkcode CurveHandle}, or `null` if there is none
471
+ *
472
+ * @examplePrompt Get the shared segment where these two edges overlap
473
+ *
474
+ * # Example
475
+ * ```ts
476
+ * const p0 = await snaptrude.core.math.vec3.new(0, 0, 0)
477
+ * const p5 = await snaptrude.core.math.vec3.new(5, 0, 0)
478
+ * const p10 = await snaptrude.core.math.vec3.new(10, 0, 0)
479
+ * const p15 = await snaptrude.core.math.vec3.new(15, 0, 0)
480
+ * const lineA = await snaptrude.core.geom.create.line(p0, p10)
481
+ * const lineB = await snaptrude.core.geom.create.line(p5, p15)
482
+ * const common = await snaptrude.core.geom.query.curve.getCommonPart(lineA, lineB)
483
+ * if (common) {
484
+ * const length = await snaptrude.core.geom.query.curve.getLength(common) // 5
485
+ * }
486
+ * ```
487
+ */
488
+ public abstract getCommonPart(
489
+ curveA: CurveHandle,
490
+ curveB: CurveHandle,
491
+ ): PluginApiReturn<CurveHandle | null>
492
+
493
+ /**
494
+ * List the intersection points between two curves.
495
+ * @param curveA First curve
496
+ * @param curveB Second curve
497
+ * @param boundedA Optional flag to bound intersections to `curveA`'s extent (defaults to `true`)
498
+ * @param boundedB Optional flag to bound intersections to `curveB`'s extent (defaults to `true`)
499
+ * @returns The intersection points as {@linkcode Vec3Components}`[]`
500
+ *
501
+ * @examplePrompt Where do these two lines cross?
502
+ * @examplePrompt Find the intersection points of these two gridlines
503
+ *
504
+ * # Example
505
+ * ```ts
506
+ * const a1 = await snaptrude.core.math.vec3.new(0, 0, 0)
507
+ * const a2 = await snaptrude.core.math.vec3.new(10, 0, 0)
508
+ * const b1 = await snaptrude.core.math.vec3.new(5, 0, -5)
509
+ * const b2 = await snaptrude.core.math.vec3.new(5, 0, 5)
510
+ * const lineA = await snaptrude.core.geom.create.line(a1, a2)
511
+ * const lineB = await snaptrude.core.geom.create.line(b1, b2)
512
+ * const points = await snaptrude.core.geom.query.curve.listIntersections(lineA, lineB) // [{ x: 5, y: 0, z: 0 }]
513
+ * const unbounded = await snaptrude.core.geom.query.curve.listIntersections(lineA, lineB, false, false) // treat both as infinite
514
+ * ```
515
+ */
516
+ public abstract listIntersections(
517
+ curveA: CurveHandle,
518
+ curveB: CurveHandle,
519
+ boundedA?: boolean,
520
+ boundedB?: boolean,
521
+ ): PluginApiReturn<Vec3Components[]>
522
+
523
+ /**
524
+ * Merge two curves into a single curve when they are mergeable.
525
+ * @param curveA First curve
526
+ * @param curveB Second curve
527
+ * @returns The merged curve as a {@linkcode CurveHandle}, or `null` if they cannot be merged
528
+ *
529
+ * @examplePrompt Merge these two line segments into a single line
530
+ *
531
+ * # Example
532
+ * ```ts
533
+ * const p0 = await snaptrude.core.math.vec3.new(0, 0, 0)
534
+ * const p5 = await snaptrude.core.math.vec3.new(5, 0, 0)
535
+ * const p10 = await snaptrude.core.math.vec3.new(10, 0, 0)
536
+ * const lineA = await snaptrude.core.geom.create.line(p0, p5)
537
+ * const lineB = await snaptrude.core.geom.create.line(p5, p10)
538
+ * const merged = await snaptrude.core.geom.query.curve.getMergedCurve(lineA, lineB)
539
+ * if (merged) {
540
+ * const length = await snaptrude.core.geom.query.curve.getLength(merged) // 10
541
+ * }
542
+ * ```
543
+ */
544
+ public abstract getMergedCurve(
545
+ curveA: CurveHandle,
546
+ curveB: CurveHandle,
547
+ ): PluginApiReturn<CurveHandle | null>
548
+
549
+ /**
550
+ * Test whether two curves are continuous (share an endpoint without a gap).
551
+ * @param curveA First curve
552
+ * @param curveB Second curve
553
+ * @returns `true` if the curves are continuous, otherwise `false`
554
+ *
555
+ * @examplePrompt Do these two edges connect end to end without a gap?
556
+ *
557
+ * # Example
558
+ * ```ts
559
+ * const a = await snaptrude.core.math.vec3.new(0, 0, 0)
560
+ * const b = await snaptrude.core.math.vec3.new(5, 0, 0)
561
+ * const c = await snaptrude.core.math.vec3.new(5, 0, 5)
562
+ * const lineA = await snaptrude.core.geom.create.line(a, b)
563
+ * const lineB = await snaptrude.core.geom.create.line(b, c)
564
+ * const connected = await snaptrude.core.geom.query.curve.isContinuous(lineA, lineB) // true
565
+ * ```
566
+ */
567
+ public abstract isContinuous(
568
+ curveA: CurveHandle,
569
+ curveB: CurveHandle,
570
+ ): PluginApiReturn<boolean>
571
+
572
+ /**
573
+ * Test whether two lines are parallel within an optional tolerance.
574
+ * @param lineA First line
575
+ * @param lineB Second line
576
+ * @param tolerance Optional angular tolerance (defaults to the engine default)
577
+ * @returns `true` if the lines are parallel, otherwise `false`
578
+ *
579
+ * @examplePrompt Are these two walls parallel?
580
+ * @examplePrompt Check if these gridlines run parallel to each other
581
+ *
582
+ * # Example
583
+ * ```ts
584
+ * const a1 = await snaptrude.core.math.vec3.new(0, 0, 0)
585
+ * const a2 = await snaptrude.core.math.vec3.new(10, 0, 0)
586
+ * const b1 = await snaptrude.core.math.vec3.new(0, 0, 3)
587
+ * const b2 = await snaptrude.core.math.vec3.new(10, 0, 3)
588
+ * const lineA = await snaptrude.core.geom.create.line(a1, a2)
589
+ * const lineB = await snaptrude.core.geom.create.line(b1, b2)
590
+ * const parallel = await snaptrude.core.geom.query.curve.isParallel(lineA, lineB) // true
591
+ * ```
592
+ */
593
+ public abstract isParallel(
594
+ lineA: LineHandle,
595
+ lineB: LineHandle,
596
+ tolerance?: number,
597
+ ): PluginApiReturn<boolean>
598
+
599
+ /**
600
+ * Get the shortest gap between two curves, optionally including their endpoints.
601
+ * @param curveA First curve
602
+ * @param curveB Second curve
603
+ * @param includeEndPoints Optional flag to include endpoints when measuring (defaults to `false`)
604
+ * @returns The shortest gap as a `number`
605
+ *
606
+ * @examplePrompt What is the gap between these two wall edges?
607
+ * @examplePrompt How close do these two curves get to each other?
608
+ *
609
+ * # Example
610
+ * ```ts
611
+ * const a1 = await snaptrude.core.math.vec3.new(0, 0, 0)
612
+ * const a2 = await snaptrude.core.math.vec3.new(5, 0, 0)
613
+ * const b1 = await snaptrude.core.math.vec3.new(0, 0, 2)
614
+ * const b2 = await snaptrude.core.math.vec3.new(5, 0, 2)
615
+ * const curveA = await snaptrude.core.geom.create.line(a1, a2)
616
+ * const curveB = await snaptrude.core.geom.create.line(b1, b2)
617
+ * const gap = await snaptrude.core.geom.query.curve.getShortestGap(curveA, curveB) // 2
618
+ * ```
619
+ */
620
+ public abstract getShortestGap(
621
+ curveA: CurveHandle,
622
+ curveB: CurveHandle,
623
+ includeEndPoints?: boolean,
624
+ ): PluginApiReturn<number>
625
+
626
+ /**
627
+ * Get the perpendicular distance between two parallel lines.
628
+ * @param lineA First line
629
+ * @param lineB Second line
630
+ * @returns The distance between the lines as a `number`
631
+ *
632
+ * @examplePrompt How far apart are these two parallel walls?
633
+ * @examplePrompt Measure the spacing between these two gridlines
634
+ *
635
+ * # Example
636
+ * ```ts
637
+ * const a1 = await snaptrude.core.math.vec3.new(0, 0, 0)
638
+ * const a2 = await snaptrude.core.math.vec3.new(10, 0, 0)
639
+ * const b1 = await snaptrude.core.math.vec3.new(0, 0, 4)
640
+ * const b2 = await snaptrude.core.math.vec3.new(10, 0, 4)
641
+ * const lineA = await snaptrude.core.geom.create.line(a1, a2)
642
+ * const lineB = await snaptrude.core.geom.create.line(b1, b2)
643
+ * const spacing = await snaptrude.core.geom.query.curve.getDistanceBetween(lineA, lineB) // 4
644
+ * ```
645
+ */
646
+ public abstract getDistanceBetween(
647
+ lineA: LineHandle,
648
+ lineB: LineHandle,
649
+ ): PluginApiReturn<number>
650
+ }
651
+
652
+ /**
653
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getStartPoint}.
654
+ *
655
+ * | Property | Type | Description |
656
+ * |---|---|---|
657
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
658
+ */
659
+ export const PluginGeomQueryCurveGetStartPointArgs = z.object({
660
+ curve: CurveHandle,
661
+ })
662
+
663
+ export type PluginGeomQueryCurveGetStartPointArgs = z.infer<typeof PluginGeomQueryCurveGetStartPointArgs>
664
+
665
+ /**
666
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getEndPoint}.
667
+ *
668
+ * | Property | Type | Description |
669
+ * |---|---|---|
670
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
671
+ */
672
+ export const PluginGeomQueryCurveGetEndPointArgs = z.object({
673
+ curve: CurveHandle,
674
+ })
675
+
676
+ export type PluginGeomQueryCurveGetEndPointArgs = z.infer<typeof PluginGeomQueryCurveGetEndPointArgs>
677
+
678
+ /**
679
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getMidPoint}.
680
+ *
681
+ * | Property | Type | Description |
682
+ * |---|---|---|
683
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
684
+ */
685
+ export const PluginGeomQueryCurveGetMidPointArgs = z.object({
686
+ curve: CurveHandle,
687
+ })
688
+
689
+ export type PluginGeomQueryCurveGetMidPointArgs = z.infer<typeof PluginGeomQueryCurveGetMidPointArgs>
690
+
691
+ /**
692
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getLength}.
693
+ *
694
+ * | Property | Type | Description |
695
+ * |---|---|---|
696
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
697
+ */
698
+ export const PluginGeomQueryCurveGetLengthArgs = z.object({
699
+ curve: CurveHandle,
700
+ })
701
+
702
+ export type PluginGeomQueryCurveGetLengthArgs = z.infer<typeof PluginGeomQueryCurveGetLengthArgs>
703
+
704
+ /**
705
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getChordLength}.
706
+ *
707
+ * | Property | Type | Description |
708
+ * |---|---|---|
709
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
710
+ */
711
+ export const PluginGeomQueryCurveGetChordLengthArgs = z.object({
712
+ curve: CurveHandle,
713
+ })
714
+
715
+ export type PluginGeomQueryCurveGetChordLengthArgs = z.infer<typeof PluginGeomQueryCurveGetChordLengthArgs>
716
+
717
+ /**
718
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getTangent}.
719
+ *
720
+ * | Property | Type | Description |
721
+ * |---|---|---|
722
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
723
+ * | `point` | {@linkcode Vec3Handle} | Point on the curve |
724
+ */
725
+ export const PluginGeomQueryCurveGetTangentArgs = z.object({
726
+ curve: CurveHandle,
727
+ point: Vec3Handle,
728
+ })
729
+
730
+ export type PluginGeomQueryCurveGetTangentArgs = z.infer<typeof PluginGeomQueryCurveGetTangentArgs>
731
+
732
+ /**
733
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getNormal}.
734
+ *
735
+ * | Property | Type | Description |
736
+ * |---|---|---|
737
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
738
+ * | `point` | {@linkcode Vec3Handle} | Point on the curve |
739
+ */
740
+ export const PluginGeomQueryCurveGetNormalArgs = z.object({
741
+ curve: CurveHandle,
742
+ point: Vec3Handle,
743
+ })
744
+
745
+ export type PluginGeomQueryCurveGetNormalArgs = z.infer<typeof PluginGeomQueryCurveGetNormalArgs>
746
+
747
+ /**
748
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getNearestPoint}.
749
+ *
750
+ * | Property | Type | Description |
751
+ * |---|---|---|
752
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
753
+ * | `point` | {@linkcode Vec3Handle} | The reference point |
754
+ */
755
+ export const PluginGeomQueryCurveGetNearestPointArgs = z.object({
756
+ curve: CurveHandle,
757
+ point: Vec3Handle,
758
+ })
759
+
760
+ export type PluginGeomQueryCurveGetNearestPointArgs = z.infer<typeof PluginGeomQueryCurveGetNearestPointArgs>
761
+
762
+ /**
763
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getProjection}.
764
+ *
765
+ * | Property | Type | Description |
766
+ * |---|---|---|
767
+ * | `curve` | {@linkcode CurveHandle} | The curve to project onto |
768
+ * | `point` | {@linkcode Vec3Handle} | The point to project |
769
+ */
770
+ export const PluginGeomQueryCurveGetProjectionArgs = z.object({
771
+ curve: CurveHandle,
772
+ point: Vec3Handle,
773
+ })
774
+
775
+ export type PluginGeomQueryCurveGetProjectionArgs = z.infer<typeof PluginGeomQueryCurveGetProjectionArgs>
776
+
777
+ /**
778
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getPointAtDistance}.
779
+ *
780
+ * | Property | Type | Description |
781
+ * |---|---|---|
782
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
783
+ * | `referencePoint` | {@linkcode Vec3Handle} | Point on the curve to measure from |
784
+ * | `distance` | `number` | Distance along the curve from the reference point |
785
+ * | `forward` | `boolean` | Optional direction along the curve (defaults to `true`) |
786
+ */
787
+ export const PluginGeomQueryCurveGetPointAtDistanceArgs = z.object({
788
+ curve: CurveHandle,
789
+ referencePoint: Vec3Handle,
790
+ distance: z.number(),
791
+ forward: z.boolean().optional(),
792
+ })
793
+
794
+ export type PluginGeomQueryCurveGetPointAtDistanceArgs = z.infer<typeof PluginGeomQueryCurveGetPointAtDistanceArgs>
795
+
796
+ /**
797
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getParameterAtPoint}.
798
+ *
799
+ * | Property | Type | Description |
800
+ * |---|---|---|
801
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
802
+ * | `point` | {@linkcode Vec3Handle} | Point on the curve |
803
+ */
804
+ export const PluginGeomQueryCurveGetParameterAtPointArgs = z.object({
805
+ curve: CurveHandle,
806
+ point: Vec3Handle,
807
+ })
808
+
809
+ export type PluginGeomQueryCurveGetParameterAtPointArgs = z.infer<typeof PluginGeomQueryCurveGetParameterAtPointArgs>
810
+
811
+ /**
812
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getCurvature}.
813
+ *
814
+ * | Property | Type | Description |
815
+ * |---|---|---|
816
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
817
+ * | `point` | {@linkcode Vec3Handle} | Point on the curve |
818
+ */
819
+ export const PluginGeomQueryCurveGetCurvatureArgs = z.object({
820
+ curve: CurveHandle,
821
+ point: Vec3Handle,
822
+ })
823
+
824
+ export type PluginGeomQueryCurveGetCurvatureArgs = z.infer<typeof PluginGeomQueryCurveGetCurvatureArgs>
825
+
826
+ /**
827
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getDistanceToPoint}.
828
+ *
829
+ * | Property | Type | Description |
830
+ * |---|---|---|
831
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
832
+ * | `point` | {@linkcode Vec3Handle} | The point to measure from |
833
+ */
834
+ export const PluginGeomQueryCurveGetDistanceToPointArgs = z.object({
835
+ curve: CurveHandle,
836
+ point: Vec3Handle,
837
+ })
838
+
839
+ export type PluginGeomQueryCurveGetDistanceToPointArgs = z.infer<typeof PluginGeomQueryCurveGetDistanceToPointArgs>
840
+
841
+ /**
842
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getDistanceAlong}.
843
+ *
844
+ * | Property | Type | Description |
845
+ * |---|---|---|
846
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
847
+ * | `pointA` | {@linkcode Vec3Handle} | First point on the curve |
848
+ * | `pointB` | {@linkcode Vec3Handle} | Second point on the curve |
849
+ */
850
+ export const PluginGeomQueryCurveGetDistanceAlongArgs = z.object({
851
+ curve: CurveHandle,
852
+ pointA: Vec3Handle,
853
+ pointB: Vec3Handle,
854
+ })
855
+
856
+ export type PluginGeomQueryCurveGetDistanceAlongArgs = z.infer<typeof PluginGeomQueryCurveGetDistanceAlongArgs>
857
+
858
+ /**
859
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.listPoints}.
860
+ *
861
+ * | Property | Type | Description |
862
+ * |---|---|---|
863
+ * | `curve` | {@linkcode CurveHandle} | The curve to sample |
864
+ * | `resolution` | `number` | Optional number of samples for arcs (defaults to `20`; ignored for lines) |
865
+ */
866
+ export const PluginGeomQueryCurveListPointsArgs = z.object({
867
+ curve: CurveHandle,
868
+ resolution: z.number().optional(),
869
+ })
870
+
871
+ export type PluginGeomQueryCurveListPointsArgs = z.infer<typeof PluginGeomQueryCurveListPointsArgs>
872
+
873
+ /**
874
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.listSubdivisions}.
875
+ *
876
+ * | Property | Type | Description |
877
+ * |---|---|---|
878
+ * | `curve` | {@linkcode CurveHandle} | The curve to subdivide |
879
+ * | `segments` | `number` | Number of equal segments to divide the curve into |
880
+ */
881
+ export const PluginGeomQueryCurveListSubdivisionsArgs = z.object({
882
+ curve: CurveHandle,
883
+ segments: z.number(),
884
+ })
885
+
886
+ export type PluginGeomQueryCurveListSubdivisionsArgs = z.infer<typeof PluginGeomQueryCurveListSubdivisionsArgs>
887
+
888
+ /**
889
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.isLinear}.
890
+ *
891
+ * | Property | Type | Description |
892
+ * |---|---|---|
893
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
894
+ */
895
+ export const PluginGeomQueryCurveIsLinearArgs = z.object({
896
+ curve: CurveHandle,
897
+ })
898
+
899
+ export type PluginGeomQueryCurveIsLinearArgs = z.infer<typeof PluginGeomQueryCurveIsLinearArgs>
900
+
901
+ /**
902
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.isOnCurve}.
903
+ *
904
+ * | Property | Type | Description |
905
+ * |---|---|---|
906
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
907
+ * | `point` | {@linkcode Vec3Handle} | The point to test |
908
+ * | `threshold` | `number` | Optional distance tolerance (defaults to the engine default) |
909
+ */
910
+ export const PluginGeomQueryCurveIsOnCurveArgs = z.object({
911
+ curve: CurveHandle,
912
+ point: Vec3Handle,
913
+ threshold: z.number().optional(),
914
+ })
915
+
916
+ export type PluginGeomQueryCurveIsOnCurveArgs = z.infer<typeof PluginGeomQueryCurveIsOnCurveArgs>
917
+
918
+ /**
919
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.hasPoint}.
920
+ *
921
+ * | Property | Type | Description |
922
+ * |---|---|---|
923
+ * | `curve` | {@linkcode CurveHandle} | The curve to query |
924
+ * | `point` | {@linkcode Vec3Handle} | The point to test |
925
+ * | `includeEndPoints` | `boolean` | Optional flag to count endpoints as contained (defaults to `true`) |
926
+ */
927
+ export const PluginGeomQueryCurveHasPointArgs = z.object({
928
+ curve: CurveHandle,
929
+ point: Vec3Handle,
930
+ includeEndPoints: z.boolean().optional(),
931
+ })
932
+
933
+ export type PluginGeomQueryCurveHasPointArgs = z.infer<typeof PluginGeomQueryCurveHasPointArgs>
934
+
935
+ /**
936
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.isEqual}.
937
+ *
938
+ * | Property | Type | Description |
939
+ * |---|---|---|
940
+ * | `curveA` | {@linkcode CurveHandle} | First curve |
941
+ * | `curveB` | {@linkcode CurveHandle} | Second curve |
942
+ */
943
+ export const PluginGeomQueryCurveIsEqualArgs = z.object({
944
+ curveA: CurveHandle,
945
+ curveB: CurveHandle,
946
+ })
947
+
948
+ export type PluginGeomQueryCurveIsEqualArgs = z.infer<typeof PluginGeomQueryCurveIsEqualArgs>
949
+
950
+ /**
951
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.isOverlapping}.
952
+ *
953
+ * | Property | Type | Description |
954
+ * |---|---|---|
955
+ * | `curveA` | {@linkcode CurveHandle} | First curve |
956
+ * | `curveB` | {@linkcode CurveHandle} | Second curve |
957
+ * | `includeEndPoints` | `boolean` | Optional flag to count endpoint contact as overlap (defaults to `false`) |
958
+ */
959
+ export const PluginGeomQueryCurveIsOverlappingArgs = z.object({
960
+ curveA: CurveHandle,
961
+ curveB: CurveHandle,
962
+ includeEndPoints: z.boolean().optional(),
963
+ })
964
+
965
+ export type PluginGeomQueryCurveIsOverlappingArgs = z.infer<typeof PluginGeomQueryCurveIsOverlappingArgs>
966
+
967
+ /**
968
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getCommonPart}.
969
+ *
970
+ * | Property | Type | Description |
971
+ * |---|---|---|
972
+ * | `curveA` | {@linkcode CurveHandle} | First curve |
973
+ * | `curveB` | {@linkcode CurveHandle} | Second curve |
974
+ */
975
+ export const PluginGeomQueryCurveGetCommonPartArgs = z.object({
976
+ curveA: CurveHandle,
977
+ curveB: CurveHandle,
978
+ })
979
+
980
+ export type PluginGeomQueryCurveGetCommonPartArgs = z.infer<typeof PluginGeomQueryCurveGetCommonPartArgs>
981
+
982
+ /**
983
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.listIntersections}.
984
+ *
985
+ * | Property | Type | Description |
986
+ * |---|---|---|
987
+ * | `curveA` | {@linkcode CurveHandle} | First curve |
988
+ * | `curveB` | {@linkcode CurveHandle} | Second curve |
989
+ * | `boundedA` | `boolean` | Optional flag to bound intersections to `curveA`'s extent (defaults to `true`) |
990
+ * | `boundedB` | `boolean` | Optional flag to bound intersections to `curveB`'s extent (defaults to `true`) |
991
+ */
992
+ export const PluginGeomQueryCurveListIntersectionsArgs = z.object({
993
+ curveA: CurveHandle,
994
+ curveB: CurveHandle,
995
+ boundedA: z.boolean().optional(),
996
+ boundedB: z.boolean().optional(),
997
+ })
998
+
999
+ export type PluginGeomQueryCurveListIntersectionsArgs = z.infer<typeof PluginGeomQueryCurveListIntersectionsArgs>
1000
+
1001
+ /**
1002
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getMergedCurve}.
1003
+ *
1004
+ * | Property | Type | Description |
1005
+ * |---|---|---|
1006
+ * | `curveA` | {@linkcode CurveHandle} | First curve |
1007
+ * | `curveB` | {@linkcode CurveHandle} | Second curve |
1008
+ */
1009
+ export const PluginGeomQueryCurveGetMergedCurveArgs = z.object({
1010
+ curveA: CurveHandle,
1011
+ curveB: CurveHandle,
1012
+ })
1013
+
1014
+ export type PluginGeomQueryCurveGetMergedCurveArgs = z.infer<typeof PluginGeomQueryCurveGetMergedCurveArgs>
1015
+
1016
+ /**
1017
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.isContinuous}.
1018
+ *
1019
+ * | Property | Type | Description |
1020
+ * |---|---|---|
1021
+ * | `curveA` | {@linkcode CurveHandle} | First curve |
1022
+ * | `curveB` | {@linkcode CurveHandle} | Second curve |
1023
+ */
1024
+ export const PluginGeomQueryCurveIsContinuousArgs = z.object({
1025
+ curveA: CurveHandle,
1026
+ curveB: CurveHandle,
1027
+ })
1028
+
1029
+ export type PluginGeomQueryCurveIsContinuousArgs = z.infer<typeof PluginGeomQueryCurveIsContinuousArgs>
1030
+
1031
+ /**
1032
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.isParallel}.
1033
+ *
1034
+ * | Property | Type | Description |
1035
+ * |---|---|---|
1036
+ * | `lineA` | {@linkcode LineHandle} | First line |
1037
+ * | `lineB` | {@linkcode LineHandle} | Second line |
1038
+ * | `tolerance` | `number` | Optional angular tolerance (defaults to the engine default) |
1039
+ */
1040
+ export const PluginGeomQueryCurveIsParallelArgs = z.object({
1041
+ lineA: LineHandle,
1042
+ lineB: LineHandle,
1043
+ tolerance: z.number().optional(),
1044
+ })
1045
+
1046
+ export type PluginGeomQueryCurveIsParallelArgs = z.infer<typeof PluginGeomQueryCurveIsParallelArgs>
1047
+
1048
+ /**
1049
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getShortestGap}.
1050
+ *
1051
+ * | Property | Type | Description |
1052
+ * |---|---|---|
1053
+ * | `curveA` | {@linkcode CurveHandle} | First curve |
1054
+ * | `curveB` | {@linkcode CurveHandle} | Second curve |
1055
+ * | `includeEndPoints` | `boolean` | Optional flag to include endpoints when measuring (defaults to `false`) |
1056
+ */
1057
+ export const PluginGeomQueryCurveGetShortestGapArgs = z.object({
1058
+ curveA: CurveHandle,
1059
+ curveB: CurveHandle,
1060
+ includeEndPoints: z.boolean().optional(),
1061
+ })
1062
+
1063
+ export type PluginGeomQueryCurveGetShortestGapArgs = z.infer<typeof PluginGeomQueryCurveGetShortestGapArgs>
1064
+
1065
+ /**
1066
+ * Arguments for {@linkcode PluginGeomQueryCurveApi.getDistanceBetween}.
1067
+ *
1068
+ * | Property | Type | Description |
1069
+ * |---|---|---|
1070
+ * | `lineA` | {@linkcode LineHandle} | First line |
1071
+ * | `lineB` | {@linkcode LineHandle} | Second line |
1072
+ */
1073
+ export const PluginGeomQueryCurveGetDistanceBetweenArgs = z.object({
1074
+ lineA: LineHandle,
1075
+ lineB: LineHandle,
1076
+ })
1077
+
1078
+ export type PluginGeomQueryCurveGetDistanceBetweenArgs = z.infer<typeof PluginGeomQueryCurveGetDistanceBetweenArgs>