Skip to content
Browse files

Tweaked shell generation.

  • Loading branch information...
1 parent 72ce254 commit 69f7de155d89f11aec155645920b114adddf0d45 @clothbot clothbot committed Sep 18, 2010
Showing with 15 additions and 64 deletions.
  1. +11 −52 Area.pde
  2. +1 −1 Fill.pde
  3. +3 −3 SuperSkein.pde
  4. +0 −8 config.txt
View
63 Area.pde
@@ -46,61 +46,20 @@ class SSArea extends Area {
this.transform(scaleAreaTransform);
}
- void makeShell(float shellWidth) {
+ void makeShell(float shellWidth, int dirCount) {
float sqt2=sqrt(2);
AffineTransform shiftTrans = new AffineTransform();
-
- shiftTrans.setToTranslation(shellWidth,0); Area copyXP = this.createTransformedArea(shiftTrans);
- copyXP.subtract(this);
- shiftTrans.setToTranslation(-shellWidth,0); copyXP.transform(shiftTrans);
- if(copyXP.isEmpty()) println(" makeShell: copyXP is Empty");
-
- shiftTrans.setToTranslation(-shellWidth,0); Area copyXM = this.createTransformedArea(shiftTrans);
- copyXM.subtract(this);
- shiftTrans.setToTranslation(shellWidth,0); copyXM.transform(shiftTrans);
- if(copyXM.isEmpty()) println(" makeShell: copyXM is Empty");
-
- shiftTrans.setToTranslation(0,shellWidth); Area copyYP = this.createTransformedArea(shiftTrans);
- copyYP.subtract(this);
- shiftTrans.setToTranslation(0,-shellWidth); copyYP.transform(shiftTrans);
- if(copyYP.isEmpty()) println(" makeShell: copyYP is Empty");
-
- shiftTrans.setToTranslation(0,-shellWidth); Area copyYM = this.createTransformedArea(shiftTrans);
- copyYM.subtract(this);
- shiftTrans.setToTranslation(0,shellWidth); copyYM.transform(shiftTrans);
- if(copyYM.isEmpty()) println(" makeShell: copyYM is Empty");
-
- // Diagonals
- shiftTrans.setToTranslation(shellWidth/sqt2,shellWidth/sqt2); Area copyXPYP = this.createTransformedArea(shiftTrans);
- copyXPYP.subtract(this);
- shiftTrans.setToTranslation(-shellWidth/sqt2,-shellWidth/sqt2); copyXPYP.transform(shiftTrans);
- if(copyXPYP.isEmpty()) println(" makeShell: copyXPYP is Empty");
-
- shiftTrans.setToTranslation(-shellWidth/sqt2,shellWidth/sqt2); Area copyXMYP = this.createTransformedArea(shiftTrans);
- copyXMYP.subtract(this);
- shiftTrans.setToTranslation(shellWidth/sqt2,-shellWidth/sqt2); copyXMYP.transform(shiftTrans);
- if(copyXM.isEmpty()) println(" makeShell: copyXMYP is Empty");
-
- shiftTrans.setToTranslation(shellWidth/sqt2,-shellWidth/sqt2); Area copyXPYM = this.createTransformedArea(shiftTrans);
- copyXPYM.subtract(this);
- shiftTrans.setToTranslation(-shellWidth/sqt2,shellWidth/sqt2); copyXPYM.transform(shiftTrans);
- if(copyXPYM.isEmpty()) println(" makeShell: copyXPYM is Empty");
-
- shiftTrans.setToTranslation(-shellWidth/sqt2,-shellWidth/sqt2); Area copyXMYM = this.createTransformedArea(shiftTrans);
- copyXMYM.subtract(this);
- shiftTrans.setToTranslation(shellWidth/sqt2,shellWidth/sqt2); copyXMYM.transform(shiftTrans);
- if(copyYM.isEmpty()) println(" makeShell: copyXMYM is Empty");
-
-
Area innerArea=new Area(this);
- innerArea.subtract(copyXP);
- innerArea.subtract(copyXM);
- innerArea.subtract(copyYP);
- innerArea.subtract(copyYM);
- innerArea.subtract(copyXPYP);
- innerArea.subtract(copyXMYP);
- innerArea.subtract(copyXPYM);
- innerArea.subtract(copyXMYM);
+ for(int i=0;i<dirCount;i++) {
+ float dx=shellWidth*cos(i*360/dirCount);
+ float dy=shellWidth*sin(i*360/dirCount);
+ shiftTrans.setToTranslation(dx,dy);
+ Area shiftCopy = this.createTransformedArea(shiftTrans);
+ shiftCopy.subtract(this);
+ shiftTrans.setToTranslation(-dx,-dy); shiftCopy.transform(shiftTrans);
+ if(shiftCopy.isEmpty()) println(" makeShell: shiftCopy is Empty");
+ innerArea.subtract(shiftCopy);
+ }
if(innerArea.isEmpty()) {
println(" makeShell: innerArea is Empty");
} else {
View
2 Fill.pde
@@ -56,7 +56,7 @@ class Fill {
SSArea thisShell = new SSArea();
thisShell.setGridScale(thisArea.getGridScale());
thisShell.add(thisArea);
- thisShell.makeShell(wallWidth);
+ thisShell.makeShell(wallWidth,8);
// Fill mask area
SSArea thisFill = new SSArea();
thisFill.setGridScale(thisArea.getGridScale());
View
6 SuperSkein.pde
@@ -370,7 +370,7 @@ class FileWriteProc implements Runnable{
SSArea thisShell = new SSArea();
thisShell.setGridScale(thisArea.getGridScale());
thisShell.add(thisArea);
- thisShell.makeShell(0.25);
+ thisShell.makeShell(0.25,8);
SSArea thisSubArea = new SSArea();
thisSubArea.setGridScale(thisArea.getGridScale());
thisSubArea.add(thisArea);
@@ -468,15 +468,15 @@ class DXFWriteProc implements Runnable{
SSArea thisShell = new SSArea();
thisShell.setGridScale(thisArea.getGridScale());
thisShell.add(thisArea);
- thisShell.makeShell(0.25);
+ thisShell.makeShell(0.25,8);
if(ShellNum>0) {
SSArea bridgeCheck = new SSArea();
bridgeCheck.setGridScale(thisArea.getGridScale());
bridgeCheck.add(thisArea);
bridgeCheck.subtract( (SSArea) SliceAreaList.get(ShellNum-1));
if( !bridgeCheck.isEmpty() ) {
println(" Bridges found in "+ShellNum);
- // bridgeCheck.makeShell(0.25);
+ // bridgeCheck.makeShell(0.25,8);
bridgeCheck.intersect(thisArea);
// thisShell.add(bridgeCheck);
}
View
8 config.txt
@@ -1,8 +0,0 @@
-CONFIG_SCALE 1.0
-CONFIG_XROTATE 0.0
-CONFIG_STLFILE C:\git\SuperSkein\sculpt_dragon.stl
-MACHINE_OPTEMP 220
-MACHINE_FLOWRATE 190
-CONFIG_SINK 0.0
-MACHINE_PRINTHEADSPEED 2000.0
-MACHINE_LAYERTHICKNESS 0.3

0 comments on commit 69f7de1

Please sign in to comment.
Something went wrong with that request. Please try again.