- •Credits
- •About the Author
- •About the Reviewers
- •www.PacktPub.com
- •Table of Contents
- •Preface
- •Mission Briefing
- •Making Processing talk
- •Reading Shakespeare
- •Adding more actors
- •Building robots
- •Mission Accomplished
- •Mission Briefing
- •Connecting the Kinect
- •Making Processing see
- •Making a dancer
- •Dance! Dance! Dance!
- •Mission Accomplished
- •Mission Briefing
- •Can you hear me?
- •Blinking to the music
- •Making your disco dance floor
- •Here come the dancers
- •Mission Accomplished
- •Mission Briefing
- •Drawing your face
- •Let me change it
- •Hello Twitter
- •Tweet your mood
- •Mission Accomplished
- •Mission Briefing
- •Connecting your Arduino
- •Building your controller
- •Changing your face
- •Putting it in a box
- •Mission Accomplished
- •Mission Briefing
- •Drawing a sprite
- •Initiating the landing sequence
- •Running your sketch in the browser
- •Running the game on an Android phone
- •Mission Accomplished
- •Mission Briefing
- •Rotating a sphere
- •Let there be light
- •From sphere to globe
- •From globe to neon globe
- •Mission Accomplished
- •Mission Briefing
- •Reading a logfile
- •Geocoding IP addresses
- •Red Dot Fever
- •Interactive Red Dot Fever
- •Mission Accomplished
- •Mission Briefing
- •Beautiful functions
- •Generating an object
- •Exporting the object
- •Making it real
- •Mission Accomplished
- •Index
From Virtual to Real
11.Run the sketch now and adjust the parameters until you have created a vase that pleases you. Export the mesh as an STL file. One of the meshes I created looks like this:
Objective Complete - Mini Debriefing
Our third task for this mission was to export the mesh of our vase to an STL file. We added a Triangle class and a TriangleSoup class, which allowed us to store the triangles of our mesh in a list and then export the list. The TriangleSoup class takes care of creating the header and vertex data in the correct binary format.
We added a button to our GUI, which opens a file selection box and a callback function that gets called when the user selects a filename. We added a TriangleSoup object to our sketch and created export methods that create our inner and outer walls, the bottom triangle fans, and the top ring that connects the inner and outer wall.
After all the triangles are created and added to our List, the save() method is called and an STL file with the selected filename is created.
Making it real
The final task of our current mission is to take the file we exported in the third task and turn it into a physical object. I will show you how to print these STL files on a desktop 3D printer, and how to order them from an online 3D printing service. The 3D printer I used for these examples is the Makerbot CupCake CNC (2009). Other printers use different control software, but the steps required to convert an STL file to a physical object are very similar on each of them.
238
Project 9
If you don't have a 3D printer at home, you can try to find a hackerspace or fab lab near you. These are groups of makers and hackers who meet on a regular basis to share their projects and provide the tools and information to get them done. Many of them have 3D printers these days.
From step 9 onwards, I also show you how to use an online 3D printing service to order your object. I used http://www.shapeways.com for this example because they offer a wide range of materials to choose from and deliver to most countries.
Engage Thrusters
Let's print our object:
1.The software that's needed to control the Makerbot Cupcake is called ReplicatorG and can be downloaded from http://replicat.org. For this example, I used Version 0037 because the newest version doesn't support my printer. Download ReplicatorG for your platform.
2.Open the file you downloaded in the previous step and start ReplicatorG.
3.To generate the correct control commands, you have to select the type of printer you want to use by going to Machine | Machine Type (Driver).
4.Now we can open the STL file that we exported from our sketch in the last task. The mesh gets rendered as a preview and should look like the one in this screenshot:
239
From Virtual to Real
5.Make sure the object you want to print fits the build platform. Move and scale it (if necessary) using the menu on the right-hand side of the preview image.
6.When the size and placement of the object are correct, we need to generate the GCode for your machine. This step slices the object into printable layers and
generates the control commands that are interpreted by the printer to position the printing head and control the extrusion. Click on the Generate GCode button and select the printing profile you would like to use.
7.When the GCode generation is finished, you can start your build by going to GCode | Build. The following image shows my vase while it's being printed:
8.When the print is finished, take a flower and place it in what was not too long ago just a few lines of code on your computer.
240
Project 9
9.If you don't have access to a desktop 3D printer, you can use an online printing service, like the one from http://www.shapeways.com.
10.Register for a user account and start the ordering process by clicking on Create and then on New Product.
11.Then, click on Select 3D file and upload the STL file that we exported from our sketch in the third task.
12.Now select the material for your object. Shapeways offers a whole range of materials, from plastic to ceramic or even stainless steel.
13.Once you are satisfied with the material, add it to the cart and order it.
14.This is how the vase (which I created using the sketch) looks when the White
Strong & Flexible material is used.
Objective Complete - Mini Debriefing
For the final task of our current mission, we turned our virtual 3D object into a real one. We used ReplicatorG to slice our model and turn it into GCode instructions. These codes are then interpreted by the printer and used to position the printer head and control the extrusion of the plastic filaments.
From step 9 onwards, we learned how to use an online printing service to order the object we created. I chose Shapeways for this example because they use a different kind of 3D printer that supports a very wide range of materials, from plastics to ceramics or even metal. Depending on what you need your object for, this makes online services an interesting option, even when you have access to a desktop 3D printer.
241