@snaptrude/plugin-core 0.0.0-dev-20260911064951 → 0.0.0-surfaces-20260921090636

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 (79) hide show
  1. package/CHANGELOG.md +0 -25
  2. package/api-manifest.json +151 -12
  3. package/dist/api/core/geom/create/index.d.ts +918 -93
  4. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  5. package/dist/api/core/geom/query/brep.d.ts +50 -0
  6. package/dist/api/core/geom/query/brep.d.ts.map +1 -1
  7. package/dist/api/core/geom/query/curve.d.ts +58 -35
  8. package/dist/api/core/geom/query/curve.d.ts.map +1 -1
  9. package/dist/api/core/geom/query/edge.d.ts +2 -2
  10. package/dist/api/core/geom/query/face.d.ts +105 -0
  11. package/dist/api/core/geom/query/face.d.ts.map +1 -1
  12. package/dist/api/core/geom/update/curve.d.ts +5 -5
  13. package/dist/api/core/geom/update/profile.d.ts +1 -1
  14. package/dist/api/core/io/import/index.d.ts +1 -3
  15. package/dist/api/core/io/import/index.d.ts.map +1 -1
  16. package/dist/api/design/create/index.d.ts +22 -310
  17. package/dist/api/design/create/index.d.ts.map +1 -1
  18. package/dist/api/design/delete/index.d.ts +0 -4
  19. package/dist/api/design/delete/index.d.ts.map +1 -1
  20. package/dist/api/design/doors/index.d.ts +13 -20
  21. package/dist/api/design/doors/index.d.ts.map +1 -1
  22. package/dist/api/design/index.d.ts +0 -5
  23. package/dist/api/design/index.d.ts.map +1 -1
  24. package/dist/api/design/query/geometry/index.d.ts +27 -1
  25. package/dist/api/design/query/geometry/index.d.ts.map +1 -1
  26. package/dist/api/design/query/index.d.ts +47 -0
  27. package/dist/api/design/query/index.d.ts.map +1 -1
  28. package/dist/api/design/query/spaces.d.ts +5 -5
  29. package/dist/api/design/update/index.d.ts +87 -0
  30. package/dist/api/design/update/index.d.ts.map +1 -1
  31. package/dist/api/entity/referenceLine.d.ts +2 -2
  32. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  33. package/dist/api/entity/space.d.ts +5 -4
  34. package/dist/api/entity/space.d.ts.map +1 -1
  35. package/dist/api/entity/story.d.ts +4 -4
  36. package/dist/api/presentation/annotate.d.ts +2 -2
  37. package/dist/api/presentation/shapes.d.ts +2 -2
  38. package/dist/api/program/site.d.ts +4 -4
  39. package/dist/api/program/spreadsheet.d.ts +4 -4
  40. package/dist/handles.d.ts +12 -22
  41. package/dist/handles.d.ts.map +1 -1
  42. package/dist/index.cjs +2773 -2445
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.d.ts +2 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +2726 -2422
  47. package/dist/index.js.map +1 -1
  48. package/dist/massParameters.d.ts +280 -0
  49. package/dist/massParameters.d.ts.map +1 -0
  50. package/dist/massParameters.ops.d.ts +135 -0
  51. package/dist/massParameters.ops.d.ts.map +1 -0
  52. package/package.json +1 -1
  53. package/src/api/core/geom/create/index.ts +1011 -94
  54. package/src/api/core/geom/query/brep.ts +51 -0
  55. package/src/api/core/geom/query/curve.ts +25 -2
  56. package/src/api/core/geom/query/edge.ts +2 -2
  57. package/src/api/core/geom/query/face.ts +109 -4
  58. package/src/api/core/io/import/index.ts +3 -11
  59. package/src/api/design/create/index.ts +38 -335
  60. package/src/api/design/delete/index.ts +0 -4
  61. package/src/api/design/doors/index.ts +13 -20
  62. package/src/api/design/index.ts +0 -5
  63. package/src/api/design/query/geometry/index.ts +29 -0
  64. package/src/api/design/query/index.ts +50 -0
  65. package/src/api/design/update/index.ts +94 -0
  66. package/src/handles.ts +15 -27
  67. package/src/index.ts +2 -0
  68. package/src/massParameters.ops.ts +243 -0
  69. package/src/massParameters.ts +418 -0
  70. package/test/massParameters.test.mjs +936 -0
  71. package/dist/api/design/create/bulk-items.d.ts +0 -185
  72. package/dist/api/design/create/bulk-items.d.ts.map +0 -1
  73. package/dist/api/design/create/opening-fields.d.ts +0 -37
  74. package/dist/api/design/create/opening-fields.d.ts.map +0 -1
  75. package/dist/api/design/dimensions.d.ts +0 -427
  76. package/dist/api/design/dimensions.d.ts.map +0 -1
  77. package/src/api/design/create/bulk-items.ts +0 -186
  78. package/src/api/design/create/opening-fields.ts +0 -37
  79. package/src/api/design/dimensions.ts +0 -453
@@ -0,0 +1,280 @@
1
+ import * as z from "zod";
2
+ import { OperationRecord, ParameterPatchValue } from "./massParameters.ops";
3
+ export * from "./massParameters.ops";
4
+ /**
5
+ * Mass **creation-parameter records** — the recipe a parametric mass was built
6
+ * from, shared verbatim by plugin-core, the Snaptrude host, and the agent
7
+ * runtime (one schema, three repos — no hand-mirrored DTOs).
8
+ *
9
+ * A record is present on a mass committed from a `core.geom.create` brep
10
+ * constructor that carries a recipe (the four primitives, extrusion,
11
+ * revolution, loft, sweep). A fillet, chamfer, shell or offset of a **recorded**
12
+ * solid keeps the record: `kind` stays the base constructor and the step is
13
+ * appended to the record's `operations` list (see {@linkcode OperationRecord}).
14
+ * The record is absent — `null` — for everything
15
+ * else: drawn masses, imported geometry, booleans, split parts,
16
+ * `brepFromFaces`/`brepFromMesh`, and any operation on a solid that carried no
17
+ * record. Geometry there is not a pure function of a legible parameter set, and
18
+ * a record must never be a lie.
19
+ *
20
+ * Read one with `design.query.getParameters`.
21
+ *
22
+ * Everything here is **pure JSON** by construction — plain objects, numbers and
23
+ * arrays only, one `{x, y, z}` point shape everywhere (no tuples, no class
24
+ * instances): records are persisted by enumerable-field reflection, cloned with
25
+ * `structuredClone`, and round-tripped through the collaboration wire.
26
+ */
27
+ /** A point in space. The single point shape used across every record. */
28
+ export type XYZ = {
29
+ x: number;
30
+ y: number;
31
+ z: number;
32
+ };
33
+ /**
34
+ * One boundary curve of a profile record.
35
+ *
36
+ * The two spline forms are either/or, never both: a curve authored through
37
+ * points carries `splineThrough` (patch the points and the fit re-runs), and a
38
+ * curve with no through-point provenance — read back off an edge, or authored
39
+ * from control vertices — carries `splinePoles` and is re-minted verbatim.
40
+ * There is no variant holding both, so a `throughPoints` edit can never leave
41
+ * stale poles behind.
42
+ */
43
+ export type CurveRecord = {
44
+ type: "line";
45
+ start: XYZ;
46
+ end: XYZ;
47
+ } | {
48
+ type: "arc";
49
+ start: XYZ;
50
+ end: XYZ;
51
+ centre: XYZ;
52
+ axis: XYZ;
53
+ } | {
54
+ type: "circle";
55
+ centre: XYZ;
56
+ axis: XYZ;
57
+ radius: number;
58
+ }
59
+ /** Authored via splineFromPoints / profileFromSplinePoints. The through-points
60
+ * ARE the recipe; regeneration re-runs the versioned fit (fitVersion).
61
+ * Chained runs in one contour re-fit as ONE loop; use splinePoles to keep tangents. */
62
+ | {
63
+ type: "splineThrough";
64
+ fitVersion: 1;
65
+ throughPoints: XYZ[];
66
+ }
67
+ /** No through-point provenance (authored from CVs, or read back off an edge).
68
+ * Regenerable verbatim — re-mint the curve from these exact data. */
69
+ | {
70
+ type: "splinePoles";
71
+ degree: number;
72
+ knots: number[];
73
+ mults: number[];
74
+ poles: XYZ[];
75
+ };
76
+ /** A closed boundary loop, as an ordered list of curves. */
77
+ export type ProfileRecord = {
78
+ curves: CurveRecord[];
79
+ };
80
+ /** An outer loop plus its holes — the cross-section shape of a recipe. */
81
+ export type ContourRecord = {
82
+ outer: ProfileRecord;
83
+ holes: ProfileRecord[];
84
+ };
85
+ /** Optional loft behaviour switches, mirroring `core.geom.create.brepFromLoft`. */
86
+ export type LoftOptions = {
87
+ compatibility?: "strict" | "auto";
88
+ seamAlignment?: "authored" | "auto";
89
+ /** `"ruled"` (default) keeps the straight-sided lane: every pair of sections
90
+ * joined by flat sides. `"smooth"` lofts every section in ONE pass, so the
91
+ * sides curve continuously through the intermediates. */
92
+ smoothing?: "ruled" | "smooth";
93
+ };
94
+ /**
95
+ * How a swept profile turns along its path, mirroring
96
+ * `core.geom.create.brepFromSweepAlongCurve`. `"upright"` keeps the profile's up
97
+ * aligned with world up, `"frenet"` lets it roll with the path's curvature, and
98
+ * `"fixed"` carries the authored frame along unchanged.
99
+ */
100
+ export type SweepOrientation = "frenet" | "fixed" | "upright";
101
+ /** Optional sweep-along-a-curve switches. Pure JSON: the creator's own bag also
102
+ * takes a `rail` curve, which is a live handle and never reaches a record. */
103
+ export type SweepAlongCurveRecordOptions = {
104
+ orientation?: SweepOrientation;
105
+ };
106
+ /** Optional sweep scale law and corner transition, mirroring `core.geom.create.brepFromSweep`. */
107
+ export type SweepOptions = {
108
+ startScale?: number;
109
+ endScale?: number;
110
+ scales?: number[];
111
+ transition?: "miter" | "round" | {
112
+ bevel: number;
113
+ };
114
+ };
115
+ /** A face's surface kind — the vocabulary of `core.geom.query.face.getSurfaceKind`. */
116
+ export type SurfaceKind = "plane" | "cylinder" | "cone" | "sphere" | "torus" | "spline";
117
+ /** An edge's curve kind. Both spline forms of {@linkcode CurveRecord} report `"spline"`. */
118
+ export type CurveKind = "line" | "arc" | "circle" | "spline";
119
+ /**
120
+ * A mass's creation recipe: the constructor `kind`, a schema `version`, the
121
+ * `values` that constructor was called with, and the kernel `operations`
122
+ * (fillet / chamfer / shell / offset) applied on top, in order. Points and axes
123
+ * are in the mass's own local frame when stored; `design.query.getParameters`
124
+ * returns them in world coordinates. `operations` is frame-free. One variant
125
+ * per constructor `kind`; its `values` are that constructor's own arguments.
126
+ *
127
+ * `kind` stays the base constructor even after operations: a shelled, filleted
128
+ * sphere is still `{ kind: "sphere", operations: [shell, fillet] }`.
129
+ */
130
+ export type MassParametersRecord = {
131
+ kind: "sphere";
132
+ version: 1;
133
+ values: {
134
+ centre: XYZ;
135
+ radius: number;
136
+ };
137
+ operations?: OperationRecord[];
138
+ } | {
139
+ kind: "cylinder";
140
+ version: 1;
141
+ values: {
142
+ base: XYZ;
143
+ axis: XYZ;
144
+ radius: number;
145
+ height: number;
146
+ };
147
+ operations?: OperationRecord[];
148
+ } | {
149
+ kind: "cone";
150
+ version: 1;
151
+ values: {
152
+ base: XYZ;
153
+ axis: XYZ;
154
+ baseRadius: number;
155
+ topRadius: number;
156
+ height: number;
157
+ };
158
+ operations?: OperationRecord[];
159
+ } | {
160
+ kind: "torus";
161
+ version: 1;
162
+ values: {
163
+ centre: XYZ;
164
+ axis: XYZ;
165
+ majorRadius: number;
166
+ minorRadius: number;
167
+ };
168
+ operations?: OperationRecord[];
169
+ } | {
170
+ kind: "extrusion";
171
+ version: 1;
172
+ values: {
173
+ contour: ContourRecord;
174
+ direction: XYZ;
175
+ amount: number;
176
+ /** Total rotation base → top about `direction`, through the base
177
+ * contour's centroid, in DEGREES — an angle, never converted. Absent
178
+ * or 0 is a straight extrusion. */
179
+ twistInDegrees?: number;
180
+ /** Top outline scale about the same axis, a ratio — never converted.
181
+ * Absent or 1 is a straight extrusion. */
182
+ topScale?: number;
183
+ /** How many sections the twist/taper was built from, a count (2..64).
184
+ * Resolved and stamped at create time, so an existing mass regenerates
185
+ * from the record and never from a heuristic that may change. Absent
186
+ * exactly when the mass is neither twisted nor tapered. */
187
+ levels?: number;
188
+ };
189
+ operations?: OperationRecord[];
190
+ } | {
191
+ kind: "revolution";
192
+ version: 1;
193
+ values: {
194
+ contour: ContourRecord;
195
+ axisOrigin: XYZ;
196
+ axisDirection: XYZ;
197
+ angleInDegrees: number;
198
+ };
199
+ operations?: OperationRecord[];
200
+ } | {
201
+ kind: "loft";
202
+ version: 1;
203
+ values: {
204
+ sections: ContourRecord[];
205
+ options?: LoftOptions;
206
+ };
207
+ operations?: OperationRecord[];
208
+ } | {
209
+ kind: "sweep";
210
+ version: 1;
211
+ values: {
212
+ profile: ContourRecord;
213
+ path: XYZ[];
214
+ options?: SweepOptions;
215
+ };
216
+ operations?: OperationRecord[];
217
+ } | {
218
+ kind: "sweepAlongCurve";
219
+ version: 1;
220
+ values: {
221
+ profile: ContourRecord;
222
+ path: CurveRecord[];
223
+ options?: SweepAlongCurveRecordOptions;
224
+ };
225
+ operations?: OperationRecord[];
226
+ };
227
+ /**
228
+ * The argument of `design.update.parameters`: either a **partial** of a
229
+ * record's `values` (plus an optional `operations` list) — keys you leave out
230
+ * stay as they are — or the **whole record** you read from
231
+ * `design.query.getParameters`, edited. `kind` and `version` are immutable.
232
+ */
233
+ export type MassParametersPatch = MassParametersRecord | Record<string, ParameterPatchValue>;
234
+ /** Maximum through-points in one authored spline curve record. */
235
+ export declare const MAX_SPLINE_THROUGH_POINTS = 256;
236
+ /** Maximum control points in one exact-NURBS spline curve record. */
237
+ export declare const MAX_SPLINE_POLES = 512;
238
+ /** Maximum path points in a sweep record. */
239
+ export declare const MAX_SWEEP_PATH_POINTS = 512;
240
+ /** Maximum path curves in a sweep-along-a-curve record. */
241
+ export declare const MAX_PATH_CURVES = 64;
242
+ /** Maximum cross-sections in a loft record. */
243
+ export declare const MAX_LOFT_SECTIONS = 32;
244
+ /** Maximum sections a twisted or tapered extrusion record is built from. */
245
+ export declare const MAX_TWIST_LEVELS = 64;
246
+ /** Maximum boundary curves in one profile loop record. */
247
+ export declare const MAX_PROFILE_CURVES = 256;
248
+ /** Maximum hole loops in one contour record. */
249
+ export declare const MAX_CONTOUR_HOLES = 64;
250
+ /** A point in space — `{ x, y, z }`, all finite. */
251
+ export declare const XYZ: z.ZodType<XYZ, XYZ>;
252
+ /** One boundary curve of a profile record. See {@linkcode CurveRecord}. */
253
+ export declare const CurveRecord: z.ZodType<CurveRecord, CurveRecord>;
254
+ /** A closed boundary loop. See {@linkcode ProfileRecord}. */
255
+ export declare const ProfileRecord: z.ZodType<ProfileRecord, ProfileRecord>;
256
+ /** An outer loop plus its holes. See {@linkcode ContourRecord}. */
257
+ export declare const ContourRecord: z.ZodType<ContourRecord, ContourRecord>;
258
+ /** Optional loft behaviour switches. See {@linkcode LoftOptions}. */
259
+ export declare const LoftOptions: z.ZodType<LoftOptions, LoftOptions>;
260
+ /** See {@linkcode SweepAlongCurveRecordOptions}. */
261
+ export declare const SweepAlongCurveRecordOptions: z.ZodType<SweepAlongCurveRecordOptions, SweepAlongCurveRecordOptions>;
262
+ /** Optional sweep scale law and corner transition. See {@linkcode SweepOptions}. */
263
+ export declare const SweepOptions: z.ZodType<SweepOptions, SweepOptions>;
264
+ /**
265
+ * A mass's creation recipe. See {@linkcode MassParametersRecord}.
266
+ *
267
+ * `version` is a literal `1`: a restore that reads an unknown version fails
268
+ * `safeParse` and the mass degrades to non-parametric — editability is lost,
269
+ * geometry never is, and load is never blocked. Future versions add a migration
270
+ * at the restore site.
271
+ */
272
+ export declare const MassParametersRecord: z.ZodType<MassParametersRecord, MassParametersRecord>;
273
+ /**
274
+ * The argument of `design.update.parameters`. See {@linkcode MassParametersPatch}.
275
+ * The full-record form is recognised by carrying both `kind` and `values`;
276
+ * which keys a kind actually has is checked host-side, where the error can name
277
+ * them.
278
+ */
279
+ export declare const MassParametersPatch: z.ZodType<MassParametersPatch, MassParametersPatch>;
280
+ //# sourceMappingURL=massParameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"massParameters.d.ts","sourceRoot":"","sources":["../src/massParameters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAkB,eAAe,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAK3F,cAAc,sBAAsB,CAAA;AAEpC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,yEAAyE;AACzE,MAAM,MAAM,GAAG,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAErD;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC;IAAC,GAAG,EAAE,GAAG,CAAC;IAAC,MAAM,EAAE,GAAG,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MA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E,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAI1D,CAAA;AAEF,oDAAoD;AACpD,eAAO,MAAM,4BAA4B,EAAE,CAAC,CAAC,OAAO,CAClD,4BAA4B,EAC5B,4BAA4B,CAG5B,CAAA;AAEF,oFAAoF;AACpF,eAAO,MAAM,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,YAAY,CAW7D,CAAA;AAWF;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,EAAE,oBAAoB,CA8FrF,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,EAAE,mBAAmB,CAGlF,CAAA"}
@@ -0,0 +1,135 @@
1
+ import * as z from "zod";
2
+ import { ContourRecord, CurveRecord, LoftOptions, SweepAlongCurveRecordOptions, SweepOptions, XYZ } from "./massParameters";
3
+ import type { CurveKind, SurfaceKind } from "./massParameters";
4
+ /**
5
+ * The **operation half** of a mass creation-parameter record: which edge or
6
+ * face of the recipe's solid a kernel step used, the step itself, and the
7
+ * values a `design.update.parameters` patch may carry.
8
+ *
9
+ * Split out of `massParameters.ts` — same contract, same repos, one module each
10
+ * so either can be read whole — and re-exported from it and from the package
11
+ * root, so every import path keeps working.
12
+ *
13
+ * Everything here is **pure JSON** by construction, exactly as in
14
+ * {@linkcode MassParametersRecord}: plain objects, numbers and arrays only, one
15
+ * `{x, y, z}` point shape, no class instances.
16
+ */
17
+ /** Maximum kernel operations chained onto one recipe. */
18
+ export declare const MAX_OPERATIONS = 8;
19
+ /** Maximum edges one fillet/chamfer operation may select. */
20
+ export declare const MAX_OPERATION_EDGES = 64;
21
+ /** Maximum faces one shell operation may open. */
22
+ export declare const MAX_OPERATION_FACES = 32;
23
+ /** Maximum rows in a variable-fillet radius law. */
24
+ export declare const MAX_FILLET_LAW_SAMPLES = 32;
25
+ /**
26
+ * Which EDGE of the input solid an operation used: its index in
27
+ * `core.geom.query.brep.listEdges` order at authoring time, the indices of the
28
+ * two faces it lies between, and its curve kind. This is topology, not
29
+ * coordinates — it survives a scalar edit of the base recipe (which moves every
30
+ * edge) and trips on a reorder or a topology change. Read-only: to blend a
31
+ * different edge, re-select it on the new shape and re-apply the operation.
32
+ */
33
+ export type EdgeSelector = {
34
+ index: number;
35
+ faces: [number, number];
36
+ curve: CurveKind;
37
+ /** Where the edge sits INSIDE its solid: its midpoint in the record's own
38
+ * frame, divided by the solid's bounding-box extent — a ratio per axis,
39
+ * never a length, so it survives a scalar edit that scales the whole shape.
40
+ * Written only when the discriminators above cannot tell two edges apart. A
41
+ * tiebreak, never a coordinate fingerprint: a replay checks it within 0.02 of
42
+ * the solid's own box and refuses on a miss — it never searches for a better
43
+ * candidate. */
44
+ at?: XYZ;
45
+ };
46
+ /**
47
+ * Which FACE of the input solid an operation used: its index in
48
+ * `core.geom.query.brep.listFaces` order, its surface kind, and the number of
49
+ * edges in its outer loop. Read-only, like {@linkcode EdgeSelector}.
50
+ */
51
+ export type FaceSelector = {
52
+ index: number;
53
+ kind: SurfaceKind;
54
+ edgeCount: number;
55
+ /** The face's centroid under the same normalisation and the same tiebreak
56
+ * rule as {@linkcode EdgeSelector}'s `at` — written only where the
57
+ * discriminators above cannot separate two faces, which on a freeform solid
58
+ * (every face answers `"spline"`) is the common case. */
59
+ at?: XYZ;
60
+ };
61
+ /** The input solid's topology at authoring time — the counts a replay checks first. */
62
+ export type TopologyCounts = {
63
+ faceCount: number;
64
+ edgeCount: number;
65
+ };
66
+ /**
67
+ * One kernel operation applied to the base recipe's solid, in order. `input`
68
+ * pins the topology the operation was authored against, so a base edit that
69
+ * changes the topology is refused rather than mis-applied.
70
+ *
71
+ * Edit one by patching the whole list back:
72
+ * `design.update.parameters(mass, { operations })`.
73
+ */
74
+ export type OperationRecord = {
75
+ op: "fillet";
76
+ edges: EdgeSelector[];
77
+ radius: number;
78
+ /** Radius at the far end of the blend contour, internal length units — a
79
+ * linear variable blend from `radius`. One edge, and never with `radii`. */
80
+ endRadius?: number;
81
+ /** The blend's radius law instead: `position` is normalised arc length
82
+ * along the blend contour (a ratio 0..1, never converted), `radius` is
83
+ * internal length units. 2..32 rows, strictly increasing `position`.
84
+ * One edge, and never with `endRadius`. */
85
+ radii?: {
86
+ position: number;
87
+ radius: number;
88
+ }[];
89
+ input: TopologyCounts;
90
+ } | {
91
+ op: "chamfer";
92
+ edges: EdgeSelector[];
93
+ distance: number;
94
+ input: TopologyCounts;
95
+ } | {
96
+ op: "shell";
97
+ openFaces: FaceSelector[];
98
+ thickness: number;
99
+ input: TopologyCounts;
100
+ } | {
101
+ op: "offset";
102
+ distance: number;
103
+ input: TopologyCounts;
104
+ };
105
+ /**
106
+ * One value of a `MassParametersPatch` — whatever a record's `values` key (or
107
+ * `operations`) may hold. Scalars and points merge by key; every array form
108
+ * replaces the list whole.
109
+ */
110
+ export type ParameterPatchValue = number | XYZ | XYZ[] | ContourRecord | ContourRecord[] | CurveRecord[] | LoftOptions | SweepOptions | SweepAlongCurveRecordOptions | OperationRecord[];
111
+ /** See {@linkcode EdgeSelector}. */
112
+ export declare const EdgeSelector: z.ZodType<EdgeSelector, EdgeSelector>;
113
+ /** See {@linkcode FaceSelector}. */
114
+ export declare const FaceSelector: z.ZodType<FaceSelector, FaceSelector>;
115
+ /** See {@linkcode TopologyCounts}. */
116
+ export declare const TopologyCounts: z.ZodType<TopologyCounts, TopologyCounts>;
117
+ /**
118
+ * See {@linkcode OperationRecord}.
119
+ *
120
+ * A variable fillet — `endRadius` or `radii` — names ONE edge: the law is a
121
+ * property of the blend contour that edge belongs to, and `position` is measured
122
+ * from that edge's start, so a second edge would have no origin. The two forms
123
+ * are mutually exclusive and `radii` rows run strictly forward.
124
+ */
125
+ export declare const OperationRecord: z.ZodType<OperationRecord, OperationRecord>;
126
+ /**
127
+ * One value of a parameter patch. See {@linkcode ParameterPatchValue}.
128
+ *
129
+ * Deliberately a CLOSED union of the shapes a record's `values` actually hold —
130
+ * no `z.unknown()`, nothing recursive: an unrecognised value is a VALIDATION at
131
+ * the wire, not a silent write of nonsense onto a mass. It only ever widens, so
132
+ * every value it accepted before it still accepts.
133
+ */
134
+ export declare const ParameterPatchValue: z.ZodType<ParameterPatchValue, ParameterPatchValue>;
135
+ //# sourceMappingURL=massParameters.ops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"massParameters.ops.d.ts","sourceRoot":"","sources":["../src/massParameters.ops.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EACL,aAAa,EACb,WAAW,EACX,WAAW,EAIX,4BAA4B,EAC5B,YAAY,EACZ,GAAG,EACJ,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9D;;;;;;;;;;;;GAYG;AAEH,yDAAyD;AACzD,eAAO,MAAM,cAAc,IAAI,CAAA;AAC/B,6DAA6D;AAC7D,eAAO,MAAM,mBAAmB,KAAK,CAAA;AACrC,kDAAkD;AAClD,eAAO,MAAM,mBAAmB,KAAK,CAAA;AACrC,oDAAoD;AACpD,eAAO,MAAM,sBAAsB,KAAK,CAAA;AAQxC;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvB,KAAK,EAAE,SAAS,CAAA;IAChB;;;;;;qBAMiB;IACjB,EAAE,CAAC,EAAE,GAAG,CAAA;CACT,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,WAAW,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB;;;8DAG0D;IAC1D,EAAE,CAAC,EAAE,GAAG,CAAA;CACT,CAAA;AAED,uFAAuF;AACv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EF,sCAAsC;AACtC,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAGnE,CAAA;AAQF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,eAAe,CAqDpE,CAAA;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,EAAE,mBAAmB,CAanF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snaptrude/plugin-core",
3
- "version": "0.0.0-dev-20260911064951",
3
+ "version": "0.0.0-surfaces-20260921090636",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",