partforge 0.85.0 → 0.85.2
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/docs/ERROR-PATTERNS.md
CHANGED
|
@@ -521,6 +521,18 @@ Variant literal for a curve-adjacent corner: `filletProfile: corner <i> at (<x>,
|
|
|
521
521
|
- **Cause:** two sharp-tagged vertices (or two contour corners) in the same section are numerically coincident, so the arc between them has zero length — e.g. tagging *both* ends of a closed NACA trailing edge, whose closure coefficient already brings them to the same point (or the same point after a per-section `rotate`). This also fires for the v1 meaning of the message: a genuinely degenerate section.
|
|
522
522
|
- **Fix:** tag only one of the coincident vertices as the corner (see `src/parts/propeller.js`'s `sharpTE` comment for why a second tag there would create exactly this zero-length arc). See [AUTHORING-PARTS.md](AUTHORING-PARTS.md)'s `k.loftSmooth` row.
|
|
523
523
|
|
|
524
|
+
## loftsmooth-stations-out-of-range
|
|
525
|
+
|
|
526
|
+
- **Symptom:** `loftSmooth: stations must be 2…1024 (or "controls")` — an explicit `stations` was rejected.
|
|
527
|
+
- **Cause:** `stations` is clamped to 2…1024 (a preview/export density guard); a non-integer, non-finite, or out-of-range value throws. The default (8 per span + 1 open, 8 per section closed) caps itself at 1024, so omitting the option never trips this.
|
|
528
|
+
- **Fix:** pass an integer in 2…1024, or omit `stations` for the capped default. More rings than 1024 along the spine is a density smell — the surface is already spline-smooth between stations; raise `samples` instead if the banding is around the ring. See the `loftSmooth` row in [KERNEL-CONTRACT.md](KERNEL-CONTRACT.md).
|
|
529
|
+
|
|
530
|
+
## loftsmooth-samples-out-of-range
|
|
531
|
+
|
|
532
|
+
- **Symptom:** `loftSmooth: samples must be 8…2048` — possibly without ever passing `samples`.
|
|
533
|
+
- **Cause:** `samples` is clamped to 8…2048. The default is `max(64, largest section)`, so a control section with more than 2048 points pushes the DEFAULT out of range — the throw then names an option the caller never passed.
|
|
534
|
+
- **Fix:** pass a `samples` value in 8…2048, and thin any control section above ~2048 points — `loftSmooth` interpolates a smooth outline through the points, so sections that dense defeat the sparse-sections design (pass the dense rings straight to `k.loft` instead). See the `loftSmooth` row in [KERNEL-CONTRACT.md](KERNEL-CONTRACT.md).
|
|
535
|
+
|
|
524
536
|
## duplicate-preset-name-throws
|
|
525
537
|
|
|
526
538
|
- **Symptom:** `duplicate preset name across sections:` thrown from verify/measure, naming the repeated preset (e.g. `duplicate preset name across sections: "Compact"`).
|
package/package.json
CHANGED
|
@@ -303,8 +303,8 @@ function reconcile(resolved, V) {
|
|
|
303
303
|
* corners implicitly.
|
|
304
304
|
* @param {{stations?: number|"controls", samples?: number, closed?: boolean}} opts
|
|
305
305
|
* stations — output ring count along the spine (default 8 per span + 1 open,
|
|
306
|
-
* 8 per section closed; ≥ 2; raised to the section count when
|
|
307
|
-
* control knot is always emitted). The string "controls" skips cross-station
|
|
306
|
+
* 8 per section closed, capped at 1024; ≥ 2; raised to the section count when
|
|
307
|
+
* lower; every control knot is always emitted). The string "controls" skips cross-station
|
|
308
308
|
* interpolation entirely and emits one ring per control section at its own z
|
|
309
309
|
* — the B-rep path, where the backend's native smooth loft (`ruled: false`)
|
|
310
310
|
* does the skinning through exact wires and only the around-ring
|
|
@@ -320,7 +320,9 @@ export function smoothLoftRings(sections, { stations, samples, closed = false }
|
|
|
320
320
|
if (closed && stations === "controls")
|
|
321
321
|
throw new Error('loftSmooth: closed:true cannot combine with stations:"controls"');
|
|
322
322
|
if (closed && n < 3) throw new Error("loftSmooth: closed:true needs at least 3 control sections");
|
|
323
|
-
|
|
323
|
+
// The default caps at the clamp ceiling: at 129+ sections the raw formula
|
|
324
|
+
// would trip the range check on an option the caller never passed.
|
|
325
|
+
const S = stations ?? Math.min(closed ? n * 8 : (n - 1) * 8 + 1, 1024);
|
|
324
326
|
const V = samples ?? Math.max(64, ...resolved.map((r) => r.pts2d.length));
|
|
325
327
|
if (stations !== "controls" && !(Number.isFinite(S) && S >= 2 && S <= 1024))
|
|
326
328
|
throw new Error('loftSmooth: stations must be 2…1024 (or "controls")');
|
package/types/kernel.d.ts
CHANGED
|
@@ -323,7 +323,8 @@ export interface ExtrudeOptions {
|
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
export interface LoftRing {
|
|
326
|
-
|
|
326
|
+
/** Points, a curve contour, or a single-region hole-free `Shape2D` outline. */
|
|
327
|
+
polygon?: Contour | Shape2D;
|
|
327
328
|
sides?: number;
|
|
328
329
|
radius?: number;
|
|
329
330
|
z: number;
|
|
@@ -398,7 +399,7 @@ export interface LoftSmoothSection {
|
|
|
398
399
|
export interface LoftSmoothOptions {
|
|
399
400
|
/** Sparse control sections; vertex counts may differ between sections. */
|
|
400
401
|
sections: LoftSmoothSection[];
|
|
401
|
-
/** Output ring count along the spine (default 8 per span + 1; closed: 8 per section). */
|
|
402
|
+
/** Output ring count along the spine (default 8 per span + 1; closed: 8 per section; capped at 1024). */
|
|
402
403
|
stations?: number;
|
|
403
404
|
/** Output vertex count around each ring (default max(64, largest section)). */
|
|
404
405
|
samples?: number;
|