partforge 0.83.0 → 0.83.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "partforge",
3
- "version": "0.83.0",
3
+ "version": "0.83.1",
4
4
  "description": "Turn a declarative part definition into a parametric-CAD web app (three.js + Manifold/Replicad). Requires a Vite-based consumer.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -428,6 +428,10 @@ export function createOcctKernel(replicad) {
428
428
  // lofts the same resolved point rings the Manifold backend stitches, so parity is by
429
429
  // construction (ThruSections' own wire-matching never gets to pick a different seam).
430
430
  // closed:true loops are Manifold-only (replicad loft is open).
431
+ // ThruSections can hand back a NEGATIVELY-oriented solid for some all-cubic wires
432
+ // even though every input wire is CCW (arc and line wires never trigger this), so a
433
+ // volume latch restores the positive orientation — the OCCT twin of loftMesh's
434
+ // whole-mesh volume<0 rebuild on the Manifold side.
431
435
  const loftOp = (rings, { ruled = true, closed = false } = {}) => {
432
436
  if (closed) throw new Error("loft: closed:true loops are only supported on the Manifold backend");
433
437
  const key = h("loft", loftRingsKey(rings), ruled);
@@ -435,7 +439,9 @@ export function createOcctKernel(replicad) {
435
439
  const { mode, resolved } = resolveLoftRings(rings);
436
440
  const wires = resolved.map(({ pts2d, contour, z }) =>
437
441
  (mode === "curve" ? contourDrawing(contour) : contourDrawing(pts2d)).sketchOnPlane("XY", z).wire);
438
- return wrap(loft(wires, { ruled }), [], key);
442
+ const solid = loft(wires, { ruled });
443
+ if (measureVolume(solid) < 0) solid.wrapped.Reverse();
444
+ return wrap(solid, [], key);
439
445
  });
440
446
  };
441
447