summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradrian-bowyer <adrian-bowyer>2007-12-03 22:30:53 +0000
committeradrian-bowyer <adrian-bowyer@cb376a5e-1013-0410-a455-b6b1f9ac8223>2007-12-03 22:30:53 +0000
commit16479540ea10f38f5fc5915759b39cff5fa150e9 (patch)
treea0253b6811034da10999c3ba6b4037b3ac6b484e
parente62aa510b20092c9092cdd9be6f5ed4693fda8d8 (diff)
downloadreprap-16479540ea10f38f5fc5915759b39cff5fa150e9.tar.gz
reprap-16479540ea10f38f5fc5915759b39cff5fa150e9.zip
More STL slicing experiments...
git-svn-id: https://reprap.svn.sourceforge.net/svnroot/reprap@1144 cb376a5e-1013-0410-a455-b6b1f9ac8223
-rw-r--r--trunk/users/adrian/Java-experiments/STLSlice.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/trunk/users/adrian/Java-experiments/STLSlice.java b/trunk/users/adrian/Java-experiments/STLSlice.java
index a9e9df7a..5e09675c 100644
--- a/trunk/users/adrian/Java-experiments/STLSlice.java
+++ b/trunk/users/adrian/Java-experiments/STLSlice.java
@@ -429,8 +429,8 @@ public class STLSlice
*/
private double toGrid(double x)
{
- return x;
- //return (double)((int)(x*Preferences.grid() + 0.5))*Preferences.gridRes();
+ //return x;
+ return (double)((int)(x*Preferences.grid() + 0.5))*Preferences.gridRes();
}
/**
@@ -685,7 +685,7 @@ public class STLSlice
{
v = coords.get(p).doubleValue();
g = v - vpOld;
- if(g > Preferences.machineResolution())
+ if(g > Preferences.gridRes()*0.1)
{
return 0.5*(vpOld + v);
}
@@ -699,7 +699,7 @@ public class STLSlice
{
v = coords.get(m).doubleValue();
g = vmOld - v;
- if(g > Preferences.machineResolution())
+ if(g > Preferences.gridRes()*0.1)
{
return 0.5*(v + vmOld);
}
@@ -710,7 +710,7 @@ public class STLSlice
}
}
- if(biggest.length() > Preferences.machineResolution()*0.1)
+ if(biggest.length() > Preferences.gridRes()*0.1)
return biggest.low() + 0.5*biggest.length();
else
{
@@ -728,6 +728,7 @@ public class STLSlice
private Rr2Point biggestGap()
{
Rr2Point result = new Rr2Point(findGap(xCoords, box.x()), findGap(yCoords, box.y()));
+ System.out.println("Box: " + box.toString() + " centre: " + result.toString());
// Not needed any more
@@ -1095,7 +1096,7 @@ public class STLSlice
// Make sure nothing falls down the cracks.
- sFactor = 1.0; //Preferences.swell();
+ sFactor = Preferences.swell();
box = box.scale(sFactor);
resolution_2 = box.d_2()*Preferences.tiny();