# Design into 3D

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:

- boxes
- Rabbeted --- https://www.thingiverse.com/thing:3575705 http://chaunax.github.io/projects/twhl-box/twhl.html see: https://www.shapeoko.com/wiki/index.php/Carbide_Create:_A_Simple_CNC_Box
- fitted --- the simplest box, requiring a minimum of parameters, and invariant of endmill diameter for round or oval boxes
- mitered --- a simple box design requiring only a 90 degree V endmill
- finger joint: https://community.carbide3d.com/t/cnc-finger-joint-box/8880 with an OpenSCAD file posted to https://community.carbide3d.com/uploads/default/original/2X/7/7b38d865b39af4c06b29020c62a2130a57a02255.zip --- note that this and dovetail joinery require a fixture for holding the board vertically: https://community.carbide3d.com/t/cnc-finger-joint-box/8880/47
- dovetails: https://community.carbide3d.com/t/sharing-carbide-create-dovetail-files/9371/21

- tools
- hex bit organizer: https://www.reddit.com/r/functionalprint/comments/4yt295/hex_bit_storage/ --- OpenSCAD code

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.

## Contents

## OpenSCAD

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

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:

## 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:

- Box (1)
- magazine storage
- drawer dividers

- Tools
- Japanese hand brace
- locking register calipers: http://www.shapeoko.com/wiki/index.php/File:Tool_calipers_locking.svg https://community.carbide3d.com/t/locking-register-calipers-after-h-o-studley/658
- bevel gauge: https://cutrocket.com/p/5c199e292863a/ https://community.carbide3d.com/t/adding-geometry-to-cut-as-a-pocket-with-a-finishing-pass/9993

- Birdhouses (2)
- Games
- Cribbage Boards (3)
- Chinese checkers (4) --- note that this began as https://en.wikipedia.org/wiki/Halma --- may make sense to offer variations beyond size.

- Organizers
- Spice racks (5)
- Desk Organizers (6)
- serving tray (7)
- collectible card sorting tray (8)
- Endmills (9)

- Spoons / utensils
- phone / iPad / tablet / laptop holder --- the parameter would be the tablet size/model
- Flags --- import an SVG from Wikimedia, adjust for waviness
- picture frames (10) --- parameters would include size of picture, width and thickness of stock, frame width, and options for ornamentation and possibly labeling