-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Georgios Kaleadis
committed
Jan 13, 2018
1 parent
e377316
commit ff40be9
Showing
1,043 changed files
with
193,341 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
assets/attrib.txt | ||
.idea/ | ||
todo.rtf |
83 changes: 83 additions & 0 deletions
83
research/projects/OrigamiSimulator-master/CreasePatternScripts/Hypar/Hypar.pde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import processing.pdf.*; | ||
|
||
float numSegs = 100;//number of radial segments, this can be reduced to 4 to do a regular hypar | ||
float outerRad = 200;//radius of outer border | ||
float spacing = 8;//radial space between neighboring creases | ||
int numPleats = 7;//number of mountain/valley pairs of circular creases | ||
|
||
boolean antisym = true;//symmetric vs antisymmetric triangulation | ||
boolean triangulationsAsHinges = false;//draw triangulations as facets creases (yellow) or undriven hinges (magenta) | ||
|
||
void setup(){ | ||
|
||
size(450, 450); | ||
|
||
//tessellation | ||
beginRecord(PDF, "Hypar.pdf"); | ||
background(255); | ||
pushMatrix(); | ||
translate(width/2, height/2); | ||
|
||
//outer border | ||
stroke(0); | ||
drawRing(outerRad); | ||
|
||
//creases and triangulations | ||
float rad = outerRad; | ||
for (int i=0;i<numPleats;i++){ | ||
drawHinges(rad, true); | ||
rad -= spacing; | ||
stroke(255,0,0); | ||
drawRing(rad); | ||
drawHinges(rad, false); | ||
rad -= spacing; | ||
stroke(0,0,255); | ||
drawRing(rad); | ||
} | ||
drawHinges(rad, true); | ||
|
||
//inner border | ||
rad -= spacing; | ||
stroke(0); | ||
drawRing(rad); | ||
|
||
//radial facet creases | ||
stroke(255,255,0); | ||
for (float i=0;i<numSegs;i++){ | ||
float theta = i/numSegs*2*PI; | ||
line(outerRad*cos(theta), outerRad*sin(theta), rad*cos(theta), rad*sin(theta)); | ||
} | ||
|
||
endRecord(); | ||
println("Finished."); | ||
// exit(); | ||
} | ||
|
||
void drawHinges(float rad, boolean opp){ | ||
if (triangulationsAsHinges) stroke(255,0,255); | ||
else stroke(255,255,0); | ||
for (float i=0;i<numSegs;i++){ | ||
float theta = i/numSegs*2*PI; | ||
if (antisym){ | ||
if (opp){ | ||
if (i%2==0) line(rad*cos(theta), rad*sin(theta), (rad-spacing)*cos(theta-1.0/numSegs*2*PI), (rad-spacing)*sin(theta-1.0/numSegs*2*PI)); | ||
else line((rad-spacing)*cos(theta), (rad-spacing)*sin(theta), rad*cos(theta-1.0/numSegs*2*PI), rad*sin(theta-1.0/numSegs*2*PI)); | ||
} else { | ||
if (i%2==1) line(rad*cos(theta), rad*sin(theta), (rad-spacing)*cos(theta-1.0/numSegs*2*PI), (rad-spacing)*sin(theta-1.0/numSegs*2*PI)); | ||
else line((rad-spacing)*cos(theta), (rad-spacing)*sin(theta), rad*cos(theta-1.0/numSegs*2*PI), rad*sin(theta-1.0/numSegs*2*PI)); | ||
} | ||
} else{ | ||
if (i%2==0) line(rad*cos(theta), rad*sin(theta), (rad-spacing)*cos(theta-1.0/numSegs*2*PI), (rad-spacing)*sin(theta-1.0/numSegs*2*PI)); | ||
else line((rad-spacing)*cos(theta), (rad-spacing)*sin(theta), rad*cos(theta-1.0/numSegs*2*PI), rad*sin(theta-1.0/numSegs*2*PI)); | ||
} | ||
} | ||
} | ||
|
||
void drawRing(float rad){ | ||
for (float i=0;i<numSegs;i++){ | ||
float theta = i/numSegs*2*PI; | ||
line(rad*cos(theta), rad*sin(theta), rad*cos(theta-1.0/numSegs*2*PI), rad*sin(theta-1.0/numSegs*2*PI)); | ||
} | ||
} | ||
|
||
|
2 changes: 2 additions & 0 deletions
2
research/projects/OrigamiSimulator-master/CreasePatternScripts/Hypar/sketch.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mode.id=processing.mode.java.JavaMode | ||
mode=Java |
4 changes: 4 additions & 0 deletions
4
research/projects/OrigamiSimulator-master/CreasePatternScripts/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
These are <a href="https://processing.org/" target="_blank">Processing</a> scripts I used to generate crease patterns | ||
for some of the examples in the app. Processing exports pdfs with a | ||
clipping mask, you will need to pull this into a vector editing program to remove | ||
the clipping mask and save as SVG before importing it into the Origami Simulator app. |
166 changes: 166 additions & 0 deletions
166
research/projects/OrigamiSimulator-master/CreasePatternScripts/SquareTwist/SquareTwist.pde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
import processing.pdf.*; | ||
|
||
boolean mountValleyColors = true; | ||
boolean dashedCreaseLines = true; | ||
|
||
float angle = PI/3;// PI/2 > angle > 0 | ||
float edgeLength = 72;//1in and 72dpi | ||
float diagLength = 2*edgeLength/sqrt(2); | ||
|
||
void setup() { | ||
size(400, 400); | ||
|
||
//tesselation | ||
beginRecord(PDF, "squaretwisttesselation.pdf"); | ||
background(255); | ||
|
||
makeUnitCell(200,200); | ||
|
||
endRecord(); | ||
|
||
//single twist | ||
beginRecord(PDF, "squaretwist.pdf"); | ||
background(255); | ||
makeSingleUnitCell(width/2,height/2); | ||
endRecord(); | ||
|
||
//many single twists | ||
size(700, 700); | ||
beginRecord(PDF, "squaretwistManyAngles.pdf"); | ||
|
||
background(255); | ||
for (int i=0;i<3;i++){ | ||
for (int j=0;j<3;j++){ | ||
float index = i*3+j; | ||
angle = map(index, 0, 8, PI/6, 2*PI/6); | ||
makeSingleUnitCell(j*width/3+width/6,i*height/3+height/6); | ||
} | ||
} | ||
|
||
endRecord(); | ||
|
||
// // Exit the program | ||
println("Finished."); | ||
exit(); | ||
} | ||
|
||
void makeSingleUnitCell(float x, float y){ | ||
makeUnitCell(x, y, true, true, true, true, true); | ||
} | ||
|
||
void makeUnitCell(float x, float y){ | ||
makeUnitCell(x, y, false, false, false, false, false); | ||
} | ||
|
||
void makeUnitCell(float x, float y, boolean allBounds, | ||
boolean leftBounds, boolean topBounds, boolean bottomBounds, boolean rightBounds){ | ||
pushMatrix(); | ||
translate(x, y); | ||
rotate(-angle/2); | ||
|
||
setMountainColor(); | ||
//top | ||
float square1X = diagLength/2*sin(angle-PI/4); | ||
float square1Y = -diagLength/2*cos(angle-PI/4); | ||
|
||
//right | ||
float square2X = diagLength/2*sin(angle+PI/4); | ||
float square2Y = -diagLength/2*cos(angle+PI/4); | ||
|
||
drawCrease(square1X, square1Y, square1X, square1Y-edgeLength); | ||
drawCrease(-square1X, -square1Y, -square1X, -square1Y+edgeLength); | ||
|
||
drawCrease(square2X, square2Y, square2X+edgeLength, square2Y); | ||
drawCrease(-square2X, -square2Y, -square2X-edgeLength, -square2Y); | ||
|
||
//inner square | ||
drawCrease(square1X, square1Y, square2X, square2Y); | ||
drawCrease(square1X, square1Y, -square2X, -square2Y); | ||
drawCrease(-square1X, -square1Y, square2X, square2Y); | ||
drawCrease(-square1X, -square1Y, -square2X, -square2Y); | ||
|
||
//bounds | ||
if (allBounds) setCutColor(); | ||
|
||
if (leftBounds){ | ||
//left | ||
line(square1X-edgeLength, square1Y-edgeLength, square1X-edgeLength, square1Y); | ||
line(square1X-edgeLength, square1Y, -square2X-edgeLength, -square2Y); | ||
line(-square2X-edgeLength, -square2Y, -square2X-edgeLength, -square2Y+edgeLength); | ||
} | ||
|
||
if (topBounds){ | ||
//top | ||
line(square1X, square1Y-edgeLength, square1X-edgeLength, square1Y-edgeLength); | ||
line(square1X, square1Y-edgeLength, square2X, square2Y-edgeLength); | ||
line(square2X, square2Y-edgeLength, square2X+edgeLength, square2Y-edgeLength); | ||
} | ||
|
||
if (rightBounds){ | ||
//right | ||
line(square2X+edgeLength, square2Y-edgeLength, square2X+edgeLength, square2Y); | ||
line(square2X+edgeLength, square2Y, -square1X+edgeLength, -square1Y); | ||
line(-square1X+edgeLength, -square1Y, -square1X+edgeLength, -square1Y+edgeLength); | ||
} | ||
|
||
if (bottomBounds){ | ||
//bottom | ||
line(-square1X+edgeLength, -square1Y+edgeLength, -square1X, -square1Y+edgeLength); | ||
line(-square1X, -square1Y+edgeLength, -square2X, -square2Y+edgeLength); | ||
line(-square2X, -square2Y+edgeLength, -square2X-edgeLength, -square2Y+edgeLength); | ||
} | ||
|
||
setValleyColor(); | ||
drawCrease(square1X, square1Y, square1X-edgeLength, square1Y); | ||
drawCrease(-square1X, -square1Y, -square1X+edgeLength, -square1Y); | ||
|
||
drawCrease(square2X, square2Y, square2X, square2Y-edgeLength); | ||
drawCrease(-square2X, -square2Y, -square2X, -square2Y+edgeLength); | ||
|
||
popMatrix(); | ||
} | ||
|
||
void setMountainColor(){ | ||
if (mountValleyColors){ | ||
stroke(0,0,255);//blue | ||
} else { | ||
setCreaseColor(); | ||
} | ||
} | ||
|
||
void setValleyColor(){ | ||
if (mountValleyColors){ | ||
stroke(255,0,0);//red | ||
} else { | ||
setCreaseColor(); | ||
} | ||
} | ||
|
||
void setCutColor(){ | ||
stroke(0);//black | ||
} | ||
|
||
void setCreaseColor(){ | ||
stroke(255,0,0);//red | ||
} | ||
|
||
void drawCrease(float x1, float y1, float x2, float y2){ | ||
if (dashedCreaseLines){ | ||
dashedLine(x1, y1, x2, y2, 6, 6); | ||
} else { | ||
line(x1, y1, x2, y2); | ||
} | ||
} | ||
|
||
void dashedLine(float x1, float y1, float x2, float y2, float dashLength, float spaceLength){ | ||
pushMatrix(); | ||
translate(x1, y1); | ||
rotate(atan2(y2-y1, x2-x1)); | ||
float lineLength = sqrt((y2-y1)*(y2-y1) + (x2-x1)*(x2-x1)); | ||
float partialDash = lineLength/(dashLength+spaceLength) - floor(lineLength/(dashLength+spaceLength)); | ||
for (float i=(partialDash+spaceLength)/2;i<lineLength;i+=dashLength+spaceLength){ | ||
line(i, 0, i+dashLength, 0); | ||
} | ||
popMatrix(); | ||
} | ||
|
74 changes: 74 additions & 0 deletions
74
...h/projects/OrigamiSimulator-master/CreasePatternScripts/TriTesselation/TriTesselation.pde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import processing.pdf.*; | ||
|
||
float triangleHeight = 40;//40px/72dpi = ~0.55in tall | ||
boolean dashedCreaseLines = true; | ||
|
||
void setup() { | ||
|
||
//20in*72dpi= 1440px | ||
size(1440, 1440, PDF, "tritesselation.pdf"); | ||
background(255); | ||
|
||
//horizontal lines | ||
for (float i=triangleHeight;i<height;i+=triangleHeight){ | ||
drawCrease(0, i, width, i); | ||
} | ||
|
||
// \\\\\\ lines | ||
for (float i=-height/sqrt(3);i<width;i+=2*triangleHeight/sqrt(3)){ | ||
|
||
float xPos = i+height/sqrt(3); | ||
if (xPos>width){ | ||
float xDiff = xPos-width; | ||
drawCrease(i, 0, width, height-xDiff*sqrt(3)); | ||
} else if (i<0){ | ||
float xDiff = -i; | ||
drawCrease(0, xDiff*sqrt(3), i+height/sqrt(3), height); | ||
} else { | ||
drawCrease(i, 0, i+height/sqrt(3), height); | ||
} | ||
} | ||
|
||
// //////// lines | ||
for (float i=0;i<width+height/sqrt(3);i+=2*triangleHeight/sqrt(3)){ | ||
|
||
float xPos = i-height/sqrt(3); | ||
if (i>width){ | ||
float xDiff = i-width; | ||
drawCrease(width, xDiff*sqrt(3), i-height/sqrt(3), height); | ||
} else if (xPos<0){ | ||
float xDiff = -xPos; | ||
drawCrease(i, 0, 0, height - xDiff*sqrt(3)); | ||
} else { | ||
drawCrease(i, 0, i-height/sqrt(3), height); | ||
} | ||
|
||
} | ||
|
||
// Exit the program | ||
println("Finished."); | ||
exit(); | ||
} | ||
|
||
void drawCrease(float x1, float y1, float x2, float y2){ | ||
if (dashedCreaseLines){ | ||
float numDashesPerSide = 5; | ||
float dashLength = triangleHeight*2/sqrt(3)/(numDashesPerSide*2); | ||
dashedLine(x1, y1, x2, y2, dashLength, dashLength); | ||
} else { | ||
line(x1, y1, x2, y2); | ||
} | ||
} | ||
|
||
void dashedLine(float x1, float y1, float x2, float y2, float dashLength, float spaceLength){ | ||
pushMatrix(); | ||
translate(x1, y1); | ||
rotate(atan2(y2-y1, x2-x1)); | ||
float lineLength = sqrt((y2-y1)*(y2-y1) + (x2-x1)*(x2-x1)); | ||
float partialDash = lineLength/(dashLength+spaceLength) - floor(lineLength/(dashLength+spaceLength)); | ||
println(partialDash); | ||
for (float i=(partialDash+spaceLength)/2;i<lineLength;i+=dashLength+spaceLength){ | ||
line(i, 0, i+dashLength, 0); | ||
} | ||
popMatrix(); | ||
} |
Oops, something went wrong.