@snaptrude/plugin-core 0.0.0-dev-20260921132444 → 0.0.0-surfaces-20260923052616
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.
- package/CHANGELOG.md +1 -1
- package/api-manifest.json +767 -31
- package/dist/api/core/geom/create/index.d.ts +924 -100
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/brep.d.ts +55 -1
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/geom/query/curve.d.ts +58 -35
- package/dist/api/core/geom/query/curve.d.ts.map +1 -1
- package/dist/api/core/geom/query/edge.d.ts +2 -2
- package/dist/api/core/geom/query/face.d.ts +105 -0
- package/dist/api/core/geom/query/face.d.ts.map +1 -1
- package/dist/api/core/geom/update/curve.d.ts +5 -5
- package/dist/api/core/geom/update/profile.d.ts +1 -1
- package/dist/api/design/create/grids.d.ts +2 -2
- package/dist/api/design/create/grids.d.ts.map +1 -1
- package/dist/api/design/family.d.ts +65 -8
- package/dist/api/design/family.d.ts.map +1 -1
- package/dist/api/design/query/geometry/index.d.ts +33 -5
- package/dist/api/design/query/geometry/index.d.ts.map +1 -1
- package/dist/api/design/query/grids.d.ts +4 -3
- package/dist/api/design/query/grids.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +47 -0
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/spaces.d.ts +5 -5
- package/dist/api/design/update/index.d.ts +87 -0
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +2 -2
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +5 -4
- package/dist/api/entity/space.d.ts.map +1 -1
- package/dist/api/entity/story.d.ts +4 -4
- package/dist/api/program/site.d.ts +4 -4
- package/dist/api/program/spreadsheet.d.ts +4 -4
- package/dist/handles.d.ts +12 -3
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +3413 -2943
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3366 -2943
- package/dist/index.js.map +1 -1
- package/dist/massParameters.d.ts +287 -0
- package/dist/massParameters.d.ts.map +1 -0
- package/dist/massParameters.ops.d.ts +137 -0
- package/dist/massParameters.ops.d.ts.map +1 -0
- package/package.json +13 -13
- package/src/api/core/geom/create/index.ts +1019 -101
- package/src/api/core/geom/query/brep.ts +56 -1
- package/src/api/core/geom/query/curve.ts +25 -2
- package/src/api/core/geom/query/edge.ts +2 -2
- package/src/api/core/geom/query/face.ts +109 -4
- package/src/api/design/family.ts +66 -8
- package/src/api/design/query/geometry/index.ts +35 -4
- package/src/api/design/query/index.ts +50 -0
- package/src/api/design/update/index.ts +94 -0
- package/src/handles.ts +15 -3
- package/src/index.ts +2 -0
- package/src/massParameters.ops.ts +245 -0
- package/src/massParameters.ts +427 -0
- package/test/massParameters.test.mjs +938 -0
|
@@ -48,6 +48,46 @@ export declare abstract class PluginGeomQueryFaceApi {
|
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
50
50
|
abstract getMaterialIndex(face: FaceHandle): PluginApiReturn<number>;
|
|
51
|
+
/**
|
|
52
|
+
* Read what KIND of surface a face lies on. This is the one read that tells a
|
|
53
|
+
* genuinely curved face from a faceted approximation of one: every face of a
|
|
54
|
+
* 200-triangle "dome" answers `"plane"`, while a real dome has faces
|
|
55
|
+
* answering `"sphere"`. Use it to confirm a curved solid actually came out
|
|
56
|
+
* curved.
|
|
57
|
+
*
|
|
58
|
+
* | Value | Surface |
|
|
59
|
+
* |---|---|
|
|
60
|
+
* | `"plane"` | Flat face |
|
|
61
|
+
* | `"cylinder"` | Cylindrical face — constant radius about an axis |
|
|
62
|
+
* | `"cone"` | Conical face — a tapered ring (a cone or frustum side) |
|
|
63
|
+
* | `"sphere"` | Spherical face |
|
|
64
|
+
* | `"torus"` | Toroidal face — the ring surface of a donut |
|
|
65
|
+
* | `"spline"` | Free-form NURBS face |
|
|
66
|
+
*
|
|
67
|
+
* Pure read: no geometry kernel is loaded.
|
|
68
|
+
*
|
|
69
|
+
* @param face The face to query
|
|
70
|
+
* @returns The surface kind (see the table), or `null` when the face carries
|
|
71
|
+
* no surface classification
|
|
72
|
+
*
|
|
73
|
+
* @examplePrompt Is this face flat or curved?
|
|
74
|
+
* @examplePrompt Check that this dome is a real sphere, not a faceted approximation
|
|
75
|
+
* @examplePrompt What kind of surface is this face?
|
|
76
|
+
* @examplePrompt How many curved faces does this mass have?
|
|
77
|
+
*
|
|
78
|
+
* # Example
|
|
79
|
+
* ```ts
|
|
80
|
+
* const [mass] = await snaptrude.design.query.listMasses()
|
|
81
|
+
* const brep = await snaptrude.design.query.geometry.getBrep(mass)
|
|
82
|
+
* if (brep) {
|
|
83
|
+
* const faces = await snaptrude.core.geom.query.brep.listFaces(brep)
|
|
84
|
+
* const kinds = []
|
|
85
|
+
* for (const face of faces) kinds.push(await snaptrude.core.geom.query.face.getSurfaceKind(face))
|
|
86
|
+
* console.log("spherical faces:", kinds.filter((k) => k === "sphere").length)
|
|
87
|
+
* }
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
abstract getSurfaceKind(face: FaceHandle): PluginApiReturn<"plane" | "cylinder" | "cone" | "sphere" | "torus" | "spline" | null>;
|
|
51
91
|
/**
|
|
52
92
|
* Get a seed half-edge of a face's outer loop.
|
|
53
93
|
* @param face The face to query
|
|
@@ -227,6 +267,54 @@ export declare abstract class PluginGeomQueryFaceApi {
|
|
|
227
267
|
* ```
|
|
228
268
|
*/
|
|
229
269
|
abstract listVertexPositions(face: FaceHandle, brep: BrepHandle): PluginApiReturn<Vec3Components[]>;
|
|
270
|
+
/**
|
|
271
|
+
* Exact surface area of one face of `brep`, in internal length units SQUARED —
|
|
272
|
+
* integrated off the face's own surface, not its facets, so a curved patch
|
|
273
|
+
* reads exactly rather than as its triangles. Needs the parent brep: a face
|
|
274
|
+
* handle cannot name its own solid.
|
|
275
|
+
* @param face The face to measure
|
|
276
|
+
* @param brep The parent brep (owner last, as in
|
|
277
|
+
* {@linkcode PluginGeomQueryFaceApi.listVertexPositions})
|
|
278
|
+
* @returns The area as a `number`
|
|
279
|
+
* @throws VALIDATION if `face` is not a face of `brep`
|
|
280
|
+
* @throws OPERATION_FAILED if the kernel could not measure the face
|
|
281
|
+
*
|
|
282
|
+
* @examplePrompt How big is this roof patch?
|
|
283
|
+
* @examplePrompt Which face of this mass has the largest area?
|
|
284
|
+
*
|
|
285
|
+
* # Example
|
|
286
|
+
* ```ts
|
|
287
|
+
* const [mass] = await snaptrude.design.query.listMasses()
|
|
288
|
+
* const brep = await snaptrude.design.query.geometry.getBrep(mass)
|
|
289
|
+
* if (brep) {
|
|
290
|
+
* const faces = await snaptrude.core.geom.query.brep.listFaces(brep)
|
|
291
|
+
* const areas = await Promise.all(
|
|
292
|
+
* faces.map((f) => snaptrude.core.geom.query.face.getArea(f, brep)),
|
|
293
|
+
* )
|
|
294
|
+
* }
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
297
|
+
abstract getArea(face: FaceHandle, brep: BrepHandle): PluginApiReturn<number>;
|
|
298
|
+
/**
|
|
299
|
+
* Centre of area of one face of `brep`, as a point in that brep's frame
|
|
300
|
+
* (internal length units). On a solid whose every face reads `"spline"` this
|
|
301
|
+
* is the read that tells two patches apart — the top of a thickened patch from
|
|
302
|
+
* its bottom, one quarter of a closed surface from the next.
|
|
303
|
+
* @param face The face to measure
|
|
304
|
+
* @param brep The parent brep (owner last)
|
|
305
|
+
* @returns The centroid as {@linkcode Vec3Components}
|
|
306
|
+
* @throws VALIDATION if `face` is not a face of `brep`
|
|
307
|
+
* @throws OPERATION_FAILED if the kernel could not measure the face
|
|
308
|
+
*
|
|
309
|
+
* @examplePrompt Where is the middle of this face?
|
|
310
|
+
* @examplePrompt Pick the topmost face of this curved mass
|
|
311
|
+
*
|
|
312
|
+
* # Example
|
|
313
|
+
* ```ts
|
|
314
|
+
* const centre = await snaptrude.core.geom.query.face.getCentroid(face, brep)
|
|
315
|
+
* ```
|
|
316
|
+
*/
|
|
317
|
+
abstract getCentroid(face: FaceHandle, brep: BrepHandle): PluginApiReturn<Vec3Components>;
|
|
230
318
|
/**
|
|
231
319
|
* List the tessellated boundary points of a face's outer loop (arcs sampled,
|
|
232
320
|
* sense-corrected). Not cardinality-equal to {@linkcode PluginGeomQueryFaceApi.listVertexPositions}.
|
|
@@ -276,6 +364,11 @@ export declare const PluginGeomQueryFaceGetMaterialIndexArgs: z.ZodObject<{
|
|
|
276
364
|
face: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"face">, string>>;
|
|
277
365
|
}, z.core.$strip>;
|
|
278
366
|
export type PluginGeomQueryFaceGetMaterialIndexArgs = z.infer<typeof PluginGeomQueryFaceGetMaterialIndexArgs>;
|
|
367
|
+
/** Arguments for {@linkcode PluginGeomQueryFaceApi.getSurfaceKind}. `{ face: FaceHandle }` */
|
|
368
|
+
export declare const PluginGeomQueryFaceGetSurfaceKindArgs: z.ZodObject<{
|
|
369
|
+
face: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"face">, string>>;
|
|
370
|
+
}, z.core.$strip>;
|
|
371
|
+
export type PluginGeomQueryFaceGetSurfaceKindArgs = z.infer<typeof PluginGeomQueryFaceGetSurfaceKindArgs>;
|
|
279
372
|
/** Arguments for {@linkcode PluginGeomQueryFaceApi.getHalfEdge}. `{ face: FaceHandle }` */
|
|
280
373
|
export declare const PluginGeomQueryFaceGetHalfEdgeArgs: z.ZodObject<{
|
|
281
374
|
face: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"face">, string>>;
|
|
@@ -350,6 +443,18 @@ export declare const PluginGeomQueryFaceListVertexPositionsArgs: z.ZodObject<{
|
|
|
350
443
|
brep: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"brep">, string>>;
|
|
351
444
|
}, z.core.$strip>;
|
|
352
445
|
export type PluginGeomQueryFaceListVertexPositionsArgs = z.infer<typeof PluginGeomQueryFaceListVertexPositionsArgs>;
|
|
446
|
+
/** Arguments for {@linkcode PluginGeomQueryFaceApi.getArea}. `{ face: FaceHandle, brep: BrepHandle }` */
|
|
447
|
+
export declare const PluginGeomQueryFaceGetAreaArgs: z.ZodObject<{
|
|
448
|
+
face: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"face">, string>>;
|
|
449
|
+
brep: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"brep">, string>>;
|
|
450
|
+
}, z.core.$strip>;
|
|
451
|
+
export type PluginGeomQueryFaceGetAreaArgs = z.infer<typeof PluginGeomQueryFaceGetAreaArgs>;
|
|
452
|
+
/** Arguments for {@linkcode PluginGeomQueryFaceApi.getCentroid}. `{ face: FaceHandle, brep: BrepHandle }` */
|
|
453
|
+
export declare const PluginGeomQueryFaceGetCentroidArgs: z.ZodObject<{
|
|
454
|
+
face: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"face">, string>>;
|
|
455
|
+
brep: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"brep">, string>>;
|
|
456
|
+
}, z.core.$strip>;
|
|
457
|
+
export type PluginGeomQueryFaceGetCentroidArgs = z.infer<typeof PluginGeomQueryFaceGetCentroidArgs>;
|
|
353
458
|
/** Arguments for {@linkcode PluginGeomQueryFaceApi.listVertexPositionsWithCurves}. `{ face: FaceHandle }` */
|
|
354
459
|
export declare const PluginGeomQueryFaceListVertexPositionsWithCurvesArgs: z.ZodObject<{
|
|
355
460
|
face: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"face">, string>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"face.d.ts","sourceRoot":"","sources":["../../../../../src/api/core/geom/query/face.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,cAAc,EACf,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;;;;;;GAYG;AACH,8BAAsB,sBAAsB;;IAG1C;;;;;;;;;;;;;;OAcG;aACa,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC;IAEnE;;;;;;;;;;;;;;OAcG;aACa,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC;IAE3E;;;;;;;;;;;;;;;;;OAiBG;aACa,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,eAAe,CAAC,cAAc,GAAG,IAAI,CAAC;IAErF;;;;;;;;;;;;;;OAcG;aACa,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,eAAe,CAAC,UAAU,EAAE,CAAC;IAE1E;;;;;;;;;;;;;;OAcG;aACa,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,eAAe,CAAC,cAAc,EAAE,CAAC;IAElF;;;;;;;;;;;;;;OAcG;aACa,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,eAAe,CAAC,YAAY,EAAE,CAAC;IAE/E;;;;;;;;;;;;;;;OAeG;aACa,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,eAAe,CAAC,cAAc,EAAE,CAAC;IAE9E;;;;;;;;;;;;;;OAcG;aACa,YAAY,CAAC,IAAI,EAAE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MAAM,8BAA8B;;;iBAAkB,CAAA;AAC7D,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AAE3F,6GAA6G;AAC7G,eAAO,MAAM,kCAAkC;;;iBAAkB,CAAA;AACjE,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAEnG,6GAA6G;AAC7G,eAAO,MAAM,oDAAoD;;iBAAU,CAAA;AAC3E,MAAM,MAAM,oDAAoD,GAAG,CAAC,CAAC,KAAK,CACxE,OAAO,oDAAoD,CAC5D,CAAA;AAED,iGAAiG;AACjG,eAAO,MAAM,wCAAwC;;iBAAU,CAAA;AAC/D,MAAM,MAAM,wCAAwC,GAAG,CAAC,CAAC,KAAK,CAC5D,OAAO,wCAAwC,CAChD,CAAA"}
|
|
@@ -120,7 +120,7 @@ export declare abstract class PluginGeomUpdateCurveApi {
|
|
|
120
120
|
* | `fromStart` | `boolean` | Extend from the start end when `true`, otherwise from the end |
|
|
121
121
|
*/
|
|
122
122
|
export declare const PluginGeomUpdateCurveExtendArgs: z.ZodObject<{
|
|
123
|
-
curve: z.
|
|
123
|
+
curve: z.ZodType<CurveHandle, unknown, z.core.$ZodTypeInternals<CurveHandle, unknown>>;
|
|
124
124
|
distance: z.ZodNumber;
|
|
125
125
|
fromStart: z.ZodBoolean;
|
|
126
126
|
}, z.core.$strip>;
|
|
@@ -134,7 +134,7 @@ export type PluginGeomUpdateCurveExtendArgs = z.infer<typeof PluginGeomUpdateCur
|
|
|
134
134
|
* | `point` | {@linkcode Vec3Handle} | Point on the curve to split at |
|
|
135
135
|
*/
|
|
136
136
|
export declare const PluginGeomUpdateCurveSplitArgs: z.ZodObject<{
|
|
137
|
-
curve: z.
|
|
137
|
+
curve: z.ZodType<CurveHandle, unknown, z.core.$ZodTypeInternals<CurveHandle, unknown>>;
|
|
138
138
|
point: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>;
|
|
139
139
|
}, z.core.$strip>;
|
|
140
140
|
export type PluginGeomUpdateCurveSplitArgs = z.infer<typeof PluginGeomUpdateCurveSplitArgs>;
|
|
@@ -148,7 +148,7 @@ export type PluginGeomUpdateCurveSplitArgs = z.infer<typeof PluginGeomUpdateCurv
|
|
|
148
148
|
* | `endParam` | `number` | End parameter of the portion to keep |
|
|
149
149
|
*/
|
|
150
150
|
export declare const PluginGeomUpdateCurveTrimArgs: z.ZodObject<{
|
|
151
|
-
curve: z.
|
|
151
|
+
curve: z.ZodType<CurveHandle, unknown, z.core.$ZodTypeInternals<CurveHandle, unknown>>;
|
|
152
152
|
startParam: z.ZodNumber;
|
|
153
153
|
endParam: z.ZodNumber;
|
|
154
154
|
}, z.core.$strip>;
|
|
@@ -162,7 +162,7 @@ export type PluginGeomUpdateCurveTrimArgs = z.infer<typeof PluginGeomUpdateCurve
|
|
|
162
162
|
* | `vector` | {@linkcode Vec3Handle} | Translation vector to offset the curve by |
|
|
163
163
|
*/
|
|
164
164
|
export declare const PluginGeomUpdateCurveOffsetArgs: z.ZodObject<{
|
|
165
|
-
curve: z.
|
|
165
|
+
curve: z.ZodType<CurveHandle, unknown, z.core.$ZodTypeInternals<CurveHandle, unknown>>;
|
|
166
166
|
vector: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>;
|
|
167
167
|
}, z.core.$strip>;
|
|
168
168
|
export type PluginGeomUpdateCurveOffsetArgs = z.infer<typeof PluginGeomUpdateCurveOffsetArgs>;
|
|
@@ -174,7 +174,7 @@ export type PluginGeomUpdateCurveOffsetArgs = z.infer<typeof PluginGeomUpdateCur
|
|
|
174
174
|
* | `curve` | {@linkcode CurveHandle} | The curve to reverse |
|
|
175
175
|
*/
|
|
176
176
|
export declare const PluginGeomUpdateCurveReverseArgs: z.ZodObject<{
|
|
177
|
-
curve: z.
|
|
177
|
+
curve: z.ZodType<CurveHandle, unknown, z.core.$ZodTypeInternals<CurveHandle, unknown>>;
|
|
178
178
|
}, z.core.$strip>;
|
|
179
179
|
export type PluginGeomUpdateCurveReverseArgs = z.infer<typeof PluginGeomUpdateCurveReverseArgs>;
|
|
180
180
|
//# sourceMappingURL=curve.d.ts.map
|
|
@@ -281,7 +281,7 @@ export type PluginGeomUpdateProfileMirrorArgs = z.infer<typeof PluginGeomUpdateP
|
|
|
281
281
|
*/
|
|
282
282
|
export declare const PluginGeomUpdateProfileAddArgs: z.ZodObject<{
|
|
283
283
|
profile: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"profile">, string>>;
|
|
284
|
-
curve: z.
|
|
284
|
+
curve: z.ZodType<CurveHandle, unknown, z.core.$ZodTypeInternals<CurveHandle, unknown>>;
|
|
285
285
|
position: z.ZodOptional<z.ZodEnum<{
|
|
286
286
|
start: "start";
|
|
287
287
|
end: "end";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { ComponentHandle } from "../../../handles";
|
|
2
|
+
import { ComponentHandle, CurveHandle } from "../../../handles";
|
|
3
3
|
/**
|
|
4
4
|
* Grid line style (mirrors the engine `LineMode` values verbatim — the same
|
|
5
5
|
* vocabulary as {@linkcode PluginReferenceLineStyle}).
|
|
@@ -76,7 +76,7 @@ export type PluginDesignCreateGridArgs = z.infer<typeof PluginDesignCreateGridAr
|
|
|
76
76
|
* | …style | {@linkcode PluginGridStyleOptions} | Optional line styling |
|
|
77
77
|
*/
|
|
78
78
|
export declare const PluginDesignCreateGridFromCurveArgs: z.ZodObject<{
|
|
79
|
-
curve: z.
|
|
79
|
+
curve: z.ZodType<CurveHandle, unknown, z.core.$ZodTypeInternals<CurveHandle, unknown>>;
|
|
80
80
|
tag: z.ZodOptional<z.ZodString>;
|
|
81
81
|
style: z.ZodOptional<z.ZodEnum<{
|
|
82
82
|
SOLID: "SOLID";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grids.d.ts","sourceRoot":"","sources":["../../../../src/api/design/create/grids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"grids.d.ts","sourceRoot":"","sources":["../../../../src/api/design/create/grids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAA;AAM3E;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;EAA0C,CAAA;AAC1E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;iBASjC,CAAA;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAM3E;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;iBASP,CAAA;AAChC,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAMnF;;;;;;;;GAQG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;iBAKhB,CAAA;AAChC,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAMD;;;;;;;;;GASG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;iBAMlB,CAAA;AAChC,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,qCAAqC,CAC7C,CAAA;AAMD;;;;;;;;GAQG;AACH,eAAO,MAAM,sCAAsC;;;;iBAIjD,CAAA;AACF,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,sCAAsC,CAC9C,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { PluginApiReturn } from "../../types";
|
|
3
|
-
import { ComponentHandle } from "../../handles";
|
|
3
|
+
import { BrepHandle, ComponentHandle } from "../../handles";
|
|
4
4
|
/**
|
|
5
5
|
* `snaptrude.design.family.*` — author NATIVE parametric families from a JSON spec.
|
|
6
6
|
*
|
|
@@ -17,15 +17,21 @@ import { ComponentHandle } from "../../handles";
|
|
|
17
17
|
* getReference() read the spec DSL once — grammar, ops, expressions, example
|
|
18
18
|
* prepare({ bundle }) validate + compile + show a live ghost; nothing committed
|
|
19
19
|
* flex({ values }) re-run at new values; returns the geometry delta
|
|
20
|
-
* place() arm placement — the USER clicks to drop it
|
|
21
20
|
* create({ name }) commit it to the project's family library
|
|
21
|
+
* place() put it in the model — at `position`, or the USER clicks
|
|
22
22
|
* ```
|
|
23
23
|
*
|
|
24
|
+
* `create` comes BEFORE `place`: `place` refuses a draft that was never
|
|
25
|
+
* created (`VALIDATION`), because an instance of a family that is not in the
|
|
26
|
+
* library cannot be reloaded.
|
|
27
|
+
*
|
|
24
28
|
* ## Read getReference() first
|
|
25
29
|
*
|
|
26
30
|
* The spec DSL is a closed expression language with its own op set, coordinate
|
|
27
|
-
* convention (**+Y up, Snaptrude units** — the scene's own unit, 1 SU = 254 mm
|
|
28
|
-
*
|
|
31
|
+
* convention (**+Y up, Snaptrude units** — the scene's own unit, 1 SU = 254 mm,
|
|
32
|
+
* the same unit `core.units.getBabylonType()` names and every geometry API
|
|
33
|
+
* takes; literals inside spec expressions may carry a unit suffix such as
|
|
34
|
+
* `600mm` or `2ft`)
|
|
29
35
|
* and part-naming law. It is deliberately NOT duplicated in these types:
|
|
30
36
|
* {@linkcode PluginDesignFamilyApi.getReference} returns the whole reference,
|
|
31
37
|
* generated from a family that is actually registered in the host, so the
|
|
@@ -40,6 +46,18 @@ import { ComponentHandle } from "../../handles";
|
|
|
40
46
|
* leaves the previous good draft standing, so it costs nothing but the node you
|
|
41
47
|
* broke. Re-authoring from scratch throws away everything already correct.
|
|
42
48
|
*
|
|
49
|
+
* ## Curved parts are exact
|
|
50
|
+
*
|
|
51
|
+
* A part whose sketch has a curved edge — any `revolve`, or an `extrude` /
|
|
52
|
+
* `sweep` / `loft` with an arc or circle in its profile (or an arc in a sweep
|
|
53
|
+
* path) — is built by the exact geometry kernel, the same one behind curved
|
|
54
|
+
* masses. Straight-edged parts keep the fast mesh builder. `getParameters` on a
|
|
55
|
+
* placed component reports which built each part in `parts[].engine`, and a
|
|
56
|
+
* kernel part carries a `brep`: read it with `core.geom.query.brep.*` and
|
|
57
|
+
* `core.geom.query.face.getSurfaceKind` — the same face-kind check as for a
|
|
58
|
+
* curved mass. If the kernel is unavailable a part falls back to the mesh
|
|
59
|
+
* builder (`engine: "mesh"`) rather than failing the family.
|
|
60
|
+
*
|
|
43
61
|
* Accessed via `snaptrude.design.family`.
|
|
44
62
|
*/
|
|
45
63
|
export declare abstract class PluginDesignFamilyApi {
|
|
@@ -65,20 +83,25 @@ export declare abstract class PluginDesignFamilyApi {
|
|
|
65
83
|
abstract getReference(): PluginApiReturn<PluginFamilyReference>;
|
|
66
84
|
/**
|
|
67
85
|
* Validate, compile and preview a family spec. Nothing is committed to the
|
|
68
|
-
* model or the library — call {@linkcode PluginDesignFamilyApi.
|
|
69
|
-
* {@linkcode PluginDesignFamilyApi.
|
|
86
|
+
* model or the library — call {@linkcode PluginDesignFamilyApi.create} to save
|
|
87
|
+
* it, then {@linkcode PluginDesignFamilyApi.place} to put it in the model.
|
|
70
88
|
*
|
|
71
89
|
* Safe to call repeatedly while iterating. On success, check `partCount` and
|
|
72
90
|
* `bbox` against what you intended before treating the family as correct — a
|
|
73
91
|
* facade that built 3 parts, or a 3 m screen reporting 40 m of height, is a
|
|
74
92
|
* visible bug the validator cannot catch.
|
|
75
93
|
*
|
|
94
|
+
* Lengths — the spec's bare numbers, `bbox`, the sheet's `length` values — are
|
|
95
|
+
* Snaptrude units: the same 254 mm unit as the kernel's internal (`"babylon"`)
|
|
96
|
+
* unit. A unit suffix (`600mm`) is legal only inside a spec expression.
|
|
97
|
+
*
|
|
76
98
|
* @param args The spec bundle, as `{ bundle }` or `{ spec }`
|
|
77
99
|
* @returns Build report, or `{ ok: false, errors }` with JSON-pointer paths
|
|
78
100
|
*
|
|
79
101
|
* @examplePrompt Make a louvre screen with adjustable blade count and tilt
|
|
80
102
|
* @examplePrompt Design a curtain wall panel family with 8 bays
|
|
81
103
|
* @examplePrompt Create a railing family I can adjust
|
|
104
|
+
* @examplePrompt Make a pendant lamp family with a domed shade I can resize
|
|
82
105
|
*
|
|
83
106
|
* # Example
|
|
84
107
|
* ```ts
|
|
@@ -136,6 +159,10 @@ export declare abstract class PluginDesignFamilyApi {
|
|
|
136
159
|
* Put a family into the model — either the prepared draft or any family from
|
|
137
160
|
* {@linkcode PluginDesignFamilyApi.list}.
|
|
138
161
|
*
|
|
162
|
+
* The prepared draft must be saved with {@linkcode PluginDesignFamilyApi.create}
|
|
163
|
+
* first: placing a draft that was never created throws `VALIDATION`, because
|
|
164
|
+
* its instances could not be reloaded.
|
|
165
|
+
*
|
|
139
166
|
* Two modes, chosen by whether you pass `position`:
|
|
140
167
|
*
|
|
141
168
|
* **With `position`** the component is created there and then, undoably. Use
|
|
@@ -181,6 +208,9 @@ export declare abstract class PluginDesignFamilyApi {
|
|
|
181
208
|
* label the user says, and a Revit-imported family carries parameters that
|
|
182
209
|
* do not drive geometry at all.
|
|
183
210
|
*
|
|
211
|
+
* `length` values are Snaptrude units: the same 254 mm unit as the kernel's
|
|
212
|
+
* internal (`"babylon"`) unit — convert with `core.units.convert` to report.
|
|
213
|
+
*
|
|
184
214
|
* @param args The component to read
|
|
185
215
|
* @returns Its definition, current values, and the parameter sheet
|
|
186
216
|
*
|
|
@@ -203,6 +233,11 @@ export declare abstract class PluginDesignFamilyApi {
|
|
|
203
233
|
* that does not is accepted and stored (it round-trips to Revit) but nothing
|
|
204
234
|
* visible happens — say so rather than claiming a change the user cannot see.
|
|
205
235
|
*
|
|
236
|
+
* `length` values are Snaptrude units: the same 254 mm unit as the kernel's
|
|
237
|
+
* internal (`"babylon"`) unit — convert the user's number with
|
|
238
|
+
* `core.units.convert` first; a bare `400` is 400 SU, not 400 mm. Kernel part
|
|
239
|
+
* breps read before the edit are stale: re-read `getParameters`.
|
|
240
|
+
*
|
|
206
241
|
* @param args The component and the values to change
|
|
207
242
|
* @returns The values now in effect
|
|
208
243
|
*
|
|
@@ -217,7 +252,9 @@ export declare abstract class PluginDesignFamilyApi {
|
|
|
217
252
|
abstract setParameters(args: PluginDesignFamilySetParametersArgs): PluginApiReturn<PluginFamilyInstanceParameters>;
|
|
218
253
|
/**
|
|
219
254
|
* Commit the prepared bundle to the project's parametric-definition library,
|
|
220
|
-
* so it survives the session and appears in the Families panel.
|
|
255
|
+
* so it survives the session and appears in the Families panel. Call it
|
|
256
|
+
* BEFORE {@linkcode PluginDesignFamilyApi.place} — only a created family can
|
|
257
|
+
* be placed; `place()` without `id` then places the saved family.
|
|
221
258
|
*
|
|
222
259
|
* @param args Optional library name and team scope
|
|
223
260
|
* @returns The catalogued definition's id and version
|
|
@@ -262,7 +299,7 @@ export interface PluginFamilyParameter {
|
|
|
262
299
|
key: string;
|
|
263
300
|
label: string;
|
|
264
301
|
type: "length" | "integer" | "enum" | "text" | "boolean";
|
|
265
|
-
/** Current value. `length
|
|
302
|
+
/** Current value. `length` (Snaptrude units) and `integer` are numbers; the rest are strings. */
|
|
266
303
|
value: string | number;
|
|
267
304
|
default: string | number;
|
|
268
305
|
/**
|
|
@@ -286,6 +323,24 @@ export interface PluginFamilyDiagnostic {
|
|
|
286
323
|
message: string;
|
|
287
324
|
hint?: string;
|
|
288
325
|
}
|
|
326
|
+
/**
|
|
327
|
+
* One placed part and which engine built it, from `getParameters`. `"kernel"` —
|
|
328
|
+
* a curved sketch built exactly; `"mesh"` — straight-edged, or the kernel
|
|
329
|
+
* fallback.
|
|
330
|
+
*/
|
|
331
|
+
export interface PluginFamilyPart {
|
|
332
|
+
name: string;
|
|
333
|
+
engine: "kernel" | "mesh";
|
|
334
|
+
/**
|
|
335
|
+
* Kernel parts only: the part's exact solid, for `core.geom.query.brep.*` /
|
|
336
|
+
* `core.geom.query.face.getSurfaceKind`. READ-ONLY and PART-LOCAL — in the
|
|
337
|
+
* part's own frame, not where the component sits, so never pass it to a
|
|
338
|
+
* boolean or `design.create.massFromBrep` (a family changes only through
|
|
339
|
+
* `setParameters`). Valid until the next parameter change: re-read
|
|
340
|
+
* `getParameters` after `setParameters`.
|
|
341
|
+
*/
|
|
342
|
+
brep?: BrepHandle;
|
|
343
|
+
}
|
|
289
344
|
/** What `prepare` reports. */
|
|
290
345
|
export interface PluginFamilyPrepareResult {
|
|
291
346
|
/** `false` means the spec was rejected — read `errors`, fix, re-prepare. */
|
|
@@ -382,6 +437,8 @@ export interface PluginFamilyInstanceParameters {
|
|
|
382
437
|
values: Record<string, number | string>;
|
|
383
438
|
/** The sheet: what each key means, its bounds, and whether it moves geometry. */
|
|
384
439
|
parameters: PluginFamilyParameter[];
|
|
440
|
+
/** The placed parts; kernel parts carry their exact `brep`. */
|
|
441
|
+
parts?: PluginFamilyPart[];
|
|
385
442
|
/** Present when `getParameters` was asked for a `snapshot`. */
|
|
386
443
|
snapshot?: PluginFamilySnapshot;
|
|
387
444
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"family.d.ts","sourceRoot":"","sources":["../../../src/api/design/family.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAkB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"family.d.ts","sourceRoot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,0BAA0B;;;;;;;;;;;iBAGrC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEnF;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B;;;iBAGvC,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEvF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;iBAOtC,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAErF;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;iBAI9C,CAAA;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC;;;iBAG9C,CAAA;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA"}
|
|
@@ -13,8 +13,8 @@ import { ComponentHandle, BrepHandle, ContourHandle, CurveHandle } from "../../.
|
|
|
13
13
|
* {@linkcode PluginDesignQueryGeometryApi.getCenterline} mints a
|
|
14
14
|
* {@linkcode CurveHandle} for a wall's core curve.
|
|
15
15
|
* {@linkcode PluginDesignQueryGeometryApi.getTriangulatedMeshes} is the
|
|
16
|
-
* handle-free exception: it returns the triangulated render
|
|
17
|
-
* world-space arrays.
|
|
16
|
+
* handle-free exception: it returns `{ meshes }` — the triangulated render
|
|
17
|
+
* meshes as plain world-space arrays, wrapped in an object, never bare.
|
|
18
18
|
*
|
|
19
19
|
* Returned handles are session-ephemeral and go stale on undo/redo/re-topologize
|
|
20
20
|
* — re-fetch a fresh one after edits.
|
|
@@ -27,10 +27,26 @@ export declare abstract class PluginDesignQueryGeometryApi {
|
|
|
27
27
|
* scene entity, as a reusable {@linkcode BrepHandle} for the
|
|
28
28
|
* `core.geom.query.brep.*` reads.
|
|
29
29
|
*
|
|
30
|
+
* **Frame.** By default the brep comes back in the component's own LOCAL frame
|
|
31
|
+
* (its vertices are relative to the mesh origin, exactly as stored). This is
|
|
32
|
+
* the long-standing default, and existing callers rely on it. Pass
|
|
33
|
+
* `{ frame: "world" }` to get the same solid placed where it sits in the
|
|
34
|
+
* scene (world coordinates, like
|
|
35
|
+
* `getBottomContour` / `getTriangulatedMeshes` and every `design.query.measure`
|
|
36
|
+
* read). Use `"world"` whenever the handle will be COMBINED with other scene
|
|
37
|
+
* geometry or committed back beside its source: booleans between two scene
|
|
38
|
+
* masses, `brepFromFillet` / `brepFromShell` / `brepFromOffset` /
|
|
39
|
+
* `brepFromChamfer` on a scene mass followed by `massFromBrep`, or comparing
|
|
40
|
+
* its vertices with a bounding box. A world-frame handle from a parametrically
|
|
41
|
+
* live mass also carries that mass's recipe, so an operation result keeps an
|
|
42
|
+
* editable record.
|
|
43
|
+
*
|
|
30
44
|
* @param component - The scene component to read
|
|
31
|
-
* @
|
|
45
|
+
* @param options - `frame`: `"local"` (default, mesh-local coordinates) or `"world"` (scene coordinates)
|
|
46
|
+
* @returns The brep as a {@linkcode BrepHandle}, or `null` if the component has no brep geometry — also `null` for a parametric family: read `design.family.getParameters({ component }).parts[].brep`
|
|
32
47
|
*
|
|
33
48
|
* @examplePrompt Get the 3D solid geometry of the selected wall
|
|
49
|
+
* @examplePrompt Round the top rim of this column and put it back where it is
|
|
34
50
|
* @examplePrompt How many faces does this mass have?
|
|
35
51
|
* @examplePrompt Inspect the mesh of this slab so I can look at its faces and edges
|
|
36
52
|
* @examplePrompt Read the vertices of the selected column's geometry
|
|
@@ -41,9 +57,14 @@ export declare abstract class PluginDesignQueryGeometryApi {
|
|
|
41
57
|
* if (brep) {
|
|
42
58
|
* const faces = await snaptrude.core.geom.query.brep.listFaces(brep)
|
|
43
59
|
* }
|
|
60
|
+
*
|
|
61
|
+
* // Operate on a scene mass and commit the result where the mass sits:
|
|
62
|
+
* const placed = await snaptrude.design.query.geometry.getBrep(mass, { frame: "world" })
|
|
63
|
+
* const rounded = await snaptrude.core.geom.create.brepFromFillet(placed, edges, 0.2)
|
|
64
|
+
* await snaptrude.design.create.massFromBrep(rounded, "Rounded")
|
|
44
65
|
* ```
|
|
45
66
|
*/
|
|
46
|
-
abstract getBrep(component: ComponentHandle): PluginApiReturn<BrepHandle | null>;
|
|
67
|
+
abstract getBrep(component: ComponentHandle, options?: PluginDesignQueryGeometryGetBrepOptions): PluginApiReturn<BrepHandle | null>;
|
|
47
68
|
/**
|
|
48
69
|
* Get the **bottom-face contour** of a component — the footprint outline (outer
|
|
49
70
|
* profile + holes) of its lowest horizontal face, as a reusable
|
|
@@ -110,7 +131,8 @@ export declare abstract class PluginDesignQueryGeometryApi {
|
|
|
110
131
|
* Get the **triangulated render meshes** of scene components as plain,
|
|
111
132
|
* serializable arrays — flat world-space vertex `positions` (`[x0, y0, z0,
|
|
112
133
|
* x1, …]`) and triangle `indices` (three per triangle), one record per
|
|
113
|
-
* requested component.
|
|
134
|
+
* requested component. The result is `{ meshes }`, not a bare array —
|
|
135
|
+
* destructure it before iterating.
|
|
114
136
|
*
|
|
115
137
|
* Unlike the other `geometry.*` reads this does NOT mint kernel handles — the
|
|
116
138
|
* raw arrays cross the boundary directly, ready for export, custom analysis,
|
|
@@ -169,8 +191,14 @@ export declare abstract class PluginDesignQueryGeometryApi {
|
|
|
169
191
|
* |---|---|---|
|
|
170
192
|
* | `component` | {@linkcode ComponentHandle} | The scene component to read |
|
|
171
193
|
*/
|
|
194
|
+
/** Options for {@linkcode PluginDesignQueryGeometryApi.getBrep}: `frame` defaults to `"local"`. */
|
|
195
|
+
export type PluginDesignQueryGeometryGetBrepOptions = {
|
|
196
|
+
frame?: "local" | "world";
|
|
197
|
+
};
|
|
198
|
+
export declare const PluginDesignQueryGeometryGetBrepOptions: z.ZodType<PluginDesignQueryGeometryGetBrepOptions, PluginDesignQueryGeometryGetBrepOptions>;
|
|
172
199
|
export declare const PluginDesignQueryGeometryGetBrepArgs: z.ZodObject<{
|
|
173
200
|
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
201
|
+
options: z.ZodOptional<z.ZodType<PluginDesignQueryGeometryGetBrepOptions, PluginDesignQueryGeometryGetBrepOptions, z.core.$ZodTypeInternals<PluginDesignQueryGeometryGetBrepOptions, PluginDesignQueryGeometryGetBrepOptions>>>;
|
|
174
202
|
}, z.core.$strip>;
|
|
175
203
|
export type PluginDesignQueryGeometryGetBrepArgs = z.infer<typeof PluginDesignQueryGeometryGetBrepArgs>;
|
|
176
204
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/design/query/geometry/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACZ,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;;;;;;;;;;;GAiBG;AACH,8BAAsB,4BAA4B;;IAGhD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/design/query/geometry/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,eAAe,EACf,UAAU,EACV,aAAa,EACb,WAAW,EACZ,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;;;;;;;;;;;GAiBG;AACH,8BAAsB,4BAA4B;;IAGhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;aACa,OAAO,CACrB,SAAS,EAAE,eAAe,EAC1B,OA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AM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;;;;;;;GAQG;AACH,eAAO,MAAM,kDAAkD;;;;;;iBAQ7D,CAAA;AAEF,MAAM,MAAM,kDAAkD,GAAG,CAAC,CAAC,KAAK,CACtE,OAAO,kDAAkD,CAC1D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oDAAoD;;;;;;;;iBAE/D,CAAA;AAEF,MAAM,MAAM,oDAAoD,GAAG,CAAC,CAAC,KAAK,CACxE,OAAO,oDAAoD,CAC5D,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { PluginApiReturn } from "../../../types";
|
|
3
|
+
import { CurveHandle } from "../../../handles";
|
|
3
4
|
/**
|
|
4
5
|
* Visual properties of grid lines — the group's defaults and any per-line
|
|
5
6
|
* overrides share this shape (values mirror the engine's `GridLineProps`).
|
|
@@ -36,7 +37,7 @@ export type PluginGridLineProps = z.infer<typeof PluginGridLineProps>;
|
|
|
36
37
|
* | `overrides` | `Partial<`{@linkcode PluginGridLineProps}`>`? | This line's raw overrides, when any exist |
|
|
37
38
|
*/
|
|
38
39
|
export declare const PluginGridLineRecord: z.ZodObject<{
|
|
39
|
-
curve: z.
|
|
40
|
+
curve: z.ZodType<CurveHandle, unknown, z.core.$ZodTypeInternals<CurveHandle, unknown>>;
|
|
40
41
|
tag: z.ZodString;
|
|
41
42
|
visible: z.ZodBoolean;
|
|
42
43
|
props: z.ZodObject<{
|
|
@@ -84,7 +85,7 @@ export declare const PluginGridWingRecord: z.ZodObject<{
|
|
|
84
85
|
max: z.ZodNumber;
|
|
85
86
|
}, z.core.$strip>>;
|
|
86
87
|
lines: z.ZodArray<z.ZodObject<{
|
|
87
|
-
curve: z.
|
|
88
|
+
curve: z.ZodType<CurveHandle, unknown, z.core.$ZodTypeInternals<CurveHandle, unknown>>;
|
|
88
89
|
tag: z.ZodString;
|
|
89
90
|
visible: z.ZodBoolean;
|
|
90
91
|
props: z.ZodObject<{
|
|
@@ -192,7 +193,7 @@ export declare const PluginGridGetResult: z.ZodObject<{
|
|
|
192
193
|
max: z.ZodNumber;
|
|
193
194
|
}, z.core.$strip>>;
|
|
194
195
|
lines: z.ZodArray<z.ZodObject<{
|
|
195
|
-
curve: z.
|
|
196
|
+
curve: z.ZodType<CurveHandle, unknown, z.core.$ZodTypeInternals<CurveHandle, unknown>>;
|
|
196
197
|
tag: z.ZodString;
|
|
197
198
|
visible: z.ZodBoolean;
|
|
198
199
|
props: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grids.d.ts","sourceRoot":"","sources":["../../../../src/api/design/query/grids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"grids.d.ts","sourceRoot":"","sources":["../../../../src/api/design/query/grids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAA;AAO9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;iBAM9B,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAErE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAM/B,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK/B,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;iBAGrC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAMnF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB;;;;;;EAMhC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;iBAG5B,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEjE;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQpB,CAAA;AACZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAMrE;;;;;;;;;;;;;;GAcG;AACH,8BAAsB,yBAAyB;;IAG7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;aACa,GAAG,CACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,EAAE,GAClD,eAAe,CAAC,mBAAmB,CAAC;CACxC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { PluginApiReturn } from "../../../types";
|
|
3
3
|
import { ComponentHandle, BBoxComponents } from "../../../handles";
|
|
4
|
+
import type { MassParametersRecord } from "../../../massParameters";
|
|
4
5
|
import { PluginDesignQueryGeometryApi } from "./geometry";
|
|
5
6
|
import { PluginDesignQuerySpacesApi } from "./spaces";
|
|
6
7
|
import { PluginDesignQueryReferenceLinesApi } from "./referenceLines";
|
|
@@ -1154,6 +1155,52 @@ export declare abstract class PluginDesignQueryApi {
|
|
|
1154
1155
|
* ```
|
|
1155
1156
|
*/
|
|
1156
1157
|
abstract getStaircaseParams(staircase: ComponentHandle): PluginApiReturn<PluginStaircaseParams | null>;
|
|
1158
|
+
/**
|
|
1159
|
+
* Read a mass's creation-parameter record — the recipe it was built from
|
|
1160
|
+
* (`kind` plus the values that constructor was called with). Present on
|
|
1161
|
+
* masses committed from a `core.geom.create` brep constructor that carries a
|
|
1162
|
+
* recipe: {@linkcode MassParametersRecord} covers the four primitives
|
|
1163
|
+
* (sphere, cylinder, cone, torus), extrusions, revolutions, lofts and sweeps.
|
|
1164
|
+
*
|
|
1165
|
+
* A fillet, chamfer, shell or offset of a recorded solid keeps the record
|
|
1166
|
+
* too: `kind` stays the base constructor and the operation is appended to the
|
|
1167
|
+
* record's `operations` list. Edit any of it with `design.update.parameters`.
|
|
1168
|
+
*
|
|
1169
|
+
* `null` for everything else — drawn masses, imported geometry, booleans,
|
|
1170
|
+
* split parts, `brepFromFaces` / `brepFromMesh`, and results built on a
|
|
1171
|
+
* source that carried no record — and for a mass whose record no longer
|
|
1172
|
+
* matches what is on
|
|
1173
|
+
* screen (a later free-form edit dropped the recipe, or the mass carries a
|
|
1174
|
+
* baked scale). `null` too when the recipe was not recordable: the record
|
|
1175
|
+
* schema has its own caps (a sweep path of at most 512 points, a loft of at
|
|
1176
|
+
* most 32 sections, at most 8 chained `operations`, at most 256 curves in one
|
|
1177
|
+
* profile loop and 64 holes in one contour), and a mass built past one of
|
|
1178
|
+
* them — through a route that does not enforce the matching creator cap —
|
|
1179
|
+
* commits as ordinary geometry carrying no record. The `operations` cap is
|
|
1180
|
+
* the one an agent can walk into by accident: a 9th chained
|
|
1181
|
+
* fillet/chamfer/shell/offset drops the record silently, so the result
|
|
1182
|
+
* commits as ordinary geometry and reads back `null` here. A record is never
|
|
1183
|
+
* reported unless it is still the truth.
|
|
1184
|
+
*
|
|
1185
|
+
* Points and axes come back in **world** coordinates. Pure read — nothing is
|
|
1186
|
+
* created or modified.
|
|
1187
|
+
*
|
|
1188
|
+
* @param component - the mass's {@linkcode ComponentHandle}
|
|
1189
|
+
* @returns the {@linkcode MassParametersRecord}, or `null`
|
|
1190
|
+
*
|
|
1191
|
+
* @examplePrompt What radius is this sphere?
|
|
1192
|
+
* @examplePrompt Is this mass parametric?
|
|
1193
|
+
* @examplePrompt Read back the dome's creation parameters
|
|
1194
|
+
* @examplePrompt How tall was this cylinder made?
|
|
1195
|
+
*
|
|
1196
|
+
* # Example
|
|
1197
|
+
* ```ts
|
|
1198
|
+
* const [mass] = await snaptrude.design.query.listMasses({ isSelected: true })
|
|
1199
|
+
* const params = await snaptrude.design.query.getParameters(mass)
|
|
1200
|
+
* if (params?.kind === "sphere") console.log("radius:", params.values.radius)
|
|
1201
|
+
* ```
|
|
1202
|
+
*/
|
|
1203
|
+
abstract getParameters(component: ComponentHandle): PluginApiReturn<MassParametersRecord | null>;
|
|
1157
1204
|
/**
|
|
1158
1205
|
* Get the **union** axis-aligned bounding box enclosing a set of entities.
|
|
1159
1206
|
*
|