Loading

Project: Nameplate Generator with OpenSCAD

by MakerBotLearning, published

Project: Nameplate Generator with OpenSCAD by MakerBotLearning Jun 18, 2015

Educational Thing

Summary

In this project, students will learn and apply basic programming skills with the OpenSCAD language to style and customize a nametag. Visually, OpenSCAD is different from other types of 3D modeling programs. It’s a simple declarative computer language that was built specifically for designing 3D printable models. By modifying existing OpenSCAD code for a wavy nametag, students will explore parameters, dimensions, “for” loops, translations, and boolean operations.

Standards

Overview and Background

Students will learn how to write basic code to generate objects with the OpenSCAD language. Once comfortable, they’ll explore a sample coding project that prompts them to discover how changing different variables affects their 3D model. Finally, they’ll add their own unique variables and functions to further customize a nametag.

This project, found in MakerBot in The Classroom (http://www.makerbot.com/education), focuses on creating a parametric model using the program OpenSCAD.

You can download OpenSCAD from http://openscad.org/ or use it online from http://openscad.net/.

CCSS.MATH.CONTENT.HSF.TF.B.5
Choose trigonometric functions to model periodic phenomena with specified amplitude, frequency, and midline.

CCSS.ELA-LITERACY.RST.11-12.7: Integrate and evaluate multiple sources of information presented in diverse formats and media (e.g., quantitative data, video, multimedia) in order to address a question or solve a problem.

CCSS.MATH.CONTENT.HSF.IF.C.7
Graph functions expressed symbolically and show key features of the graph, by hand in simple cases and using technology for more complicated cases.

Lesson Plan and Activity

The entire lesson is laid out with pictures in the .PDF downloadable in the Thing Files.

Step 1: Making a Parametric nametag with existing code

  1. Try to figure out what the code is doing
  2. Modify text and font parameters
  3. Adjust dimensions to match the text
  4. Style the wave of the nametag border
  5. Create a new parameter for the text height
  6. Create a new parameter for character spacing
  7. Output an STL mesh for 3D printing

Step 2: Write OpenSCAD code from scratch to design a model

  1. Plan, Think, and Code
  2. Try new things
  3. Export, print, test, repeat

Skills Learned

  • Code
  • Translation
  • openscad
  • modifying parameters
  • measuring
  • basic code
  • writing code

Duration of Lesson

  • 1-2 class periods - Print time: 20-35 minutes per nametag

Preparation

To prepare for this lesson you will need the following supplies:

  • Chromebook or computer per student
  • Openscad.org or openscad.net open or installed
  • openscad_project.pdf handout (in Thing Files)
  • MakerBot_NametagCode_Project.scad downloaded (in Thing Files)

Rubric and Assessment

Knowledge Checks

  • What are the benefits of a parametric design?
  • How do you generate basic shapes with code?
  • Why is it important to use variables in OpenSCAD code?
  • What are examples of parameters you might change when designing an object?
  • What do you need to change or add to your OpenSCAD file to allow it to be used in Customizer?

References

Reimann Sum - http://mathworld.wolfram.com/RiemannSum.html

Custom Section

Extension Activity

Modify OpenSCAD code for thingiverse customizer
  1. Review documentation on making a customizable thing at http://customizer.makerbot.com/docs.
  2. Download code file MakerBot_NametagCode_Project.scad from the MakerBot Learning account on Thingiverse.
  3. Compare with the same OpenSCAD code used in the Thingiverse Customizer (select 4. View Source from the lower right corner of the Customizer at the MakerBot Learning account).
  4. Make modifications as you explore.
Explore the trigonometry used in the nametag
  1. Have precalculus students investigate the function used in the wavy border design of the nametags:

function f(x) =
2base +
0.5
(height - 2base)
(cos(frequencyx360/(steps-1)) + 1);

  1. In particular, what does each of the components of this function do to change the shape of the wave? Consider amplitude, frequency, and transformations. What would happen if the cosine function were replaced with the sine function? What other functions would make good nametag borders?
  2. Change and consider what amplitude, frequency, and transformations are doing.
  3. Try changing the cosine function to sine. What happens?
  4. Explore other functions that could affect the border.
Explore Riemann Sums
  1. The wave shape on the border of the nametag design is actually a simple Riemann sum approximation of the area under the graph of the function f(x) on an interval. Here’s the code that produces the steps of the wave.

for( i = [0:steps-1] ){
translate([ i*(length/steps), 0, 0 ])
cube([ length/steps, width, f(i) ]);

  1. Look at a small number of steps to get an idea of what is happening. What type of Riemann sum is being constructed?
  2. Something subtle is happening with the steps-1 part of the function definition. Why is that part of the code here and what does it do for the design? Replace steps-1 with a value (try 4, 8, etc.) and note what happens. What does it mean about the interval being used for the Riemann sum?

Custom Section

More from Learning

view more

All Apps

Customizer is the easiest way to take great 3D printable designs and make them your own. Make your OpenSCAD designs infinitely more valuable by empowering the community to customize them.

App Info Launch App
Customizer Thing App

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Quickly Scale, Mirror or Cut your 3D Models

App Info Launch App
Comments deleted.

You can also make name tags using BlocksCAD. The BlocksCAD block interface creates an OpenSCAD file for printing, but the user interface is much friendlier. The text functions let you insert any text you want in a variety of different fonts. BlocksCAD is a great way to introduce programming for younger students who might not be as adept at OpenSCAD formatting. https://www.blockscad3d.com/community/projects/30243

Thanks for the tip! We've been hearing good things about BlocksCAD from a lot of teachers. Do you have any projects that you've run using BlocksCAD? We would love to take a look!

Official BlocksCAD account here-- We're glad you have been hearing great things from teachers. We have a lot of projects on our website and would love to open a dialogue with MakerBot about projects and student and teacher needs! For more information, check out our website: https://www.blockscad3d.com/

Hi BlocksCAD! We'll send you a DM to follow up, it would be great to hear more about your projects and education initiatives.

Every project I have posted on thingiverse has been made with BlocksCAD so feel free to check out my profile! For even more ideas, check out the BlocksCAD community page and gallery at https://www.blockscad3d.com/community

Great to see some customizer lessons! This will definitely a big help for users starting making customizable things.

I have got one suggestion, you may add the str function to the code this way:

    text(
        text = str(myword), 
        font = myfont,

...

Otherwise you will not be able to enter a pure number (like 123).

Top