mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 08:25:19 +01:00
upgrade engine fixing boolean bugs
This commit is contained in:
parent
b809dcfee8
commit
2326c75b9d
3 changed files with 1631 additions and 1410 deletions
2980
package-lock.json
generated
2980
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -149,7 +149,7 @@
|
||||||
"earcut": "^2.2.4",
|
"earcut": "^2.2.4",
|
||||||
"font-awesome": "4.7.0",
|
"font-awesome": "4.7.0",
|
||||||
"immer": "^9.0.16",
|
"immer": "^9.0.16",
|
||||||
"jsketcher-occ-engine": "1.0.1-2fbef9cdf8e1167a4142c396f9abda510a2d2d26",
|
"jsketcher-occ-engine": "1.0.1-f505cdcb9f37685cdadb937bc3b11b9b75f9267c",
|
||||||
"jszip": "^3.10.1",
|
"jszip": "^3.10.1",
|
||||||
"libtess": "1.2.2",
|
"libtess": "1.2.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
|
|
|
||||||
|
|
@ -93,14 +93,15 @@ export function createOCCUtils(ctx: ApplicationContext): OCCUtils {
|
||||||
}).filter(targetName => !!targetName);
|
}).filter(targetName => !!targetName);
|
||||||
|
|
||||||
|
|
||||||
|
oci.boptions("-default");
|
||||||
|
|
||||||
oci.bclearobjects();
|
oci.bclearobjects();
|
||||||
oci.bcleartools();
|
oci.bcleartools();
|
||||||
|
|
||||||
targetNames.forEach(targetName => oci.baddobjects(targetName));
|
targetNames.forEach(targetName => oci.baddobjects(targetName));
|
||||||
tools.forEach(tool => oci.baddtools(tool));
|
tools.forEach(tool => {
|
||||||
console.log("booleanDef", booleanDef);
|
oci.baddtools(tool)
|
||||||
|
oci.settolerance(tool, 0.0001);
|
||||||
|
});
|
||||||
if (booleanDef.simplify === true){
|
if (booleanDef.simplify === true){
|
||||||
oci.bsimplify("-e", 1, "-f", 1);
|
oci.bsimplify("-e", 1, "-f", 1);
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -112,20 +113,8 @@ export function createOCCUtils(ctx: ApplicationContext): OCCUtils {
|
||||||
oci.bfillds();
|
oci.bfillds();
|
||||||
oci.bapibop("BooleanResult", booleanKindToOCCBopType(kind));
|
oci.bapibop("BooleanResult", booleanKindToOCCBopType(kind));
|
||||||
|
|
||||||
// let resultShell = occ.io.getShell("BooleanResult");
|
|
||||||
// if (resultShell.edges.length < 0) {
|
|
||||||
|
|
||||||
// oci.bsimplify("-e", 0, "-f", 0);
|
if (booleanDef.simplify === true) oci.unifysamedom("BooleanResult", "BooleanResult");
|
||||||
// oci.baddobjects("BooleanResult");
|
|
||||||
// oci.baddtools("BooleanResult");
|
|
||||||
|
|
||||||
// oci.bcheckinverted(1);
|
|
||||||
// oci.bfillds();
|
|
||||||
// oci.bapibop("BooleanResult", OccBBOPTypes.FUSE);
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
oci.fixshape("BooleanResult", "BooleanResult");
|
|
||||||
|
|
||||||
targets.forEach(t => consumed.push(t));
|
targets.forEach(t => consumed.push(t));
|
||||||
tools.forEach(t => consumed.push(t));
|
tools.forEach(t => consumed.push(t));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue