/* To convert a 2d shape into polygons 1) mirror on x axis (to correct for different origins.) 2) export as svg. 3) open svg in text editor 4) delete everything upto first 'M' 5) delete everything after last 'z' 6) search and replace 'L' with '],[' 7) search and replace 'M' with 'polygon(points=[[' 8) search and replace 'z' with ']]);' 9) if more than one polygon(if single shape) start with 'difference(){' and end with '}' 10) the result is the required polygons. */ module shape(){ // test composed of basic shapes rotate([0,0,20]) difference(){ square(450,true); square(200); circle(100); } } mirror([0,1]) // 1) & 2) shape(); /* 3) OpenSCAD Model */ /* 4) & 5) M 288.385,-134.476 L -134.476,-288.385 L -288.385,134.476 L 134.476,288.385 z M -68.404,187.939 L -34.0147,93.4545 L -43.8371,89.8794 L -61.5661,78.8011 L -76.6044,64.2788 L -88.2948,46.9472 L -96.1262,27.5637 L -99.7564,6.97565 L -99.0268,-13.9173 L -93.9693,-34.202 L -84.8048,-52.9919 L -71.934,-69.4658 L -55.9193,-82.9038 L -37.4607,-92.7184 L -17.3648,-98.4808 L 3.48995,-99.9391 L 24.1922,-97.0296 L 43.8371,-89.8794 L 61.5661,-78.8011 L 76.6044,-64.2788 L 88.2948,-46.9472 L 96.1262,-27.5637 L 99.7564,-6.97565 L 99.0268,13.9173 L 93.9693,34.202 L 187.939,68.404 L 119.534,256.343 z */ /* 6) M 288.385,-134.476 ],[ -134.476,-288.385 ],[ -288.385,134.476 ],[ 134.476,288.385 z M -68.404,187.939 ],[ -34.0147,93.4545 ],[ -43.8371,89.8794 ],[ -61.5661,78.8011 ],[ -76.6044,64.2788 ],[ -88.2948,46.9472 ],[ -96.1262,27.5637 ],[ -99.7564,6.97565 ],[ -99.0268,-13.9173 ],[ -93.9693,-34.202 ],[ -84.8048,-52.9919 ],[ -71.934,-69.4658 ],[ -55.9193,-82.9038 ],[ -37.4607,-92.7184 ],[ -17.3648,-98.4808 ],[ 3.48995,-99.9391 ],[ 24.1922,-97.0296 ],[ 43.8371,-89.8794 ],[ 61.5661,-78.8011 ],[ 76.6044,-64.2788 ],[ 88.2948,-46.9472 ],[ 96.1262,-27.5637 ],[ 99.7564,-6.97565 ],[ 99.0268,13.9173 ],[ 93.9693,34.202 ],[ 187.939,68.404 ],[ 119.534,256.343 z */ /* 7) polygon(points=[[ 288.385,-134.476 ],[ -134.476,-288.385 ],[ -288.385,134.476 ],[ 134.476,288.385 z polygon(points=[[ -68.404,187.939 ],[ -34.0147,93.4545 ],[ -43.8371,89.8794 ],[ -61.5661,78.8011 ],[ -76.6044,64.2788 ],[ -88.2948,46.9472 ],[ -96.1262,27.5637 ],[ -99.7564,6.97565 ],[ -99.0268,-13.9173 ],[ -93.9693,-34.202 ],[ -84.8048,-52.9919 ],[ -71.934,-69.4658 ],[ -55.9193,-82.9038 ],[ -37.4607,-92.7184 ],[ -17.3648,-98.4808 ],[ 3.48995,-99.9391 ],[ 24.1922,-97.0296 ],[ 43.8371,-89.8794 ],[ 61.5661,-78.8011 ],[ 76.6044,-64.2788 ],[ 88.2948,-46.9472 ],[ 96.1262,-27.5637 ],[ 99.7564,-6.97565 ],[ 99.0268,13.9173 ],[ 93.9693,34.202 ],[ 187.939,68.404 ],[ 119.534,256.343 z */ /* 8) polygon(points=[[ 288.385,-134.476 ],[ -134.476,-288.385 ],[ -288.385,134.476 ],[ 134.476,288.385 ]]); polygon(points=[[ -68.404,187.939 ],[ -34.0147,93.4545 ],[ -43.8371,89.8794 ],[ -61.5661,78.8011 ],[ -76.6044,64.2788 ],[ -88.2948,46.9472 ],[ -96.1262,27.5637 ],[ -99.7564,6.97565 ],[ -99.0268,-13.9173 ],[ -93.9693,-34.202 ],[ -84.8048,-52.9919 ],[ -71.934,-69.4658 ],[ -55.9193,-82.9038 ],[ -37.4607,-92.7184 ],[ -17.3648,-98.4808 ],[ 3.48995,-99.9391 ],[ 24.1922,-97.0296 ],[ 43.8371,-89.8794 ],[ 61.5661,-78.8011 ],[ 76.6044,-64.2788 ],[ 88.2948,-46.9472 ],[ 96.1262,-27.5637 ],[ 99.7564,-6.97565 ],[ 99.0268,13.9173 ],[ 93.9693,34.202 ],[ 187.939,68.404 ],[ 119.534,256.343 ]]); */ difference(){ polygon(points=[[ 288.385,-134.476 ],[ -134.476,-288.385 ],[ -288.385,134.476 ],[ 134.476,288.385 ]]); polygon(points=[[ -68.404,187.939 ],[ -34.0147,93.4545 ],[ -43.8371,89.8794 ],[ -61.5661,78.8011 ],[ -76.6044,64.2788 ],[ -88.2948,46.9472 ],[ -96.1262,27.5637 ],[ -99.7564,6.97565 ],[ -99.0268,-13.9173 ],[ -93.9693,-34.202 ],[ -84.8048,-52.9919 ],[ -71.934,-69.4658 ],[ -55.9193,-82.9038 ],[ -37.4607,-92.7184 ],[ -17.3648,-98.4808 ],[ 3.48995,-99.9391 ],[ 24.1922,-97.0296 ],[ 43.8371,-89.8794 ],[ 61.5661,-78.8011 ],[ 76.6044,-64.2788 ],[ 88.2948,-46.9472 ],[ 96.1262,-27.5637 ],[ 99.7564,-6.97565 ],[ 99.0268,13.9173 ],[ 93.9693,34.202 ],[ 187.939,68.404 ],[ 119.534,256.343 ]]); }