Skip to content

Commit

Permalink
Add menue options for enabling full manifold exports
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Harrington committed Nov 18, 2024
1 parent 266fbb0 commit dd98bf6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public static void main(String[] args) throws Exception {

}
CSG.setDefaultOptType(CSG.OptType.CSG_BOUND);
CSG.setPreventNonManifoldTriangles(true);
//CSG.setPreventNonManifoldTriangles(true);
Plane.setEPSILON(1.0e-9);
Vector3d.setEXPORTEPSILON(10);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,7 @@ public void onLogin(String arg0) {
CheckMenuItem showRuler = new CheckMenuItem("Show Ruler ");
showRuler.setSelected(true);
CheckMenuItem showCSGProgress = new CheckMenuItem("Show CSG Update");
CheckMenuItem useAdvancedSTL = new CheckMenuItem("Generate Advanced STL (Fully Manifold)");
CSG.setProgressMoniter((currentIndex, finalIndex, type, intermediateShape) -> {
try {
int i = currentIndex + 1;
Expand All @@ -1623,8 +1624,8 @@ public void onLogin(String arg0) {
+ finalIndex;
if (showCSGProgress.isSelected()) {
System.out.println(x);
if(finalIndex>100) {
if(percent>99) {
if(finalIndex>50) {
if(percent>90) {
SplashManager.closeSplash();
}else {
SplashManager.renderSplashFrame((int)percent, x);
Expand All @@ -1638,6 +1639,11 @@ public void onLogin(String arg0) {
ex.printStackTrace();
}
});
useAdvancedSTL.setOnAction(event -> {
boolean selected = useAdvancedSTL.isSelected();
ConfigurationDatabase.setObject("MenueSettings", "CSG_Advanced_STL", selected);
CSG.setPreventNonManifoldTriangles(selected);
});
showCSGProgress.setOnAction(event -> {
ConfigurationDatabase.setObject("MenueSettings", "printCSG", showCSGProgress.isSelected());
});
Expand All @@ -1649,13 +1655,17 @@ public void onLogin(String arg0) {
// }
// });
Runnable r = () -> {
boolean parseBoolean = Boolean
.parseBoolean(ConfigurationDatabase.getObject("MenueSettings", "CSG_Advanced_STL", CSG.isPreventNonManifoldTriangles()).toString());
CSG.setPreventNonManifoldTriangles(parseBoolean);
useAdvancedSTL.setSelected(parseBoolean);
showCSGProgress.setSelected(Boolean
.parseBoolean(ConfigurationDatabase.getObject("MenueSettings", "printCSG", true).toString()));
};
new Thread(r).start();

CreatureLab3dController.getEngine().setControls(showRuler, idlespin, autohighlight);
WindowMenu.getItems().addAll(showRuler, idlespin, autohighlight, showCSGProgress);
WindowMenu.getItems().addAll(showRuler, idlespin, autohighlight, showCSGProgress,useAdvancedSTL);

new Thread() {
public void run() {
Expand Down

0 comments on commit dd98bf6

Please sign in to comment.