@snaptrude/plugin-core 0.9.13 → 0.9.14-networks-20261001.1
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 +39 -0
- package/dist/api/core/geom/create/index.d.ts +935 -100
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/brep.d.ts +59 -2
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/geom/query/curve.d.ts +59 -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/contour.d.ts +2 -0
- package/dist/api/core/geom/update/contour.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 +3 -1
- package/dist/api/core/geom/update/profile.d.ts.map +1 -1
- package/dist/api/core/handles/index.d.ts +4 -2
- package/dist/api/core/handles/index.d.ts.map +1 -1
- package/dist/api/design/create/grids.d.ts +1 -1
- package/dist/api/design/family.d.ts +145 -10
- package/dist/api/design/family.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +6 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/networks.d.ts +530 -0
- package/dist/api/design/networks.d.ts.map +1 -0
- 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 +3 -3
- 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 +99 -0
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +1 -1
- package/dist/api/entity/space.d.ts +4 -4
- package/dist/api/entity/story.d.ts +4 -4
- package/dist/api/presentation/aiInspiration.d.ts +5 -5
- package/dist/api/program/site.d.ts +4 -4
- package/dist/api/program/spreadsheet.d.ts +4 -4
- package/dist/handles.d.ts +13 -3
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +3656 -2950
- 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 +3591 -2950
- 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 +138 -0
- package/dist/massParameters.ops.d.ts.map +1 -0
- package/package.json +2 -1
- package/scripts/check-dist-fresh.mjs +22 -0
- package/src/api/core/geom/create/index.ts +1030 -101
- package/src/api/core/geom/query/brep.ts +60 -2
- package/src/api/core/geom/query/curve.ts +26 -2
- package/src/api/core/geom/query/edge.ts +2 -2
- package/src/api/core/geom/query/face.ts +109 -4
- package/src/api/core/geom/update/contour.ts +2 -0
- package/src/api/core/geom/update/profile.ts +2 -0
- package/src/api/core/handles/index.ts +3 -2
- package/src/api/design/family.ts +145 -16
- package/src/api/design/index.ts +7 -0
- package/src/api/design/networks.ts +315 -0
- 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 +106 -0
- package/src/handles.ts +18 -3
- package/src/index.ts +2 -0
- package/src/massParameters.ops.ts +246 -0
- package/src/massParameters.ts +427 -0
- package/test/massParameters.test.mjs +952 -0
- package/api-manifest.json +0 -8371
|
@@ -1,14 +1,41 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { PluginApiReturn } from "../../../../types";
|
|
3
|
-
import {
|
|
3
|
+
import type { SweepAlongCurveRecordOptions } from "../../../../massParameters";
|
|
4
|
+
import { Vec3Handle, LineHandle, ArcHandle, SplineHandle, CircleHandle, CurveHandle, ProfileHandle, ContourHandle, BrepHandle, FaceHandle, EdgeHandle, Vec3Components } from "../../../../handles";
|
|
5
|
+
/** Maximum boundary items one patch may span. */
|
|
6
|
+
export declare const MAX_PATCH_BOUNDARY_CURVES = 16;
|
|
7
|
+
/** Maximum interior points one patch may be pulled through. */
|
|
8
|
+
export declare const MAX_PATCH_INTERIOR_POINTS = 64;
|
|
9
|
+
/**
|
|
10
|
+
* An edge named together with the solid it belongs to — an edge handle cannot
|
|
11
|
+
* name its own solid, and one patch may meet two solids. `face` is the adjacent
|
|
12
|
+
* face a tangent patch continues: REQUIRED under `continuity: "tangent"`
|
|
13
|
+
* (a solid edge has two faces — the wall or the top of a rim — and only the
|
|
14
|
+
* caller knows which), ignored otherwise. Owner LAST, like every read that
|
|
15
|
+
* takes `(face, brep)`.
|
|
16
|
+
*/
|
|
17
|
+
export type OwnedEdge = {
|
|
18
|
+
edge: EdgeHandle;
|
|
19
|
+
brep: BrepHandle;
|
|
20
|
+
face?: FaceHandle;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The trailing bag of {@linkcode PluginGeomCreateApi.brepFromSweepAlongCurve}:
|
|
24
|
+
* the recorded switches plus `rail`, a live curve handle that never enters a
|
|
25
|
+
* record (a record is pure JSON, and a dead handle would not regenerate).
|
|
26
|
+
*/
|
|
27
|
+
export type SweepAlongCurveOptions = SweepAlongCurveRecordOptions & {
|
|
28
|
+
rail?: CurveHandle;
|
|
29
|
+
};
|
|
4
30
|
/**
|
|
5
31
|
* Curve creation — construct new geometric curves from point handles (all-handle
|
|
6
32
|
* model, §11).
|
|
7
33
|
*
|
|
8
34
|
* Each method takes point handles ({@linkcode Vec3Handle}) and returns an opaque
|
|
9
|
-
* curve handle ({@linkcode LineHandle}
|
|
10
|
-
* query, update, or entity-creation
|
|
11
|
-
* via the
|
|
35
|
+
* curve handle ({@linkcode LineHandle}, {@linkcode ArcHandle}, or
|
|
36
|
+
* {@linkcode SplineHandle}) that you pass to query, update, or entity-creation
|
|
37
|
+
* methods. Read geometry back as plain values via the
|
|
38
|
+
* `snaptrude.core.geom.query.*` methods.
|
|
12
39
|
*
|
|
13
40
|
* Accessed via `snaptrude.core.geom.create`.
|
|
14
41
|
*/
|
|
@@ -69,6 +96,89 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
69
96
|
* ```
|
|
70
97
|
*/
|
|
71
98
|
abstract circle(centrePoint: Vec3Handle, axis: Vec3Handle, radius: number): PluginApiReturn<CircleHandle>;
|
|
99
|
+
/**
|
|
100
|
+
* Create an open NURBS curve passing exactly THROUGH each point, in order
|
|
101
|
+
* (centripetal Catmull-Rom fit → clamped cubic B-spline; C1-smooth, no cusps
|
|
102
|
+
* on uneven spacing). Host API call — returns a handle. The points are
|
|
103
|
+
* interpolated, NOT control points. For a CLOSED smooth loop use
|
|
104
|
+
* {@linkcode PluginGeomCreateApi.profileFromSplinePoints} — closed splines
|
|
105
|
+
* exist only as profiles, never as a single curve handle.
|
|
106
|
+
*
|
|
107
|
+
* Pure host-side math — the geometry kernel is not loaded. The result is a
|
|
108
|
+
* {@linkcode CurveHandle}: pass it to `profileFromCurves` alongside lines and
|
|
109
|
+
* arcs, or read it back via `core.geom.query.curve.*`.
|
|
110
|
+
*
|
|
111
|
+
* @param points 3..256 ordered through-points; consecutive points must be distinct
|
|
112
|
+
* @returns The new open curve as a {@linkcode SplineHandle}
|
|
113
|
+
* @throws VALIDATION if fewer than 3 points (2 points are a straight line —
|
|
114
|
+
* use {@linkcode PluginGeomCreateApi.line}), more than 256 points, or two
|
|
115
|
+
* consecutive points coincide
|
|
116
|
+
*
|
|
117
|
+
* @examplePrompt Draw a smooth curve through these points
|
|
118
|
+
* @examplePrompt Make a wavy edge that passes through A, B, C and D
|
|
119
|
+
* @examplePrompt Freeform curved wall path through these clicks
|
|
120
|
+
*
|
|
121
|
+
* # Example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const spline = await snaptrude.core.geom.create.splineFromPoints([p0, p1, p2, p3])
|
|
124
|
+
* // Mixed profile: smooth top, straight closing base
|
|
125
|
+
* const base = await snaptrude.core.geom.create.line(p3, p0)
|
|
126
|
+
* const profile = await snaptrude.core.geom.create.profileFromCurves([spline, base])
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
abstract splineFromPoints(points: Vec3Handle[]): PluginApiReturn<SplineHandle>;
|
|
130
|
+
/**
|
|
131
|
+
* Create an open NURBS curve DEFINED BY control points — the curve is pulled
|
|
132
|
+
* TOWARD the interior points, not through them; it starts at the first point
|
|
133
|
+
* and ends at the last. Knots are computed for you (clamped, uniform) —
|
|
134
|
+
* there is no knot-vector argument. For a curve that must pass THROUGH given
|
|
135
|
+
* points use {@linkcode PluginGeomCreateApi.splineFromPoints}.
|
|
136
|
+
*
|
|
137
|
+
* A curve made here records as `splinePoles` in a mass recipe and is
|
|
138
|
+
* re-minted verbatim on edit — so an agent that read a `splinePoles` curve
|
|
139
|
+
* back off a mass can move its poles and rebuild the mass with
|
|
140
|
+
* `design.update.parameters`. Pure host-side math — the geometry kernel is
|
|
141
|
+
* not loaded, and nothing is created in the scene. An edge's control points
|
|
142
|
+
* rebuild the same curve here only when its knots are clamped uniform.
|
|
143
|
+
*
|
|
144
|
+
* @param controlPoints 3..512 control points ({@linkcode Vec3Handle}s), in order
|
|
145
|
+
* @param options.degree 2 or 3; default `min(3, controlPoints.length - 1)`
|
|
146
|
+
* @returns The new open curve as a {@linkcode SplineHandle}
|
|
147
|
+
* @throws VALIDATION when fewer than `degree + 1` points are given, two
|
|
148
|
+
* consecutive points coincide, or `degree` is not 2 or 3
|
|
149
|
+
*
|
|
150
|
+
* @examplePrompt Draw a smooth curve controlled by these four points
|
|
151
|
+
*
|
|
152
|
+
* # Example
|
|
153
|
+
* ```ts
|
|
154
|
+
* const curve = await snaptrude.core.geom.create.splineFromControlPoints([p0, p1, p2, p3])
|
|
155
|
+
* // Quadratic instead of the default cubic
|
|
156
|
+
* const tighter = await snaptrude.core.geom.create.splineFromControlPoints(
|
|
157
|
+
* [p0, p1, p2, p3],
|
|
158
|
+
* { degree: 2 },
|
|
159
|
+
* )
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
abstract splineFromControlPoints(controlPoints: Vec3Handle[], options?: {
|
|
163
|
+
degree?: number;
|
|
164
|
+
}): PluginApiReturn<SplineHandle>;
|
|
165
|
+
/**
|
|
166
|
+
* Drops a curve onto a face along the face's normal and returns the curves it
|
|
167
|
+
* lands on — one per connected run, empty when the curve misses the face
|
|
168
|
+
* entirely. Host API call — returns new curve handles; the inputs are
|
|
169
|
+
* read-only. No lengths are involved: the result is a curve in the same
|
|
170
|
+
* internal length units as its inputs.
|
|
171
|
+
*
|
|
172
|
+
* @param curve The curve to project
|
|
173
|
+
* @param face The face to project onto
|
|
174
|
+
* @param faceBrep The solid `face` belongs to — a face handle cannot name its
|
|
175
|
+
* own solid
|
|
176
|
+
* @returns The projected curves as {@linkcode CurveHandle}`[]`
|
|
177
|
+
* @throws VALIDATION if `face` is not a face of `faceBrep`, or the curve's
|
|
178
|
+
* midpoint lies on the face's surface (there is no drop direction there)
|
|
179
|
+
* @throws OPERATION_FAILED if the kernel could not project the curve
|
|
180
|
+
*/
|
|
181
|
+
abstract curvesFromProjection(curve: CurveHandle, face: FaceHandle, faceBrep: BrepHandle): PluginApiReturn<CurveHandle[]>;
|
|
72
182
|
/**
|
|
73
183
|
* Create a closed profile from an ordered list of point handles connected by
|
|
74
184
|
* line segments (last auto-connected to first). Host API call — returns a handle.
|
|
@@ -101,8 +211,41 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
101
211
|
*/
|
|
102
212
|
abstract profileFromCurves(curves: CurveHandle[]): PluginApiReturn<ProfileHandle>;
|
|
103
213
|
/**
|
|
104
|
-
* Create
|
|
105
|
-
*
|
|
214
|
+
* Create a CLOSED smooth profile passing through each point, in order, with
|
|
215
|
+
* the loop closed smoothly back from the last point to the first (do NOT
|
|
216
|
+
* repeat the first point). Host API call — returns a handle. This is the
|
|
217
|
+
* closed counterpart of {@linkcode PluginGeomCreateApi.splineFromPoints} and
|
|
218
|
+
* the one-call route from points to an extrudable outline: wrap in
|
|
219
|
+
* `contourFromProfile` and extrude/loft/sweep as usual.
|
|
220
|
+
*
|
|
221
|
+
* The whole loop is smooth — this call takes no mixed straight/spline input.
|
|
222
|
+
* For a profile that is part curve and part straight, build the pieces with
|
|
223
|
+
* `splineFromPoints` + `line` and join them with
|
|
224
|
+
* {@linkcode PluginGeomCreateApi.profileFromCurves}.
|
|
225
|
+
*
|
|
226
|
+
* @param points 3..256 ordered through-points of the loop (first point NOT repeated)
|
|
227
|
+
* @returns The new closed profile as a {@linkcode ProfileHandle}
|
|
228
|
+
* @throws VALIDATION if fewer than 3 points, more than 256 points,
|
|
229
|
+
* consecutive points coincide (including last→first), or the loop
|
|
230
|
+
* self-intersects
|
|
231
|
+
*
|
|
232
|
+
* @examplePrompt Make a blob-shaped floor plate through these points
|
|
233
|
+
* @examplePrompt Organic curved outline through these corners
|
|
234
|
+
* @examplePrompt Freeform podium profile
|
|
235
|
+
*
|
|
236
|
+
* # Example
|
|
237
|
+
* ```ts
|
|
238
|
+
* const profile = await snaptrude.core.geom.create.profileFromSplinePoints([p0, p1, p2, p3, p4])
|
|
239
|
+
* const contour = await snaptrude.core.geom.create.contourFromProfile(profile)
|
|
240
|
+
* const brep = await snaptrude.core.geom.create.brepFromExtrusion(contour, { x: 0, y: 1, z: 0 }, 3)
|
|
241
|
+
* const podium = await snaptrude.design.create.massFromBrep(brep, "Podium")
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
abstract profileFromSplinePoints(points: Vec3Handle[]): PluginApiReturn<ProfileHandle>;
|
|
245
|
+
/**
|
|
246
|
+
* Create an axis-aligned **rectangle** profile in the XZ plane,
|
|
247
|
+
* `width` × `depth`, centred at `center` (defaults to the origin). Host API
|
|
248
|
+
* call — returns a handle.
|
|
106
249
|
*
|
|
107
250
|
* Pair with `design.create.space` / `design.create.spaces` to author a rectangular
|
|
108
251
|
* (box) space — there is no dedicated rectangular-space creator; build the profile
|
|
@@ -210,15 +353,34 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
210
353
|
*
|
|
211
354
|
* @param contour The cross-section to extrude (outer profile + optional holes)
|
|
212
355
|
* @param direction Extrusion direction as plain `{x, y, z}` components (non-zero, normalised by the host)
|
|
213
|
-
* @param amount Extrusion distance (non-zero; negative extrudes opposite to `direction`)
|
|
356
|
+
* @param amount Extrusion distance in internal length units (non-zero; negative extrudes opposite to `direction`)
|
|
357
|
+
* @param options Optional twist and taper, both about `direction` through the
|
|
358
|
+
* base contour's centroid. `twistInDegrees` — total rotation base → top in
|
|
359
|
+
* DEGREES (an angle: never scaled by the project's length unit), positive
|
|
360
|
+
* turning the top CLOCKWISE seen from the far end of `direction` looking
|
|
361
|
+
* back at the base — for the usual upward extrusion, the plan view;
|
|
362
|
+
* `topScale` — the top outline's scale, a ratio (1 = no taper); `levels` —
|
|
363
|
+
* how many sections to build through, a count (2..64; each step may turn
|
|
364
|
+
* at most 22.5°). Leave `levels` out
|
|
365
|
+
* and the host resolves one and writes it into the record, so the mass
|
|
366
|
+
* regenerates identically ever after. An extrusion without twist or
|
|
367
|
+
* taper (no `options`, or zero twist and a `topScale` of 1) is
|
|
368
|
+
* built exactly as before these options existed.
|
|
214
369
|
* @returns The new solid as a {@linkcode BrepHandle}
|
|
215
370
|
* @throws if the extrusion is degenerate (zero amount, zero direction, or a
|
|
216
|
-
* direction lying in the contour
|
|
217
|
-
* into a valid solid
|
|
371
|
+
* direction lying in the plane of the contour) or the contour cannot be
|
|
372
|
+
* extruded into a valid solid
|
|
373
|
+
* @throws VALIDATION if `twistInDegrees` is not finite or turns more than
|
|
374
|
+
* 1440°, `topScale` is not a positive finite ratio, `levels` is outside
|
|
375
|
+
* 2..64 or too few for the twist (more than 22.5° per step), a twist is
|
|
376
|
+
* asked of a `direction` that is not the contour's normal, the contour has
|
|
377
|
+
* holes under a twist or taper, or a scaled section self-intersects
|
|
218
378
|
*
|
|
219
379
|
* @examplePrompt Extrude this profile 3 metres up
|
|
220
380
|
* @examplePrompt Make a solid by extruding this outline
|
|
221
381
|
* @examplePrompt Create a cylinder from a circle profile
|
|
382
|
+
* @examplePrompt Extrude this floor plate 40m up with a 90 degree twist
|
|
383
|
+
* @examplePrompt Taper this tower to 60 percent of its footprint at the top
|
|
222
384
|
*
|
|
223
385
|
* # Example
|
|
224
386
|
* ```ts
|
|
@@ -228,7 +390,80 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
228
390
|
* const faceCount = await snaptrude.core.geom.query.brep.getFaceCount(brep) // 6
|
|
229
391
|
* ```
|
|
230
392
|
*/
|
|
231
|
-
abstract brepFromExtrusion(contour: ContourHandle, direction: Vec3Components, amount: number
|
|
393
|
+
abstract brepFromExtrusion(contour: ContourHandle, direction: Vec3Components, amount: number, options?: {
|
|
394
|
+
twistInDegrees?: number;
|
|
395
|
+
topScale?: number;
|
|
396
|
+
levels?: number;
|
|
397
|
+
}): PluginApiReturn<BrepHandle>;
|
|
398
|
+
/**
|
|
399
|
+
* Stretches a surface across a closed loop of boundary curves and thickens it
|
|
400
|
+
* into a SOLID in one call — a roof over four curves, a canopy between two
|
|
401
|
+
* rails, a blend across a gap. `thickness` is in internal length units and is
|
|
402
|
+
* required: only solids reach the canvas, and there is no separate surface
|
|
403
|
+
* object to keep. Pass edges as `{ edge, brep, face }` with
|
|
404
|
+
* `continuity: "tangent"` to leave the named face smoothly. The result carries
|
|
405
|
+
* NO recipe (`design.query.getParameters` returns `null`) — label it when you
|
|
406
|
+
* commit it, because the label is all the provenance there is.
|
|
407
|
+
*
|
|
408
|
+
* Runs on the OpenCascade kernel (the first kernel call loads a wasm of tens
|
|
409
|
+
* of MB — expect a pause of seconds).
|
|
410
|
+
*
|
|
411
|
+
* @param boundary 3..16 items forming ONE closed loop (ends meeting within
|
|
412
|
+
* tolerance): a curve, or an edge named WITH the solid it belongs to
|
|
413
|
+
* ({@linkcode OwnedEdge}) — an edge handle cannot name its own solid, and
|
|
414
|
+
* one patch may meet two solids. Read scene breps with
|
|
415
|
+
* `design.query.geometry.getBrep(x, { frame: "world" })` so every item is in
|
|
416
|
+
* one frame.
|
|
417
|
+
* @param thickness Solid thickness in internal length units (> 0)
|
|
418
|
+
* @param options `interiorPoints` pull the surface through them (≤ 64, plain
|
|
419
|
+
* `{x, y, z}` in the same frame as the boundary). `continuity` —
|
|
420
|
+
* `"position"` (default) or `"tangent"`: every boundary item must then be an
|
|
421
|
+
* edge item that also names the `face` to continue (a solid edge has two
|
|
422
|
+
* faces — the wall or the top of a rim). `side` — `"below"` (default) or
|
|
423
|
+
* `"above"`: which side of the boundary the solid grows to.
|
|
424
|
+
* @returns The thickened patch as a new {@linkcode BrepHandle}
|
|
425
|
+
* @throws VALIDATION if the boundary is not one closed loop (the message names
|
|
426
|
+
* the gap and its size), a count cap is exceeded, `thickness` is not
|
|
427
|
+
* positive, `continuity: "tangent"` is used with a curve item or with an
|
|
428
|
+
* edge item that names no `face` (the message names the edge's two candidate
|
|
429
|
+
* faces), or a `face` is not adjacent to its `edge`
|
|
430
|
+
* @throws OPERATION_FAILED if the kernel could not fill the boundary, the
|
|
431
|
+
* filled surface misses its own boundary by more than 0.254 mm (the message
|
|
432
|
+
* carries the measured gap), or the thicken produced no solid
|
|
433
|
+
*
|
|
434
|
+
* @examplePrompt Patch a roof over these four boundary curves, 250 mm thick
|
|
435
|
+
* @examplePrompt Span a canopy between these two curved rails, 300 mm thick
|
|
436
|
+
*
|
|
437
|
+
* # Example
|
|
438
|
+
* ```ts
|
|
439
|
+
* // A roof over four curves
|
|
440
|
+
* const roof = await snaptrude.core.geom.create.brepFromPatch(
|
|
441
|
+
* [curveA, curveB, curveC, curveD],
|
|
442
|
+
* 0.984, // 250 mm
|
|
443
|
+
* )
|
|
444
|
+
* const mass = await snaptrude.design.create.massFromBrep(roof, "Roof patch")
|
|
445
|
+
* ```
|
|
446
|
+
*
|
|
447
|
+
* ```ts
|
|
448
|
+
* // A canopy between two towers' rims, leaving every wall it meets smoothly:
|
|
449
|
+
* // with `continuity: "tangent"` EVERY item is an edge naming its face.
|
|
450
|
+
* const canopy = await snaptrude.core.geom.create.brepFromPatch(
|
|
451
|
+
* [
|
|
452
|
+
* { edge: rimA, brep: towerA, face: wallA },
|
|
453
|
+
* { edge: sideA, brep: towerA, face: endA },
|
|
454
|
+
* { edge: rimB, brep: towerB, face: wallB },
|
|
455
|
+
* { edge: sideB, brep: towerB, face: endB },
|
|
456
|
+
* ],
|
|
457
|
+
* 1.181, // 300 mm
|
|
458
|
+
* { continuity: "tangent" },
|
|
459
|
+
* )
|
|
460
|
+
* ```
|
|
461
|
+
*/
|
|
462
|
+
abstract brepFromPatch(boundary: (CurveHandle | OwnedEdge)[], thickness: number, options?: {
|
|
463
|
+
interiorPoints?: Vec3Components[];
|
|
464
|
+
continuity?: "position" | "tangent";
|
|
465
|
+
side?: "below" | "above";
|
|
466
|
+
}): PluginApiReturn<BrepHandle>;
|
|
232
467
|
/**
|
|
233
468
|
* Create a closed solid **B-rep** by lofting between a bottom and a top
|
|
234
469
|
* contour, optionally through intermediate cross-sections. Host API call —
|
|
@@ -242,8 +477,8 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
242
477
|
* unchanged. A pair whose side faces would be non-planar under every
|
|
243
478
|
* correspondence still builds for hole-free straight-edged pairs — planar
|
|
244
479
|
* side quads stay quads and warped ones split into planar triangles (the
|
|
245
|
-
* triangulated
|
|
246
|
-
* auto-matching that would pair an arc with a straight edge. Matching hole
|
|
480
|
+
* triangulated fallback); arc-bearing or holed twisted pairs are rejected, as
|
|
481
|
+
* is auto-matching that would pair an arc with a straight edge. Matching hole
|
|
247
482
|
* counts are allowed in the two-section form. With intermediates the loft
|
|
248
483
|
* is a chain of ruled segments folded into one solid: sections must be
|
|
249
484
|
* planar and hole-free, ordered bottom → intermediates → top. The contours
|
|
@@ -257,7 +492,9 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
257
492
|
* bottom — sections are auto-matched)
|
|
258
493
|
* @param intermediateContours Optional in-between cross-sections, ordered
|
|
259
494
|
* bottom to top (hole-free; edge counts may differ — every section is
|
|
260
|
-
* normalized to the largest)
|
|
495
|
+
* normalized to the largest). Any count is accepted; a loft of more
|
|
496
|
+
* than 32 sections counting the bottom and the top still builds but
|
|
497
|
+
* carries no parameter record (records are capped, calls are not)
|
|
261
498
|
* @param options Optional behavior switches. `compatibility` — `"auto"`
|
|
262
499
|
* (default) inserts vertices to match differing edge counts; `"strict"`
|
|
263
500
|
* skips normalization and throws VALIDATION when outer edge counts (or,
|
|
@@ -265,9 +502,13 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
265
502
|
* `"auto"` (default) searches seam rotations on straight-edge sections to
|
|
266
503
|
* avoid a twist; `"authored"` keeps the authored start-vertex
|
|
267
504
|
* correspondence unchanged (a twisted correspondence then builds through
|
|
268
|
-
* the triangulated
|
|
505
|
+
* the triangulated fallback for hole-free straight-edged pairs).
|
|
269
506
|
* `{ compatibility: "strict", seamAlignment: "authored" }` reproduces
|
|
270
|
-
* pre-0.9.4 lofting exactly.
|
|
507
|
+
* pre-0.9.4 lofting exactly. `smoothing` — `"ruled"` (default) keeps the
|
|
508
|
+
* straight-sided behaviour described above; `"smooth"` lofts every
|
|
509
|
+
* section in ONE kernel pass, so the sides curve continuously through the
|
|
510
|
+
* intermediates instead of creasing at each one (a vase, a curved tower —
|
|
511
|
+
* the sections must still be planar and hole-free).
|
|
271
512
|
* @returns The new solid as a {@linkcode BrepHandle}
|
|
272
513
|
* @throws VALIDATION if the contours are coincident, their hole counts
|
|
273
514
|
* differ, any section has holes when intermediates are present
|
|
@@ -289,6 +530,7 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
289
530
|
* @examplePrompt Loft these outlines even though their corners don't line up
|
|
290
531
|
* @examplePrompt Loft these outlines exactly as authored, corner to corner
|
|
291
532
|
* @examplePrompt Fail the loft if my sections don't have matching edge counts
|
|
533
|
+
* @examplePrompt Loft these three outlines with smoothly curving sides
|
|
292
534
|
*
|
|
293
535
|
* # Example
|
|
294
536
|
* ```ts
|
|
@@ -305,6 +547,7 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
305
547
|
abstract brepFromLoft(bottomContour: ContourHandle, topContour: ContourHandle, intermediateContours?: ContourHandle[], options?: {
|
|
306
548
|
compatibility?: "strict" | "auto";
|
|
307
549
|
seamAlignment?: "authored" | "auto";
|
|
550
|
+
smoothing?: "ruled" | "smooth";
|
|
308
551
|
}): PluginApiReturn<BrepHandle>;
|
|
309
552
|
/**
|
|
310
553
|
* Create a closed solid **B-rep** from indexed mesh data: a vertex position
|
|
@@ -432,46 +675,110 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
432
675
|
*/
|
|
433
676
|
abstract brepFromIntersection(a: BrepHandle, b: BrepHandle): PluginApiReturn<BrepHandle>;
|
|
434
677
|
/**
|
|
435
|
-
* Rounds the given
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
*
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
*
|
|
678
|
+
* Rounds the given edges of a solid with a constant radius. Host API call —
|
|
679
|
+
* returns a new {@linkcode BrepHandle}; the input brep is read-only.
|
|
680
|
+
*
|
|
681
|
+
* Works on curved solids: edges may be straight, circular or spline, and
|
|
682
|
+
* adjacent edges (corner blends) are allowed. To pick a **rim** — the circle
|
|
683
|
+
* where a cylinder meets a flat cap — walk the edges and keep the ones whose
|
|
684
|
+
* two faces are a `cylinder` and a `plane`:
|
|
685
|
+
* `core.geom.query.brep.listEdges(brep)` → per edge
|
|
686
|
+
* `core.geom.query.edge.listFaces(edge)` → `core.geom.query.face.getSurfaceKind`
|
|
687
|
+
* on both faces. (`core.geom.query.brep.listEdgesBetween` takes two VERTEX
|
|
688
|
+
* indices — it is NOT a face-pair lookup.) For one cap's rim only, the
|
|
689
|
+
* shorter walk is: find the cap (call `getSurfaceKind` on each face from
|
|
690
|
+
* `brep.listFaces`), then `core.geom.query.face.listEdges(capFace)`.
|
|
691
|
+
*
|
|
692
|
+
* When the input brep carries a creation recipe, the result carries it too,
|
|
693
|
+
* with this operation appended to `operations`; `design.create.massFromBrep`
|
|
694
|
+
* then keeps the mass editable through `design.update.parameters`.
|
|
695
|
+
*
|
|
696
|
+
* Runs on the OpenCascade kernel (the first kernel call loads a wasm of tens
|
|
697
|
+
* of MB — expect a pause of seconds).
|
|
443
698
|
*
|
|
444
699
|
* Inspect the result via `core.geom.query.brep.*`, or commit it to the scene
|
|
445
700
|
* with `design.create.massFromBrep`.
|
|
446
701
|
*
|
|
447
702
|
* @param brep The solid whose edges to round
|
|
448
|
-
* @param edges The
|
|
449
|
-
*
|
|
703
|
+
* @param edges The edges to fillet (one or more, all on `brep`, no
|
|
704
|
+
* duplicates; more than 64 still fillets but the result carries no
|
|
705
|
+
* parameter record)
|
|
706
|
+
* @param radius Fillet radius in internal length units (positive, finite) —
|
|
707
|
+
* the radius at the START of the blend with `endRadius`; unused with
|
|
708
|
+
* `radii` (the table is the whole law — pass its first row's radius)
|
|
709
|
+
* @param options Optional VARIABLE blend, in one of two forms, each naming
|
|
710
|
+
* exactly ONE edge: the law belongs to the whole tangent chain that edge
|
|
711
|
+
* lies on, and it is measured from that edge's start. `endRadius` —
|
|
712
|
+
* the radius at the far end, in internal length units, interpolated
|
|
713
|
+
* linearly along the chain; on a closed rim it must equal `radius` (0 and
|
|
714
|
+
* 1 are the same point) — use `radii` there. `radii` — a sampled law instead:
|
|
715
|
+
* `position` is normalised ARC LENGTH along the chain (a ratio 0..1, never
|
|
716
|
+
* converted), `radius` is internal length units; 2..32 rows with strictly
|
|
717
|
+
* increasing `position`; before the first row and after the last the
|
|
718
|
+
* radius is held constant. On a closed rim 0 and 1 are the same point, so
|
|
719
|
+
* give them the same radius and put the variation in the interior rows. The two
|
|
720
|
+
* forms are mutually exclusive; without either, the fillet has one constant
|
|
721
|
+
* radius.
|
|
450
722
|
* @returns The filleted solid as a new {@linkcode BrepHandle}
|
|
451
|
-
* @throws VALIDATION if `edges` is empty, `radius` is
|
|
452
|
-
* number, an edge is not on `brep`, an edge
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
*
|
|
457
|
-
*
|
|
458
|
-
*
|
|
723
|
+
* @throws VALIDATION if `edges` is empty or holds a duplicate, `radius` is
|
|
724
|
+
* not a positive finite number, an edge is not on `brep`, or an edge has no
|
|
725
|
+
* crease to round — it is a seam of a closed face, or it lies between two
|
|
726
|
+
* patches of one smooth surface; for a variable blend, if `endRadius` and
|
|
727
|
+
* `radii` are both given, more than one edge is passed, a `radii` table is
|
|
728
|
+
* outside 2..32 rows or its positions do not strictly increase within
|
|
729
|
+
* 0..1, or the law's two ends differ on a closed rim (an `endRadius`
|
|
730
|
+
* other than `radius`, or a `radii` table whose first and last radii
|
|
731
|
+
* differ)
|
|
732
|
+
* @throws PRECONDITION_FAILED if an edge could not be located on the kernel
|
|
733
|
+
* solid after healing (select a different edge, or fillet before the
|
|
734
|
+
* operation that curved the solid), or the kernel could not blend the edge
|
|
735
|
+
* named in the message (reduce the radius or drop that edge)
|
|
736
|
+
* @throws OPERATION_FAILED if the kernel or the translation fails, or the
|
|
737
|
+
* result is non-manifold, splits into several solids, or contains a surface
|
|
738
|
+
* Snaptrude cannot represent
|
|
739
|
+
*
|
|
740
|
+
* @examplePrompt Round the rim of the column with 200 mm
|
|
741
|
+
* @examplePrompt Soften where the dome meets the wall
|
|
459
742
|
* @examplePrompt Fillet the corners of the podium with a 0.5m radius
|
|
460
743
|
* @examplePrompt Soften the vertical edges of this tower
|
|
744
|
+
* @examplePrompt Blend this edge from 200mm at one end to 600mm at the other
|
|
745
|
+
* @examplePrompt Round this rim wider at the back than at the front
|
|
461
746
|
*
|
|
462
747
|
* # Example
|
|
463
748
|
* ```ts
|
|
464
|
-
*
|
|
465
|
-
* const edges = await snaptrude.core.geom.query.brep.listEdges(
|
|
466
|
-
* const
|
|
749
|
+
* // Rim = every edge between the cylinder side and a plane cap
|
|
750
|
+
* const edges = await snaptrude.core.geom.query.brep.listEdges(column)
|
|
751
|
+
* const rim = []
|
|
752
|
+
* for (const edge of edges) {
|
|
753
|
+
* const faces = await snaptrude.core.geom.query.edge.listFaces(edge)
|
|
754
|
+
* const kinds = await Promise.all(
|
|
755
|
+
* faces.map((f) => snaptrude.core.geom.query.face.getSurfaceKind(f)),
|
|
756
|
+
* )
|
|
757
|
+
* if (kinds.includes("cylinder") && kinds.includes("plane")) rim.push(edge)
|
|
758
|
+
* }
|
|
759
|
+
* const rounded = await snaptrude.core.geom.create.brepFromFillet(column, rim, 0.787) // 200 mm
|
|
467
760
|
* ```
|
|
468
761
|
*/
|
|
469
|
-
abstract brepFromFillet(brep: BrepHandle, edges: EdgeHandle[], radius: number
|
|
762
|
+
abstract brepFromFillet(brep: BrepHandle, edges: EdgeHandle[], radius: number, options?: {
|
|
763
|
+
endRadius?: number;
|
|
764
|
+
radii?: {
|
|
765
|
+
position: number;
|
|
766
|
+
radius: number;
|
|
767
|
+
}[];
|
|
768
|
+
}): PluginApiReturn<BrepHandle>;
|
|
470
769
|
/**
|
|
471
770
|
* Grows or shrinks a solid by offsetting every face — positive distance
|
|
472
771
|
* moves faces outward, negative moves them inward. Host API call — returns
|
|
473
772
|
* a new {@linkcode BrepHandle}; the input brep is read-only.
|
|
474
773
|
*
|
|
774
|
+
* Works on curved solids: a sphere offsets to a sphere, a torus to a torus,
|
|
775
|
+
* a cylinder to a cylinder. There is nothing to select — the whole solid is
|
|
776
|
+
* offset.
|
|
777
|
+
*
|
|
778
|
+
* When the input brep carries a creation recipe, the result carries it too,
|
|
779
|
+
* with this operation appended to `operations`; `design.create.massFromBrep`
|
|
780
|
+
* then keeps the mass editable through `design.update.parameters`.
|
|
781
|
+
*
|
|
475
782
|
* Runs on the OpenCascade kernel (the first kernel call loads a wasm of
|
|
476
783
|
* tens of MB — expect a pause of seconds).
|
|
477
784
|
*
|
|
@@ -483,9 +790,15 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
483
790
|
* @returns The offset solid as a new {@linkcode BrepHandle}
|
|
484
791
|
* @throws VALIDATION if `distance` is not finite, is too small to offset
|
|
485
792
|
* anything, or an inward distance consumes the solid entirely
|
|
486
|
-
* @throws OPERATION_FAILED if the kernel
|
|
487
|
-
* result
|
|
488
|
-
*
|
|
793
|
+
* @throws OPERATION_FAILED if the kernel or the translation fails, or the
|
|
794
|
+
* result is non-manifold, splits into several solids, or contains a surface
|
|
795
|
+
* Snaptrude cannot represent (an offset free-form NURBS surface may have no
|
|
796
|
+
* exact representation — the model is left unchanged). A distance too
|
|
797
|
+
* large for the solid is reported here, with a hint asking for a smaller
|
|
798
|
+
* one. There is no per-face refusal: the whole call fails, and the error
|
|
799
|
+
* names no face
|
|
800
|
+
*
|
|
801
|
+
* @examplePrompt Thicken the torus ring by 100 mm
|
|
489
802
|
* @examplePrompt Grow this solid by 0.5m in every direction
|
|
490
803
|
* @examplePrompt Shrink this mass by 200mm
|
|
491
804
|
* @examplePrompt Offset the building envelope outward by 1m
|
|
@@ -503,6 +816,18 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
503
816
|
* input brep is read-only. The outer surface is kept and the walls grow
|
|
504
817
|
* inward.
|
|
505
818
|
*
|
|
819
|
+
* Works on curved solids: the open faces may be spherical, cylindrical,
|
|
820
|
+
* conical, toroidal or free-form patches, not only flat ones. To open the
|
|
821
|
+
* flat base of a dome, check every face first —
|
|
822
|
+
* `core.geom.query.brep.listFaces` then
|
|
823
|
+
* `core.geom.query.face.getSurfaceKind` on each — and keep the `"plane"`
|
|
824
|
+
* one. A closed curved surface is stored as several patches (a sphere as
|
|
825
|
+
* lunes), so opening "the sphere" may mean passing several faces.
|
|
826
|
+
*
|
|
827
|
+
* When the input brep carries a creation recipe, the result carries it too,
|
|
828
|
+
* with this operation appended to `operations`; `design.create.massFromBrep`
|
|
829
|
+
* then keeps the mass editable through `design.update.parameters`.
|
|
830
|
+
*
|
|
506
831
|
* Runs on the OpenCascade kernel (the first kernel call loads a wasm of
|
|
507
832
|
* tens of MB — expect a pause of seconds).
|
|
508
833
|
*
|
|
@@ -510,24 +835,36 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
510
835
|
* with `design.create.massFromBrep`.
|
|
511
836
|
*
|
|
512
837
|
* @param brep The solid to hollow
|
|
513
|
-
* @param openFaces The faces to remove as openings (
|
|
838
|
+
* @param openFaces The faces to remove as openings (one or more, all on
|
|
839
|
+
* `brep`, no duplicates; more than 32 still shells but the result carries
|
|
840
|
+
* no parameter record)
|
|
514
841
|
* @param thickness Wall thickness (positive, finite, smaller than half the solid's smallest span)
|
|
515
842
|
* @returns The hollowed solid as a new {@linkcode BrepHandle}
|
|
516
|
-
* @throws VALIDATION if `openFaces` is empty, a face is
|
|
517
|
-
* `thickness` is not a positive finite number, or the
|
|
518
|
-
* large (it must be smaller than half the solid's smallest
|
|
519
|
-
*
|
|
520
|
-
*
|
|
521
|
-
*
|
|
843
|
+
* @throws VALIDATION if `openFaces` is empty or holds a duplicate, a face is
|
|
844
|
+
* not on `brep`, `thickness` is not a positive finite number, or the
|
|
845
|
+
* thickness is too large (it must be smaller than half the solid's smallest
|
|
846
|
+
* span)
|
|
847
|
+
* @throws OPERATION_FAILED if the kernel or the translation fails, or the
|
|
848
|
+
* result is non-manifold, splits into several solids, or contains a surface
|
|
849
|
+
* Snaptrude cannot represent. A thickness too large for the solid is
|
|
850
|
+
* reported here, with a hint asking for one below half the smallest span.
|
|
851
|
+
* There is no per-face refusal: the whole call fails, and the error
|
|
852
|
+
* names no face
|
|
853
|
+
*
|
|
854
|
+
* @examplePrompt Hollow the dome into a 300 mm shell, open at the base
|
|
522
855
|
* @examplePrompt Hollow this mass into 200mm walls
|
|
523
856
|
* @examplePrompt Shell this form with the top face open
|
|
524
857
|
* @examplePrompt Turn this solid tower into a tube open at both ends
|
|
525
858
|
*
|
|
526
859
|
* # Example
|
|
527
860
|
* ```ts
|
|
528
|
-
*
|
|
529
|
-
* const faces = await snaptrude.core.geom.query.brep.listFaces(
|
|
530
|
-
* const
|
|
861
|
+
* // Open the dome at its flat base: the one face whose surface is a plane
|
|
862
|
+
* const faces = await snaptrude.core.geom.query.brep.listFaces(dome)
|
|
863
|
+
* const base = []
|
|
864
|
+
* for (const face of faces) {
|
|
865
|
+
* if ((await snaptrude.core.geom.query.face.getSurfaceKind(face)) === "plane") base.push(face)
|
|
866
|
+
* }
|
|
867
|
+
* const hollow = await snaptrude.core.geom.create.brepFromShell(dome, base, 1.181) // 300 mm
|
|
531
868
|
* ```
|
|
532
869
|
*/
|
|
533
870
|
abstract brepFromShell(brep: BrepHandle, openFaces: FaceHandle[], thickness: number): PluginApiReturn<BrepHandle>;
|
|
@@ -567,28 +904,84 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
567
904
|
*/
|
|
568
905
|
abstract brepsFromSplit(brep: BrepHandle, planeOrigin: Vec3Components, planeNormal: Vec3Components): PluginApiReturn<BrepHandle[]>;
|
|
569
906
|
/**
|
|
570
|
-
*
|
|
571
|
-
*
|
|
572
|
-
*
|
|
907
|
+
* Cuts a solid with a FACE of another solid — the curved twin of
|
|
908
|
+
* {@linkcode PluginGeomCreateApi.brepsFromSplit}, which cuts with a plane.
|
|
909
|
+
* Host API call — returns new {@linkcode BrepHandle}s; both inputs are
|
|
910
|
+
* read-only. BOTH breps must be in the same frame: read scene masses with
|
|
911
|
+
* `design.query.geometry.getBrep(x, { frame: "world" })` (the default is each
|
|
912
|
+
* mass's own local frame, and two masses have two). The pieces come back in
|
|
913
|
+
* DESCENDING volume order; pick the one you want with
|
|
914
|
+
* `core.geom.query.brep.getCentroid` or `getVolume` and commit it. A piece
|
|
915
|
+
* carries no recipe — label it.
|
|
916
|
+
*
|
|
917
|
+
* Runs on the OpenCascade kernel (the first kernel call loads a wasm of tens
|
|
918
|
+
* of MB — expect a pause of seconds).
|
|
919
|
+
*
|
|
920
|
+
* @param brep The solid to cut
|
|
921
|
+
* @param toolFace The cutting face, read-only
|
|
922
|
+
* @param toolBrep The solid `toolFace` belongs to — a face handle cannot name
|
|
923
|
+
* its own solid
|
|
924
|
+
* @returns The resulting pieces as {@linkcode BrepHandle}`[]`, largest first
|
|
925
|
+
* @throws VALIDATION if `toolFace` is not a face of `toolBrep`, `toolBrep` IS
|
|
926
|
+
* `brep`, or the cut produced a single part — the surface does not pass all
|
|
927
|
+
* the way through (extend it past the mass on every side, and check both
|
|
928
|
+
* breps were read in the same frame)
|
|
929
|
+
* @throws OPERATION_FAILED if the kernel could not split the solid
|
|
930
|
+
*
|
|
931
|
+
* @examplePrompt Cut this mass with the curved roof surface and keep the lower part
|
|
932
|
+
*
|
|
933
|
+
* # Example
|
|
934
|
+
* ```ts
|
|
935
|
+
* const target = await snaptrude.design.query.geometry.getBrep(tower, { frame: "world" })
|
|
936
|
+
* const tool = await snaptrude.design.query.geometry.getBrep(roof, { frame: "world" })
|
|
937
|
+
* const [toolFace] = await snaptrude.core.geom.query.brep.listFaces(tool)
|
|
938
|
+
* const pieces = await snaptrude.core.geom.create.brepsFromSplitByFace(target, toolFace, tool)
|
|
939
|
+
* ```
|
|
940
|
+
*/
|
|
941
|
+
abstract brepsFromSplitByFace(brep: BrepHandle, toolFace: FaceHandle, toolBrep: BrepHandle): PluginApiReturn<BrepHandle[]>;
|
|
942
|
+
/**
|
|
943
|
+
* Bevels the given edges of a solid with a symmetric planar cut. Host API
|
|
944
|
+
* call — returns a new {@linkcode BrepHandle}; the input brep is read-only.
|
|
945
|
+
*
|
|
946
|
+
* Works on curved solids: edges may be straight, circular or spline, and
|
|
947
|
+
* adjacent edges are allowed. Pick edges the same way as for
|
|
948
|
+
* {@linkcode PluginGeomCreateApi.brepFromFillet} — `brep.listEdges`, then
|
|
949
|
+
* `core.geom.query.edge.listFaces` and `core.geom.query.face.getSurfaceKind`
|
|
950
|
+
* on both faces of each edge. (`core.geom.query.brep.listEdgesBetween` takes
|
|
951
|
+
* two VERTEX indices — it is NOT a face-pair lookup.) Chamfering a cylinder's
|
|
952
|
+
* rim yields a cone patch where a fillet would yield a torus patch.
|
|
573
953
|
*
|
|
574
|
-
*
|
|
575
|
-
*
|
|
576
|
-
*
|
|
954
|
+
* When the input brep carries a creation recipe, the result carries it too,
|
|
955
|
+
* with this operation appended to `operations`; `design.create.massFromBrep`
|
|
956
|
+
* then keeps the mass editable through `design.update.parameters`.
|
|
957
|
+
*
|
|
958
|
+
* Runs on the OpenCascade kernel (the first kernel call loads a wasm of tens
|
|
959
|
+
* of MB — expect a pause of seconds).
|
|
577
960
|
*
|
|
578
961
|
* Inspect the result via `core.geom.query.brep.*`, or commit it to the scene
|
|
579
962
|
* with `design.create.massFromBrep`.
|
|
580
963
|
*
|
|
581
964
|
* @param brep The solid whose edges to bevel
|
|
582
|
-
* @param edges The
|
|
965
|
+
* @param edges The edges to chamfer (one or more, all on `brep`, no
|
|
966
|
+
* duplicates; more than 64 still chamfers but the result carries no
|
|
967
|
+
* parameter record)
|
|
583
968
|
* @param distance Chamfer distance from the edge on each adjacent face (positive, finite)
|
|
584
969
|
* @returns The chamfered solid as a new {@linkcode BrepHandle}
|
|
585
|
-
* @throws VALIDATION if `edges` is empty, `distance` is
|
|
586
|
-
* finite number, an edge is not on `brep`, an edge
|
|
587
|
-
*
|
|
588
|
-
*
|
|
589
|
-
* @throws
|
|
590
|
-
*
|
|
591
|
-
*
|
|
970
|
+
* @throws VALIDATION if `edges` is empty or holds a duplicate, `distance` is
|
|
971
|
+
* not a positive finite number, an edge is not on `brep`, or an edge has no
|
|
972
|
+
* crease to cut — it is a seam of a closed face, or it lies between two
|
|
973
|
+
* patches of one smooth surface
|
|
974
|
+
* @throws PRECONDITION_FAILED if an edge could not be located on the kernel
|
|
975
|
+
* solid after healing (select a different edge, or chamfer before the
|
|
976
|
+
* operation that curved the solid)
|
|
977
|
+
* @throws OPERATION_FAILED if the kernel or the translation fails, or the
|
|
978
|
+
* result is non-manifold, splits into several solids, or contains a surface
|
|
979
|
+
* Snaptrude cannot represent. A distance larger than an adjacent face
|
|
980
|
+
* is reported here, with a hint asking for a smaller one. Unlike
|
|
981
|
+
* {@linkcode PluginGeomCreateApi.brepFromFillet}, the kernel does not say
|
|
982
|
+
* which edge failed a chamfer, so the error names no edge
|
|
983
|
+
*
|
|
984
|
+
* @examplePrompt Chamfer the top edge of the cylinder
|
|
592
985
|
* @examplePrompt Bevel these edges by 100mm
|
|
593
986
|
* @examplePrompt Chamfer the top edges of the plinth
|
|
594
987
|
* @examplePrompt Cut a 45-degree flat along the corners of this mass
|
|
@@ -619,11 +1012,16 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
619
1012
|
* tapering across a bend or along an arc edge would create faces Snaptrude
|
|
620
1013
|
* cannot represent and throws (sweep each straight run separately and union
|
|
621
1014
|
* the results instead). An optional `transition` picks the corner
|
|
622
|
-
* treatment: `"miter"` (default) is
|
|
1015
|
+
* treatment: `"miter"` (default) is a sharp mitred bend; `"round"`
|
|
1016
|
+
* carries the section around each turning corner on a tangent circular arc,
|
|
1017
|
+
* so the corner patch is a real curved surface (geometrically cylindrical;
|
|
1018
|
+
* `getSurfaceKind` reports it as `"spline"`) rather than a
|
|
1019
|
+
* flat cut (open paths only — `"round"` on a closed ring path is refused);
|
|
623
1020
|
* `{ bevel: b }` chamfers each turning corner by cutting `b` back along
|
|
624
1021
|
* both adjacent legs (works on open and closed paths — each leg must be
|
|
625
|
-
* long enough for its cuts). On a corner-less path `transition` has no
|
|
626
|
-
* varying
|
|
1022
|
+
* long enough for its cuts). On a corner-less path `transition` has no
|
|
1023
|
+
* effect, and a varying scale only accepts straight paths, so it never meets
|
|
1024
|
+
* a corner.
|
|
627
1025
|
*
|
|
628
1026
|
* Open paths run on the OpenCascade kernel (the first kernel call loads a
|
|
629
1027
|
* wasm of tens of MB — expect a pause of seconds); closed paths are
|
|
@@ -633,19 +1031,22 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
633
1031
|
* with `design.create.massFromBrep`.
|
|
634
1032
|
*
|
|
635
1033
|
* @param profile The cross-section to sweep (hole-free contour)
|
|
636
|
-
* @param path The polyline path as plain `{x, y, z}` points (
|
|
637
|
-
* first point as the last to close the path into a ring
|
|
1034
|
+
* @param path The polyline path as plain `{x, y, z}` points (2 or more;
|
|
1035
|
+
* repeat the first point as the last to close the path into a ring; more
|
|
1036
|
+
* than 512 points still sweeps but the result carries no parameter record)
|
|
638
1037
|
* @param options Optional scale law and corner transition. Scale law:
|
|
639
1038
|
* `startScale`/`endScale` (linear taper by arc length) or `scales` (one
|
|
640
1039
|
* factor per path point; mutually exclusive with
|
|
641
1040
|
* `startScale`/`endScale`); every factor must be finite and within
|
|
642
|
-
* 1e-3..1e3. `transition`: `"miter"` (default, sharp corners)
|
|
643
|
-
* `
|
|
644
|
-
*
|
|
1041
|
+
* 1e-3..1e3. `transition`: `"miter"` (default, sharp corners),
|
|
1042
|
+
* `"round"` (arc-carried corners — curved corner patches; open paths
|
|
1043
|
+
* only) or `{ bevel: b }` (chamfered corners, `b` finite within
|
|
1044
|
+
* 1e-3..1e3; open and closed paths)
|
|
645
1045
|
* @returns The swept solid as a new {@linkcode BrepHandle}
|
|
646
1046
|
* @throws VALIDATION if the profile has holes, the path has fewer than 2
|
|
647
|
-
* points, consecutive path points coincide, a
|
|
648
|
-
* or the profile plane contains the first
|
|
1047
|
+
* points, consecutive path points coincide, a
|
|
1048
|
+
* coordinate is not finite, or the profile plane contains the first
|
|
1049
|
+
* path segment's direction
|
|
649
1050
|
* (degenerate sweep); for closed paths, if the ring has fewer than 3
|
|
650
1051
|
* distinct corners, the path is non-planar, a corner doubles back, the
|
|
651
1052
|
* profile has an arc edge, or the profile is too large for a mitred
|
|
@@ -653,11 +1054,14 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
653
1054
|
* is combined with `startScale`/`endScale`, `scales` does not match the
|
|
654
1055
|
* path length, or a varying scale is used on a bent or closed path or
|
|
655
1056
|
* with an arc-edged profile; for `{ bevel }`, if a leg is too short for
|
|
656
|
-
* the cuts its
|
|
657
|
-
* back so its
|
|
1057
|
+
* the cuts its bevelled corners take from it or a corner nearly doubles
|
|
1058
|
+
* back so its bevel collapses (the errors name the corner)
|
|
1059
|
+
* @throws PRECONDITION_FAILED if `transition` is `"round"` and the path is
|
|
1060
|
+
* closed — round corners work on open paths only; use `"miter"` or
|
|
1061
|
+
* `{ bevel }` on a ring
|
|
658
1062
|
* @throws OPERATION_FAILED if the kernel cannot sweep the profile into a
|
|
659
|
-
* valid solid
|
|
660
|
-
*
|
|
1063
|
+
* valid solid — including a `"round"` corner whose arc does not fit its
|
|
1064
|
+
* legs, which is not pre-checked and so is not named per corner
|
|
661
1065
|
*
|
|
662
1066
|
* @examplePrompt Sweep this profile along the corridor path
|
|
663
1067
|
* @examplePrompt Extrude the railing section along this route
|
|
@@ -666,6 +1070,7 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
666
1070
|
* @examplePrompt Taper this duct from 1x1 to 2x2 along its run
|
|
667
1071
|
* @examplePrompt Sweep a column section that narrows toward the top
|
|
668
1072
|
* @examplePrompt Chamfer the corners of this swept frame by 200mm
|
|
1073
|
+
* @examplePrompt Sweep this handrail with rounded corners at the bends
|
|
669
1074
|
*
|
|
670
1075
|
* # Example
|
|
671
1076
|
* ```ts
|
|
@@ -701,17 +1106,71 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
701
1106
|
startScale?: number;
|
|
702
1107
|
endScale?: number;
|
|
703
1108
|
scales?: number[];
|
|
704
|
-
transition?: "miter" | {
|
|
1109
|
+
transition?: "miter" | "round" | {
|
|
705
1110
|
bevel: number;
|
|
706
1111
|
};
|
|
707
1112
|
}): PluginApiReturn<BrepHandle>;
|
|
1113
|
+
/**
|
|
1114
|
+
* Sweeps a cross-section along a SMOOTH path — splines, arcs and lines chained
|
|
1115
|
+
* end to end — with control of how the profile turns.
|
|
1116
|
+
* {@linkcode PluginGeomCreateApi.brepFromSweep} takes a polyline path; this
|
|
1117
|
+
* takes curves. Host API call — returns a new {@linkcode BrepHandle}; the
|
|
1118
|
+
* inputs are read-only. Records as `sweepAlongCurve`, so the orientation stays
|
|
1119
|
+
* editable through `design.update.parameters`. The properties panel shows it
|
|
1120
|
+
* read-only, because it is a text value, not a number. A railed sweep records
|
|
1121
|
+
* nothing (`getParameters` answers `null`).
|
|
1122
|
+
*
|
|
1123
|
+
* Runs on the OpenCascade kernel (the first kernel call loads a wasm of tens
|
|
1124
|
+
* of MB — expect a pause of seconds).
|
|
1125
|
+
*
|
|
1126
|
+
* @param profile Hole-free cross-section contour; placed at the first curve's start
|
|
1127
|
+
* @param path 1..64 curves, ordered, meeting end to end within tolerance
|
|
1128
|
+
* @param options `orientation` — `"upright"` (default) keeps the profile's up
|
|
1129
|
+
* aligned with world up (ducts, handrails, ribbons that must not roll);
|
|
1130
|
+
* `"frenet"` lets it roll with the path's curvature; `"fixed"` carries the
|
|
1131
|
+
* authored frame along unchanged, which is a pure translation — use it to
|
|
1132
|
+
* bend a footprint along an arc. `rail` is a second guide curve.
|
|
1133
|
+
* @returns The swept solid as a new {@linkcode BrepHandle}
|
|
1134
|
+
* @throws VALIDATION if the path curves are not connected, the path is closed,
|
|
1135
|
+
* the profile has holes, the first tangent lies in the profile plane, the
|
|
1136
|
+
* path runs vertically under `"upright"` (that frame is undefined there —
|
|
1137
|
+
* the message names the run and points at `"frenet"`), the path turns
|
|
1138
|
+
* parallel to the profile under `"fixed"`, `rail` is closed, or `rail` and
|
|
1139
|
+
* `orientation` are both given
|
|
1140
|
+
* @throws OPERATION_FAILED if the kernel could not sweep the profile — a
|
|
1141
|
+
* self-intersection on a tight bend
|
|
1142
|
+
*
|
|
1143
|
+
* @examplePrompt Sweep a 600x400 duct along this curved route and keep it upright
|
|
1144
|
+
* @examplePrompt Run this handrail along the curved stair edge
|
|
1145
|
+
* @examplePrompt Bend this footprint along the arc
|
|
1146
|
+
*
|
|
1147
|
+
* # Example
|
|
1148
|
+
* ```ts
|
|
1149
|
+
* const route = await snaptrude.core.geom.create.splineFromPoints(points)
|
|
1150
|
+
* const duct = await snaptrude.core.geom.create.brepFromSweepAlongCurve(profile, [route], {
|
|
1151
|
+
* orientation: "upright",
|
|
1152
|
+
* })
|
|
1153
|
+
* ```
|
|
1154
|
+
*/
|
|
1155
|
+
abstract brepFromSweepAlongCurve(profile: ContourHandle, path: CurveHandle[], options?: SweepAlongCurveOptions): PluginApiReturn<BrepHandle>;
|
|
708
1156
|
/**
|
|
709
1157
|
* Revolves a planar profile about an axis to make a solid of revolution — a
|
|
710
1158
|
* full turn by default. Host API call — returns a new
|
|
711
1159
|
* {@linkcode BrepHandle}; the input contour is read-only. Holes in the
|
|
712
|
-
* profile are allowed
|
|
713
|
-
*
|
|
714
|
-
*
|
|
1160
|
+
* profile are allowed, and segments may run at any angle to the axis: an
|
|
1161
|
+
* inclined segment revolves into a cone, an arc into a sphere or torus
|
|
1162
|
+
* section. This is the general route to domes, vases, columns and rotundas.
|
|
1163
|
+
*
|
|
1164
|
+
* Two rules bind the axis to the profile. First, the axis line must lie IN
|
|
1165
|
+
* the profile's plane or run parallel to it — a revolution turns a planar
|
|
1166
|
+
* section about a line drawn in that same plane; a parallel axis offset out
|
|
1167
|
+
* of the plane is judged by its projection into the plane (the result is a
|
|
1168
|
+
* hollow ring). A skew axis is refused: move the axis into the profile's
|
|
1169
|
+
* plane. Second, within that plane the whole profile stays on ONE side of
|
|
1170
|
+
* the axis.
|
|
1171
|
+
* Vertices and whole segments may lie ON the axis — that is how a dome's
|
|
1172
|
+
* pole and a cylinder's inner edge are authored — but no part of the profile
|
|
1173
|
+
* may cross to the other side, which would sweep a self-intersecting solid.
|
|
715
1174
|
*
|
|
716
1175
|
* Runs on the OpenCascade kernel (the first kernel call loads a wasm of
|
|
717
1176
|
* tens of MB — expect a pause of seconds).
|
|
@@ -725,19 +1184,25 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
725
1184
|
* @param angleInDegrees Optional revolution angle in degrees (0 < angle ≤ 360; default 360)
|
|
726
1185
|
* @returns The revolved solid as a new {@linkcode BrepHandle}
|
|
727
1186
|
* @throws VALIDATION if `axisDirection` is zero-length, `angleInDegrees` is
|
|
728
|
-
* not in (0, 360],
|
|
729
|
-
*
|
|
730
|
-
*
|
|
731
|
-
*
|
|
732
|
-
*
|
|
1187
|
+
* not in (0, 360], a coordinate is not finite, or the profile crosses the
|
|
1188
|
+
* axis (the message names the offending segment — keep the whole profile
|
|
1189
|
+
* on one side; points may touch the axis but not cross it)
|
|
1190
|
+
* @throws PRECONDITION_FAILED if the axis is skew to the profile's plane
|
|
1191
|
+
* (neither in it nor parallel to it; the message asks you to move the axis
|
|
1192
|
+
* into the plane of the profile)
|
|
1193
|
+
* @throws OPERATION_FAILED if the kernel cannot revolve the profile into a
|
|
1194
|
+
* valid solid
|
|
733
1195
|
*
|
|
734
1196
|
* @examplePrompt Create a dome from this section
|
|
735
1197
|
* @examplePrompt Revolve this profile 360 degrees around the vertical axis
|
|
736
1198
|
* @examplePrompt Build a rotunda by revolving this wall section
|
|
1199
|
+
* @examplePrompt Make a dome by revolving a quarter-circle about the vertical axis
|
|
1200
|
+
* @examplePrompt Turn this curved outline into a vase
|
|
737
1201
|
*
|
|
738
1202
|
* # Example
|
|
739
1203
|
* ```ts
|
|
740
|
-
* // A cylinder: revolve a 2m-wide, 3m-tall rectangle about the Y axis at
|
|
1204
|
+
* // A cylinder: revolve a 2m-wide, 3m-tall rectangle about the Y axis at
|
|
1205
|
+
* // its edge — the left edge sits ON the axis, which is legal.
|
|
741
1206
|
* const rect = await snaptrude.core.geom.create.profileFromLinePoints([
|
|
742
1207
|
* await snaptrude.core.math.vec3.new(0, 0, 0),
|
|
743
1208
|
* await snaptrude.core.math.vec3.new(2, 0, 0),
|
|
@@ -753,6 +1218,136 @@ export declare abstract class PluginGeomCreateApi {
|
|
|
753
1218
|
* ```
|
|
754
1219
|
*/
|
|
755
1220
|
abstract brepFromRevolution(profile: ContourHandle, axisOrigin: Vec3Components, axisDirection: Vec3Components, angleInDegrees?: number): PluginApiReturn<BrepHandle>;
|
|
1221
|
+
/**
|
|
1222
|
+
* Create a solid **sphere** B-rep (boundary representation: the solid's
|
|
1223
|
+
* exact faces, edges and vertices) from a centre and radius. Host API call
|
|
1224
|
+
* — returns a {@linkcode BrepHandle}; commit it to the scene with
|
|
1225
|
+
* `design.create.massFromBrep`. The result carries an exact spherical
|
|
1226
|
+
* surface (not a faceted approximation) and a creation recipe — read the
|
|
1227
|
+
* committed mass's parameters back with `design.query.getParameters` and edit
|
|
1228
|
+
* them with `design.update.parameters`.
|
|
1229
|
+
*
|
|
1230
|
+
* Runs on the OpenCascade kernel (the first kernel call loads a wasm of tens
|
|
1231
|
+
* of MB — expect a pause of seconds).
|
|
1232
|
+
*
|
|
1233
|
+
* @param centre Sphere centre as plain `{x, y, z}` components (internal length units)
|
|
1234
|
+
* @param radius Sphere radius (> 0, internal length units)
|
|
1235
|
+
* @returns The new solid as a {@linkcode BrepHandle}
|
|
1236
|
+
* @throws VALIDATION if `radius` is not a positive finite number or a
|
|
1237
|
+
* coordinate is not finite
|
|
1238
|
+
*
|
|
1239
|
+
* @examplePrompt Create a sphere of radius 5 at the origin
|
|
1240
|
+
* @examplePrompt Add a 3m ball on top of the tower
|
|
1241
|
+
*
|
|
1242
|
+
* # Example
|
|
1243
|
+
* ```ts
|
|
1244
|
+
* const brep = await snaptrude.core.geom.create.brepFromSphere({ x: 0, y: 5, z: 0 }, 5)
|
|
1245
|
+
* const mass = await snaptrude.design.create.massFromBrep(brep, "Sphere")
|
|
1246
|
+
* ```
|
|
1247
|
+
*/
|
|
1248
|
+
abstract brepFromSphere(centre: Vec3Components, radius: number): PluginApiReturn<BrepHandle>;
|
|
1249
|
+
/**
|
|
1250
|
+
* Create a solid **cylinder** B-rep from its bottom-cap centre, axis
|
|
1251
|
+
* direction, radius and height. Host API call — returns a
|
|
1252
|
+
* {@linkcode BrepHandle}; commit with `design.create.massFromBrep`. The
|
|
1253
|
+
* bottom cap sits AT `base` and the solid extends `height` along `axis` —
|
|
1254
|
+
* place `base` on the floor and use axis `{x: 0, y: 1, z: 0}` for an upright
|
|
1255
|
+
* column. Carries a creation recipe (radius, height), editable through
|
|
1256
|
+
* `design.update.parameters`.
|
|
1257
|
+
*
|
|
1258
|
+
* Runs on the OpenCascade kernel (the first kernel call loads a wasm of tens
|
|
1259
|
+
* of MB — expect a pause of seconds).
|
|
1260
|
+
*
|
|
1261
|
+
* @param base Centre of the bottom cap as plain `{x, y, z}` components
|
|
1262
|
+
* @param axis Axis direction as plain `{x, y, z}` components (non-zero, normalised by the host)
|
|
1263
|
+
* @param radius Cylinder radius (> 0)
|
|
1264
|
+
* @param height Cylinder height along `axis` (> 0)
|
|
1265
|
+
* @returns The new solid as a {@linkcode BrepHandle}
|
|
1266
|
+
* @throws VALIDATION if `radius`/`height` are not positive finite numbers or
|
|
1267
|
+
* `axis` is zero-length
|
|
1268
|
+
*
|
|
1269
|
+
* @examplePrompt Create a cylinder 2m across and 4m tall
|
|
1270
|
+
* @examplePrompt Add a circular column here
|
|
1271
|
+
*
|
|
1272
|
+
* # Example
|
|
1273
|
+
* ```ts
|
|
1274
|
+
* const brep = await snaptrude.core.geom.create.brepFromCylinder(
|
|
1275
|
+
* { x: 0, y: 0, z: 0 },
|
|
1276
|
+
* { x: 0, y: 1, z: 0 },
|
|
1277
|
+
* 1,
|
|
1278
|
+
* 4,
|
|
1279
|
+
* )
|
|
1280
|
+
* const column = await snaptrude.design.create.massFromBrep(brep, "Column")
|
|
1281
|
+
* ```
|
|
1282
|
+
*/
|
|
1283
|
+
abstract brepFromCylinder(base: Vec3Components, axis: Vec3Components, radius: number, height: number): PluginApiReturn<BrepHandle>;
|
|
1284
|
+
/**
|
|
1285
|
+
* Create a solid **cone or frustum** B-rep: bottom-cap centre, axis, base
|
|
1286
|
+
* radius, height, and an optional top radius (default 0 — a full cone to a
|
|
1287
|
+
* point; > 0 — a frustum / tapered column). Host API call — returns a
|
|
1288
|
+
* {@linkcode BrepHandle}; commit with `design.create.massFromBrep`. Carries
|
|
1289
|
+
* a creation recipe (radii + height), editable through `design.update.parameters`.
|
|
1290
|
+
*
|
|
1291
|
+
* Runs on the OpenCascade kernel (the first kernel call loads a wasm of tens
|
|
1292
|
+
* of MB — expect a pause of seconds).
|
|
1293
|
+
*
|
|
1294
|
+
* @param base Centre of the bottom cap as plain `{x, y, z}` components
|
|
1295
|
+
* @param axis Axis direction as plain `{x, y, z}` components (non-zero, normalised by the host)
|
|
1296
|
+
* @param baseRadius Radius at the base (> 0)
|
|
1297
|
+
* @param height Height along `axis` (> 0)
|
|
1298
|
+
* @param topRadius Optional radius at the top (≥ 0, ≠ `baseRadius`; default 0 = apex)
|
|
1299
|
+
* @returns The new solid as a {@linkcode BrepHandle}
|
|
1300
|
+
* @throws VALIDATION if radii/height are invalid, `topRadius === baseRadius`
|
|
1301
|
+
* (that is a cylinder — use {@linkcode PluginGeomCreateApi.brepFromCylinder}),
|
|
1302
|
+
* or `axis` is zero-length
|
|
1303
|
+
*
|
|
1304
|
+
* @examplePrompt Create a cone roof 4m wide and 3m tall
|
|
1305
|
+
* @examplePrompt Make a tapered column narrowing from 1m to 0.6m
|
|
1306
|
+
*
|
|
1307
|
+
* # Example
|
|
1308
|
+
* ```ts
|
|
1309
|
+
* const roof = await snaptrude.core.geom.create.brepFromCone(
|
|
1310
|
+
* { x: 0, y: 9, z: 0 },
|
|
1311
|
+
* { x: 0, y: 1, z: 0 },
|
|
1312
|
+
* 2,
|
|
1313
|
+
* 3,
|
|
1314
|
+
* )
|
|
1315
|
+
* ```
|
|
1316
|
+
*/
|
|
1317
|
+
abstract brepFromCone(base: Vec3Components, axis: Vec3Components, baseRadius: number, height: number, topRadius?: number): PluginApiReturn<BrepHandle>;
|
|
1318
|
+
/**
|
|
1319
|
+
* Create a solid **torus** (ring / donut) B-rep from its centre, plane
|
|
1320
|
+
* normal, ring radius and tube radius. Host API call — returns a
|
|
1321
|
+
* {@linkcode BrepHandle}; commit with `design.create.massFromBrep`.
|
|
1322
|
+
* `majorRadius` is centre-to-tube-centre; `minorRadius` is the tube's own
|
|
1323
|
+
* radius and must be strictly smaller. Carries a creation recipe, editable
|
|
1324
|
+
* through `design.update.parameters`.
|
|
1325
|
+
*
|
|
1326
|
+
* Runs on the OpenCascade kernel (the first kernel call loads a wasm of tens
|
|
1327
|
+
* of MB — expect a pause of seconds).
|
|
1328
|
+
*
|
|
1329
|
+
* @param centre Torus centre as plain `{x, y, z}` components
|
|
1330
|
+
* @param axis Plane normal of the ring as plain `{x, y, z}` components (non-zero)
|
|
1331
|
+
* @param majorRadius Ring radius, centre to tube centre (> 0)
|
|
1332
|
+
* @param minorRadius Tube radius (> 0 and < `majorRadius` — a self-intersecting torus is rejected)
|
|
1333
|
+
* @returns The new solid as a {@linkcode BrepHandle}
|
|
1334
|
+
* @throws VALIDATION if a radius is invalid, `minorRadius >= majorRadius`,
|
|
1335
|
+
* or `axis` is zero-length
|
|
1336
|
+
*
|
|
1337
|
+
* @examplePrompt Create a donut-shaped ring 10m across with a 1m tube
|
|
1338
|
+
* @examplePrompt Add a torus canopy around the tower
|
|
1339
|
+
*
|
|
1340
|
+
* # Example
|
|
1341
|
+
* ```ts
|
|
1342
|
+
* const ring = await snaptrude.core.geom.create.brepFromTorus(
|
|
1343
|
+
* { x: 0, y: 6, z: 0 },
|
|
1344
|
+
* { x: 0, y: 1, z: 0 },
|
|
1345
|
+
* 5,
|
|
1346
|
+
* 1,
|
|
1347
|
+
* )
|
|
1348
|
+
* ```
|
|
1349
|
+
*/
|
|
1350
|
+
abstract brepFromTorus(centre: Vec3Components, axis: Vec3Components, majorRadius: number, minorRadius: number): PluginApiReturn<BrepHandle>;
|
|
756
1351
|
}
|
|
757
1352
|
/**
|
|
758
1353
|
* Arguments for {@linkcode PluginGeomCreateApi.line}.
|
|
@@ -799,6 +1394,32 @@ export declare const PluginGeomCreateCircleArgs: z.ZodObject<{
|
|
|
799
1394
|
radius: z.ZodNumber;
|
|
800
1395
|
}, z.core.$strip>;
|
|
801
1396
|
export type PluginGeomCreateCircleArgs = z.infer<typeof PluginGeomCreateCircleArgs>;
|
|
1397
|
+
/**
|
|
1398
|
+
* Arguments for {@linkcode PluginGeomCreateApi.splineFromPoints}.
|
|
1399
|
+
*
|
|
1400
|
+
* | Property | Type | Description |
|
|
1401
|
+
* |---|---|---|
|
|
1402
|
+
* | `points` | {@linkcode Vec3Handle}`[]` | 3..256 ordered through-points of the curve |
|
|
1403
|
+
*/
|
|
1404
|
+
export declare const PluginGeomCreateSplineFromPointsArgs: z.ZodObject<{
|
|
1405
|
+
points: z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>>;
|
|
1406
|
+
}, z.core.$strip>;
|
|
1407
|
+
export type PluginGeomCreateSplineFromPointsArgs = z.infer<typeof PluginGeomCreateSplineFromPointsArgs>;
|
|
1408
|
+
/**
|
|
1409
|
+
* Arguments for {@linkcode PluginGeomCreateApi.splineFromControlPoints}.
|
|
1410
|
+
*
|
|
1411
|
+
* | Property | Type | Description |
|
|
1412
|
+
* |---|---|---|
|
|
1413
|
+
* | `controlPoints` | {@linkcode Vec3Handle}`[]` | 3..512 control points of the curve, in order |
|
|
1414
|
+
* | `options` | `object`? | `degree`: 2 or 3 (default `min(3, controlPoints.length - 1)`) |
|
|
1415
|
+
*/
|
|
1416
|
+
export declare const PluginGeomCreateSplineFromControlPointsArgs: z.ZodObject<{
|
|
1417
|
+
controlPoints: z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>>;
|
|
1418
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
1419
|
+
degree: z.ZodOptional<z.ZodNumber>;
|
|
1420
|
+
}, z.core.$strip>>;
|
|
1421
|
+
}, z.core.$strip>;
|
|
1422
|
+
export type PluginGeomCreateSplineFromControlPointsArgs = z.infer<typeof PluginGeomCreateSplineFromControlPointsArgs>;
|
|
802
1423
|
/**
|
|
803
1424
|
* Arguments for {@linkcode PluginGeomCreateApi.profileFromLinePoints}.
|
|
804
1425
|
*
|
|
@@ -818,9 +1439,20 @@ export type PluginGeomCreateProfileFromLinePointsArgs = z.infer<typeof PluginGeo
|
|
|
818
1439
|
* | `curves` | {@linkcode CurveHandle}`[]` | Ordered curve handles forming a closed loop |
|
|
819
1440
|
*/
|
|
820
1441
|
export declare const PluginGeomCreateProfileFromCurvesArgs: z.ZodObject<{
|
|
821
|
-
curves: z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"arc">, string>>]>>;
|
|
1442
|
+
curves: z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"arc">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"spline">, string>>]>>;
|
|
822
1443
|
}, z.core.$strip>;
|
|
823
1444
|
export type PluginGeomCreateProfileFromCurvesArgs = z.infer<typeof PluginGeomCreateProfileFromCurvesArgs>;
|
|
1445
|
+
/**
|
|
1446
|
+
* Arguments for {@linkcode PluginGeomCreateApi.profileFromSplinePoints}.
|
|
1447
|
+
*
|
|
1448
|
+
* | Property | Type | Description |
|
|
1449
|
+
* |---|---|---|
|
|
1450
|
+
* | `points` | {@linkcode Vec3Handle}`[]` | 3..256 ordered through-points of the closed loop (first point NOT repeated) |
|
|
1451
|
+
*/
|
|
1452
|
+
export declare const PluginGeomCreateProfileFromSplinePointsArgs: z.ZodObject<{
|
|
1453
|
+
points: z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"vec3">, string>>>;
|
|
1454
|
+
}, z.core.$strip>;
|
|
1455
|
+
export type PluginGeomCreateProfileFromSplinePointsArgs = z.infer<typeof PluginGeomCreateProfileFromSplinePointsArgs>;
|
|
824
1456
|
/**
|
|
825
1457
|
* Arguments for {@linkcode PluginGeomCreateApi.contourFromProfile}.
|
|
826
1458
|
*
|
|
@@ -868,6 +1500,7 @@ export type PluginGeomCreateBrepFromFacesArgs = z.infer<typeof PluginGeomCreateB
|
|
|
868
1500
|
* | `contour` | {@linkcode ContourHandle} | The cross-section to extrude |
|
|
869
1501
|
* | `direction` | {@linkcode Vec3Components} | Extrusion direction (non-zero, finite components) |
|
|
870
1502
|
* | `amount` | `number` | Extrusion distance (finite, non-zero) |
|
|
1503
|
+
* | `options` | `object`? | Optional twist and taper: `twistInDegrees` (an angle, finite), `topScale` (a ratio, finite and positive) and `levels` (a count, 2..64) |
|
|
871
1504
|
*/
|
|
872
1505
|
export declare const PluginGeomCreateBrepFromExtrusionArgs: z.ZodObject<{
|
|
873
1506
|
contour: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"contour">, string>>;
|
|
@@ -877,6 +1510,11 @@ export declare const PluginGeomCreateBrepFromExtrusionArgs: z.ZodObject<{
|
|
|
877
1510
|
z: z.ZodNumber;
|
|
878
1511
|
}, z.core.$strip>;
|
|
879
1512
|
amount: z.ZodNumber;
|
|
1513
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
1514
|
+
twistInDegrees: z.ZodOptional<z.ZodNumber>;
|
|
1515
|
+
topScale: z.ZodOptional<z.ZodNumber>;
|
|
1516
|
+
levels: z.ZodOptional<z.ZodNumber>;
|
|
1517
|
+
}, z.core.$strip>>;
|
|
880
1518
|
}, z.core.$strip>;
|
|
881
1519
|
export type PluginGeomCreateBrepFromExtrusionArgs = z.infer<typeof PluginGeomCreateBrepFromExtrusionArgs>;
|
|
882
1520
|
/**
|
|
@@ -886,8 +1524,8 @@ export type PluginGeomCreateBrepFromExtrusionArgs = z.infer<typeof PluginGeomCre
|
|
|
886
1524
|
* |---|---|---|
|
|
887
1525
|
* | `bottomContour` | {@linkcode ContourHandle} | The bottom cross-section |
|
|
888
1526
|
* | `topContour` | {@linkcode ContourHandle} | The top cross-section |
|
|
889
|
-
* | `intermediateContours` | {@linkcode ContourHandle}`[]`? | Optional in-between cross-sections, ordered bottom to top |
|
|
890
|
-
* | `options` | `object`? | Optional behavior switches: `compatibility` (`"strict"` throws on mismatched edge counts instead of auto-matching; default `"auto"`)
|
|
1527
|
+
* | `intermediateContours` | {@linkcode ContourHandle}`[]`? | Optional in-between cross-sections, ordered bottom to top (any count; more than 32 sections in all builds but carries no parameter record) |
|
|
1528
|
+
* | `options` | `object`? | Optional behavior switches: `compatibility` (`"strict"` throws on mismatched edge counts instead of auto-matching; default `"auto"`), `seamAlignment` (`"authored"` keeps the authored correspondence instead of searching seam rotations; default `"auto"`) and `smoothing` (`"smooth"` lofts every section in one pass, so the sides curve through the intermediates; default `"ruled"`) |
|
|
891
1529
|
*/
|
|
892
1530
|
export declare const PluginGeomCreateBrepFromLoftArgs: z.ZodObject<{
|
|
893
1531
|
bottomContour: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"contour">, string>>;
|
|
@@ -902,6 +1540,10 @@ export declare const PluginGeomCreateBrepFromLoftArgs: z.ZodObject<{
|
|
|
902
1540
|
auto: "auto";
|
|
903
1541
|
authored: "authored";
|
|
904
1542
|
}>>;
|
|
1543
|
+
smoothing: z.ZodOptional<z.ZodEnum<{
|
|
1544
|
+
ruled: "ruled";
|
|
1545
|
+
smooth: "smooth";
|
|
1546
|
+
}>>;
|
|
905
1547
|
}, z.core.$strip>>;
|
|
906
1548
|
}, z.core.$strip>;
|
|
907
1549
|
export type PluginGeomCreateBrepFromLoftArgs = z.infer<typeof PluginGeomCreateBrepFromLoftArgs>;
|
|
@@ -944,15 +1586,62 @@ export type PluginGeomCreateBrepBooleanArgs = z.infer<typeof PluginGeomCreateBre
|
|
|
944
1586
|
* | Property | Type | Description |
|
|
945
1587
|
* |---|---|---|
|
|
946
1588
|
* | `brep` | {@linkcode BrepHandle} | The solid whose edges to round |
|
|
947
|
-
* | `edges` | {@linkcode EdgeHandle}`[]` | The
|
|
948
|
-
* | `radius` | `number` | Fillet radius (positive, finite) |
|
|
1589
|
+
* | `edges` | {@linkcode EdgeHandle}`[]` | The edges to fillet (one or more; more than 64 builds but carries no parameter record) |
|
|
1590
|
+
* | `radius` | `number` | Fillet radius (positive, finite); the start radius with `endRadius`, unused with `radii` |
|
|
1591
|
+
* | `options` | `object`? | Optional variable blend: `endRadius` (positive, finite) or `radii` (2..32 rows of `{ position, radius }`, `position` a ratio 0..1 strictly increasing). Mutually exclusive, and either one takes exactly ONE edge |
|
|
949
1592
|
*/
|
|
950
1593
|
export declare const PluginGeomCreateBrepFromFilletArgs: z.ZodObject<{
|
|
951
1594
|
brep: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"brep">, string>>;
|
|
952
1595
|
edges: z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"edge">, string>>>;
|
|
953
1596
|
radius: z.ZodNumber;
|
|
1597
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
1598
|
+
endRadius: z.ZodOptional<z.ZodNumber>;
|
|
1599
|
+
radii: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1600
|
+
position: z.ZodNumber;
|
|
1601
|
+
radius: z.ZodNumber;
|
|
1602
|
+
}, z.core.$strip>>>;
|
|
1603
|
+
}, z.core.$strip>>;
|
|
954
1604
|
}, z.core.$strip>;
|
|
955
1605
|
export type PluginGeomCreateBrepFromFilletArgs = z.infer<typeof PluginGeomCreateBrepFromFilletArgs>;
|
|
1606
|
+
/** An edge with the solid it belongs to. See {@linkcode OwnedEdge}. */
|
|
1607
|
+
export declare const OwnedEdge: z.ZodObject<{
|
|
1608
|
+
edge: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"edge">, string>>;
|
|
1609
|
+
brep: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"brep">, string>>;
|
|
1610
|
+
face: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"face">, string>>>;
|
|
1611
|
+
}, z.core.$strip>;
|
|
1612
|
+
/**
|
|
1613
|
+
* Arguments for {@linkcode PluginGeomCreateApi.brepFromPatch}.
|
|
1614
|
+
*
|
|
1615
|
+
* | Property | Type | Description |
|
|
1616
|
+
* |---|---|---|
|
|
1617
|
+
* | `boundary` | ({@linkcode CurveHandle} \| {@linkcode OwnedEdge})`[]` | 3..16 items forming one closed loop |
|
|
1618
|
+
* | `thickness` | `number` | Solid thickness in internal length units (positive, finite) |
|
|
1619
|
+
* | `options` | `object`? | `interiorPoints` (≤ 64 plain `{x, y, z}` the surface is pulled through), `continuity` (`"position"` default, or `"tangent"` — every item must then be an edge item naming its `face`), `side` (`"below"` default, or `"above"`) |
|
|
1620
|
+
*/
|
|
1621
|
+
export declare const PluginGeomCreateBrepFromPatchArgs: z.ZodObject<{
|
|
1622
|
+
boundary: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"arc">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"spline">, string>>]>, z.ZodObject<{
|
|
1623
|
+
edge: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"edge">, string>>;
|
|
1624
|
+
brep: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"brep">, string>>;
|
|
1625
|
+
face: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"face">, string>>>;
|
|
1626
|
+
}, z.core.$strip>]>>;
|
|
1627
|
+
thickness: z.ZodNumber;
|
|
1628
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
1629
|
+
interiorPoints: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1630
|
+
x: z.ZodNumber;
|
|
1631
|
+
y: z.ZodNumber;
|
|
1632
|
+
z: z.ZodNumber;
|
|
1633
|
+
}, z.core.$strip>>>;
|
|
1634
|
+
continuity: z.ZodOptional<z.ZodEnum<{
|
|
1635
|
+
position: "position";
|
|
1636
|
+
tangent: "tangent";
|
|
1637
|
+
}>>;
|
|
1638
|
+
side: z.ZodOptional<z.ZodEnum<{
|
|
1639
|
+
below: "below";
|
|
1640
|
+
above: "above";
|
|
1641
|
+
}>>;
|
|
1642
|
+
}, z.core.$strip>>;
|
|
1643
|
+
}, z.core.$strip>;
|
|
1644
|
+
export type PluginGeomCreateBrepFromPatchArgs = z.infer<typeof PluginGeomCreateBrepFromPatchArgs>;
|
|
956
1645
|
/**
|
|
957
1646
|
* Arguments for {@linkcode PluginGeomCreateApi.brepFromOffset}.
|
|
958
1647
|
*
|
|
@@ -972,7 +1661,7 @@ export type PluginGeomCreateBrepFromOffsetArgs = z.infer<typeof PluginGeomCreate
|
|
|
972
1661
|
* | Property | Type | Description |
|
|
973
1662
|
* |---|---|---|
|
|
974
1663
|
* | `brep` | {@linkcode BrepHandle} | The solid to hollow |
|
|
975
|
-
* | `openFaces` | {@linkcode FaceHandle}`[]` | The faces to remove as openings (
|
|
1664
|
+
* | `openFaces` | {@linkcode FaceHandle}`[]` | The faces to remove as openings (one or more; more than 32 builds but carries no parameter record) |
|
|
976
1665
|
* | `thickness` | `number` | Wall thickness (positive, finite) |
|
|
977
1666
|
*/
|
|
978
1667
|
export declare const PluginGeomCreateBrepFromShellArgs: z.ZodObject<{
|
|
@@ -1004,13 +1693,43 @@ export declare const PluginGeomCreateBrepsFromSplitArgs: z.ZodObject<{
|
|
|
1004
1693
|
}, z.core.$strip>;
|
|
1005
1694
|
}, z.core.$strip>;
|
|
1006
1695
|
export type PluginGeomCreateBrepsFromSplitArgs = z.infer<typeof PluginGeomCreateBrepsFromSplitArgs>;
|
|
1696
|
+
/**
|
|
1697
|
+
* Arguments for {@linkcode PluginGeomCreateApi.brepsFromSplitByFace}.
|
|
1698
|
+
*
|
|
1699
|
+
* | Property | Type | Description |
|
|
1700
|
+
* |---|---|---|
|
|
1701
|
+
* | `brep` | {@linkcode BrepHandle} | The solid to cut |
|
|
1702
|
+
* | `toolFace` | {@linkcode FaceHandle} | The cutting face (read-only) |
|
|
1703
|
+
* | `toolBrep` | {@linkcode BrepHandle} | The solid `toolFace` belongs to (owner last) |
|
|
1704
|
+
*/
|
|
1705
|
+
export declare const PluginGeomCreateBrepsFromSplitByFaceArgs: z.ZodObject<{
|
|
1706
|
+
brep: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"brep">, string>>;
|
|
1707
|
+
toolFace: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"face">, string>>;
|
|
1708
|
+
toolBrep: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"brep">, string>>;
|
|
1709
|
+
}, z.core.$strip>;
|
|
1710
|
+
export type PluginGeomCreateBrepsFromSplitByFaceArgs = z.infer<typeof PluginGeomCreateBrepsFromSplitByFaceArgs>;
|
|
1711
|
+
/**
|
|
1712
|
+
* Arguments for {@linkcode PluginGeomCreateApi.curvesFromProjection}.
|
|
1713
|
+
*
|
|
1714
|
+
* | Property | Type | Description |
|
|
1715
|
+
* |---|---|---|
|
|
1716
|
+
* | `curve` | {@linkcode CurveHandle} | The curve to project |
|
|
1717
|
+
* | `face` | {@linkcode FaceHandle} | The face to project onto |
|
|
1718
|
+
* | `faceBrep` | {@linkcode BrepHandle} | The solid `face` belongs to (owner last) |
|
|
1719
|
+
*/
|
|
1720
|
+
export declare const PluginGeomCreateCurvesFromProjectionArgs: z.ZodObject<{
|
|
1721
|
+
curve: z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"arc">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"spline">, string>>]>;
|
|
1722
|
+
face: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"face">, string>>;
|
|
1723
|
+
faceBrep: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"brep">, string>>;
|
|
1724
|
+
}, z.core.$strip>;
|
|
1725
|
+
export type PluginGeomCreateCurvesFromProjectionArgs = z.infer<typeof PluginGeomCreateCurvesFromProjectionArgs>;
|
|
1007
1726
|
/**
|
|
1008
1727
|
* Arguments for {@linkcode PluginGeomCreateApi.brepFromChamfer}.
|
|
1009
1728
|
*
|
|
1010
1729
|
* | Property | Type | Description |
|
|
1011
1730
|
* |---|---|---|
|
|
1012
1731
|
* | `brep` | {@linkcode BrepHandle} | The solid whose edges to bevel |
|
|
1013
|
-
* | `edges` | {@linkcode EdgeHandle}`[]` | The
|
|
1732
|
+
* | `edges` | {@linkcode EdgeHandle}`[]` | The edges to chamfer (one or more; more than 64 builds but carries no parameter record) |
|
|
1014
1733
|
* | `distance` | `number` | Chamfer distance from the edge on each adjacent face (positive, finite) |
|
|
1015
1734
|
*/
|
|
1016
1735
|
export declare const PluginGeomCreateBrepFromChamferArgs: z.ZodObject<{
|
|
@@ -1025,8 +1744,8 @@ export type PluginGeomCreateBrepFromChamferArgs = z.infer<typeof PluginGeomCreat
|
|
|
1025
1744
|
* | Property | Type | Description |
|
|
1026
1745
|
* |---|---|---|
|
|
1027
1746
|
* | `profile` | {@linkcode ContourHandle} | The cross-section to sweep (hole-free) |
|
|
1028
|
-
* | `path` | {@linkcode Vec3Components}`[]` | The polyline path (
|
|
1029
|
-
* | `options` | `object`? | Optional scale law: `startScale`/`endScale` (linear taper by arc length) or per-point `scales` (mutually exclusive; factors finite, 1e-3..1e3; `scales.length` must equal `path.length`). Optional corner `transition`: `"miter"` (default) or `{ bevel }` (chamfered corners; finite, 1e-3..1e3) |
|
|
1747
|
+
* | `path` | {@linkcode Vec3Components}`[]` | The polyline path (2 or more points, finite components — more than 512 builds but carries no parameter record; repeating the first point as the last closes it into a ring — closed paths must be flat and straight-segmented and take a straight-edged profile) |
|
|
1748
|
+
* | `options` | `object`? | Optional scale law: `startScale`/`endScale` (linear taper by arc length) or per-point `scales` (mutually exclusive; factors finite, 1e-3..1e3; `scales.length` must equal `path.length`). Optional corner `transition`: `"miter"` (default), `"round"` (arc-carried corners) or `{ bevel }` (chamfered corners; finite, 1e-3..1e3) |
|
|
1030
1749
|
*/
|
|
1031
1750
|
export declare const PluginGeomCreateBrepFromSweepArgs: z.ZodObject<{
|
|
1032
1751
|
profile: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"contour">, string>>;
|
|
@@ -1039,20 +1758,42 @@ export declare const PluginGeomCreateBrepFromSweepArgs: z.ZodObject<{
|
|
|
1039
1758
|
startScale: z.ZodOptional<z.ZodNumber>;
|
|
1040
1759
|
endScale: z.ZodOptional<z.ZodNumber>;
|
|
1041
1760
|
scales: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
1042
|
-
transition: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"miter">, z.ZodObject<{
|
|
1761
|
+
transition: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"miter">, z.ZodLiteral<"round">, z.ZodObject<{
|
|
1043
1762
|
bevel: z.ZodNumber;
|
|
1044
1763
|
}, z.core.$strip>]>>;
|
|
1045
1764
|
}, z.core.$strip>>;
|
|
1046
1765
|
}, z.core.$strip>;
|
|
1047
1766
|
export type PluginGeomCreateBrepFromSweepArgs = z.infer<typeof PluginGeomCreateBrepFromSweepArgs>;
|
|
1767
|
+
/**
|
|
1768
|
+
* Arguments for {@linkcode PluginGeomCreateApi.brepFromSweepAlongCurve}.
|
|
1769
|
+
*
|
|
1770
|
+
* | Property | Type | Description |
|
|
1771
|
+
* |---|---|---|
|
|
1772
|
+
* | `profile` | {@linkcode ContourHandle} | The cross-section to sweep (hole-free) |
|
|
1773
|
+
* | `path` | {@linkcode CurveHandle}`[]` | 1..64 curves, ordered, meeting end to end |
|
|
1774
|
+
* | `options` | `object`? | `orientation` — `"upright"` (default), `"frenet"` or `"fixed"`; `rail` — a second guide {@linkcode CurveHandle} |
|
|
1775
|
+
*/
|
|
1776
|
+
export declare const PluginGeomCreateBrepFromSweepAlongCurveArgs: z.ZodObject<{
|
|
1777
|
+
profile: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"contour">, string>>;
|
|
1778
|
+
path: z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"arc">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"spline">, string>>]>>;
|
|
1779
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
1780
|
+
orientation: z.ZodOptional<z.ZodEnum<{
|
|
1781
|
+
fixed: "fixed";
|
|
1782
|
+
frenet: "frenet";
|
|
1783
|
+
upright: "upright";
|
|
1784
|
+
}>>;
|
|
1785
|
+
rail: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"arc">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../../..").Handle<"spline">, string>>]>>;
|
|
1786
|
+
}, z.core.$strip>>;
|
|
1787
|
+
}, z.core.$strip>;
|
|
1788
|
+
export type PluginGeomCreateBrepFromSweepAlongCurveArgs = z.infer<typeof PluginGeomCreateBrepFromSweepAlongCurveArgs>;
|
|
1048
1789
|
/**
|
|
1049
1790
|
* Arguments for {@linkcode PluginGeomCreateApi.brepFromRevolution}.
|
|
1050
1791
|
*
|
|
1051
1792
|
* | Property | Type | Description |
|
|
1052
1793
|
* |---|---|---|
|
|
1053
1794
|
* | `profile` | {@linkcode ContourHandle} | The cross-section to revolve (holes allowed) |
|
|
1054
|
-
* | `axisOrigin` | {@linkcode Vec3Components} | A point on the revolution axis (finite components) |
|
|
1055
|
-
* | `axisDirection` | {@linkcode Vec3Components} | The axis direction (non-zero, finite components) |
|
|
1795
|
+
* | `axisOrigin` | {@linkcode Vec3Components} | A point on the revolution axis (finite components; the axis must lie in the plane of the profile) |
|
|
1796
|
+
* | `axisDirection` | {@linkcode Vec3Components} | The axis direction (non-zero, finite components; the axis must lie in the plane of the profile) |
|
|
1056
1797
|
* | `angleInDegrees` | `number`? | Revolution angle in degrees (0 < angle ≤ 360; default 360) |
|
|
1057
1798
|
*/
|
|
1058
1799
|
export declare const PluginGeomCreateBrepFromRevolutionArgs: z.ZodObject<{
|
|
@@ -1070,4 +1811,98 @@ export declare const PluginGeomCreateBrepFromRevolutionArgs: z.ZodObject<{
|
|
|
1070
1811
|
angleInDegrees: z.ZodOptional<z.ZodNumber>;
|
|
1071
1812
|
}, z.core.$strip>;
|
|
1072
1813
|
export type PluginGeomCreateBrepFromRevolutionArgs = z.infer<typeof PluginGeomCreateBrepFromRevolutionArgs>;
|
|
1814
|
+
/**
|
|
1815
|
+
* Arguments for {@linkcode PluginGeomCreateApi.brepFromSphere}.
|
|
1816
|
+
*
|
|
1817
|
+
* | Property | Type | Description |
|
|
1818
|
+
* |---|---|---|
|
|
1819
|
+
* | `centre` | {@linkcode Vec3Components} | Sphere centre (finite components) |
|
|
1820
|
+
* | `radius` | `number` | Sphere radius (finite; positivity is checked host-side so the error names the parameter) |
|
|
1821
|
+
*/
|
|
1822
|
+
export declare const PluginGeomCreateBrepFromSphereArgs: z.ZodObject<{
|
|
1823
|
+
centre: z.ZodObject<{
|
|
1824
|
+
x: z.ZodNumber;
|
|
1825
|
+
y: z.ZodNumber;
|
|
1826
|
+
z: z.ZodNumber;
|
|
1827
|
+
}, z.core.$strip>;
|
|
1828
|
+
radius: z.ZodNumber;
|
|
1829
|
+
}, z.core.$strip>;
|
|
1830
|
+
export type PluginGeomCreateBrepFromSphereArgs = z.infer<typeof PluginGeomCreateBrepFromSphereArgs>;
|
|
1831
|
+
/**
|
|
1832
|
+
* Arguments for {@linkcode PluginGeomCreateApi.brepFromCylinder}.
|
|
1833
|
+
*
|
|
1834
|
+
* | Property | Type | Description |
|
|
1835
|
+
* |---|---|---|
|
|
1836
|
+
* | `base` | {@linkcode Vec3Components} | Centre of the bottom cap (finite components) |
|
|
1837
|
+
* | `axis` | {@linkcode Vec3Components} | Axis direction (non-zero, finite components) |
|
|
1838
|
+
* | `radius` | `number` | Cylinder radius (finite, positive) |
|
|
1839
|
+
* | `height` | `number` | Height along `axis` (finite, positive) |
|
|
1840
|
+
*/
|
|
1841
|
+
export declare const PluginGeomCreateBrepFromCylinderArgs: z.ZodObject<{
|
|
1842
|
+
base: z.ZodObject<{
|
|
1843
|
+
x: z.ZodNumber;
|
|
1844
|
+
y: z.ZodNumber;
|
|
1845
|
+
z: z.ZodNumber;
|
|
1846
|
+
}, z.core.$strip>;
|
|
1847
|
+
axis: z.ZodObject<{
|
|
1848
|
+
x: z.ZodNumber;
|
|
1849
|
+
y: z.ZodNumber;
|
|
1850
|
+
z: z.ZodNumber;
|
|
1851
|
+
}, z.core.$strip>;
|
|
1852
|
+
radius: z.ZodNumber;
|
|
1853
|
+
height: z.ZodNumber;
|
|
1854
|
+
}, z.core.$strip>;
|
|
1855
|
+
export type PluginGeomCreateBrepFromCylinderArgs = z.infer<typeof PluginGeomCreateBrepFromCylinderArgs>;
|
|
1856
|
+
/**
|
|
1857
|
+
* Arguments for {@linkcode PluginGeomCreateApi.brepFromCone}.
|
|
1858
|
+
*
|
|
1859
|
+
* | Property | Type | Description |
|
|
1860
|
+
* |---|---|---|
|
|
1861
|
+
* | `base` | {@linkcode Vec3Components} | Centre of the bottom cap (finite components) |
|
|
1862
|
+
* | `axis` | {@linkcode Vec3Components} | Axis direction (non-zero, finite components) |
|
|
1863
|
+
* | `baseRadius` | `number` | Radius at the base (finite, positive) |
|
|
1864
|
+
* | `height` | `number` | Height along `axis` (finite, positive) |
|
|
1865
|
+
* | `topRadius` | `number`? | Radius at the top (finite, ≥ 0, ≠ `baseRadius`; default 0 = apex) |
|
|
1866
|
+
*/
|
|
1867
|
+
export declare const PluginGeomCreateBrepFromConeArgs: z.ZodObject<{
|
|
1868
|
+
base: z.ZodObject<{
|
|
1869
|
+
x: z.ZodNumber;
|
|
1870
|
+
y: z.ZodNumber;
|
|
1871
|
+
z: z.ZodNumber;
|
|
1872
|
+
}, z.core.$strip>;
|
|
1873
|
+
axis: z.ZodObject<{
|
|
1874
|
+
x: z.ZodNumber;
|
|
1875
|
+
y: z.ZodNumber;
|
|
1876
|
+
z: z.ZodNumber;
|
|
1877
|
+
}, z.core.$strip>;
|
|
1878
|
+
baseRadius: z.ZodNumber;
|
|
1879
|
+
height: z.ZodNumber;
|
|
1880
|
+
topRadius: z.ZodOptional<z.ZodNumber>;
|
|
1881
|
+
}, z.core.$strip>;
|
|
1882
|
+
export type PluginGeomCreateBrepFromConeArgs = z.infer<typeof PluginGeomCreateBrepFromConeArgs>;
|
|
1883
|
+
/**
|
|
1884
|
+
* Arguments for {@linkcode PluginGeomCreateApi.brepFromTorus}.
|
|
1885
|
+
*
|
|
1886
|
+
* | Property | Type | Description |
|
|
1887
|
+
* |---|---|---|
|
|
1888
|
+
* | `centre` | {@linkcode Vec3Components} | Torus centre (finite components) |
|
|
1889
|
+
* | `axis` | {@linkcode Vec3Components} | Plane normal of the ring (non-zero, finite components) |
|
|
1890
|
+
* | `majorRadius` | `number` | Ring radius, centre to tube centre (finite, positive) |
|
|
1891
|
+
* | `minorRadius` | `number` | Tube radius (finite, positive, strictly less than `majorRadius`) |
|
|
1892
|
+
*/
|
|
1893
|
+
export declare const PluginGeomCreateBrepFromTorusArgs: z.ZodObject<{
|
|
1894
|
+
centre: z.ZodObject<{
|
|
1895
|
+
x: z.ZodNumber;
|
|
1896
|
+
y: z.ZodNumber;
|
|
1897
|
+
z: z.ZodNumber;
|
|
1898
|
+
}, z.core.$strip>;
|
|
1899
|
+
axis: z.ZodObject<{
|
|
1900
|
+
x: z.ZodNumber;
|
|
1901
|
+
y: z.ZodNumber;
|
|
1902
|
+
z: z.ZodNumber;
|
|
1903
|
+
}, z.core.$strip>;
|
|
1904
|
+
majorRadius: z.ZodNumber;
|
|
1905
|
+
minorRadius: z.ZodNumber;
|
|
1906
|
+
}, z.core.$strip>;
|
|
1907
|
+
export type PluginGeomCreateBrepFromTorusArgs = z.infer<typeof PluginGeomCreateBrepFromTorusArgs>;
|
|
1073
1908
|
//# sourceMappingURL=index.d.ts.map
|