geometrix 0.5.42 → 0.5.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +19 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3894,30 +3894,38 @@ ${extrud.outName} = fex_${extrud.outName}()
3894
3894
  let rStr = "";
3895
3895
  if (volum.inList.length === 0) {
3896
3896
  console.log(`err215: ${volum.outName} has an empty inList`);
3897
- } else if (volum.inList.length === 1) {
3897
+ } else if (volum.inList.length === 1 || volum.boolMethod === 0 /* eIdentity */) {
3898
3898
  rStr += `${volum.outName} = ${volum.inList[0]}
3899
3899
  `;
3900
3900
  } else {
3901
3901
  const firstV = volum.inList[0];
3902
3902
  const othersV = volum.inList.slice(1);
3903
+ let combMethod = "dbg897";
3903
3904
  switch (volum.boolMethod) {
3904
- case 0 /* eIdentity */:
3905
- rStr += `${volum.outName} = ${firstV}
3906
- `;
3907
- break;
3908
3905
  case 1 /* eIntersection */:
3909
- rStr += `${volum.outName} = ${firstV}.common([${othersV.join(", ")}])
3910
- `;
3906
+ combMethod = "common";
3911
3907
  break;
3912
3908
  case 2 /* eUnion */:
3913
- rStr += `${volum.outName} = ${firstV}.fuse([${othersV.join(", ")}])
3914
- `;
3909
+ combMethod = "fuse";
3915
3910
  break;
3916
3911
  case 3 /* eSubstraction */:
3917
- rStr += `${volum.outName} = ${firstV}.cut([${othersV.join(", ")}])
3918
- `;
3912
+ combMethod = "cut";
3919
3913
  break;
3920
3914
  }
3915
+ rStr += `def fvol_${volum.outName}():
3916
+ V000 = ${firstV}
3917
+ `;
3918
+ let vidx = 0;
3919
+ for (const vol of othersV) {
3920
+ rStr += ` V${fid(vidx + 1)} = V${fid(vidx)}.${combMethod}(${vol})
3921
+ `;
3922
+ vidx += 1;
3923
+ }
3924
+ rStr += ` VFC = V${fid(vidx)}.removeSplitter()
3925
+ return VFC
3926
+ ${volum.outName} = fvol_${volum.outName}()
3927
+
3928
+ `;
3921
3929
  }
3922
3930
  return rStr;
3923
3931
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geometrix",
3
- "version": "0.5.42",
3
+ "version": "0.5.43",
4
4
  "description": "The 2D geometry engine of the parametrix",
5
5
  "private": false,
6
6
  "repository": {