[OpenSCAD] SVG import recenter

Parkinbot rudolf at parkinbot.com
Sun Jan 21 12:14:59 EST 2018


You are right. My fast example did not cover these cases, but this is not
important for functional stuff, where you can discover negative volumes. 

This code

$fn = 4; 
difference()
{
  circle(20); 
  circle(10); 
}

will give: 

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="40mm" height="40mm" viewBox="-20 -20 40 40"
xmlns="http://www.w3.org/2000/svg" version="1.1">
<title>OpenSCAD Model</title>
<path d="
M 20,-0 L 0,-20 L -20,-0 L 0,20 z
M -10,-0 L 0,-10 L 10,-0 L 0,10 z
" stroke="black" fill="lightgray" stroke-width="0.5"/>
</svg>

and I would expect to get this: 
import = [[[ 20,-0 ],[ 0,-20 ],[-20,-0], [ 0,20]], [[ -10,-0],[ 0,-10 ],[
10,-0 ],[ 0,10]]];

which results from the M sections. Currently I am using my own converter for
this. But it would be a nice to have. Also equivalentkly for STLs. 




--
Sent from: http://forum.openscad.org/




More information about the Discuss mailing list