fill in the Data: Steps and Distance (recorded with Google Fit)
click āplayā and render the code
click on the result to save a .pdf-file
open the generated .pdf-file (which has vector graphics) in Adobe Illustrator
click on the path
click object ā> path ā> outline ā> stroke
choose no fill and set an 0.01pt red outline for the laser-cutter/vinyl cutter
safe
Final Coasters:
~Ā ~Ā EXHIBITION-TIME
POSTER @ EXHIBITION:
Following you will find my Final Code:
import processing.pdf.*;
final int drawingWidth = 1200;
final int drawingHeight = 1200;
float size = 500;
void setup() {
Ā size(1200, 1200);
Ā background(255, 255, 255);
// Only once
noLoop();
}
void draw() {
Ā // Begin saving the PDF
Ā beginRecord(PDF, "01.09.2.pdf");
Ā // We only want the outline of the shape
Ā noFill();
Ā // Width of the line. Make it THICC in order to get a good laser cutting result..
Ā strokeWeight(40);
Ā // Don't add joins
Ā strokeJoin(MITER);
Ā // Now we can finally draw the shape
Ā beginShape();
Ā // Center point in the drawing
Ā float centerX = drawingWidth/2;
Ā float centerY = drawingWidth/2;
Ā // Shape of the rose; See Wikipedia
Ā float k = 10.0; Ā
Ā float dis = 1.0;
Ā float step = 6.0;
Ā k = dis/step;
Ā float maxTheta = 12*PI;
Ā // How many points do we want? 100 seems to work fine
Ā int iters = 100;
Ā for (int i = 0; i < iters+3; i++) {
Ā Ā int realI = i % iters;
Ā Ā float theta = realI*(maxTheta/(float)iters);
Ā Ā float x = size*cos(k*theta)*cos(theta);
Ā Ā float y = size*cos(k*theta)*sin(theta);
Because of the problems Iāve had with the outline I came up and googled some ideas how to fix the code. I tried different things until it finally worked by combining this four functions: (if you click on the functions you will be forwarded to the documentation-website of processing)
strokeWeight()
strokeJoin()
beginShape()
curveVertex()Ā
Following you will find the code of my first trial as well as my final one:
final int drawingWidth = 1200;
final int drawingHeight = 1200;
float size = 500;
void setup() {
Ā size(1200, 1200);
Ā background(255, 255, 255);
Ā // Only once
Ā noLoop();
}
void draw() {
Ā // Begin saving the PDF
Ā beginRecord(PDF, "01.09.2.pdf");
Ā // We only want the outline of the shape
Ā noFill();
Ā // Width of the line. Make it THICC in order to get a good laser cutting result..
Ā strokeWeight(50);
Ā // Don't add joins
Ā strokeJoin(MITER);
Ā // Now we can finally draw the shape
Ā beginShape();
Ā // Center point in the drawing
Ā float centerX = drawingWidth/2;
Ā float centerY = drawingWidth/2;
Ā // Shape of the rose; See Wikipedia
Ā float k = 10.0; Ā
Ā float dis = 1.0;
Ā float step = 6.0;
Ā k = dis/step;
Ā float maxTheta = 12*PI;
Ā // How many points do we want? 100 seems to work fine
Ā int iters = 100;
Ā for (int i = 0; i < iters+3; i++) {
Ā Ā int realI = i % iters;
Ā Ā float theta = realI*(maxTheta/(float)iters);
Ā Ā float x = size*cos(k*theta)*cos(theta);
Ā Ā float y = size*cos(k*theta)*sin(theta);
Iāve thought a lot about the problem with circles and the outline.
Finally I managed to edit the code that I have outlines instead of circles.
So, because I just want the Outline of the shape I set a noFill with a really thick line (so get a good result for the laser cutter). I also donāt want the joins to add so I set a strokeJoin(MITER) and then I finally draw the shape.
My Workflow is now:Ā
Open my CodeĀ
fill in the Data: Steps and Distance (recorded with Google Fit)
clickĀ āplayā and render the codeĀ
click on the result to save a .pdf-file
open the generated .pdf-file (which has vector graphics) in Adobe Illustrator
click on the path
click object --> path --> outline --> stroke
choose no fill and set an 0.01pt red outline for the laser-cutter/vinyl cutter
To create a file which I can use for Laser-Cutter/Vinyl-Cutter was harder than imagined. Because of the equation I donāt have a simple outline, Iāve a a lot of circles.. So I try to figure out whatās happening and how I can improve my code to get a simple, clean outline which I can cut.
a lot of circles.. no outline.
changed the code-line āpointā [ point(x+centerX, y+centerY); ] to ālineā [ line(lastX+centerX, lastY+centerY, x+centerX, y+centerY); ]
But still, I need to get rid of the circles.
I have done theĀ āFab Lab Aboutā-Tour to learn something about our fablab and to be able to use it. Now Iām waiting for a Lasercutter-Workshop that I can start cutting out examples.
I have also created an excel document and transferred my made steps from Google FiĀ to it. So I can use it as my data source for my code.
For example:
My steps on the 30. September 2017 = 14.000 stepsĀ
And the Distance was about 12 Kilometers.
This is the result:
My steps on the 01. October 2017 = 6.000 steps
The Distance was about 4 kilometers.
This looks like that:
Workflow:
Input: My own data source: Steps documented with Google Fit
I created a Labyrinth Game where you can walk through and find your way to the ball in the middle. For the walls I used several 3D Objects (āCubeā) and I gave them a nature bush Texture. For the ball in the middle I used a Sphere which by collision switch from red to green. I also created a 3D Text to signalize the Start. I wanted the Start-Sign to slide up and disappear. To implement this I created a empty āGameObjectā, which reacts with by a Script called āMoveStartā and it will be triggered by walking into the āGameObjectā. First, the Script is searching for the āstartTextā-Object. If it finds that Object and will be triggered, it will let theĀ āstartTextā move upward until the distance is more than 100. If itās more than 100 it will destroy itself - what means, it will disappear.Ā
At the Finish I placed a Spotlight as well as aĀ checkered flag.
With the 3D Transformation Patch and the Iterator is duplicated a cube ten times. To get this 3D Effect I played with the colours of the Cube. The Cubes are changing their size (width and height) through moving the mouse in different directions.
First I set a window size and drew a background. As sun I created a ellipse. I wanted the sun going red, so I let the green decreases with time. And to create a slow sunset I let the ellipse move in y-direction slower than in x-direction by using a frameCount. To create the water I drew a quadrat with a filling. For the crane I create various triangle. So that the crane moves with the mouse movement, I calculate a rotation angle depending on the mouse x-position.
I created two TorusKnot as a Basic with a MeshBasic Material which has a flat shading and shows the wireframe with different sized. I let the TourKnots move with the mesh.render in y- and x-direction with different speed. I also set different red-tones to the Scene.
I created a Labyrinth Game where you can walk through and find your way to the ball in the middle. For the walls I used Cubes and for the ball in the middle I used a Sphere. I also created a 3D Text to signalize the Start. If you touches the Sphere in the middle it switches from red to green.
The nameĀ āBubblestarsā combinesĀ āBubbleā andĀ āStarsā. Because, if a Bubble pop yellow particles, which look like Stars, emerge. To create the Bubbles I used a Sphere with theĀ āBubbleā Material. I duplicated the Sphere with theĀ āDuplicatorā and I let the Bubbles move & rotate random with theĀ āMove Randomā as well as the āRotate Randomā Script. To have different sized Bubbles I used theĀ āSize Randomā Script. I also added a Audio Source to the whole Scene as well as a Sound to signalize when a Bubble explode. And aĀ āPop Collisionā Script which created the Particle, when you touch the Bubbles.
In this Example I created a sphere and duplicated it with theĀ āDuplicatorā. To the Sphere itself I added a Scrip called āMove Randomā which I used to let the duplicated Spheres move in different directions. I also added aĀ āTrail Rendererā which I used to display a trail by motion of the spheres. To make it more interesting I set the Material of the Mesh Renderer transparent.
Unity is a gaming engine which is primarily used to develop video games and simulations for computers, consoles and mobile devices.
> Examples <
It is nice because you can walk around & discover the world!
Hierarchy (Objects)
Scene (3D-World)
Inspector (Object Settings)
dopple-click on list-object will zoom to the object
middle-mouse-button allows you to look around
escape you can move the mouse again & come back to the editor mode
Box-collider = turn off to run through objects
Collision-Script = something happen, when I touch it
Distance Rotate Reaction = reacting to the distance to the object
w = forwards
s = backwards
a = left
d = right
Behaving of player game object?
sphere should: roll around, bump into walls, stay on the ground & not fly into the space, collide and pick them up if needed ā> rigidbody component =