@snaptrude/plugin-core 0.0.5 → 0.0.6

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 (59) hide show
  1. package/dist/api/core/geom/arc.d.ts +50 -1
  2. package/dist/api/core/geom/arc.d.ts.map +1 -1
  3. package/dist/api/core/geom/curve.d.ts +26 -1
  4. package/dist/api/core/geom/curve.d.ts.map +1 -1
  5. package/dist/api/core/geom/index.d.ts +16 -0
  6. package/dist/api/core/geom/index.d.ts.map +1 -1
  7. package/dist/api/core/geom/line.d.ts +35 -1
  8. package/dist/api/core/geom/line.d.ts.map +1 -1
  9. package/dist/api/core/geom/profile.d.ts +66 -2
  10. package/dist/api/core/geom/profile.d.ts.map +1 -1
  11. package/dist/api/core/index.d.ts +8 -0
  12. package/dist/api/core/index.d.ts.map +1 -1
  13. package/dist/api/core/math/index.d.ts +8 -0
  14. package/dist/api/core/math/index.d.ts.map +1 -1
  15. package/dist/api/core/math/quat.d.ts +156 -15
  16. package/dist/api/core/math/quat.d.ts.map +1 -1
  17. package/dist/api/core/math/vec3.d.ts +131 -14
  18. package/dist/api/core/math/vec3.d.ts.map +1 -1
  19. package/dist/api/entity/index.d.ts +8 -0
  20. package/dist/api/entity/index.d.ts.map +1 -1
  21. package/dist/api/entity/space.d.ts +217 -4
  22. package/dist/api/entity/space.d.ts.map +1 -1
  23. package/dist/api/entity/story.d.ts +166 -0
  24. package/dist/api/entity/story.d.ts.map +1 -1
  25. package/dist/api/index.d.ts +14 -0
  26. package/dist/api/index.d.ts.map +1 -1
  27. package/dist/api/tools/index.d.ts +8 -0
  28. package/dist/api/tools/index.d.ts.map +1 -1
  29. package/dist/api/tools/selection.d.ts +37 -0
  30. package/dist/api/tools/selection.d.ts.map +1 -1
  31. package/dist/api/tools/transform.d.ts +82 -0
  32. package/dist/api/tools/transform.d.ts.map +1 -1
  33. package/dist/api/units/index.d.ts +72 -13
  34. package/dist/api/units/index.d.ts.map +1 -1
  35. package/dist/index.cjs +322 -36
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.js +321 -35
  38. package/dist/index.js.map +1 -1
  39. package/dist/types.d.ts +8 -1
  40. package/dist/types.d.ts.map +1 -1
  41. package/package.json +1 -1
  42. package/src/api/core/geom/arc.ts +50 -1
  43. package/src/api/core/geom/curve.ts +26 -1
  44. package/src/api/core/geom/index.ts +16 -0
  45. package/src/api/core/geom/line.ts +35 -1
  46. package/src/api/core/geom/profile.ts +66 -2
  47. package/src/api/core/index.ts +8 -0
  48. package/src/api/core/math/index.ts +8 -0
  49. package/src/api/core/math/quat.ts +156 -15
  50. package/src/api/core/math/vec3.ts +131 -14
  51. package/src/api/entity/index.ts +8 -0
  52. package/src/api/entity/space.ts +218 -5
  53. package/src/api/entity/story.ts +166 -0
  54. package/src/api/index.ts +14 -0
  55. package/src/api/tools/index.ts +8 -0
  56. package/src/api/tools/selection.ts +37 -0
  57. package/src/api/tools/transform.ts +82 -0
  58. package/src/api/units/index.ts +72 -13
  59. package/src/types.ts +8 -1
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/math/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/api/core/geom/index.ts","../src/api/core/index.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/entity/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/index.ts","../src/api/units/index.ts","../src/api/index.ts"],"sourcesContent":["import * as z from \"zod\"\n\nexport abstract class PluginVec3Api {\n constructor() {}\n\n /** Create a new PVec3. */\n new(x: number, y: number, z: number): PVec3 {\n return { x, y, z }\n }\n\n /** Add two vectors. */\n add(a: PVec3, b: PVec3): PVec3 {\n return { x: a.x + b.x, y: a.y + b.y, z: a.z + b.z }\n }\n\n /** Subtract b from a. */\n subtract(a: PVec3, b: PVec3): PVec3 {\n return { x: a.x - b.x, y: a.y - b.y, z: a.z - b.z }\n }\n\n /** Scale a vector by a scalar. */\n scale(v: PVec3, scalar: number): PVec3 {\n return { x: v.x * scalar, y: v.y * scalar, z: v.z * scalar }\n }\n\n /** Dot product of two vectors. */\n dot(a: PVec3, b: PVec3): number {\n return a.x * b.x + a.y * b.y + a.z * b.z\n }\n\n /** Cross product of two vectors. */\n cross(a: PVec3, b: PVec3): PVec3 {\n return {\n x: a.y * b.z - a.z * b.y,\n y: a.z * b.x - a.x * b.z,\n z: a.x * b.y - a.y * b.x,\n }\n }\n\n /** Length (magnitude) of a vector. */\n length(v: PVec3): number {\n return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z)\n }\n\n /** Squared length of a vector (avoids sqrt). */\n lengthSquared(v: PVec3): number {\n return v.x * v.x + v.y * v.y + v.z * v.z\n }\n\n /** Normalize a vector to unit length. Returns zero vector if length is 0. */\n normalize(v: PVec3): PVec3 {\n const len = this.length(v)\n if (len === 0) return { x: 0, y: 0, z: 0 }\n return { x: v.x / len, y: v.y / len, z: v.z / len }\n }\n\n /** Distance between two points. */\n distance(a: PVec3, b: PVec3): number {\n return this.length(this.subtract(a, b))\n }\n\n /** Linearly interpolate between two vectors. */\n lerp(a: PVec3, b: PVec3, t: number): PVec3 {\n return {\n x: a.x + (b.x - a.x) * t,\n y: a.y + (b.y - a.y) * t,\n z: a.z + (b.z - a.z) * t,\n }\n }\n\n /** Negate a vector. */\n negate(v: PVec3): PVec3 {\n return { x: -v.x, y: -v.y, z: -v.z }\n }\n\n /** Check if two vectors are equal (exact). */\n equals(a: PVec3, b: PVec3): boolean {\n return a.x === b.x && a.y === b.y && a.z === b.z\n }\n\n /** Check if two vectors are approximately equal within an epsilon. */\n equalsApprox(a: PVec3, b: PVec3, epsilon: number = 1e-6): boolean {\n return (\n Math.abs(a.x - b.x) < epsilon &&\n Math.abs(a.y - b.y) < epsilon &&\n Math.abs(a.z - b.z) < epsilon\n )\n }\n}\n\nexport const PVec3 = z.object({\n x: z.number(),\n y: z.number(),\n z: z.number(),\n})\n\nexport type PVec3 = z.infer<typeof PVec3>\n","import * as z from \"zod\"\nimport type { PVec3 } from \"./vec3\"\n\nexport abstract class PluginQuatApi {\n constructor() {}\n\n /** Create a new PQuat. */\n new(x: number, y: number, z: number, w: number): PQuat {\n return { x, y, z, w }\n }\n\n /** Create an identity quaternion (no rotation). */\n identity(): PQuat {\n return { x: 0, y: 0, z: 0, w: 1 }\n }\n\n /** Create a quaternion from an axis and angle (radians). */\n fromAxisAngle(axis: PVec3, angle: number): PQuat {\n const halfAngle = angle / 2\n const s = Math.sin(halfAngle)\n const len = Math.sqrt(axis.x * axis.x + axis.y * axis.y + axis.z * axis.z)\n if (len === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return {\n x: (axis.x / len) * s,\n y: (axis.y / len) * s,\n z: (axis.z / len) * s,\n w: Math.cos(halfAngle),\n }\n }\n\n /** Create a quaternion from Euler angles (radians, XYZ order). */\n fromEuler(x: number, y: number, z: number): PQuat {\n const cx = Math.cos(x / 2)\n const sx = Math.sin(x / 2)\n const cy = Math.cos(y / 2)\n const sy = Math.sin(y / 2)\n const cz = Math.cos(z / 2)\n const sz = Math.sin(z / 2)\n return {\n x: sx * cy * cz + cx * sy * sz,\n y: cx * sy * cz - sx * cy * sz,\n z: cx * cy * sz + sx * sy * cz,\n w: cx * cy * cz - sx * sy * sz,\n }\n }\n\n /** Multiply two quaternions (a * b). */\n multiply(a: PQuat, b: PQuat): PQuat {\n return {\n x: a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,\n y: a.w * b.y - a.x * b.z + a.y * b.w + a.z * b.x,\n z: a.w * b.z + a.x * b.y - a.y * b.x + a.z * b.w,\n w: a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z,\n }\n }\n\n /** Conjugate of a quaternion. */\n conjugate(q: PQuat): PQuat {\n return { x: -q.x, y: -q.y, z: -q.z, w: q.w }\n }\n\n /** Length (magnitude) of a quaternion. */\n length(q: PQuat): number {\n return Math.sqrt(q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w)\n }\n\n /** Normalize a quaternion to unit length. Returns identity if length is 0. */\n normalize(q: PQuat): PQuat {\n const len = this.length(q)\n if (len === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return { x: q.x / len, y: q.y / len, z: q.z / len, w: q.w / len }\n }\n\n /** Inverse of a quaternion (conjugate / lengthSquared). */\n inverse(q: PQuat): PQuat {\n const lenSq = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w\n if (lenSq === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return { x: -q.x / lenSq, y: -q.y / lenSq, z: -q.z / lenSq, w: q.w / lenSq }\n }\n\n /** Rotate a vector by a quaternion. */\n rotateVec3(q: PQuat, v: PVec3): PVec3 {\n const vq: PQuat = { x: v.x, y: v.y, z: v.z, w: 0 }\n const conj = this.conjugate(q)\n const result = this.multiply(this.multiply(q, vq), conj)\n return { x: result.x, y: result.y, z: result.z }\n }\n\n /** Convert a quaternion to axis-angle representation. */\n toAxisAngle(q: PQuat): { axis: PVec3; angle: number } {\n const nq = this.normalize(q)\n const angle = 2 * Math.acos(Math.min(1, Math.max(-1, nq.w)))\n const s = Math.sin(angle / 2)\n if (s < 1e-6) {\n return { axis: { x: 1, y: 0, z: 0 }, angle: 0 }\n }\n return {\n axis: { x: nq.x / s, y: nq.y / s, z: nq.z / s },\n angle,\n }\n }\n\n /** Spherical linear interpolation between two quaternions. */\n slerp(a: PQuat, b: PQuat, t: number): PQuat {\n let cosHalf = a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w\n let bx = b.x, by = b.y, bz = b.z, bw = b.w\n if (cosHalf < 0) {\n cosHalf = -cosHalf\n bx = -bx; by = -by; bz = -bz; bw = -bw\n }\n if (cosHalf >= 1.0) {\n return { x: a.x, y: a.y, z: a.z, w: a.w }\n }\n const halfAngle = Math.acos(cosHalf)\n const sinHalf = Math.sin(halfAngle)\n const ratioA = Math.sin((1 - t) * halfAngle) / sinHalf\n const ratioB = Math.sin(t * halfAngle) / sinHalf\n return {\n x: a.x * ratioA + bx * ratioB,\n y: a.y * ratioA + by * ratioB,\n z: a.z * ratioA + bz * ratioB,\n w: a.w * ratioA + bw * ratioB,\n }\n }\n\n /** Dot product of two quaternions. */\n dot(a: PQuat, b: PQuat): number {\n return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w\n }\n\n /** Check if two quaternions are equal (exact). */\n equals(a: PQuat, b: PQuat): boolean {\n return a.x === b.x && a.y === b.y && a.z === b.z && a.w === b.w\n }\n\n /** Check if two quaternions are approximately equal within an epsilon. */\n equalsApprox(a: PQuat, b: PQuat, epsilon: number = 1e-6): boolean {\n return (\n Math.abs(a.x - b.x) < epsilon &&\n Math.abs(a.y - b.y) < epsilon &&\n Math.abs(a.z - b.z) < epsilon &&\n Math.abs(a.w - b.w) < epsilon\n )\n }\n}\n\nexport const PQuat = z.object({\n x: z.number(),\n y: z.number(),\n z: z.number(),\n w: z.number(),\n})\n\nexport type PQuat = z.infer<typeof PQuat>\n","import { PluginVec3Api } from \"./vec3\"\nimport { PluginQuatApi } from \"./quat\"\n\nexport abstract class PluginMathApi {\n public abstract vec3: PluginVec3Api\n public abstract quat: PluginQuatApi\n\n constructor() {}\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import * as z from \"zod\"\nimport { PVec3 } from \"../math/vec3\"\n\nexport abstract class PluginLineApi {\n constructor() {}\n\n /** Create a new PLine from start and end points. */\n new(startPoint: PVec3, endPoint: PVec3): PLine {\n return { curveType: \"Line\", startPoint, endPoint }\n }\n}\n\nexport const PLine = z.object({\n curveType: z.literal(\"Line\"),\n startPoint: PVec3,\n endPoint: PVec3,\n})\n\nexport type PLine = z.infer<typeof PLine>\n","import * as z from \"zod\"\nimport { PVec3 } from \"../math/vec3\"\n\nexport abstract class PluginArcApi {\n constructor() {}\n\n /** Create a new PArc from start, end, centre and axis. */\n new(startPoint: PVec3, endPoint: PVec3, centrePoint: PVec3, axis: PVec3): PArc {\n return { curveType: \"Arc\", startPoint, endPoint, centrePoint, axis }\n }\n}\n\nexport const PArc = z.object({\n curveType: z.literal(\"Arc\"),\n startPoint: PVec3,\n endPoint: PVec3,\n centrePoint: PVec3,\n axis: PVec3,\n})\n\nexport type PArc = z.infer<typeof PArc>\n","import * as z from \"zod\"\nimport { PLine } from \"./line\"\nimport { PArc } from \"./arc\"\n\nexport abstract class PluginCurveApi {\n constructor() {}\n\n /** Create a PCurve from a PLine or PArc. */\n new(curve: PLine | PArc): PCurve {\n return curve\n }\n}\n\nexport const PCurve = z.discriminatedUnion(\"curveType\", [PLine, PArc])\n\nexport type PCurve = z.infer<typeof PCurve>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../../types\"\nimport { PVec3 } from \"../math/vec3\"\nimport { PCurve } from \"./curve\"\n\nexport abstract class PluginProfileApi {\n constructor() {}\n\n /** Create a new PProfile from an array of PCurves. */\n new(curves: PCurve[]): PProfile {\n return { curves }\n }\n\n /** Create a PProfile from an array of points, connecting them with lines. */\n public abstract fromLinePoints(\n args: PluginProfileFromLinePointsArgs\n ): PluginApiReturn<PProfile>\n}\n\nexport const PluginProfileFromLinePointsArgs = z.object({\n points: z.array(PVec3),\n})\n\nexport type PluginProfileFromLinePointsArgs = z.infer<typeof PluginProfileFromLinePointsArgs>\n\nexport const PProfile = z.object({\n curves: z.array(PCurve),\n})\n\nexport type PProfile = z.infer<typeof PProfile>\n","import { PluginLineApi } from \"./line\"\nimport { PluginArcApi } from \"./arc\"\nimport { PluginCurveApi } from \"./curve\"\nimport { PluginProfileApi } from \"./profile\"\n\nexport abstract class PluginGeomApi {\n public abstract line: PluginLineApi\n public abstract arc: PluginArcApi\n public abstract curve: PluginCurveApi\n public abstract profile: PluginProfileApi\n\n constructor() {}\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginMathApi } from \"./math\"\nimport { PluginGeomApi } from \"./geom\"\n\nexport abstract class PluginCoreApi {\n public abstract math: PluginMathApi\n public abstract geom: PluginGeomApi\n\n constructor() {}\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\nimport { PQuat } from \"../core/math/quat\"\nimport { PProfile } from \"../core/geom/profile\"\n\nexport abstract class PluginSpaceApi {\n constructor() {}\n\n public abstract createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): PluginApiReturn<PluginSpaceCreateRectangularResult>\n\n public abstract createFromProfile({\n profile,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): PluginApiReturn<PluginSpaceCreateFromProfileResult>\n\n public abstract getAll(): PluginApiReturn<PluginSpaceGetAllResult>\n\n public abstract get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): PluginApiReturn<PluginSpaceGetResult>\n\n public abstract deleteById({\n spaceId,\n }: PluginSpaceDeleteByIdArgs): PluginApiReturn<PluginSpaceDeleteByIdResult>\n}\n\nexport const PluginSpaceCreateRectangularArgs = z.object({\n position: PVec3,\n dimensions: z.object({\n width: z.number(),\n height: z.number(),\n depth: z.number(),\n }),\n})\n\nexport type PluginSpaceCreateRectangularArgs = z.infer<typeof PluginSpaceCreateRectangularArgs>\n\nexport const PluginSpaceCreateRectangularResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceCreateRectangularResult = z.infer<typeof PluginSpaceCreateRectangularResult>\n\nexport const PluginSpaceCreateFromProfileArgs = z.object({\n profile: PProfile,\n extrudeHeight: z.number(),\n position: PVec3,\n})\n\nexport type PluginSpaceCreateFromProfileArgs = z.infer<typeof PluginSpaceCreateFromProfileArgs>\n\nexport const PluginSpaceCreateFromProfileResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceCreateFromProfileResult = z.infer<typeof PluginSpaceCreateFromProfileResult>\n\nexport const PluginSpaceGetProperty = z.enum([\n \"id\",\n \"type\",\n \"room_type\",\n \"name\",\n \"area\",\n \"department\",\n \"position\",\n \"absolutePosition\",\n \"rotation\",\n \"rotationQuaternion\",\n])\n\nexport const PluginSpaceGetArgs = z.object({\n spaceId: z.string(),\n properties: z.array(PluginSpaceGetProperty),\n})\n\nexport type PluginSpaceGetArgs = z.infer<typeof PluginSpaceGetArgs>\n\nexport const PluginSpaceGetResult = z\n .object({\n id: z.string(),\n type: z.string(),\n room_type: z.string(),\n name: z.string(),\n area: z.number(),\n department: z.string(),\n position: PVec3,\n absolutePosition: PVec3,\n rotation: PVec3,\n rotationQuaternion: PQuat.nullable(),\n })\n .partial()\n\nexport type PluginSpaceGetResult = z.infer<typeof PluginSpaceGetResult>\n\nexport const PluginSpaceGetAllResult = z.object({\n spacesIds: z.array(z.string()),\n})\n\nexport type PluginSpaceGetAllResult = z.infer<typeof PluginSpaceGetAllResult>\n\nexport const PluginSpaceDeleteByIdArgs = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceDeleteByIdArgs = z.infer<typeof PluginSpaceDeleteByIdArgs>\n\nexport type PluginSpaceDeleteByIdResult = void\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginStoryApi {\n constructor() {}\n\n public abstract get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): PluginApiReturn<PluginStoryGetResult>\n\n public abstract getAll(): PluginApiReturn<PluginStoryGetAllResult>\n\n public abstract create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): PluginApiReturn<PluginStoryCreateResult>\n\n public abstract update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): PluginApiReturn<PluginStoryUpdateResult>\n}\n\nexport const PluginStoryGetProperty = z.enum([\n \"value\",\n \"id\",\n \"name\",\n \"height\",\n \"base\",\n \"hidden\",\n \"spacesCount\",\n \"totalArea\",\n])\n\nexport const PluginStoryGetArgs = z.object({\n storyValue: z.number().int(),\n properties: z.array(PluginStoryGetProperty),\n})\n\nexport type PluginStoryGetArgs = z.infer<typeof PluginStoryGetArgs>\n\nexport const PluginStoryGetResult = z\n .object({\n value: z.number(),\n id: z.string(),\n name: z.string(),\n height: z.number(),\n base: z.number(),\n hidden: z.boolean(),\n spacesCount: z.number(),\n totalArea: z.number(),\n })\n .partial()\n\nexport type PluginStoryGetResult = z.infer<typeof PluginStoryGetResult>\n\nexport const PluginStoryGetAllResult = z.object({\n stories: z.array(\n z.object({\n value: z.number(),\n id: z.string(),\n name: z.string(),\n })\n ),\n})\n\nexport type PluginStoryGetAllResult = z.infer<typeof PluginStoryGetAllResult>\n\nexport const PluginStoryCreateArgs = z.object({\n storyValue: z.number().int(),\n height: z.number().optional(),\n})\n\nexport type PluginStoryCreateArgs = z.infer<typeof PluginStoryCreateArgs>\n\nexport const PluginStoryCreateResult = z.object({\n storyId: z.string(),\n storyValue: z.number(),\n})\n\nexport type PluginStoryCreateResult = z.infer<typeof PluginStoryCreateResult>\n\nexport const PluginStoryUpdateArgs = z.object({\n storyValue: z.number().int(),\n height: z.number(),\n})\n\nexport type PluginStoryUpdateArgs = z.infer<typeof PluginStoryUpdateArgs>\n\nexport const PluginStoryUpdateResult = z.object({\n storyValue: z.number(),\n height: z.number(),\n})\n\nexport type PluginStoryUpdateResult = z.infer<typeof PluginStoryUpdateResult>\n","import { PluginSpaceApi } from \"./space\"\nimport { PluginStoryApi } from \"./story\"\n\nexport abstract class PluginEntityApi {\n public abstract space: PluginSpaceApi\n public abstract story: PluginStoryApi\n\n constructor() {}\n}\n\nexport * from \"./space\"\nexport * from \"./story\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginSelectionApi {\n constructor() {}\n\n public abstract get(): PluginApiReturn<PluginSelectionGetResult>\n}\n\nexport const PluginSelectionGetResult = z.object({\n selected: z.array(z.string()),\n})\n\nexport type PluginSelectionGetResult = z.infer<typeof PluginSelectionGetResult>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\n\nexport abstract class PluginTransformApi {\n constructor() {}\n\n public abstract move({\n componentIds,\n displacement,\n }: PluginMoveArgs): PluginApiReturn<void>\n\n public abstract rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): PluginApiReturn<void>\n}\n\nexport const PluginMoveArgs = z.object({\n componentIds: z.array(z.string()),\n displacement: PVec3,\n})\n\nexport type PluginMoveArgs = z.infer<typeof PluginMoveArgs>\n\nexport const PluginRotateArgs = z.object({\n componentIds: z.array(z.string()),\n angle: z.number(),\n axis: PVec3,\n pivot: PVec3,\n})\n\nexport type PluginRotateArgs = z.infer<typeof PluginRotateArgs>\n","import { PluginSelectionApi } from \"./selection\"\nimport { PluginTransformApi } from \"./transform\"\n\nexport abstract class PluginToolsApi {\n public abstract selection: PluginSelectionApi\n public abstract transform: PluginTransformApi\n\n constructor() {}\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\nexport abstract class PluginUnitsApi {\n constructor() {}\n\n /**\n * Convert a value from the given unit to Snaptrude's internal (Babylon) units.\n *\n * Use this when you have a measurement in real-world units (e.g. meters, feet)\n * and need to convert it to the coordinate system used by Snaptrude internally.\n *\n * @param args.unit - The source unit to convert from (e.g. `\"meters\"`, `\"feet-inches\"`)\n * @param args.value - The numeric value in the source unit\n * @returns An object containing the converted `value` in Snaptrude/Babylon units\n *\n * @example\n * ```ts\n * const result = await snaptrude.units.convertFrom({ unit: \"meters\", value: 5 })\n * // result.value is 5 meters expressed in Babylon units\n * ```\n */\n public abstract convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): PluginApiReturn<PluginUnitsConvertFromResult>\n\n /**\n * Convert a value from Snaptrude's internal (Babylon) units to the given unit.\n *\n * Use this when you have a value in Snaptrude's internal coordinate system\n * and need to express it in real-world units (e.g. meters, feet).\n *\n * @param args.unit - The target unit to convert to (e.g. `\"meters\"`, `\"feet-inches\"`)\n * @param args.value - The numeric value in Snaptrude/Babylon units\n * @returns An object containing the converted `value` in the target unit\n *\n * @example\n * ```ts\n * const result = await snaptrude.units.convertTo({ unit: \"feet-inches\", value: 1.2 })\n * // result.value is 1.2 Babylon units expressed in feet\n * ```\n */\n public abstract convertTo(\n args: PluginUnitsConvertToArgs,\n ): PluginApiReturn<PluginUnitsConvertToResult>\n}\n\n/**\n * Supported unit types for conversion.\n *\n * - `meters` — Metric meters\n * - `feet-inches` — Imperial feet (1 foot = 12 inches)\n * - `inches` — Imperial inches\n * - `centimeters` — Metric centimeters\n * - `millimeters` — Metric millimeters\n * - `kilometers` — Metric kilometers\n * - `miles` — Imperial miles\n */\nexport const PUnitType = z.enum([\n \"meters\",\n \"feet-inches\",\n \"inches\",\n \"centimeters\",\n \"millimeters\",\n \"kilometers\",\n \"miles\",\n])\n\nexport type PUnitType = z.infer<typeof PUnitType>\n\nexport const PluginUnitsConvertFromArgs = z.object({\n unit: PUnitType,\n value: z.number(),\n})\n\nexport type PluginUnitsConvertFromArgs = z.infer<typeof PluginUnitsConvertFromArgs>\n\nexport const PluginUnitsConvertFromResult = z.object({\n value: z.number(),\n})\n\nexport type PluginUnitsConvertFromResult = z.infer<typeof PluginUnitsConvertFromResult>\n\nexport const PluginUnitsConvertToArgs = z.object({\n unit: PUnitType,\n value: z.number(),\n})\n\nexport type PluginUnitsConvertToArgs = z.infer<typeof PluginUnitsConvertToArgs>\n\nexport const PluginUnitsConvertToResult = z.object({\n value: z.number(),\n})\n\nexport type PluginUnitsConvertToResult = z.infer<typeof PluginUnitsConvertToResult>\n","import { PluginCoreApi } from \"./core\"\nimport { PluginEntityApi } from \"./entity\"\nimport { PluginToolsApi } from \"./tools\"\nimport { PluginUnitsApi } from \"./units\"\n\nexport abstract class PluginApi {\n public abstract core: PluginCoreApi\n public abstract tools: PluginToolsApi\n public abstract entity: PluginEntityApi\n public abstract units: PluginUnitsApi\n\n constructor() {}\n}\n\nexport * from \"./core\"\nexport * from \"./entity\"\nexport * from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AAyB;AAAA,EAM9B,cAAc;AAAA,EAAC;AACjB;","names":["z","z","z","z","z","z","z","z","z","z","z"]}
1
+ {"version":3,"sources":["../src/api/core/math/vec3.ts","../src/api/core/math/quat.ts","../src/api/core/math/index.ts","../src/api/core/geom/line.ts","../src/api/core/geom/arc.ts","../src/api/core/geom/curve.ts","../src/api/core/geom/profile.ts","../src/api/core/geom/index.ts","../src/api/core/index.ts","../src/api/entity/space.ts","../src/api/entity/story.ts","../src/api/entity/index.ts","../src/api/tools/selection.ts","../src/api/tools/transform.ts","../src/api/tools/index.ts","../src/api/units/index.ts","../src/api/index.ts"],"sourcesContent":["import * as z from \"zod\"\n\n/**\n * 3D vector operations for positions, directions, and displacements.\n *\n * All methods are **pure** — they return new {@linkcode PVec3} values\n * without mutating the inputs.\n *\n * Accessed via `snaptrude.core.math.vec3`.\n */\nexport abstract class PluginVec3Api {\n constructor() {}\n\n /**\n * Create a new 3D vector.\n *\n * @param x - The X component\n * @param y - The Y component\n * @param z - The Z component\n * @returns A new {@linkcode PVec3}\n *\n * # Example\n * ```ts\n * const position = snaptrude.core.math.vec3.new(1, 2, 3)\n * // { x: 1, y: 2, z: 3 }\n * ```\n */\n new(x: number, y: number, z: number): PVec3 {\n return { x, y, z }\n }\n\n /**\n * Add two vectors component-wise.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns A new {@linkcode PVec3} where each component is `a[i] + b[i]`\n */\n add(a: PVec3, b: PVec3): PVec3 {\n return { x: a.x + b.x, y: a.y + b.y, z: a.z + b.z }\n }\n\n /**\n * Subtract vector {@linkcode b} from vector {@linkcode a} component-wise.\n *\n * @param a - Vector to subtract from\n * @param b - Vector to subtract\n * @returns A new {@linkcode PVec3} where each component is `a[i] - b[i]`\n */\n subtract(a: PVec3, b: PVec3): PVec3 {\n return { x: a.x - b.x, y: a.y - b.y, z: a.z - b.z }\n }\n\n /**\n * Scale a vector by a scalar value.\n *\n * @param v - The vector to scale\n * @param scalar - The scalar multiplier\n * @returns A new {@linkcode PVec3} where each component is `v[i] * scalar`\n */\n scale(v: PVec3, scalar: number): PVec3 {\n return { x: v.x * scalar, y: v.y * scalar, z: v.z * scalar }\n }\n\n /**\n * Compute the dot product of two vectors.\n *\n * The dot product equals `|a| * |b| * cos(θ)` where `θ` is the angle\n * between the vectors. Useful for checking orthogonality (result = 0)\n * or projection.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns The scalar dot product\n */\n dot(a: PVec3, b: PVec3): number {\n return a.x * b.x + a.y * b.y + a.z * b.z\n }\n\n /**\n * Compute the cross product of two vectors.\n *\n * The result is a vector perpendicular to both inputs, with magnitude\n * equal to the area of the parallelogram they span. Useful for computing\n * surface normals.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns A new {@linkcode PVec3} perpendicular to both {@linkcode a} and {@linkcode b}\n */\n cross(a: PVec3, b: PVec3): PVec3 {\n return {\n x: a.y * b.z - a.z * b.y,\n y: a.z * b.x - a.x * b.z,\n z: a.x * b.y - a.y * b.x,\n }\n }\n\n /**\n * Compute the length (magnitude) of a vector.\n *\n * @param v - The vector\n * @returns The Euclidean length `√(x² + y² + z²)`\n */\n length(v: PVec3): number {\n return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z)\n }\n\n /**\n * Compute the squared length of a vector.\n *\n * Avoids the `sqrt` call — prefer this over {@linkcode PluginVec3Api.length}\n * when comparing relative magnitudes.\n *\n * @param v - The vector\n * @returns The squared length `x² + y² + z²`\n */\n lengthSquared(v: PVec3): number {\n return v.x * v.x + v.y * v.y + v.z * v.z\n }\n\n /**\n * Normalize a vector to unit length.\n *\n * @param v - The vector to normalize\n * @returns A new unit-length {@linkcode PVec3} in the same direction,\n * or a zero vector `(0, 0, 0)` if the input has zero length\n */\n normalize(v: PVec3): PVec3 {\n const len = this.length(v)\n if (len === 0) return { x: 0, y: 0, z: 0 }\n return { x: v.x / len, y: v.y / len, z: v.z / len }\n }\n\n /**\n * Compute the Euclidean distance between two points.\n *\n * @param a - First point\n * @param b - Second point\n * @returns The distance `|a - b|`\n */\n distance(a: PVec3, b: PVec3): number {\n return this.length(this.subtract(a, b))\n }\n\n /**\n * Linearly interpolate between two vectors.\n *\n * @param a - Start vector (returned when `t = 0`)\n * @param b - End vector (returned when `t = 1`)\n * @param t - Interpolation factor, typically in `[0, 1]`\n * @returns A new {@linkcode PVec3} at `a + (b - a) * t`\n */\n lerp(a: PVec3, b: PVec3, t: number): PVec3 {\n return {\n x: a.x + (b.x - a.x) * t,\n y: a.y + (b.y - a.y) * t,\n z: a.z + (b.z - a.z) * t,\n }\n }\n\n /**\n * Negate a vector (reverse its direction).\n *\n * @param v - The vector to negate\n * @returns A new {@linkcode PVec3} with all components negated\n */\n negate(v: PVec3): PVec3 {\n return { x: -v.x, y: -v.y, z: -v.z }\n }\n\n /**\n * Check if two vectors are exactly equal (strict equality per component).\n *\n * For floating-point comparisons, prefer {@linkcode PluginVec3Api.equalsApprox}.\n *\n * @param a - First vector\n * @param b - Second vector\n * @returns `true` if all components match exactly\n */\n equals(a: PVec3, b: PVec3): boolean {\n return a.x === b.x && a.y === b.y && a.z === b.z\n }\n\n /**\n * Check if two vectors are approximately equal within a tolerance.\n *\n * @param a - First vector\n * @param b - Second vector\n * @param epsilon - Maximum allowed difference per component (default `1e-6`)\n * @returns `true` if `|a[i] - b[i]| < epsilon` for all components\n */\n equalsApprox(a: PVec3, b: PVec3, epsilon: number = 1e-6): boolean {\n return (\n Math.abs(a.x - b.x) < epsilon &&\n Math.abs(a.y - b.y) < epsilon &&\n Math.abs(a.z - b.z) < epsilon\n )\n }\n}\n\n/**\n * A 3D vector with `x`, `y`, and `z` components.\n *\n * Used throughout the plugin API for positions, directions, displacements,\n * and Euler rotation angles. Equivalent to `BABYLON.Vector3`.\n */\nexport const PVec3 = z.object({\n x: z.number(),\n y: z.number(),\n z: z.number(),\n})\n\nexport type PVec3 = z.infer<typeof PVec3>\n","import * as z from \"zod\"\nimport type { PVec3 } from \"./vec3\"\n\n/**\n * Quaternion operations for 3D rotations.\n *\n * Quaternions avoid gimbal lock and provide smooth interpolation\n * compared to Euler angles. All methods are **pure** — they return\n * new {@linkcode PQuat} values without mutating the inputs.\n *\n * Accessed via `snaptrude.core.math.quat`.\n */\nexport abstract class PluginQuatApi {\n constructor() {}\n\n /**\n * Create a new quaternion from raw components.\n *\n * For most use cases prefer {@linkcode PluginQuatApi.fromAxisAngle}\n * or {@linkcode PluginQuatApi.fromEuler} instead.\n *\n * @param x - The X component\n * @param y - The Y component\n * @param z - The Z component\n * @param w - The W (scalar) component\n * @returns A new {@linkcode PQuat}\n */\n new(x: number, y: number, z: number, w: number): PQuat {\n return { x, y, z, w }\n }\n\n /**\n * Create an identity quaternion representing no rotation.\n *\n * @returns `{ x: 0, y: 0, z: 0, w: 1 }`\n */\n identity(): PQuat {\n return { x: 0, y: 0, z: 0, w: 1 }\n }\n\n /**\n * Create a quaternion from an axis and an angle.\n *\n * @param axis - The rotation axis as a {@linkcode PVec3} (will be normalized internally)\n * @param angle - The rotation angle in **radians**\n * @returns A new unit {@linkcode PQuat}, or identity if {@linkcode axis} has zero length\n *\n * # Example\n * ```ts\n * const { vec3, quat } = snaptrude.core.math\n * // 90° rotation around the Y axis\n * const rot = quat.fromAxisAngle(vec3.new(0, 1, 0), Math.PI / 2)\n * ```\n */\n fromAxisAngle(axis: PVec3, angle: number): PQuat {\n const halfAngle = angle / 2\n const s = Math.sin(halfAngle)\n const len = Math.sqrt(axis.x * axis.x + axis.y * axis.y + axis.z * axis.z)\n if (len === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return {\n x: (axis.x / len) * s,\n y: (axis.y / len) * s,\n z: (axis.z / len) * s,\n w: Math.cos(halfAngle),\n }\n }\n\n /**\n * Create a quaternion from Euler angles in **XYZ** rotation order.\n *\n * @param x - Rotation around X axis in **radians**\n * @param y - Rotation around Y axis in **radians**\n * @param z - Rotation around Z axis in **radians**\n * @returns A new {@linkcode PQuat}\n */\n fromEuler(x: number, y: number, z: number): PQuat {\n const cx = Math.cos(x / 2)\n const sx = Math.sin(x / 2)\n const cy = Math.cos(y / 2)\n const sy = Math.sin(y / 2)\n const cz = Math.cos(z / 2)\n const sz = Math.sin(z / 2)\n return {\n x: sx * cy * cz + cx * sy * sz,\n y: cx * sy * cz - sx * cy * sz,\n z: cx * cy * sz + sx * sy * cz,\n w: cx * cy * cz - sx * sy * sz,\n }\n }\n\n /**\n * Multiply two quaternions, combining their rotations.\n *\n * Quaternion multiplication is **not commutative**: `a * b ≠ b * a`.\n * The result applies rotation {@linkcode b} first, then {@linkcode a}.\n *\n * @param a - First quaternion (applied second)\n * @param b - Second quaternion (applied first)\n * @returns A new {@linkcode PQuat} representing the combined rotation\n */\n multiply(a: PQuat, b: PQuat): PQuat {\n return {\n x: a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,\n y: a.w * b.y - a.x * b.z + a.y * b.w + a.z * b.x,\n z: a.w * b.z + a.x * b.y - a.y * b.x + a.z * b.w,\n w: a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z,\n }\n }\n\n /**\n * Compute the conjugate of a quaternion.\n *\n * For unit quaternions the conjugate equals the inverse.\n *\n * @param q - The quaternion\n * @returns A new {@linkcode PQuat} with negated vector part `(-x, -y, -z, w)`\n */\n conjugate(q: PQuat): PQuat {\n return { x: -q.x, y: -q.y, z: -q.z, w: q.w }\n }\n\n /**\n * Compute the length (magnitude) of a quaternion.\n *\n * @param q - The quaternion\n * @returns The magnitude `√(x² + y² + z² + w²)`\n */\n length(q: PQuat): number {\n return Math.sqrt(q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w)\n }\n\n /**\n * Normalize a quaternion to unit length.\n *\n * @param q - The quaternion to normalize\n * @returns A new unit-length {@linkcode PQuat}, or identity if the input has zero length\n */\n normalize(q: PQuat): PQuat {\n const len = this.length(q)\n if (len === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return { x: q.x / len, y: q.y / len, z: q.z / len, w: q.w / len }\n }\n\n /**\n * Compute the inverse of a quaternion.\n *\n * The inverse satisfies `q * inverse(q) = identity`.\n *\n * @param q - The quaternion to invert\n * @returns A new {@linkcode PQuat} that is the multiplicative inverse,\n * or identity if the input has zero length\n */\n inverse(q: PQuat): PQuat {\n const lenSq = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w\n if (lenSq === 0) return { x: 0, y: 0, z: 0, w: 1 }\n return { x: -q.x / lenSq, y: -q.y / lenSq, z: -q.z / lenSq, w: q.w / lenSq }\n }\n\n /**\n * Rotate a 3D vector by a quaternion.\n *\n * Computes `q * v * conjugate(q)` using the Hamilton product.\n *\n * @param q - The rotation quaternion (should be unit-length)\n * @param v - The vector to rotate as a {@linkcode PVec3}\n * @returns A new rotated {@linkcode PVec3}\n *\n * # Example\n * ```ts\n * const { vec3, quat } = snaptrude.core.math\n * const rot = quat.fromAxisAngle(vec3.new(0, 1, 0), Math.PI / 2)\n * const rotated = quat.rotateVec3(rot, vec3.new(1, 0, 0))\n * // ≈ { x: 0, y: 0, z: -1 }\n * ```\n */\n rotateVec3(q: PQuat, v: PVec3): PVec3 {\n const vq: PQuat = { x: v.x, y: v.y, z: v.z, w: 0 }\n const conj = this.conjugate(q)\n const result = this.multiply(this.multiply(q, vq), conj)\n return { x: result.x, y: result.y, z: result.z }\n }\n\n /**\n * Convert a quaternion to axis-angle representation.\n *\n * @param q - The quaternion to convert\n * @returns An object with:\n * - `axis` — The rotation axis as a unit {@linkcode PVec3}\n * (defaults to `(1, 0, 0)` when angle is zero)\n * - `angle` — The rotation angle in **radians**\n */\n toAxisAngle(q: PQuat): { axis: PVec3; angle: number } {\n const nq = this.normalize(q)\n const angle = 2 * Math.acos(Math.min(1, Math.max(-1, nq.w)))\n const s = Math.sin(angle / 2)\n if (s < 1e-6) {\n return { axis: { x: 1, y: 0, z: 0 }, angle: 0 }\n }\n return {\n axis: { x: nq.x / s, y: nq.y / s, z: nq.z / s },\n angle,\n }\n }\n\n /**\n * Spherical linear interpolation between two quaternions.\n *\n * Produces smooth constant-speed rotation between {@linkcode a} and {@linkcode b}.\n *\n * @param a - Start quaternion (returned when `t = 0`)\n * @param b - End quaternion (returned when `t = 1`)\n * @param t - Interpolation factor, typically in `[0, 1]`\n * @returns A new interpolated {@linkcode PQuat}\n */\n slerp(a: PQuat, b: PQuat, t: number): PQuat {\n let cosHalf = a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w\n let bx = b.x, by = b.y, bz = b.z, bw = b.w\n if (cosHalf < 0) {\n cosHalf = -cosHalf\n bx = -bx; by = -by; bz = -bz; bw = -bw\n }\n if (cosHalf >= 1.0) {\n return { x: a.x, y: a.y, z: a.z, w: a.w }\n }\n const halfAngle = Math.acos(cosHalf)\n const sinHalf = Math.sin(halfAngle)\n const ratioA = Math.sin((1 - t) * halfAngle) / sinHalf\n const ratioB = Math.sin(t * halfAngle) / sinHalf\n return {\n x: a.x * ratioA + bx * ratioB,\n y: a.y * ratioA + by * ratioB,\n z: a.z * ratioA + bz * ratioB,\n w: a.w * ratioA + bw * ratioB,\n }\n }\n\n /**\n * Compute the dot product of two quaternions.\n *\n * A value close to `1` or `-1` indicates similar orientations;\n * a value close to `0` indicates maximally different orientations.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @returns The scalar dot product\n */\n dot(a: PQuat, b: PQuat): number {\n return a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w\n }\n\n /**\n * Check if two quaternions are exactly equal (strict equality per component).\n *\n * For floating-point comparisons, prefer {@linkcode PluginQuatApi.equalsApprox}.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @returns `true` if all components match exactly\n */\n equals(a: PQuat, b: PQuat): boolean {\n return a.x === b.x && a.y === b.y && a.z === b.z && a.w === b.w\n }\n\n /**\n * Check if two quaternions are approximately equal within a tolerance.\n *\n * @param a - First quaternion\n * @param b - Second quaternion\n * @param epsilon - Maximum allowed difference per component (default `1e-6`)\n * @returns `true` if `|a[i] - b[i]| < epsilon` for all components\n */\n equalsApprox(a: PQuat, b: PQuat, epsilon: number = 1e-6): boolean {\n return (\n Math.abs(a.x - b.x) < epsilon &&\n Math.abs(a.y - b.y) < epsilon &&\n Math.abs(a.z - b.z) < epsilon &&\n Math.abs(a.w - b.w) < epsilon\n )\n }\n}\n\n/**\n * A quaternion with `x`, `y`, `z`, and `w` components.\n *\n * Used for representing 3D rotations without gimbal lock.\n * Equivalent to `BABYLON.Quaternion`.\n */\nexport const PQuat = z.object({\n x: z.number(),\n y: z.number(),\n z: z.number(),\n w: z.number(),\n})\n\nexport type PQuat = z.infer<typeof PQuat>\n","import { PluginVec3Api } from \"./vec3\"\nimport { PluginQuatApi } from \"./quat\"\n\n/**\n * Math primitives for 3D vector and quaternion operations.\n *\n * - {@linkcode PluginMathApi.vec3} — 3D vector creation and arithmetic\n * - {@linkcode PluginMathApi.quat} — Quaternion creation and rotation operations\n */\nexport abstract class PluginMathApi {\n /** 3D vector operations. See {@linkcode PluginVec3Api}. */\n public abstract vec3: PluginVec3Api\n /** Quaternion operations. See {@linkcode PluginQuatApi}. */\n public abstract quat: PluginQuatApi\n\n constructor() {}\n}\n\nexport * from \"./vec3\"\nexport * from \"./quat\"\n","import * as z from \"zod\"\nimport { PVec3 } from \"../math/vec3\"\n\n/**\n * Line segment construction.\n *\n * A {@linkcode PLine} is the simplest curve primitive — a straight\n * segment between two 3D points. Lines can be wrapped as a\n * {@linkcode PCurve} and combined into a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.line`.\n */\nexport abstract class PluginLineApi {\n constructor() {}\n\n /**\n * Create a new line segment between two points.\n *\n * @param startPoint - The start point as a {@linkcode PVec3}\n * @param endPoint - The end point as a {@linkcode PVec3}\n * @returns A new {@linkcode PLine}\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n * const { line } = snaptrude.core.geom\n *\n * const edge = line.new(vec3.new(0, 0, 0), vec3.new(5, 0, 0))\n * ```\n */\n new(startPoint: PVec3, endPoint: PVec3): PLine {\n return { curveType: \"Line\", startPoint, endPoint }\n }\n}\n\n/**\n * A line segment defined by a start and end point.\n *\n * Discriminated by `curveType: \"Line\"` within the {@linkcode PCurve} union.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curveType` | `\"Line\"` | Discriminator tag |\n * | `startPoint` | {@linkcode PVec3} | Start point of the segment |\n * | `endPoint` | {@linkcode PVec3} | End point of the segment |\n */\nexport const PLine = z.object({\n curveType: z.literal(\"Line\"),\n startPoint: PVec3,\n endPoint: PVec3,\n})\n\nexport type PLine = z.infer<typeof PLine>\n","import * as z from \"zod\"\nimport { PVec3 } from \"../math/vec3\"\n\n/**\n * Arc construction.\n *\n * A {@linkcode PArc} represents a circular arc in 3D space, defined by\n * start/end points, a centre, and a rotation axis. Arcs can be wrapped\n * as a {@linkcode PCurve} and combined into a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.arc`.\n */\nexport abstract class PluginArcApi {\n constructor() {}\n\n /**\n * Create a new arc from start, end, centre, and axis.\n *\n * The arc sweeps from {@linkcode startPoint} to {@linkcode endPoint}\n * along the circle centred at {@linkcode centrePoint}, in the\n * direction determined by the right-hand rule around {@linkcode axis}.\n *\n * @param startPoint - The start point as a {@linkcode PVec3}\n * @param endPoint - The end point as a {@linkcode PVec3}\n * @param centrePoint - The centre of the arc's circle as a {@linkcode PVec3}\n * @param axis - The arc's rotation axis as a {@linkcode PVec3}\n * (perpendicular to the arc's plane)\n * @returns A new {@linkcode PArc}\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n * const { arc } = snaptrude.core.geom\n *\n * // Quarter-circle arc on the XZ plane\n * const a = arc.new(\n * vec3.new(1, 0, 0), // start\n * vec3.new(0, 0, 1), // end\n * vec3.new(0, 0, 0), // centre\n * vec3.new(0, 1, 0), // Y-up axis\n * )\n * ```\n */\n new(startPoint: PVec3, endPoint: PVec3, centrePoint: PVec3, axis: PVec3): PArc {\n return { curveType: \"Arc\", startPoint, endPoint, centrePoint, axis }\n }\n}\n\n/**\n * A circular arc defined by start, end, centre, and axis.\n *\n * Discriminated by `curveType: \"Arc\"` within the {@linkcode PCurve} union.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curveType` | `\"Arc\"` | Discriminator tag |\n * | `startPoint` | {@linkcode PVec3} | Start point of the arc |\n * | `endPoint` | {@linkcode PVec3} | End point of the arc |\n * | `centrePoint` | {@linkcode PVec3} | Centre of the arc's circle |\n * | `axis` | {@linkcode PVec3} | Rotation axis (normal to the arc's plane) |\n */\nexport const PArc = z.object({\n curveType: z.literal(\"Arc\"),\n startPoint: PVec3,\n endPoint: PVec3,\n centrePoint: PVec3,\n axis: PVec3,\n})\n\nexport type PArc = z.infer<typeof PArc>\n","import * as z from \"zod\"\nimport { PLine } from \"./line\"\nimport { PArc } from \"./arc\"\n\n/**\n * Unified curve wrapper — either a {@linkcode PLine} or a {@linkcode PArc}.\n *\n * Use this to build heterogeneous curve lists (mixing lines and arcs)\n * when constructing a {@linkcode PProfile}.\n *\n * Accessed via `snaptrude.core.geom.curve`.\n */\nexport abstract class PluginCurveApi {\n constructor() {}\n\n /**\n * Wrap a {@linkcode PLine} or {@linkcode PArc} as a {@linkcode PCurve}.\n *\n * This is an identity operation — it simply returns the input unchanged.\n * It exists for type-level clarity when building mixed curve lists.\n *\n * @param curve - A {@linkcode PLine} or {@linkcode PArc} to wrap\n * @returns The same value typed as {@linkcode PCurve}\n */\n new(curve: PLine | PArc): PCurve {\n return curve\n }\n}\n\n/**\n * A discriminated union of {@linkcode PLine} and {@linkcode PArc}.\n *\n * Discriminated on the `curveType` field:\n * - `\"Line\"` → {@linkcode PLine}\n * - `\"Arc\"` → {@linkcode PArc}\n *\n * Use `curve.curveType` to narrow the type in a switch or if-statement.\n */\nexport const PCurve = z.discriminatedUnion(\"curveType\", [PLine, PArc])\n\nexport type PCurve = z.infer<typeof PCurve>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../../types\"\nimport { PVec3 } from \"../math/vec3\"\nimport { PCurve } from \"./curve\"\n\n/**\n * Profile construction — a closed loop of {@linkcode PCurve}s.\n *\n * Profiles are the primary 2D shape primitive used for creating\n * extruded entities like spaces. Build profiles either from an\n * explicit list of curves or from a list of points (auto-connected\n * with line segments).\n *\n * Accessed via `snaptrude.core.geom.profile`.\n */\nexport abstract class PluginProfileApi {\n constructor() {}\n\n /**\n * Create a profile from an ordered list of curves.\n *\n * The curves should form a closed loop — the end point of each curve\n * should coincide with the start point of the next.\n *\n * @param curves - An ordered array of {@linkcode PCurve}s forming a closed loop\n * @returns A new {@linkcode PProfile}\n */\n new(curves: PCurve[]): PProfile {\n return { curves }\n }\n\n /**\n * Create a profile by connecting a list of points with line segments.\n *\n * The points are connected in order, with the last point automatically\n * connected back to the first to close the loop.\n *\n * This is a **host API call** — it returns a `Promise`.\n *\n * @param args - An object containing:\n * - {@linkcode PluginProfileFromLinePointsArgs.points args.points} — An ordered\n * array of {@linkcode PVec3} forming the profile vertices\n * @returns A {@linkcode PProfile} with line-segment curves connecting the points\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Create an L-shaped profile\n * const profile = await snaptrude.core.geom.profile.fromLinePoints({\n * points: [\n * vec3.new(0, 0, 0),\n * vec3.new(10, 0, 0),\n * vec3.new(10, 0, 5),\n * vec3.new(5, 0, 5),\n * vec3.new(5, 0, 10),\n * vec3.new(0, 0, 10),\n * ],\n * })\n * ```\n */\n public abstract fromLinePoints(\n args: PluginProfileFromLinePointsArgs\n ): PluginApiReturn<PProfile>\n}\n\n/**\n * Arguments for {@linkcode PluginProfileApi.fromLinePoints}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `points` | {@linkcode PVec3}`[]` | Ordered vertices of the profile |\n */\nexport const PluginProfileFromLinePointsArgs = z.object({\n points: z.array(PVec3),\n})\n\nexport type PluginProfileFromLinePointsArgs = z.infer<typeof PluginProfileFromLinePointsArgs>\n\n/**\n * A closed profile composed of an ordered list of curves.\n *\n * Profiles are used as input to entity creation methods like\n * {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `curves` | {@linkcode PCurve}`[]` | Ordered curves forming a closed loop |\n */\nexport const PProfile = z.object({\n curves: z.array(PCurve),\n})\n\nexport type PProfile = z.infer<typeof PProfile>\n","import { PluginLineApi } from \"./line\"\nimport { PluginArcApi } from \"./arc\"\nimport { PluginCurveApi } from \"./curve\"\nimport { PluginProfileApi } from \"./profile\"\n\n/**\n * Geometry primitives for constructing 2D/3D shapes.\n *\n * Build geometry bottom-up: points ({@linkcode PVec3}) → lines/arcs → curves → profiles.\n * Profiles can then be used with entity creation methods like\n * {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * - {@linkcode PluginGeomApi.line} — Line segment construction\n * - {@linkcode PluginGeomApi.arc} — Arc construction\n * - {@linkcode PluginGeomApi.curve} — Unified curve wrapper (line or arc)\n * - {@linkcode PluginGeomApi.profile} — Closed loop of curves\n */\nexport abstract class PluginGeomApi {\n /** Line segment construction. See {@linkcode PluginLineApi}. */\n public abstract line: PluginLineApi\n /** Arc construction. See {@linkcode PluginArcApi}. */\n public abstract arc: PluginArcApi\n /** Unified curve wrapper. See {@linkcode PluginCurveApi}. */\n public abstract curve: PluginCurveApi\n /** Closed profile (loop of curves). See {@linkcode PluginProfileApi}. */\n public abstract profile: PluginProfileApi\n\n constructor() {}\n}\n\nexport * from \"./line\"\nexport * from \"./arc\"\nexport * from \"./curve\"\nexport * from \"./profile\"\n","import { PluginMathApi } from \"./math\"\nimport { PluginGeomApi } from \"./geom\"\n\n/**\n * Core primitives used across the plugin API.\n *\n * - {@linkcode PluginCoreApi.math} — Vector and quaternion operations\n * - {@linkcode PluginCoreApi.geom} — Geometry primitives (lines, arcs, curves, profiles)\n */\nexport abstract class PluginCoreApi {\n /** Vector and quaternion math utilities. See {@linkcode PluginMathApi}. */\n public abstract math: PluginMathApi\n /** Geometry primitives and constructors. See {@linkcode PluginGeomApi}. */\n public abstract geom: PluginGeomApi\n\n constructor() {}\n}\n\nexport * from \"./math\"\nexport * from \"./geom\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\nimport { PQuat } from \"../core/math/quat\"\nimport { PProfile } from \"../core/geom/profile\"\n\n/**\n * Space (room/mass) management — create, query, and delete spaces.\n *\n * A **space** is a 3D volume representing a room or mass in the\n * Snaptrude scene. Spaces live on a particular story and carry\n * properties such as name, area, department, and room type.\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.space`.\n */\nexport abstract class PluginSpaceApi {\n constructor() {}\n\n /**\n * Create a rectangular (box) space.\n *\n * Generates an axis-aligned box with the given dimensions at the\n * specified position. The created space is automatically assigned\n * to the active story and a default department.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceCreateRectangularArgs.position args.position} — Origin\n * position as a {@linkcode PVec3} in Babylon units\n * - {@linkcode PluginSpaceCreateRectangularArgs.dimensions args.dimensions} — Box\n * dimensions `{ width, height, depth }` in Babylon units\n * @returns A {@linkcode PluginSpaceCreateRectangularResult} with the `spaceId`\n * of the created space\n * @throws If space creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const { spaceId } = await snaptrude.entity.space.createRectangular({\n * position: vec3.new(0, 0, 0),\n * dimensions: { width: 5, height: 3, depth: 4 },\n * })\n * ```\n */\n public abstract createRectangular({\n position,\n dimensions,\n }: PluginSpaceCreateRectangularArgs): PluginApiReturn<PluginSpaceCreateRectangularResult>\n\n /**\n * Create a space by extruding a 2D profile.\n *\n * The {@linkcode PluginSpaceCreateFromProfileArgs.profile profile} is extruded\n * upward (along the Y axis) by {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight\n * extrudeHeight}, then offset by {@linkcode PluginSpaceCreateFromProfileArgs.position\n * position}. The created space is automatically assigned to the active story\n * and a default department.\n *\n * Use {@linkcode PluginProfileApi.fromLinePoints} to quickly build a profile\n * from a list of points.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceCreateFromProfileArgs.profile args.profile} — A closed\n * {@linkcode PProfile} defining the floor shape\n * - {@linkcode PluginSpaceCreateFromProfileArgs.extrudeHeight args.extrudeHeight} —\n * Extrusion height in Babylon units\n * - {@linkcode PluginSpaceCreateFromProfileArgs.position args.position} — Offset\n * position as a {@linkcode PVec3} in Babylon units\n * @returns A {@linkcode PluginSpaceCreateFromProfileResult} with the `spaceId`\n * of the created space\n * @throws If the profile is invalid or mesh creation fails\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * const profile = await snaptrude.core.geom.profile.fromLinePoints({\n * points: [\n * vec3.new(0, 0, 0),\n * vec3.new(10, 0, 0),\n * vec3.new(10, 0, 8),\n * vec3.new(0, 0, 8),\n * ],\n * })\n *\n * const { spaceId } = await snaptrude.entity.space.createFromProfile({\n * profile,\n * extrudeHeight: 3,\n * position: vec3.new(0, 0, 0),\n * })\n * ```\n */\n public abstract createFromProfile({\n profile,\n extrudeHeight,\n position,\n }: PluginSpaceCreateFromProfileArgs): PluginApiReturn<PluginSpaceCreateFromProfileResult>\n\n /**\n * Get the IDs of all spaces in the current project.\n *\n * Returns every space (mass that is not a building) across all stories.\n * Use the returned IDs with {@linkcode PluginSpaceApi.get} to query\n * individual space properties.\n *\n * @returns A {@linkcode PluginSpaceGetAllResult} with a `spacesIds` array\n *\n * # Example\n * ```ts\n * const { spacesIds } = await snaptrude.entity.space.getAll()\n * console.log(`Project has ${spacesIds.length} spaces`)\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginSpaceGetAllResult>\n\n /**\n * Get properties of a space by its ID.\n *\n * Only the properties listed in {@linkcode PluginSpaceGetArgs.properties\n * args.properties} are returned — unlisted properties will be `undefined`\n * in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceGetArgs.spaceId args.spaceId} — The unique space ID\n * (as returned by creation methods or {@linkcode PluginSpaceApi.getAll})\n * - {@linkcode PluginSpaceGetArgs.properties args.properties} — Array of property\n * names to retrieve. See {@linkcode PluginSpaceGetProperty} for available values.\n * @returns A partial {@linkcode PluginSpaceGetResult} containing only the requested\n * properties\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * const info = await snaptrude.entity.space.get({\n * spaceId: \"some-space-id\",\n * properties: [\"name\", \"area\", \"position\"],\n * })\n * console.log(info.name, info.area, info.position)\n * ```\n */\n public abstract get({\n spaceId,\n properties,\n }: PluginSpaceGetArgs): PluginApiReturn<PluginSpaceGetResult>\n\n /**\n * Delete a space by its ID.\n *\n * Permanently removes the space and its associated mesh from the scene.\n * This operation is undoable via Snaptrude's command system.\n *\n * @param args - An object containing:\n * - {@linkcode PluginSpaceDeleteArgs.spaceId args.spaceId} — The unique space ID\n * to delete\n * @throws If the space does not exist or the component is not a space/mass\n *\n * # Example\n * ```ts\n * await snaptrude.entity.space.delete({ spaceId: \"some-space-id\" })\n * ```\n */\n public abstract delete({\n spaceId,\n }: PluginSpaceDeleteArgs): PluginApiReturn<PluginSpaceDeleteResult>\n}\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.createRectangular}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `position` | {@linkcode PVec3} | Origin position in Babylon units |\n * | `dimensions` | `{ width, height, depth }` | Box dimensions in Babylon units |\n */\nexport const PluginSpaceCreateRectangularArgs = z.object({\n position: PVec3,\n dimensions: z.object({\n width: z.number(),\n height: z.number(),\n depth: z.number(),\n }),\n})\n\nexport type PluginSpaceCreateRectangularArgs = z.infer<typeof PluginSpaceCreateRectangularArgs>\n\n/**\n * Result of {@linkcode PluginSpaceApi.createRectangular}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Unique ID of the created space |\n */\nexport const PluginSpaceCreateRectangularResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceCreateRectangularResult = z.infer<typeof PluginSpaceCreateRectangularResult>\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `profile` | {@linkcode PProfile} | Closed 2D profile defining the floor shape |\n * | `extrudeHeight` | `number` | Extrusion height in Babylon units |\n * | `position` | {@linkcode PVec3} | Offset position in Babylon units |\n */\nexport const PluginSpaceCreateFromProfileArgs = z.object({\n profile: PProfile,\n extrudeHeight: z.number(),\n position: PVec3,\n})\n\nexport type PluginSpaceCreateFromProfileArgs = z.infer<typeof PluginSpaceCreateFromProfileArgs>\n\n/**\n * Result of {@linkcode PluginSpaceApi.createFromProfile}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | Unique ID of the created space |\n */\nexport const PluginSpaceCreateFromProfileResult = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceCreateFromProfileResult = z.infer<typeof PluginSpaceCreateFromProfileResult>\n\n/**\n * Available properties that can be queried on a space.\n *\n * | Value | Return Type | Description |\n * |---|---|---|\n * | `\"id\"` | `string` | Unique space identifier |\n * | `\"type\"` | `string` | Component type |\n * | `\"room_type\"` | `string` | Room type classification |\n * | `\"name\"` | `string` | Display name of the space |\n * | `\"area\"` | `number` | Bottom (floor) area |\n * | `\"department\"` | `string` | Assigned department name |\n * | `\"position\"` | {@linkcode PVec3} | Local position relative to parent |\n * | `\"absolutePosition\"` | {@linkcode PVec3} | Absolute position in the scene |\n * | `\"rotation\"` | {@linkcode PVec3} | Euler rotation angles (radians) |\n * | `\"rotationQuaternion\"` | {@linkcode PQuat} \\| `null` | Quaternion rotation, or `null` if unset |\n */\nexport const PluginSpaceGetProperty = z.enum([\n \"id\",\n \"type\",\n \"room_type\",\n \"name\",\n \"area\",\n \"department\",\n \"position\",\n \"absolutePosition\",\n \"rotation\",\n \"rotationQuaternion\",\n])\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to query |\n * | `properties` | {@linkcode PluginSpaceGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginSpaceGetArgs = z.object({\n spaceId: z.string(),\n properties: z.array(PluginSpaceGetProperty),\n})\n\nexport type PluginSpaceGetArgs = z.infer<typeof PluginSpaceGetArgs>\n\n/**\n * Result of {@linkcode PluginSpaceApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginSpaceGetArgs.properties} will be present.\n */\nexport const PluginSpaceGetResult = z\n .object({\n id: z.string(),\n type: z.string(),\n room_type: z.string(),\n name: z.string(),\n area: z.number(),\n department: z.string(),\n position: PVec3,\n absolutePosition: PVec3,\n rotation: PVec3,\n rotationQuaternion: PQuat.nullable(),\n })\n .partial()\n\nexport type PluginSpaceGetResult = z.infer<typeof PluginSpaceGetResult>\n\n/**\n * Result of {@linkcode PluginSpaceApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spacesIds` | `string[]` | IDs of all spaces in the project |\n */\nexport const PluginSpaceGetAllResult = z.object({\n spacesIds: z.array(z.string()),\n})\n\nexport type PluginSpaceGetAllResult = z.infer<typeof PluginSpaceGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginSpaceApi.delete}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `spaceId` | `string` | The space ID to delete |\n */\nexport const PluginSpaceDeleteArgs = z.object({\n spaceId: z.string(),\n})\n\nexport type PluginSpaceDeleteArgs = z.infer<typeof PluginSpaceDeleteArgs>\n\n/** Result type for {@linkcode PluginSpaceApi.delete} — returns nothing on success. */\nexport type PluginSpaceDeleteResult = void\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Story (floor/storey) management.\n *\n * A story represents a building floor in the Snaptrude project. Stories\n * are identified by their integer **story value** (e.g. `1` for ground\n * floor, `2` for first floor, `-1` for a basement).\n *\n * All methods are **host API calls** that return Promises and support\n * undo/redo via Snaptrude's command system.\n *\n * Accessed via `snaptrude.entity.story`.\n */\nexport abstract class PluginStoryApi {\n constructor() {}\n\n /**\n * Get properties of a story by its storey number.\n *\n * Only the properties listed in {@linkcode PluginStoryGetArgs.properties args.properties}\n * are returned — unlisted properties will be `undefined` in the result.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryGetArgs.storyValue args.storyValue} — Integer storey number\n * (e.g. `1` for ground floor, `2` for first floor, `-1` for basement)\n * - {@linkcode PluginStoryGetArgs.properties args.properties} — Array of property names\n * to retrieve. See {@linkcode PluginStoryGetProperty} for available values.\n * @returns A partial {@linkcode PluginStoryGetResult} containing only the requested properties\n * @throws If the story with the given value does not exist\n *\n * # Example\n * ```ts\n * const info = await snaptrude.entity.story.get({\n * storyValue: 1,\n * properties: [\"height\", \"name\", \"spacesCount\"],\n * })\n * console.log(info.name, info.height, info.spacesCount)\n * ```\n */\n public abstract get({\n storyValue,\n properties,\n }: PluginStoryGetArgs): PluginApiReturn<PluginStoryGetResult>\n\n /**\n * Get all stories in the current project.\n *\n * Returns basic identification data for every storey. Stories are sorted\n * from **top to bottom** (highest story value first).\n *\n * @returns A {@linkcode PluginStoryGetAllResult} with a `stories` array,\n * each entry containing `value`, `id`, and `name`\n *\n * # Example\n * ```ts\n * const { stories } = await snaptrude.entity.story.getAll()\n * for (const s of stories) {\n * console.log(`Story ${s.value}: ${s.name} (id: ${s.id})`)\n * }\n * ```\n */\n public abstract getAll(): PluginApiReturn<PluginStoryGetAllResult>\n\n /**\n * Create a new story (floor) in the project.\n *\n * The new story is inserted at the position specified by\n * {@linkcode PluginStoryCreateArgs.storyValue args.storyValue}. This\n * operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryCreateArgs.storyValue args.storyValue} — Integer storey number\n * to create (e.g. `3` to add a third floor)\n * - {@linkcode PluginStoryCreateArgs.height args.height} — Optional height in Babylon\n * units. If omitted, the project's default storey height is used.\n * @returns A {@linkcode PluginStoryCreateResult} with `storyId` and `storyValue`\n * @throws If a story with the given value already exists or creation fails\n *\n * # Example\n * ```ts\n * // Create a new third floor with custom height\n * const { storyId } = await snaptrude.entity.story.create({\n * storyValue: 3,\n * height: 4.5,\n * })\n * ```\n */\n public abstract create({\n storyValue,\n height,\n }: PluginStoryCreateArgs): PluginApiReturn<PluginStoryCreateResult>\n\n /**\n * Update a story's height.\n *\n * Changes the floor-to-floor height of the specified story. This\n * operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginStoryUpdateArgs.storyValue args.storyValue} — Integer storey number\n * identifying the story to update\n * - {@linkcode PluginStoryUpdateArgs.height args.height} — New height value in Babylon\n * units\n * @returns A {@linkcode PluginStoryUpdateResult} with the updated `storyValue` and `height`\n * @throws If the story does not exist or the update fails\n *\n * # Example\n * ```ts\n * // Set ground floor height to 5 Babylon units\n * const result = await snaptrude.entity.story.update({\n * storyValue: 1,\n * height: 5,\n * })\n * ```\n */\n public abstract update({\n storyValue,\n height,\n }: PluginStoryUpdateArgs): PluginApiReturn<PluginStoryUpdateResult>\n}\n\n/**\n * Available properties that can be queried on a story.\n *\n * | Value | Type | Description |\n * |---|---|---|\n * | `\"value\"` | `number` | The integer storey number |\n * | `\"id\"` | `string` | Unique story identifier |\n * | `\"name\"` | `string` | Display name of the story |\n * | `\"height\"` | `number` | Floor-to-floor height in Babylon units |\n * | `\"base\"` | `number` | Base elevation in Babylon units |\n * | `\"hidden\"` | `boolean` | Whether the story is hidden in the viewport |\n * | `\"spacesCount\"` | `number` | Number of spaces on this story |\n * | `\"totalArea\"` | `number` | Total floor area of this story |\n */\nexport const PluginStoryGetProperty = z.enum([\n \"value\",\n \"id\",\n \"name\",\n \"height\",\n \"base\",\n \"hidden\",\n \"spacesCount\",\n \"totalArea\",\n])\n\n/**\n * Arguments for {@linkcode PluginStoryApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | The storey number to query |\n * | `properties` | {@linkcode PluginStoryGetProperty}`[]` | Properties to retrieve |\n */\nexport const PluginStoryGetArgs = z.object({\n storyValue: z.number().int(),\n properties: z.array(PluginStoryGetProperty),\n})\n\nexport type PluginStoryGetArgs = z.infer<typeof PluginStoryGetArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.get}.\n *\n * A partial object — only the properties that were requested in\n * {@linkcode PluginStoryGetArgs.properties} will be present.\n */\nexport const PluginStoryGetResult = z\n .object({\n value: z.number(),\n id: z.string(),\n name: z.string(),\n height: z.number(),\n base: z.number(),\n hidden: z.boolean(),\n spacesCount: z.number(),\n totalArea: z.number(),\n })\n .partial()\n\nexport type PluginStoryGetResult = z.infer<typeof PluginStoryGetResult>\n\n/**\n * Result of {@linkcode PluginStoryApi.getAll}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `stories` | `Array<{ value, id, name }>` | All stories, sorted top to bottom |\n */\nexport const PluginStoryGetAllResult = z.object({\n stories: z.array(\n z.object({\n value: z.number(),\n id: z.string(),\n name: z.string(),\n })\n ),\n})\n\nexport type PluginStoryGetAllResult = z.infer<typeof PluginStoryGetAllResult>\n\n/**\n * Arguments for {@linkcode PluginStoryApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | The storey number for the new story |\n * | `height` | `number?` | Optional height in Babylon units |\n */\nexport const PluginStoryCreateArgs = z.object({\n storyValue: z.number().int(),\n height: z.number().optional(),\n})\n\nexport type PluginStoryCreateArgs = z.infer<typeof PluginStoryCreateArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.create}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyId` | `string` | Unique ID of the created story |\n * | `storyValue` | `number` | The storey number of the created story |\n */\nexport const PluginStoryCreateResult = z.object({\n storyId: z.string(),\n storyValue: z.number(),\n})\n\nexport type PluginStoryCreateResult = z.infer<typeof PluginStoryCreateResult>\n\n/**\n * Arguments for {@linkcode PluginStoryApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` (int) | Storey number of the story to update |\n * | `height` | `number` | New height in Babylon units |\n */\nexport const PluginStoryUpdateArgs = z.object({\n storyValue: z.number().int(),\n height: z.number(),\n})\n\nexport type PluginStoryUpdateArgs = z.infer<typeof PluginStoryUpdateArgs>\n\n/**\n * Result of {@linkcode PluginStoryApi.update}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `storyValue` | `number` | The storey number of the updated story |\n * | `height` | `number` | The new height after the update |\n */\nexport const PluginStoryUpdateResult = z.object({\n storyValue: z.number(),\n height: z.number(),\n})\n\nexport type PluginStoryUpdateResult = z.infer<typeof PluginStoryUpdateResult>\n","import { PluginSpaceApi } from \"./space\"\nimport { PluginStoryApi } from \"./story\"\n\n/**\n * CRUD operations on Snaptrude building entities.\n *\n * - {@linkcode PluginEntityApi.space} — Create, query, and delete spaces (rooms/masses)\n * - {@linkcode PluginEntityApi.story} — Create, query, and update stories (floors)\n */\nexport abstract class PluginEntityApi {\n /** Space (room/mass) operations. See {@linkcode PluginSpaceApi}. */\n public abstract space: PluginSpaceApi\n /** Story (floor/storey) operations. See {@linkcode PluginStoryApi}. */\n public abstract story: PluginStoryApi\n\n constructor() {}\n}\n\nexport * from \"./space\"\nexport * from \"./story\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Query the current user selection in the Snaptrude editor.\n *\n * Accessed via `snaptrude.tools.selection`.\n */\nexport abstract class PluginSelectionApi {\n constructor() {}\n\n /**\n * Get the IDs of all currently selected components.\n *\n * Returns the component IDs from the editor's active selection stack.\n * If nothing is selected, returns an empty array.\n *\n * The returned IDs can be used with {@linkcode PluginTransformApi.move},\n * {@linkcode PluginTransformApi.rotate}, or entity query methods like\n * {@linkcode PluginSpaceApi.get}.\n *\n * @returns A {@linkcode PluginSelectionGetResult} with a `selected` array\n * of component ID strings\n *\n * # Example\n * ```ts\n * const { selected } = await snaptrude.tools.selection.get()\n * if (selected.length > 0) {\n * // Move selected components 5 units along X\n * await snaptrude.tools.transform.move({\n * componentIds: selected,\n * displacement: snaptrude.core.math.vec3.new(5, 0, 0),\n * })\n * }\n * ```\n */\n public abstract get(): PluginApiReturn<PluginSelectionGetResult>\n}\n\n/**\n * Result of {@linkcode PluginSelectionApi.get}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `selected` | `string[]` | Component IDs of the current selection |\n */\nexport const PluginSelectionGetResult = z.object({\n selected: z.array(z.string()),\n})\n\nexport type PluginSelectionGetResult = z.infer<typeof PluginSelectionGetResult>\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\nimport { PVec3 } from \"../core/math/vec3\"\n\n/**\n * Transform operations — move and rotate scene components.\n *\n * All transform methods accept an array of component IDs and apply the\n * transformation to each. Operations are recorded in Snaptrude's\n * command system for undo/redo support.\n *\n * Accessed via `snaptrude.tools.transform`.\n */\nexport abstract class PluginTransformApi {\n constructor() {}\n\n /**\n * Translate components by a displacement vector.\n *\n * Each component's position is offset by the given\n * {@linkcode PluginMoveArgs.displacement displacement} vector.\n * This operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginMoveArgs.componentIds args.componentIds} — Array of component\n * ID strings to move\n * - {@linkcode PluginMoveArgs.displacement args.displacement} — Translation vector\n * as a {@linkcode PVec3} in Babylon units\n * @throws If any component ID is not found in the scene\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Move a space 10 units along the X axis\n * await snaptrude.tools.transform.move({\n * componentIds: [\"some-space-id\"],\n * displacement: vec3.new(10, 0, 0),\n * })\n * ```\n */\n public abstract move({\n componentIds,\n displacement,\n }: PluginMoveArgs): PluginApiReturn<void>\n\n /**\n * Rotate components around an axis through a pivot point.\n *\n * Each component is rotated by {@linkcode PluginRotateArgs.angle angle}\n * radians around the {@linkcode PluginRotateArgs.axis axis} vector,\n * pivoting about the {@linkcode PluginRotateArgs.pivot pivot} point.\n * This operation is undoable.\n *\n * @param args - An object containing:\n * - {@linkcode PluginRotateArgs.componentIds args.componentIds} — Array of component\n * ID strings to rotate\n * - {@linkcode PluginRotateArgs.angle args.angle} — Rotation angle in **radians**\n * - {@linkcode PluginRotateArgs.axis args.axis} — Rotation axis as a {@linkcode PVec3}\n * - {@linkcode PluginRotateArgs.pivot args.pivot} — Pivot point as a {@linkcode PVec3}\n * in Babylon units\n * @throws If any component ID is not found in the scene\n *\n * # Example\n * ```ts\n * const { vec3 } = snaptrude.core.math\n *\n * // Rotate a space 45° around the Y axis at the origin\n * await snaptrude.tools.transform.rotate({\n * componentIds: [\"some-space-id\"],\n * angle: Math.PI / 4,\n * axis: vec3.new(0, 1, 0),\n * pivot: vec3.new(0, 0, 0),\n * })\n * ```\n */\n public abstract rotate({\n componentIds,\n angle,\n axis,\n pivot,\n }: PluginRotateArgs): PluginApiReturn<void>\n}\n\n/**\n * Arguments for {@linkcode PluginTransformApi.move}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentIds` | `string[]` | Component IDs to move |\n * | `displacement` | {@linkcode PVec3} | Translation vector in Babylon units |\n */\nexport const PluginMoveArgs = z.object({\n componentIds: z.array(z.string()),\n displacement: PVec3,\n})\n\nexport type PluginMoveArgs = z.infer<typeof PluginMoveArgs>\n\n/**\n * Arguments for {@linkcode PluginTransformApi.rotate}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `componentIds` | `string[]` | Component IDs to rotate |\n * | `angle` | `number` | Rotation angle in radians |\n * | `axis` | {@linkcode PVec3} | Rotation axis direction |\n * | `pivot` | {@linkcode PVec3} | Pivot point in Babylon units |\n */\nexport const PluginRotateArgs = z.object({\n componentIds: z.array(z.string()),\n angle: z.number(),\n axis: PVec3,\n pivot: PVec3,\n})\n\nexport type PluginRotateArgs = z.infer<typeof PluginRotateArgs>\n","import { PluginSelectionApi } from \"./selection\"\nimport { PluginTransformApi } from \"./transform\"\n\n/**\n * Snaptrude editor tools for querying and manipulating scene components.\n *\n * - {@linkcode PluginToolsApi.selection} — Query the current user selection\n * - {@linkcode PluginToolsApi.transform} — Move and rotate components\n */\nexport abstract class PluginToolsApi {\n /** Query the current selection. See {@linkcode PluginSelectionApi}. */\n public abstract selection: PluginSelectionApi\n /** Move and rotate components. See {@linkcode PluginTransformApi}. */\n public abstract transform: PluginTransformApi\n\n constructor() {}\n}\n\nexport * from \"./selection\"\nexport * from \"./transform\"\n","import * as z from \"zod\"\nimport { PluginApiReturn } from \"../../types\"\n\n/**\n * Unit conversion between real-world units and Snaptrude's internal\n * (Babylon) coordinate system.\n *\n * Snaptrude uses an internal unit system (Babylon units) for all\n * coordinates and dimensions. Use these methods to convert between\n * real-world measurements and Babylon units.\n *\n * Accessed via `snaptrude.units`.\n */\nexport abstract class PluginUnitsApi {\n constructor() {}\n\n /**\n * Convert a value from a real-world unit to Snaptrude's internal (Babylon) units.\n *\n * Use this when you have a measurement in real-world units (e.g. meters, feet)\n * and need to convert it to the coordinate system used by Snaptrude internally.\n *\n * @param args - An object containing:\n * - {@linkcode PluginUnitsConvertFromArgs.unit args.unit} — The source unit\n * to convert from. See {@linkcode PUnitType} for supported values.\n * - {@linkcode PluginUnitsConvertFromArgs.value args.value} — The numeric\n * value in the source unit\n * @returns A {@linkcode PluginUnitsConvertFromResult} containing the converted\n * `value` in Babylon units\n *\n * # Example\n * ```ts\n * // Convert 5 meters to Babylon units for use in API calls\n * const result = await snaptrude.units.convertFrom({ unit: \"meters\", value: 5 })\n * const { spaceId } = await snaptrude.entity.space.createRectangular({\n * position: snaptrude.core.math.vec3.new(0, 0, 0),\n * dimensions: { width: result.value, height: result.value, depth: result.value },\n * })\n * ```\n */\n public abstract convertFrom(\n args: PluginUnitsConvertFromArgs,\n ): PluginApiReturn<PluginUnitsConvertFromResult>\n\n /**\n * Convert a value from Snaptrude's internal (Babylon) units to a real-world unit.\n *\n * Use this when you have a value in Snaptrude's internal coordinate system\n * and need to express it in real-world units (e.g. meters, feet).\n *\n * @param args - An object containing:\n * - {@linkcode PluginUnitsConvertToArgs.unit args.unit} — The target unit\n * to convert to. See {@linkcode PUnitType} for supported values.\n * - {@linkcode PluginUnitsConvertToArgs.value args.value} — The numeric\n * value in Babylon units\n * @returns A {@linkcode PluginUnitsConvertToResult} containing the converted\n * `value` in the target unit\n *\n * # Example\n * ```ts\n * // Get a space's area in square meters\n * const info = await snaptrude.entity.space.get({\n * spaceId: \"some-id\",\n * properties: [\"area\"],\n * })\n * const areaInMeters = await snaptrude.units.convertTo({\n * unit: \"meters\",\n * value: info.area!,\n * })\n * ```\n */\n public abstract convertTo(\n args: PluginUnitsConvertToArgs,\n ): PluginApiReturn<PluginUnitsConvertToResult>\n}\n\n/**\n * Supported unit types for conversion.\n *\n * - `meters` — Metric meters\n * - `feet-inches` — Imperial feet (1 foot = 12 inches)\n * - `inches` — Imperial inches\n * - `centimeters` — Metric centimeters\n * - `millimeters` — Metric millimeters\n * - `kilometers` — Metric kilometers\n * - `miles` — Imperial miles\n */\nexport const PUnitType = z.enum([\n \"meters\",\n \"feet-inches\",\n \"inches\",\n \"centimeters\",\n \"millimeters\",\n \"kilometers\",\n \"miles\",\n])\n\nexport type PUnitType = z.infer<typeof PUnitType>\n\n/**\n * Arguments for {@linkcode PluginUnitsApi.convertFrom}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `unit` | {@linkcode PUnitType} | Source real-world unit |\n * | `value` | `number` | Numeric value in the source unit |\n */\nexport const PluginUnitsConvertFromArgs = z.object({\n unit: PUnitType,\n value: z.number(),\n})\n\nexport type PluginUnitsConvertFromArgs = z.infer<typeof PluginUnitsConvertFromArgs>\n\n/**\n * Result of {@linkcode PluginUnitsApi.convertFrom}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `value` | `number` | The converted value in Babylon units |\n */\nexport const PluginUnitsConvertFromResult = z.object({\n value: z.number(),\n})\n\nexport type PluginUnitsConvertFromResult = z.infer<typeof PluginUnitsConvertFromResult>\n\n/**\n * Arguments for {@linkcode PluginUnitsApi.convertTo}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `unit` | {@linkcode PUnitType} | Target real-world unit |\n * | `value` | `number` | Numeric value in Babylon units |\n */\nexport const PluginUnitsConvertToArgs = z.object({\n unit: PUnitType,\n value: z.number(),\n})\n\nexport type PluginUnitsConvertToArgs = z.infer<typeof PluginUnitsConvertToArgs>\n\n/**\n * Result of {@linkcode PluginUnitsApi.convertTo}.\n *\n * | Property | Type | Description |\n * |---|---|---|\n * | `value` | `number` | The converted value in the target unit |\n */\nexport const PluginUnitsConvertToResult = z.object({\n value: z.number(),\n})\n\nexport type PluginUnitsConvertToResult = z.infer<typeof PluginUnitsConvertToResult>\n","import { PluginCoreApi } from \"./core\"\nimport { PluginEntityApi } from \"./entity\"\nimport { PluginToolsApi } from \"./tools\"\nimport { PluginUnitsApi } from \"./units\"\n\n/**\n * Root API surface for Snaptrude plugins.\n *\n * Access all plugin capabilities through the namespaced properties:\n *\n * - {@linkcode PluginApi.core} — Math and geometry primitives\n * - {@linkcode PluginApi.entity} — CRUD operations on Snaptrude entities (spaces, stories)\n * - {@linkcode PluginApi.tools} — Selection and transform tools\n * - {@linkcode PluginApi.units} — Unit conversion utilities\n */\nexport abstract class PluginApi {\n /** Core math and geometry primitives. See {@linkcode PluginCoreApi}. */\n public abstract core: PluginCoreApi\n /** Selection and transform tools. See {@linkcode PluginToolsApi}. */\n public abstract tools: PluginToolsApi\n /** CRUD operations on Snaptrude entities. See {@linkcode PluginEntityApi}. */\n public abstract entity: PluginEntityApi\n /** Unit conversion utilities. See {@linkcode PluginUnitsApi}. */\n public abstract units: PluginUnitsApi\n\n constructor() {}\n}\n\nexport * from \"./core\"\nexport * from \"./entity\"\nexport * from \"./tools\"\nexport * from \"./units\"\n"],"mappings":";AAAA,YAAY,OAAO;AAUZ,IAAe,gBAAf,MAA6B;AAAA,EAClC,cAAc;AAAA,EAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBf,IAAI,GAAW,GAAWA,KAAkB;AAC1C,WAAO,EAAE,GAAG,GAAG,GAAAA,IAAE;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,IAAI,GAAU,GAAiB;A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EAC/C,MAAM;AAAA,EACN,OAAS,WAAO;AAClB,CAAC;AAWM,IAAM,6BAA+B,WAAO;AAAA,EACjD,OAAS,WAAO;AAClB,CAAC;;;ACxIM,IAAe,YAAf,MAAyB;AAAA,EAU9B,cAAc;AAAA,EAAC;AACjB;","names":["z","z","z","z","z","z","z","z","z","z","z"]}
package/dist/types.d.ts CHANGED
@@ -1,9 +1,16 @@
1
1
  /**
2
- * A ComponentId is a unique identifier for a component in the scene.
2
+ * A unique identifier for a component in the Snaptrude scene.
3
+ *
4
+ * Component IDs are returned by entity creation methods (e.g.
5
+ * {@linkcode PluginSpaceApi.createRectangular}) and can be used with
6
+ * query and transform methods throughout the API.
3
7
  */
4
8
  export type ComponentId = string;
5
9
  /**
6
10
  * Return type for a plugin API method.
11
+ *
12
+ * Methods that require a host round-trip return `Promise<T>`,
13
+ * while pure local computations may return `T` directly.
7
14
  */
8
15
  export type PluginApiReturn<T> = Promise<T> | T;
9
16
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAA;AAEhC;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAA;AAEhC;;;;;GAKG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snaptrude/plugin-core",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,15 +1,64 @@
1
1
  import * as z from "zod"
2
2
  import { PVec3 } from "../math/vec3"
3
3
 
4
+ /**
5
+ * Arc construction.
6
+ *
7
+ * A {@linkcode PArc} represents a circular arc in 3D space, defined by
8
+ * start/end points, a centre, and a rotation axis. Arcs can be wrapped
9
+ * as a {@linkcode PCurve} and combined into a {@linkcode PProfile}.
10
+ *
11
+ * Accessed via `snaptrude.core.geom.arc`.
12
+ */
4
13
  export abstract class PluginArcApi {
5
14
  constructor() {}
6
15
 
7
- /** Create a new PArc from start, end, centre and axis. */
16
+ /**
17
+ * Create a new arc from start, end, centre, and axis.
18
+ *
19
+ * The arc sweeps from {@linkcode startPoint} to {@linkcode endPoint}
20
+ * along the circle centred at {@linkcode centrePoint}, in the
21
+ * direction determined by the right-hand rule around {@linkcode axis}.
22
+ *
23
+ * @param startPoint - The start point as a {@linkcode PVec3}
24
+ * @param endPoint - The end point as a {@linkcode PVec3}
25
+ * @param centrePoint - The centre of the arc's circle as a {@linkcode PVec3}
26
+ * @param axis - The arc's rotation axis as a {@linkcode PVec3}
27
+ * (perpendicular to the arc's plane)
28
+ * @returns A new {@linkcode PArc}
29
+ *
30
+ * # Example
31
+ * ```ts
32
+ * const { vec3 } = snaptrude.core.math
33
+ * const { arc } = snaptrude.core.geom
34
+ *
35
+ * // Quarter-circle arc on the XZ plane
36
+ * const a = arc.new(
37
+ * vec3.new(1, 0, 0), // start
38
+ * vec3.new(0, 0, 1), // end
39
+ * vec3.new(0, 0, 0), // centre
40
+ * vec3.new(0, 1, 0), // Y-up axis
41
+ * )
42
+ * ```
43
+ */
8
44
  new(startPoint: PVec3, endPoint: PVec3, centrePoint: PVec3, axis: PVec3): PArc {
9
45
  return { curveType: "Arc", startPoint, endPoint, centrePoint, axis }
10
46
  }
11
47
  }
12
48
 
49
+ /**
50
+ * A circular arc defined by start, end, centre, and axis.
51
+ *
52
+ * Discriminated by `curveType: "Arc"` within the {@linkcode PCurve} union.
53
+ *
54
+ * | Property | Type | Description |
55
+ * |---|---|---|
56
+ * | `curveType` | `"Arc"` | Discriminator tag |
57
+ * | `startPoint` | {@linkcode PVec3} | Start point of the arc |
58
+ * | `endPoint` | {@linkcode PVec3} | End point of the arc |
59
+ * | `centrePoint` | {@linkcode PVec3} | Centre of the arc's circle |
60
+ * | `axis` | {@linkcode PVec3} | Rotation axis (normal to the arc's plane) |
61
+ */
13
62
  export const PArc = z.object({
14
63
  curveType: z.literal("Arc"),
15
64
  startPoint: PVec3,
@@ -2,15 +2,40 @@ import * as z from "zod"
2
2
  import { PLine } from "./line"
3
3
  import { PArc } from "./arc"
4
4
 
5
+ /**
6
+ * Unified curve wrapper — either a {@linkcode PLine} or a {@linkcode PArc}.
7
+ *
8
+ * Use this to build heterogeneous curve lists (mixing lines and arcs)
9
+ * when constructing a {@linkcode PProfile}.
10
+ *
11
+ * Accessed via `snaptrude.core.geom.curve`.
12
+ */
5
13
  export abstract class PluginCurveApi {
6
14
  constructor() {}
7
15
 
8
- /** Create a PCurve from a PLine or PArc. */
16
+ /**
17
+ * Wrap a {@linkcode PLine} or {@linkcode PArc} as a {@linkcode PCurve}.
18
+ *
19
+ * This is an identity operation — it simply returns the input unchanged.
20
+ * It exists for type-level clarity when building mixed curve lists.
21
+ *
22
+ * @param curve - A {@linkcode PLine} or {@linkcode PArc} to wrap
23
+ * @returns The same value typed as {@linkcode PCurve}
24
+ */
9
25
  new(curve: PLine | PArc): PCurve {
10
26
  return curve
11
27
  }
12
28
  }
13
29
 
30
+ /**
31
+ * A discriminated union of {@linkcode PLine} and {@linkcode PArc}.
32
+ *
33
+ * Discriminated on the `curveType` field:
34
+ * - `"Line"` → {@linkcode PLine}
35
+ * - `"Arc"` → {@linkcode PArc}
36
+ *
37
+ * Use `curve.curveType` to narrow the type in a switch or if-statement.
38
+ */
14
39
  export const PCurve = z.discriminatedUnion("curveType", [PLine, PArc])
15
40
 
16
41
  export type PCurve = z.infer<typeof PCurve>
@@ -3,10 +3,26 @@ import { PluginArcApi } from "./arc"
3
3
  import { PluginCurveApi } from "./curve"
4
4
  import { PluginProfileApi } from "./profile"
5
5
 
6
+ /**
7
+ * Geometry primitives for constructing 2D/3D shapes.
8
+ *
9
+ * Build geometry bottom-up: points ({@linkcode PVec3}) → lines/arcs → curves → profiles.
10
+ * Profiles can then be used with entity creation methods like
11
+ * {@linkcode PluginSpaceApi.createFromProfile}.
12
+ *
13
+ * - {@linkcode PluginGeomApi.line} — Line segment construction
14
+ * - {@linkcode PluginGeomApi.arc} — Arc construction
15
+ * - {@linkcode PluginGeomApi.curve} — Unified curve wrapper (line or arc)
16
+ * - {@linkcode PluginGeomApi.profile} — Closed loop of curves
17
+ */
6
18
  export abstract class PluginGeomApi {
19
+ /** Line segment construction. See {@linkcode PluginLineApi}. */
7
20
  public abstract line: PluginLineApi
21
+ /** Arc construction. See {@linkcode PluginArcApi}. */
8
22
  public abstract arc: PluginArcApi
23
+ /** Unified curve wrapper. See {@linkcode PluginCurveApi}. */
9
24
  public abstract curve: PluginCurveApi
25
+ /** Closed profile (loop of curves). See {@linkcode PluginProfileApi}. */
10
26
  public abstract profile: PluginProfileApi
11
27
 
12
28
  constructor() {}
@@ -1,15 +1,49 @@
1
1
  import * as z from "zod"
2
2
  import { PVec3 } from "../math/vec3"
3
3
 
4
+ /**
5
+ * Line segment construction.
6
+ *
7
+ * A {@linkcode PLine} is the simplest curve primitive — a straight
8
+ * segment between two 3D points. Lines can be wrapped as a
9
+ * {@linkcode PCurve} and combined into a {@linkcode PProfile}.
10
+ *
11
+ * Accessed via `snaptrude.core.geom.line`.
12
+ */
4
13
  export abstract class PluginLineApi {
5
14
  constructor() {}
6
15
 
7
- /** Create a new PLine from start and end points. */
16
+ /**
17
+ * Create a new line segment between two points.
18
+ *
19
+ * @param startPoint - The start point as a {@linkcode PVec3}
20
+ * @param endPoint - The end point as a {@linkcode PVec3}
21
+ * @returns A new {@linkcode PLine}
22
+ *
23
+ * # Example
24
+ * ```ts
25
+ * const { vec3 } = snaptrude.core.math
26
+ * const { line } = snaptrude.core.geom
27
+ *
28
+ * const edge = line.new(vec3.new(0, 0, 0), vec3.new(5, 0, 0))
29
+ * ```
30
+ */
8
31
  new(startPoint: PVec3, endPoint: PVec3): PLine {
9
32
  return { curveType: "Line", startPoint, endPoint }
10
33
  }
11
34
  }
12
35
 
36
+ /**
37
+ * A line segment defined by a start and end point.
38
+ *
39
+ * Discriminated by `curveType: "Line"` within the {@linkcode PCurve} union.
40
+ *
41
+ * | Property | Type | Description |
42
+ * |---|---|---|
43
+ * | `curveType` | `"Line"` | Discriminator tag |
44
+ * | `startPoint` | {@linkcode PVec3} | Start point of the segment |
45
+ * | `endPoint` | {@linkcode PVec3} | End point of the segment |
46
+ */
13
47
  export const PLine = z.object({
14
48
  curveType: z.literal("Line"),
15
49
  startPoint: PVec3,
@@ -3,26 +3,90 @@ import { PluginApiReturn } from "../../../types"
3
3
  import { PVec3 } from "../math/vec3"
4
4
  import { PCurve } from "./curve"
5
5
 
6
+ /**
7
+ * Profile construction — a closed loop of {@linkcode PCurve}s.
8
+ *
9
+ * Profiles are the primary 2D shape primitive used for creating
10
+ * extruded entities like spaces. Build profiles either from an
11
+ * explicit list of curves or from a list of points (auto-connected
12
+ * with line segments).
13
+ *
14
+ * Accessed via `snaptrude.core.geom.profile`.
15
+ */
6
16
  export abstract class PluginProfileApi {
7
17
  constructor() {}
8
18
 
9
- /** Create a new PProfile from an array of PCurves. */
19
+ /**
20
+ * Create a profile from an ordered list of curves.
21
+ *
22
+ * The curves should form a closed loop — the end point of each curve
23
+ * should coincide with the start point of the next.
24
+ *
25
+ * @param curves - An ordered array of {@linkcode PCurve}s forming a closed loop
26
+ * @returns A new {@linkcode PProfile}
27
+ */
10
28
  new(curves: PCurve[]): PProfile {
11
29
  return { curves }
12
30
  }
13
31
 
14
- /** Create a PProfile from an array of points, connecting them with lines. */
32
+ /**
33
+ * Create a profile by connecting a list of points with line segments.
34
+ *
35
+ * The points are connected in order, with the last point automatically
36
+ * connected back to the first to close the loop.
37
+ *
38
+ * This is a **host API call** — it returns a `Promise`.
39
+ *
40
+ * @param args - An object containing:
41
+ * - {@linkcode PluginProfileFromLinePointsArgs.points args.points} — An ordered
42
+ * array of {@linkcode PVec3} forming the profile vertices
43
+ * @returns A {@linkcode PProfile} with line-segment curves connecting the points
44
+ *
45
+ * # Example
46
+ * ```ts
47
+ * const { vec3 } = snaptrude.core.math
48
+ *
49
+ * // Create an L-shaped profile
50
+ * const profile = await snaptrude.core.geom.profile.fromLinePoints({
51
+ * points: [
52
+ * vec3.new(0, 0, 0),
53
+ * vec3.new(10, 0, 0),
54
+ * vec3.new(10, 0, 5),
55
+ * vec3.new(5, 0, 5),
56
+ * vec3.new(5, 0, 10),
57
+ * vec3.new(0, 0, 10),
58
+ * ],
59
+ * })
60
+ * ```
61
+ */
15
62
  public abstract fromLinePoints(
16
63
  args: PluginProfileFromLinePointsArgs
17
64
  ): PluginApiReturn<PProfile>
18
65
  }
19
66
 
67
+ /**
68
+ * Arguments for {@linkcode PluginProfileApi.fromLinePoints}.
69
+ *
70
+ * | Property | Type | Description |
71
+ * |---|---|---|
72
+ * | `points` | {@linkcode PVec3}`[]` | Ordered vertices of the profile |
73
+ */
20
74
  export const PluginProfileFromLinePointsArgs = z.object({
21
75
  points: z.array(PVec3),
22
76
  })
23
77
 
24
78
  export type PluginProfileFromLinePointsArgs = z.infer<typeof PluginProfileFromLinePointsArgs>
25
79
 
80
+ /**
81
+ * A closed profile composed of an ordered list of curves.
82
+ *
83
+ * Profiles are used as input to entity creation methods like
84
+ * {@linkcode PluginSpaceApi.createFromProfile}.
85
+ *
86
+ * | Property | Type | Description |
87
+ * |---|---|---|
88
+ * | `curves` | {@linkcode PCurve}`[]` | Ordered curves forming a closed loop |
89
+ */
26
90
  export const PProfile = z.object({
27
91
  curves: z.array(PCurve),
28
92
  })
@@ -1,8 +1,16 @@
1
1
  import { PluginMathApi } from "./math"
2
2
  import { PluginGeomApi } from "./geom"
3
3
 
4
+ /**
5
+ * Core primitives used across the plugin API.
6
+ *
7
+ * - {@linkcode PluginCoreApi.math} — Vector and quaternion operations
8
+ * - {@linkcode PluginCoreApi.geom} — Geometry primitives (lines, arcs, curves, profiles)
9
+ */
4
10
  export abstract class PluginCoreApi {
11
+ /** Vector and quaternion math utilities. See {@linkcode PluginMathApi}. */
5
12
  public abstract math: PluginMathApi
13
+ /** Geometry primitives and constructors. See {@linkcode PluginGeomApi}. */
6
14
  public abstract geom: PluginGeomApi
7
15
 
8
16
  constructor() {}
@@ -1,8 +1,16 @@
1
1
  import { PluginVec3Api } from "./vec3"
2
2
  import { PluginQuatApi } from "./quat"
3
3
 
4
+ /**
5
+ * Math primitives for 3D vector and quaternion operations.
6
+ *
7
+ * - {@linkcode PluginMathApi.vec3} — 3D vector creation and arithmetic
8
+ * - {@linkcode PluginMathApi.quat} — Quaternion creation and rotation operations
9
+ */
4
10
  export abstract class PluginMathApi {
11
+ /** 3D vector operations. See {@linkcode PluginVec3Api}. */
5
12
  public abstract vec3: PluginVec3Api
13
+ /** Quaternion operations. See {@linkcode PluginQuatApi}. */
6
14
  public abstract quat: PluginQuatApi
7
15
 
8
16
  constructor() {}