Design by Code_ Laser-Cut Lamp — DIY How-to from Make_ Projects

7
Design by Code: Laser-Cut Lamp — DIY How-to from Make: Projects http://makeprojects.com/Project/Design-by-Code-Laser-Cut-Lamp/2278/1[2012/6/5 下午 08:32:03] Blog MAKE Magazine Videos/Podcasts Make: Projects Forum/Community Maker Shed Store « Back to category Next » Tweet 0 Sections Assembling your physical materials Download and install Processing Download the Codeable Objects library Familiarize yourself with the library Design the form of your lamp GUI Design the pattern of your lamp Specify points via iteration Cut your parts Glue your shades Assemble your frame Attach the shades to the frame Connect the light fixture Tools Relevant parts Edit Step 1 — Design by Code: Laser-Cut Lamp View: Paginated Full width Formats: Slideshow PDF XML Embed View Edit History 9 Start a New Guide Laser Cutting Laser Cutting Fabrication. Projects Page 1 of 2 Design by Code: Laser-Cut Lamp Design your own one-of-a-kind lamp. Author: Jennifer Jacobs Time required: 1-2 hours Difficulty: Moderate x 1 x 1 Codeable Objects is a library for Processing that lets anyone design and construct an artifact using geometric computation and digital fabrication. This tutorial will show you how to use the library to make a laser-cut lamp. User-Contributed Project This project guide is not managed by MAKE staff. copper phosphorus brazing rods Self-fluxing filler metals to join copper and copper-based alloys www.stella-welding.com/br Solar bollards Multipole smart long life aluminium solar bollards www.lightpole.com The Best Arduino Deals Arduino at Adafruit. Boards, Kits, Accessories And More. www.adafruit.com/arduino LOGIN JOIN US Get Started » Contribute » Search copper phosphorus brazing rods Self-fluxing filler metals to join copper and copper-based alloys www.stella-welding.com/brazing Innolas uk laser systems lasers for industry & science manufacture-parts- service-upgrades www.innolas.co.uk Laser Cutter & Engraver Laser cutting & engraving machine For fabric, leather. Import now! www.lasercutterbeyond.com Laser die cutting machine Just by ur side die cutting expert. product with low price,high quality www.diecutting.cc Computer running Windows XP, Vista, or Mac OS X Laser cutter 1/4" plywood (at least 1 sq foot) 2 17"x14" sheets of bristol board or similar heavy weight paper semi transparent tissue paper or artist's vellum Glue The laser cutter is an amazing tool that anyone can use! Unfortunately, the majority of computer design software is difficult to use, and requires significant expertise and time to design something unique. We take a new approach by showing users how to use programming and geometric computing to quickly design and build a unique laser-cut lamp. If you don’t know how to program, and the words “geometric computing” sound like some form of math-

Transcript of Design by Code_ Laser-Cut Lamp — DIY How-to from Make_ Projects

Page 1: Design by Code_ Laser-Cut Lamp — DIY How-to from Make_ Projects

Design by Code: Laser-Cut Lamp — DIY How-to from Make: Projects

http://makeprojects.com/Project/Design-by-Code-Laser-Cut-Lamp/2278/1[2012/6/5 下午 08:32:03]

Blog MAKE Magazine Videos/Podcasts Make: Projects Forum/Community Maker Shed Store

« Back to category Next »

Tweet 0

SectionsAssembling your physical materialsDownload and install ProcessingDownload the Codeable Objects libraryFamiliarize yourself with the libraryDesign the form of your lampGUIDesign the pattern of your lampSpecify points via iterationCut your partsGlue your shadesAssemble your frameAttach the shades to the frameConnect the light fixture

Tools

Relevant parts

EditStep 1 — Design by Code:Laser-Cut Lamp

View: Paginated Full width Formats: Slideshow PDF XML Embed

View Edit History

9

Start a New Guide

Laser CuttingLaser Cutting Fabrication.

Projects

Page 1 of 2

Design by Code: Laser-Cut Lamp

Design your own one-of-a-kind lamp.

Author: Jennifer Jacobs Time required: 1-2 hours Difficulty: Moderate

x 1 x 1

Codeable Objects is a library for Processing that lets anyone design and construct an artifactusing geometric computation and digital fabrication. This tutorial will show you how to use thelibrary to make a laser-cut lamp.

User-Contributed ProjectThis project guide is not managed by MAKE staff.

copper phosphorus brazing rods Self-fluxing filler metals to join copper and copper-based alloys www.stella-welding.com/br

Solar bollards Multipole smart long life aluminium solar bollards www.lightpole.com

The Best Arduino Deals Arduino at Adafruit. Boards, Kits, Accessories And More. www.adafruit.com/arduino

LOGIN JOIN USGet Started » Contribute » Search

copper phosphorus brazing rodsSelf-fluxing filler metals to join copper andcopper-based alloyswww.stella-welding.com/brazing

Innolas uk laser systemslasers for industry & science manufacture-parts-service-upgradeswww.innolas.co.uk

Laser Cutter & EngraverLaser cutting & engraving machine For fabric,leather. Import now!www.lasercutterbeyond.com

Laser die cutting machineJust by ur side die cutting expert. product withlow price,high qualitywww.diecutting.cc

Computer running Windows XP, Vista, or Mac OSXLaser cutter

1/4" plywood (at least 1 sq foot)2 17"x14" sheets of bristol board or similar heavyweight papersemi transparent tissue paper or artist's vellumGlue

The laser cutter is an amazing tool that anyone canuse! Unfortunately, the majority of computer designsoftware is difficult to use, and requires significantexpertise and time to design something unique. Wetake a new approach by showing users how to useprogramming and geometric computing to quicklydesign and build a unique laser-cut lamp.

If you don’t know how to program, and the words“geometric computing” sound like some form of math-

Page 2: Design by Code_ Laser-Cut Lamp — DIY How-to from Make_ Projects

Design by Code: Laser-Cut Lamp — DIY How-to from Make: Projects

http://makeprojects.com/Project/Design-by-Code-Laser-Cut-Lamp/2278/1[2012/6/5 下午 08:32:03]

EditStep 2 — Assembling yourphysical materials

EditStep 3 — Download andinstall Processing

based punishment, don’t worry. The methods we useare easy and accessible for anyone, even novicecoders. This tutorial teaches you everything you needto know. If you’re an experienced coder, thistechnique also offers an opportunity to stretch yourlegs and experiment.

1-3 square feet of ¼” plywood.

1-3 sheets of 17” x 14” Bristol board, or some othersimilar weight paper.

1-3 sheets of semi-transparent vellum or high-gradetissue paper. (You can use normal tissue paper aswell, but it might result in a less durable finishedproject.) You can purchase both of these papers atmost art and craft supply stores. Choose any coloryou like for both papers.

One pre-made light fixture. We recommend using onethat has a socket diameter of around 20-40 mm andaccepts a candelabra-style bulb. This is the one weuse in our tutorial.

1 light bulb. We recommend getting a low-wattagebulb, (around 25 watts), or a compact fluorescent.

Processing is a popular Java-based programmingenvironment that allows people to learn andexperiment with programming in a simple andstraightforward context. If you’ve never usedProcessing before, it’s extremely useful for a range ofprojects. You will need to download the ProcessingIDE (which is free), here.

For tips on how to install Processing after you’vedownloaded it, check out this page. Follow theinstructions on installation, based on your operatingsystem. Note: This tutorial covers the basic elements

Page 3: Design by Code_ Laser-Cut Lamp — DIY How-to from Make_ Projects

Design by Code: Laser-Cut Lamp — DIY How-to from Make: Projects

http://makeprojects.com/Project/Design-by-Code-Laser-Cut-Lamp/2278/1[2012/6/5 下午 08:32:03]

EditStep 4 — Download theCodeable Objects library

of Processing, but should not be considered a lessonin Processing in general. For that, check outhttp://processing.org for some great tutorials.

Processing’s functionality can be augmented by user-created libraries. Codeable Objects is one such librarythat we created to facilitate this project. You candownload the library here.

Locate the Processing sketchbook. This is the defaultdirectory of all of your Processing sketches. On amac, this will usually be:/Users/Username/Documents/Processing on a PC, it’sprobably: c:/My Documents/Processing/ You will needto place the Codeable Objects library in this directory.It should automatically have been created when youinstalled Processing. In this directory, there shouldexist a folder called “libraries”. Unzip thecodeableObjects.zip file and place the resultingdirectory here.

If a directory named "libraries" does not exist, you willneed to create one before placing the CodeableObjects library in it. Once you’ve done so, quit andrestart Processing if it’s already open, in order to allowit to recognize the new library. Then, open a newsketch by selecting File→New and check to see if thelibrary was found by going to Sketch→ImportLibrary. If you placed the library in the correctdirectory, then "codeableObjects" should show upamong your installed libraries in the menu. You won’tneed to import it now, but you can if you like.

Note: The process detailed above is the same processfor installing any other processing library.

Page 4: Design by Code_ Laser-Cut Lamp — DIY How-to from Make_ Projects

Design by Code: Laser-Cut Lamp — DIY How-to from Make: Projects

http://makeprojects.com/Project/Design-by-Code-Laser-Cut-Lamp/2278/1[2012/6/5 下午 08:32:03]

EditStep 5 — Familiarize yourselfwith the library

EditStep 6 — Design the form ofyour lamp

The library includes several examples to demonstratehow to use the library in Processing. They are locatedin the examples folder within the codeableObjectsdirectory. The code contained in each example isidentical with the exception of the part that controls ofthe type of decorative pattern it will generate. If youwant to generate your own file, you can create a newProcessing sketch and copy the code from one of theexamples into it to modify. For now, open the circleexample by going into the "circle" folder and double-clicking on the spiral.pde file.

The code in the file might look intimidating if you’re notfamiliar with Processing, but there are only a few partsyou need to change to design your lamp.

All of the code that you write will be contained withinthe setup() function. Setup is a pre-defined functionthat is automatically called by the Processingenvironment exactly one time at the start of theprogram when the program is run. Any code placed inbetween the curly brackets of the setup function willbe executed once.

The first line of code, size(), controls the size of yourapplication window. You shouldn’t need to adjust this.The second line creates an instance of the librarycontroller class called “point controller”. You will usethis instance to execute the library methods thatstructure your lamp.

Each lamp has a press-fit frame that is constructed ofa set of ribs that fit into a top and bottom base forminga circular structure. The code listed in this section letsyou design this structure with varying parameters.There are 11 parameters you can set with theseprogramming methods.

If you look in the "spiral" example, you should see aline containing each of these methods with a valuethat specifies the dimension. For example,pointController.setWidth(170) will set your lampwidth to 170 millimeters. The setWidth command isconstrained between 100 and 300 millimeters.

At this point you can press the "play" symbol at thetop of the Processing code window; this will compilethe code and open the application as a Java applet.You should then see a 3D wireframe model of thelamp with the parameters specified in the code. If youclose the applet, either manually by closing thewindow or by pressing the "stop" symbol in theProcessing sketch window, you can and change someof the values of the sizing commands and re-compile itagain. You should then see the changes reflected inthe model. A complete listing of all 12 of thecommands can be found in the code.

Page 5: Design by Code_ Laser-Cut Lamp — DIY How-to from Make_ Projects

Design by Code: Laser-Cut Lamp — DIY How-to from Make: Projects

http://makeprojects.com/Project/Design-by-Code-Laser-Cut-Lamp/2278/1[2012/6/5 下午 08:32:03]

EditStep 7 — GUI When you compile the code, you will notice that thereis a set of buttons in the lower left-hand corner of thescreen. The top 3 allow you to toggle betweendifferent views of the lamp structure. If you click the“parts” button, instead of seeing a 3D model you willsee a 2D view of the tool paths of the lamp that will becut out by the laser cutter.

You will also notice a set of sliders on the right-handside of the screen. These sliders control all the sameparameters as those listed in the code above. Bymoving them, you can see your design change in realtime. Note: while you can use these sliders to designyour lamp and see the changes reflected in your toolpaths, if you close the application and recompile it thelamp settings will revert to the values you specified inyour code.

Deciding on the width(s), height, and number of sidesis pretty intuitive, and all of the ranges are constrainedto ensure that what you make will fit together properly.You will need to decide if you want the light fixture tocome from the top or bottom of the lamp and set thediameter of the top hole or bottom hole to correspondto the diameter of your light fixture.

Similarly, you will need to set both the width and thediameter of the hole for the side opposite the lightfixture to be large enough for your hand to fit inside tochange the light bulb. For example, if your light fixtureis 26 millimeters in diameter and will go on the top ofthe lamp, then set the top-hole width to around 28millimeters. Similarly, you would set the bottom widthand bottom hole to a minimum of 80-100 millimeters.Hand sizes vary, so it’s a good idea to measure yourhand and see what is a comfortable-sized opening for

Page 6: Design by Code_ Laser-Cut Lamp — DIY How-to from Make_ Projects

Design by Code: Laser-Cut Lamp — DIY How-to from Make: Projects

http://makeprojects.com/Project/Design-by-Code-Laser-Cut-Lamp/2278/1[2012/6/5 下午 08:32:03]

EditStep 8 — Design the patternof your lamp

you.

The values for the top and bottom circle positions willdetermine how close the bases of the lamp will be tothe top and bottom. The choice is yours, but werecommend placing the base without the light fixtureas close to the end of that side as possible (20 mm).

Also, if your light fixture is on the bottom of the lamp,make sure you make the bottom base high enough toprevent your light fixture from sticking out of thebottom, which would result in a lamp that isunbalanced. To prevent this, measure how tall yourlight fixture is and set the bottom base position tosomething 5 or 10 millimeters greater than that.

If you are using ¼” plywood, you don’t need to changethe notch width and height settings. They have beenpre-defined for that size of material. If you want to trya different thickness of material, you will need changeto these settings, but realize that it may take someexperimenting with the laser cutter to get the correctvalue and a good press-fit. A good rule of thumb is toset the notch height to slightly less than the thicknessof your material to account for the kerf that will beburned away by the laser.

The decorative patterning of your lamp is alsocontrolled by code in the setup function. Specifically,the patterns are generated using a Voronoi diagram, aspecial type of spatial subdivision that, when given aset of point sites, generates cellular divisions aroundeach site consisting of all areas whose distance tothat point is not greater than their distance to anyother site. The library takes care of the logistics ofgenerating the diagram. All you have to do is give it aset of points to base the diagram on.

To specify a single point in Cartesian space, you usethe addCartPoint() method and pass it an x and ycoordinate. For example, to place a point at (15,10),you would type pointController.addCartPoint(15,10). You can also use some of Processing’s presetsystem variables, (width and height), to place pointsin specific locations. TypingpointController.addCartPoint(width/2, height/2);

will place a point in the very center of the screen.

Once you’ve added the points you want, you cancompile the code again and use the “pattern” button inthe GUI to switch to the pattern display. You will thensee a rendering of the Voronoi diagram generated bythe points you specified. If you hit the “points” button,located below the scene toggle buttons, you will seethe locations of the points themselves. The pattern willautomatically be clipped to fit inside the dimensions ofyour lamp.

You can also add points in polar space instead ofCartesian. This comes in handy when trying to drawradial patterns, like a circle, with points. To add apoint in polar space use the addPolarPoint() methodand pass it the x and y coordinates of the origin, theangle in radians and the radius. For example, thecode pointController.addPolarPoint(width/2,height/2, 6, 100); will place a point that’s 100pixels away from the center of the screen at an angleof 6 radians.

Page 7: Design by Code_ Laser-Cut Lamp — DIY How-to from Make_ Projects

Design by Code: Laser-Cut Lamp — DIY How-to from Make: Projects

http://makeprojects.com/Project/Design-by-Code-Laser-Cut-Lamp/2278/1[2012/6/5 下午 08:32:03]

About Contact User's Guide Community Guidelines Terms of Use Privacy Licensed under Creative Commons BY-NC-SA

Feedback always welcome © 2012 O'Reilly Media, Inc. Powered by Dozuki, making technical documentation come to life.

Guide

Page 1 of 2

Comments

The designs on the Hero-Worship site are gorgeous. I'm really excited to try this and play around :) Thanks for uploading!

CraigCouden, May 24 @ 2:06 PM

Note: if you’re more comfortable thinking indegrees than radians, you can use apredefined Processing method to convertfrom degrees to radians by calling radians() andpassing it the degree value. Refer here for details.

Next »