Design into 3D

From ShapeOko
Jump to: navigation, search

Design into 3D is an effort to create a systematic set of project generators for CNC projects, documenting things well enough that one would be able to draw up traditional plans using pen and pencil and fabricate an instance of a project using hand tools.

It is simultaneously:

  • an opensource project which is a collection of projects for things such as boxes, furniture, and tools
  • a Kickstarter
  • a book (currently in early draft stages)
  • a website: https://designinto3d.com/
  • a design philosophy

The design philosophy touches on the idea that fundamentally there are only two types of furniture:

  • platforms
  • boxes

with more complicated pieces incorporating both structures.

The following projects have been worked up thus far:

Currently it uses OpenSCAD as a 3D modeling front-end using the customizer feature which is available in developmental snapshots. When the parameters for a suitable design are entered into the customizer they may be saved as a preset in a JSON file which is stored in the same directory as the OpenSCAD source file. These may then be loaded into a file which generates a design for cutting, or toolpaths. Prospects for this include Tool Path Language and METAPOST using the library embedded in LuaTeX and importing the JSON file using the Lua scripting language.

OpenSCAD

When launched, OpenSCAD will display a blank window with an Editor, Console, and Customizer:

Design into 3D OpenSCAD interface launch.png

Hide the Editor, Console, and disclose the areas of the Customizer and use the Preview area's interface controls (esp. the 3rd button from the left to View All) to display the project and the parameters which may be adjusted:

Design into 3D OpenSCAD interface customizer.png

Geometry and Toolpaths

Once one has a saved preset in a JSON file from OpenSCAD, then it is a matter of generating the geometry and toolpaths which will be needed to cut out the project.

Loading files from JSON is well documented in most programming tools, and two are notable for being suited to making geometry and/or toolpaths:

For other options see: Programmatic G-Code Generators

The challenge here is the differences in how the modeling is done in each tool:

  • OpenSCAD defines volumes and the removing of material from an area using Boolean operations for difference and intersection
  • Tool Path Language defines a toolpath for a tool resulting in the removal of material based on that tool diameter/shape moving through the material
  • METAPOST defines geometric regions without an offset

Defining a series of macros and functions which allow each tool to work in a similar fashion would simplify these calculations tremendously.

Possible approaches:

  • import SVG into OpenSCAD
  • work up OpenSCAD macro which allows the use of METAPOST syntax

Geometry

First though, one must define the geometry of the design. This is done using classic geometric constructs, and possibly some curves defined by fancy math (but usually drawn up in a CAD or Bézier curve drawing program.

Points

The most basic construct is a point in coordinate space --- some CAM tools allow one to assign a drilling operation at a point.

Lines

Straight lines are the fundamental building blocks of vector drawing and are of course defined as the shortest distance between two points. Some CAM tools will allow one to assign various toolpaths to lines, and if not directly on the line, the offset will be determined by which point is the origin and which is the final point.

Arcs

Many CAD programs will allow the definition of arcs which are easily drawn and may be specified in several ways --- an origin point, end point, and a point of rotation are typical.

Curves

Curves are omitted from some tools, and when present may be defined in several ways.

Bézier Curves

The most common is Bézier curves which are defined by an on-curve point (the origin), a matching off-curve point, and an additional off-curve point paired with the ending on-curve point.

Paths

Paths are made up of multiple points, and/or lines/arcs/curves and are differentiated by being open or closed.

Open Paths

As noted above, toolpaths may be assigned to open paths, and the directionality will determine any offset. Open paths are necessarily limited in the toolpaths which may be assigned, and it will typically not be possible to assign any but the most basic of operations to them.

Closed Paths

Closed paths meet back at the point of origin and open up additional operations in CAM tools. They may be made up of lines, arcs, curves, or some combination.

Often tools will have especial support for regular polygons, allowing their creation or definition quickly and efficiently.

Third Dimensional Shapes

Extending all of these into 3 dimensions becomes more complex with each additional element each of which complicates the mathematics.

Up through arcs and regular curves, these are usually manageable, as is expressed in constructive solid geometry (CSG), and OpenSCAD is essentially a scripting front-end for this.

Extending arbitrary curves into 3 dimensional space involves complex geometric calculations which are the domain of 3 dimensional modeling tools such as Blender and various commercial programs.

Fortunately, the regular polygons and extruded shapes of CSG afford one a very wide array of design options.

Toolpaths

Creating toolpaths is just that, modeling the motion of the rotary tool through 3 dimensional space.

These toolpaths necessarily partake of the roundness of the tool, and are limited by that in terms of 3D space, so circles are easy, while sharp-cornered triangles and squares are not possible. One possible strategy here is to model the possible 2-dimensional shapes which one might have occasion to cut out:

  • circles
  • ovals
  • arcs of circles
  • triangles with rounded corners
  • square/rectangles with rounded corners

With a library of such geometry, one should be able to cut out the majority of designs which are typically done using 2.5D CAM.

Future

Potential projects which may be worked up: