Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OrigamiSimulator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
1cba04b8
Commit
1cba04b8
authored
Sep 03, 2017
by
amandaghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
processing sketch
parent
1e4d4c6c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
0 deletions
+89
-0
CreasePatternScripts/Hypar/Hypar.pde
CreasePatternScripts/Hypar/Hypar.pde
+83
-0
CreasePatternScripts/Hypar/sketch.properties
CreasePatternScripts/Hypar/sketch.properties
+2
-0
CreasePatternScripts/README.md
CreasePatternScripts/README.md
+4
-0
No files found.
CreasePatternScripts/Hypar/Hypar.pde
0 → 100644
View file @
1cba04b8
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
));
}
}
CreasePatternScripts/Hypar/sketch.properties
0 → 100644
View file @
1cba04b8
mode.id
=
processing.mode.java.JavaMode
mode
=
Java
CreasePatternScripts/README.md
0 → 100644
View file @
1cba04b8
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.
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment