Skip to content

Latest commit

 

History

History
79 lines (62 loc) · 3.17 KB

README.md

File metadata and controls

79 lines (62 loc) · 3.17 KB

SCADTrace

This is a toolset to convert a black-and-white bitmap into an openscad object suitable for using to emboss a cylindrical object.

from something like this (image by Biofarben GmbH):

Source Image

to this:

Geometry

It uses potrace to generate an SVG representation of the figure from a bitmap. potrace rocks.
It then uses a python script to parse the SVG, extract the path geometry and generate openscad geometry.

Generating the inner and outer faces of the geometry presents a somewhat complicated problem because the faces need to be expressed as triangles. I've used Triangle to generate tesselations, and it works well. There are still some issues remaining and the code is far from clean.

Using

The steps for converting a JPG to an openscad model are in the Makefile.

  1. convert the source image into a BMP file using convert from imagemagick
  2. convert the BMP into an SVG outline using potrace
  3. convert the SVG into an openscad model using svgtoscad.py, which invokes triangle to tessellate the faces. svgtoscad.py takes the location of the triangle binary as a command line argument.

Dependencies

  1. potrace 1.11 to generate an SVG representation of the figure from a bitmap.
  2. triangle to tesselate the SVG shapes into triangles.
  3. imagemagick to convert source image to BMP

Tesselations

Here's a close-up that shows the effect of the triangulation. Pretty, hey? Quality Tesselation

The "quality" option introduces internal nodes which allow the geometry to be deformed into a cylinder without nasty distortion of the faces.

Quality Tesselation Projected

Here's the artwork used as a negative geometry to emboss the inside of a translucent diffuser.

Translucent Embossed Diffuser

Installation of potrace

Under OSX Mavericks, the steps are:

  1. mkdir potrace; cd potrace
  2. wget http://potrace.sourceforge.net/download/potrace-1.11.tar.gz
  3. tar -zxf potrace-1.11.tar.gz
  4. cd potrace-1.11
  5. ./configure
  6. make

Installation of Triangle

Under OSX Mavericks the steps are:

  1. mkdir triangle; cd triangle
  2. wget http://www.netlib.org/voronoi/triangle.zip
  3. unzip triangle.zip
  4. vi makefile
  5. Delete '-DLINUX' from the makefile
  6. make triangle

Installation of ImageMagick

Note: you probably don't want to install like this. Install a precompiled package for your operating system.

  1. wget ftp://mirror.aarnet.edu.au/pub/imagemagick/ImageMagick-6.9.0-10.tar.bz2
  2. tar -zxf ImageMagick-6.9.0-10.tar.bz2
  3. ./configure
  4. make
  5. sudo make install