Skip to content
Merged
4 changes: 3 additions & 1 deletion src/main/java/com/commonwealthrobotics/ActiveProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import com.neuronrobotics.bowlerstudio.SplashManager;
import com.neuronrobotics.bowlerstudio.assets.ConfigurationDatabase;
import com.neuronrobotics.bowlerstudio.assets.FontSizeManager;
import com.neuronrobotics.bowlerstudio.creature.ThumbnailImage;
import com.neuronrobotics.bowlerstudio.scripting.DownloadManager;
import com.neuronrobotics.bowlerstudio.scripting.ScriptingEngine;
import com.neuronrobotics.bowlerstudio.scripting.cadoodle.CaDoodleOperation;
Expand Down Expand Up @@ -97,7 +98,7 @@ public Thread regenerateFrom(CaDoodleOperation source) {
return null;
new Thread(() -> {
try {
Thread.sleep(200);
Thread.sleep(100);
} catch (InterruptedException e) {
// Auto-generated catch block
com.neuronrobotics.sdk.common.Log.error(e);
Expand Down Expand Up @@ -384,6 +385,7 @@ public OperationResult accept() {
return operationResult;
}
});
fromFile.setImageEngine(new ThumbnailImage());
return fromFile;
} catch (Exception e) {
newProject();
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/commonwealthrobotics/SelectionBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import eu.mihosoft.vrl.v3d.CSG;
import eu.mihosoft.vrl.v3d.CSGClient;
import eu.mihosoft.vrl.v3d.Cube;
import eu.mihosoft.vrl.v3d.MissingManipulatorException;
import eu.mihosoft.vrl.v3d.Transform;
import eu.mihosoft.vrl.v3d.Vector3d;
import eu.mihosoft.vrl.v3d.ext.quickhull3d.HullUtil;
Expand Down Expand Up @@ -257,7 +258,12 @@ public List<String> checkOverlap(CSG selection2) {
for (CSG key : visible) {
// Check if boxes overlap
if(key.hasManipulator()) {
key=key.transformed(TransformFactory.affineToCSG(key.getManipulator()));
try {
key=key.transformed(TransformFactory.affineToCSG(key.getManipulator()));
} catch (MissingManipulatorException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
if (key.touching(selection2)) {
overlapping.add(key.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public ShapePalletButtonResources(HashMap<String, String> key, String typeOfShap
for (CSG c : so) {
c.setIsHole(false);
}
image = ThumbnailImage.get(ap.get().getCsgDBinstance(),so);
image = ap.get().getImageEngine().get(ap.get().getCsgDBinstance(),so);

});
while (image == null) {
Expand Down
15 changes: 10 additions & 5 deletions src/main/java/com/commonwealthrobotics/WorkplaneManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import eu.mihosoft.vrl.v3d.ColinearPointsException;
import eu.mihosoft.vrl.v3d.Cube;
import eu.mihosoft.vrl.v3d.Cylinder;
import eu.mihosoft.vrl.v3d.MissingManipulatorException;
import eu.mihosoft.vrl.v3d.Polygon;
import eu.mihosoft.vrl.v3d.Transform;
import eu.mihosoft.vrl.v3d.Vector3d;
Expand Down Expand Up @@ -215,8 +216,13 @@ public void handle(MouseEvent ev) {
if(meshesReverseLookup!=null) {
source = meshesReverseLookup.get(meshView);
if(source!=null)
if(source.getManipulator()!=null)
manipulator=source.getManipulator();
if(source.hasManipulator())
try {
manipulator=source.getManipulator();
} catch (MissingManipulatorException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

TriangleMesh mesh = (TriangleMesh) meshView.getMesh();
Expand Down Expand Up @@ -330,9 +336,8 @@ private TransformNR getFaceNormalAngles(TriangleMesh mesh, int faceIndex) {
try {
Polygon p = Polygon.fromPoints(Arrays.asList(toV(p1),toV(p2),toV(p3)));
return TransformFactory.csgToNR(PolygonUtil.calculateNormalTransform(p));
} catch (ColinearPointsException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {

}
return new TransformNR();
}
Expand Down
Loading