Message Boards Message Boards

0
|
8501 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

How does one model a cube for 3D printing

Posted 9 years ago

I've never used the wolfram programming language. What are the steps necessary to model a cube and export it for printing?

Posted 9 years ago

Kevin,

I'll give you some basic steps, but it would be helpful to have more information, and then I could be more specific. Do you plan on doing much 3D printing, or is this a one-off thing? Are you willing to invest time learning the Wolfram Language, or were you thinking it would be easier than other tools? Are you more interested in learning 3D printing or learning Wolfram Language?

You should probably check out Sketchup, Tinkercad, OpenScad, Autodesk 123D, and any other tools that show up in a search for 3D printing tools that look interesting to you.

Having said all of that, and assuming you're using Mathematica, what you'll need to do is generate a file in a format usable by the target printer. I'll assume you want STL format. So the last line in your notebook will be something like:

Export[FileNameJoin[{$HomeDirectory, "test.stl"}], simplecube, "STL"]

The first argument should be a path to where you want the file. The function FileNameJoin is a convenient way to create a path, but you can use a string instead. I've specified a path in my user/home directory. The second argument is the data you want to export, so simplecube is a variable to which you will assign that data. The third argument is the format, and is actually optional; Mathematica will figure it out from the filename specified in the first argument, since it ends in ".stl".

There are many ways with Mathematica to create data for 3D printing, and most of them would be more common than what I'm about to show you, but since you wanted a simple cube, we'll just go with that. Mathematica has example data of various kinds built in, and data about common polyhedrons is among them. We'll use PolyhedronData to extract data about a cube:

simplecube = PolyhedronData["Cube", "MeshRegion"]

MeshRegion is a representation that exports easily to STL. You could also have requested "ImplicitRegion", and you can also see lots of other types of data associated with a cube (look at documentation for PolyhedronData for examples).

And that's it. You could have done it in one line by not using the variable "simplecube", but usually there are good reasons to save certain data, maybe intermediate computations, in variables, so I'd leave it.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract