@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,377 @@
1
+ import * as z from "zod"
2
+ import { PluginApiReturn } from "../../../../types"
3
+ import {
4
+ ProfileHandle,
5
+ Vec3Handle,
6
+ CurveHandle,
7
+ Vec3Components,
8
+ } from "../../../../handles"
9
+
10
+ /**
11
+ * Profile editing — produce NEW profiles from an existing one (all-handle model, §11).
12
+ *
13
+ * Every method is an immutable derive-new operation: it takes an opaque
14
+ * {@linkcode ProfileHandle} (plus any extra inputs) and returns a fresh
15
+ * {@linkcode ProfileHandle} for the resulting profile. The input profile is never
16
+ * mutated — the original handle keeps referring to the unchanged profile. Read the
17
+ * resulting geometry back as plain values with the query namespace.
18
+ *
19
+ * Accessed via `snaptrude.core.geom.update.profile`.
20
+ */
21
+ export abstract class PluginGeomUpdateProfileApi {
22
+ constructor() {}
23
+
24
+ /**
25
+ * Offset a closed profile inward/outward by a signed distance. Immutable —
26
+ * returns a NEW profile and leaves the input unchanged.
27
+ *
28
+ * @param profile The closed profile to offset
29
+ * @param distance Signed offset distance (outward when positive, inward when negative)
30
+ * @returns The offset profile as a NEW {@linkcode ProfileHandle}
31
+ *
32
+ * @examplePrompt Offset this outline 300mm inward
33
+ * @examplePrompt Inset this boundary by a foot all around
34
+ *
35
+ * # Example
36
+ * ```ts
37
+ * const rect = await snaptrude.core.geom.create.profileRect(10, 8)
38
+ * const inset = await snaptrude.core.geom.update.profile.offset(rect, -0.3)
39
+ * const area = await snaptrude.core.geom.query.profile.getArea(inset)
40
+ * ```
41
+ */
42
+ public abstract offset(
43
+ profile: ProfileHandle,
44
+ distance: number,
45
+ ): PluginApiReturn<ProfileHandle>
46
+
47
+ /**
48
+ * Translate a profile by a vector. Immutable — returns a NEW profile and leaves
49
+ * the input unchanged.
50
+ *
51
+ * @param profile The profile to move
52
+ * @param translation Translation vector to move the profile by
53
+ * @returns The moved profile as a NEW {@linkcode ProfileHandle}
54
+ *
55
+ * @examplePrompt Move this outline 3 metres along the x axis
56
+ * @examplePrompt Shift this boundary to a new position
57
+ *
58
+ * # Example
59
+ * ```ts
60
+ * const rect = await snaptrude.core.geom.create.profileRect(6, 4)
61
+ * const shift = await snaptrude.core.math.vec3.new(3, 0, 0)
62
+ * const moved = await snaptrude.core.geom.update.profile.move(rect, shift)
63
+ * ```
64
+ */
65
+ public abstract move(
66
+ profile: ProfileHandle,
67
+ translation: Vec3Handle,
68
+ ): PluginApiReturn<ProfileHandle>
69
+
70
+ /**
71
+ * Rotate a profile about an axis through an optional pivot. Immutable — returns a
72
+ * NEW profile and leaves the input unchanged.
73
+ *
74
+ * @param profile The profile to rotate
75
+ * @param axis Rotation axis direction
76
+ * @param angle Rotation angle in radians
77
+ * @param pivot Optional pivot point to rotate about (defaults to the origin)
78
+ * @returns The rotated profile as a NEW {@linkcode ProfileHandle}
79
+ *
80
+ * @examplePrompt Rotate this outline 30 degrees
81
+ * @examplePrompt Turn this boundary about its centre point
82
+ *
83
+ * # Example
84
+ * ```ts
85
+ * const rect = await snaptrude.core.geom.create.profileRect(6, 4)
86
+ * const axis = await snaptrude.core.math.vec3.new(0, 1, 0)
87
+ * const rotated = await snaptrude.core.geom.update.profile.rotate(rect, axis, Math.PI / 6)
88
+ * ```
89
+ */
90
+ public abstract rotate(
91
+ profile: ProfileHandle,
92
+ axis: Vec3Handle,
93
+ angle: number,
94
+ pivot?: Vec3Handle,
95
+ ): PluginApiReturn<ProfileHandle>
96
+
97
+ /**
98
+ * Scale a profile uniformly or per-axis about an optional pivot. Immutable —
99
+ * returns a NEW profile and leaves the input unchanged.
100
+ *
101
+ * @param profile The profile to scale
102
+ * @param factor Uniform scale factor, or per-axis factors
103
+ * @param pivot Optional pivot point to scale about (defaults to the origin)
104
+ * @returns The scaled profile as a NEW {@linkcode ProfileHandle}
105
+ *
106
+ * @examplePrompt Scale this outline down to half size
107
+ * @examplePrompt Enlarge this boundary by 50 percent
108
+ *
109
+ * # Example
110
+ * ```ts
111
+ * const rect = await snaptrude.core.geom.create.profileRect(6, 4)
112
+ * const half = await snaptrude.core.geom.update.profile.scale(rect, 0.5)
113
+ * const stretched = await snaptrude.core.geom.update.profile.scale(rect, { x: 2, y: 1, z: 1 })
114
+ * ```
115
+ */
116
+ public abstract scale(
117
+ profile: ProfileHandle,
118
+ factor: number | Vec3Components,
119
+ pivot?: Vec3Handle,
120
+ ): PluginApiReturn<ProfileHandle>
121
+
122
+ /**
123
+ * Mirror a profile across a plane. Immutable — returns a NEW profile and leaves
124
+ * the input unchanged.
125
+ *
126
+ * @param profile The profile to mirror
127
+ * @param plane Mirror plane defined by a point on it and its normal
128
+ * @returns The mirrored profile as a NEW {@linkcode ProfileHandle}
129
+ *
130
+ * @examplePrompt Mirror this outline across the vertical plane
131
+ * @examplePrompt Flip this boundary to its mirror image
132
+ *
133
+ * # Example
134
+ * ```ts
135
+ * const rect = await snaptrude.core.geom.create.profileRect(6, 4)
136
+ * const point = await snaptrude.core.math.vec3.new(0, 0, 0)
137
+ * const normal = await snaptrude.core.math.vec3.new(1, 0, 0)
138
+ * const mirrored = await snaptrude.core.geom.update.profile.mirror(rect, { point, normal })
139
+ * ```
140
+ */
141
+ public abstract mirror(
142
+ profile: ProfileHandle,
143
+ plane: { point: Vec3Handle; normal: Vec3Handle },
144
+ ): PluginApiReturn<ProfileHandle>
145
+
146
+ /**
147
+ * Append a curve to the start or end of a profile. The curve must connect to the
148
+ * chosen end. Immutable — returns a NEW profile and leaves the input unchanged.
149
+ *
150
+ * @param profile The profile to append to
151
+ * @param curve The curve to append; it must connect to the chosen end
152
+ * @param position Optional end to append at (defaults to `"end"`)
153
+ * @returns The extended profile as a NEW {@linkcode ProfileHandle}
154
+ *
155
+ * # Example
156
+ * ```ts
157
+ * const rect = await snaptrude.core.geom.create.profileRect(4, 3)
158
+ * const open = await snaptrude.core.geom.update.profile.remove(rect, "end")
159
+ * const pts = await snaptrude.core.geom.query.profile.listPoints(open)
160
+ * const last = pts[pts.length - 1]
161
+ * const from = await snaptrude.core.math.vec3.new(last.x, last.y, last.z)
162
+ * const to = await snaptrude.core.math.vec3.new(pts[0].x, pts[0].y, pts[0].z)
163
+ * const closer = await snaptrude.core.geom.create.line(from, to)
164
+ * const closed = await snaptrude.core.geom.update.profile.add(open, closer, "end")
165
+ * ```
166
+ */
167
+ public abstract add(
168
+ profile: ProfileHandle,
169
+ curve: CurveHandle,
170
+ position?: "start" | "end",
171
+ ): PluginApiReturn<ProfileHandle>
172
+
173
+ /**
174
+ * Remove the curve at the start or end of a profile. Immutable — returns a NEW
175
+ * profile and leaves the input unchanged.
176
+ *
177
+ * @param profile The profile to remove a curve from
178
+ * @param position Optional end to remove from (defaults to `"end"`)
179
+ * @returns The trimmed profile as a NEW {@linkcode ProfileHandle}
180
+ *
181
+ * # Example
182
+ * ```ts
183
+ * const rect = await snaptrude.core.geom.create.profileRect(4, 3)
184
+ * const open = await snaptrude.core.geom.update.profile.remove(rect, "end")
185
+ * const isClosed = await snaptrude.core.geom.query.profile.isClosed(open) // false
186
+ * ```
187
+ */
188
+ public abstract remove(
189
+ profile: ProfileHandle,
190
+ position?: "start" | "end",
191
+ ): PluginApiReturn<ProfileHandle>
192
+
193
+ /**
194
+ * Reverse the orientation of a profile. Immutable — returns a NEW profile and
195
+ * leaves the input unchanged.
196
+ *
197
+ * @param profile The profile to reverse
198
+ * @returns The reversed profile as a NEW {@linkcode ProfileHandle}
199
+ *
200
+ * # Example
201
+ * ```ts
202
+ * const rect = await snaptrude.core.geom.create.profileRect(4, 3)
203
+ * const reversed = await snaptrude.core.geom.update.profile.reverse(rect)
204
+ * const clockwise = await snaptrude.core.geom.query.profile.isClockwise(reversed)
205
+ * ```
206
+ */
207
+ public abstract reverse(
208
+ profile: ProfileHandle,
209
+ ): PluginApiReturn<ProfileHandle>
210
+
211
+ /**
212
+ * Simplify a profile by merging collinear/redundant segments. Immutable —
213
+ * returns a NEW profile and leaves the input unchanged.
214
+ *
215
+ * @param profile The profile to simplify
216
+ * @returns The simplified profile as a NEW {@linkcode ProfileHandle}
217
+ *
218
+ * @examplePrompt Clean up this outline by merging collinear segments
219
+ * @examplePrompt Simplify this polyline and remove redundant points
220
+ *
221
+ * # Example
222
+ * ```ts
223
+ * const p0 = await snaptrude.core.math.vec3.new(0, 0, 0)
224
+ * const p1 = await snaptrude.core.math.vec3.new(2, 0, 0) // collinear with p0 and p2
225
+ * const p2 = await snaptrude.core.math.vec3.new(4, 0, 0)
226
+ * const p3 = await snaptrude.core.math.vec3.new(4, 0, 3)
227
+ * const jagged = await snaptrude.core.geom.create.profileFromLinePoints([p0, p1, p2, p3])
228
+ * const clean = await snaptrude.core.geom.update.profile.simplify(jagged)
229
+ * const curves = await snaptrude.core.geom.query.profile.listCurves(clean) // p0→p2 merged
230
+ * ```
231
+ */
232
+ public abstract simplify(
233
+ profile: ProfileHandle,
234
+ ): PluginApiReturn<ProfileHandle>
235
+ }
236
+
237
+ /**
238
+ * Arguments for {@linkcode PluginGeomUpdateProfileApi.offset}.
239
+ *
240
+ * | Property | Type | Description |
241
+ * |---|---|---|
242
+ * | `profile` | {@linkcode ProfileHandle} | The closed profile to offset |
243
+ * | `distance` | `number` | Signed offset distance (outward when positive, inward when negative) |
244
+ */
245
+ export const PluginGeomUpdateProfileOffsetArgs = z.object({
246
+ profile: ProfileHandle,
247
+ distance: z.number(),
248
+ })
249
+
250
+ export type PluginGeomUpdateProfileOffsetArgs = z.infer<typeof PluginGeomUpdateProfileOffsetArgs>
251
+
252
+ /**
253
+ * Arguments for {@linkcode PluginGeomUpdateProfileApi.move}.
254
+ *
255
+ * | Property | Type | Description |
256
+ * |---|---|---|
257
+ * | `profile` | {@linkcode ProfileHandle} | The profile to move |
258
+ * | `translation` | {@linkcode Vec3Handle} | Translation vector to move the profile by |
259
+ */
260
+ export const PluginGeomUpdateProfileMoveArgs = z.object({
261
+ profile: ProfileHandle,
262
+ translation: Vec3Handle,
263
+ })
264
+
265
+ export type PluginGeomUpdateProfileMoveArgs = z.infer<typeof PluginGeomUpdateProfileMoveArgs>
266
+
267
+ /**
268
+ * Arguments for {@linkcode PluginGeomUpdateProfileApi.rotate}.
269
+ *
270
+ * | Property | Type | Description |
271
+ * |---|---|---|
272
+ * | `profile` | {@linkcode ProfileHandle} | The profile to rotate |
273
+ * | `axis` | {@linkcode Vec3Handle} | Rotation axis direction |
274
+ * | `angle` | `number` | Rotation angle in radians |
275
+ * | `pivot` | {@linkcode Vec3Handle} | Optional pivot point to rotate about (defaults to the origin) |
276
+ */
277
+ export const PluginGeomUpdateProfileRotateArgs = z.object({
278
+ profile: ProfileHandle,
279
+ axis: Vec3Handle,
280
+ angle: z.number(),
281
+ pivot: Vec3Handle.optional(),
282
+ })
283
+
284
+ export type PluginGeomUpdateProfileRotateArgs = z.infer<typeof PluginGeomUpdateProfileRotateArgs>
285
+
286
+ /**
287
+ * Arguments for {@linkcode PluginGeomUpdateProfileApi.scale}.
288
+ *
289
+ * | Property | Type | Description |
290
+ * |---|---|---|
291
+ * | `profile` | {@linkcode ProfileHandle} | The profile to scale |
292
+ * | `factor` | `number` \| {@linkcode Vec3Components} | Uniform scale factor, or per-axis factors |
293
+ * | `pivot` | {@linkcode Vec3Handle} | Optional pivot point to scale about (defaults to the origin) |
294
+ */
295
+ export const PluginGeomUpdateProfileScaleArgs = z.object({
296
+ profile: ProfileHandle,
297
+ factor: z.union([z.number(), Vec3Components]),
298
+ pivot: Vec3Handle.optional(),
299
+ })
300
+
301
+ export type PluginGeomUpdateProfileScaleArgs = z.infer<typeof PluginGeomUpdateProfileScaleArgs>
302
+
303
+ /**
304
+ * Arguments for {@linkcode PluginGeomUpdateProfileApi.mirror}.
305
+ *
306
+ * | Property | Type | Description |
307
+ * |---|---|---|
308
+ * | `profile` | {@linkcode ProfileHandle} | The profile to mirror |
309
+ * | `plane` | `{ point: `{@linkcode Vec3Handle}`, normal: `{@linkcode Vec3Handle}` }` | Mirror plane defined by a point on it and its normal |
310
+ */
311
+ export const PluginGeomUpdateProfileMirrorArgs = z.object({
312
+ profile: ProfileHandle,
313
+ plane: z.object({
314
+ point: Vec3Handle,
315
+ normal: Vec3Handle,
316
+ }),
317
+ })
318
+
319
+ export type PluginGeomUpdateProfileMirrorArgs = z.infer<typeof PluginGeomUpdateProfileMirrorArgs>
320
+
321
+ /**
322
+ * Arguments for {@linkcode PluginGeomUpdateProfileApi.add}.
323
+ *
324
+ * | Property | Type | Description |
325
+ * |---|---|---|
326
+ * | `profile` | {@linkcode ProfileHandle} | The profile to append to |
327
+ * | `curve` | {@linkcode CurveHandle} | The curve to append; it must connect to the chosen end |
328
+ * | `position` | `"start"` \| `"end"` | Optional end to append at (defaults to `"end"`) |
329
+ */
330
+ export const PluginGeomUpdateProfileAddArgs = z.object({
331
+ profile: ProfileHandle,
332
+ curve: CurveHandle,
333
+ position: z.enum(["start", "end"]).optional(),
334
+ })
335
+
336
+ export type PluginGeomUpdateProfileAddArgs = z.infer<typeof PluginGeomUpdateProfileAddArgs>
337
+
338
+ /**
339
+ * Arguments for {@linkcode PluginGeomUpdateProfileApi.remove}.
340
+ *
341
+ * | Property | Type | Description |
342
+ * |---|---|---|
343
+ * | `profile` | {@linkcode ProfileHandle} | The profile to remove a curve from |
344
+ * | `position` | `"start"` \| `"end"` | Optional end to remove from (defaults to `"end"`) |
345
+ */
346
+ export const PluginGeomUpdateProfileRemoveArgs = z.object({
347
+ profile: ProfileHandle,
348
+ position: z.enum(["start", "end"]).optional(),
349
+ })
350
+
351
+ export type PluginGeomUpdateProfileRemoveArgs = z.infer<typeof PluginGeomUpdateProfileRemoveArgs>
352
+
353
+ /**
354
+ * Arguments for {@linkcode PluginGeomUpdateProfileApi.reverse}.
355
+ *
356
+ * | Property | Type | Description |
357
+ * |---|---|---|
358
+ * | `profile` | {@linkcode ProfileHandle} | The profile to reverse |
359
+ */
360
+ export const PluginGeomUpdateProfileReverseArgs = z.object({
361
+ profile: ProfileHandle,
362
+ })
363
+
364
+ export type PluginGeomUpdateProfileReverseArgs = z.infer<typeof PluginGeomUpdateProfileReverseArgs>
365
+
366
+ /**
367
+ * Arguments for {@linkcode PluginGeomUpdateProfileApi.simplify}.
368
+ *
369
+ * | Property | Type | Description |
370
+ * |---|---|---|
371
+ * | `profile` | {@linkcode ProfileHandle} | The profile to simplify |
372
+ */
373
+ export const PluginGeomUpdateProfileSimplifyArgs = z.object({
374
+ profile: ProfileHandle,
375
+ })
376
+
377
+ export type PluginGeomUpdateProfileSimplifyArgs = z.infer<typeof PluginGeomUpdateProfileSimplifyArgs>