Exporting to ponoko?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Exporting to ponoko?

Brian Korsedal
Hi,

I need to export this design as a *.svg so I can use it with ponoko.
I'm able to do this using a few different converter programs, but all
my circles turn into line segments.  The entire design consists of
line segments and I don't think it will print well.

Any suggestions?

-Brian

Reply | Threaded
Open this post in threaded view
|

Re: Exporting to ponoko?

kintel
Administrator
On Jul 14, 2010, at 21:05 PM, Brian Korsedal wrote:

> Any suggestions?
>

Due to how 2D data is represented internally, you'll lose alle information about higher-level primitives when exporting from OpenSCAD.

As an alternative, you can always tessellate it with higher precision to get a better approximation of your object.

See here for the magic $fa, $fs and $fn variables which control this:
http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features

~/= Marius

--
We are Elektropeople for a better living.





Reply | Threaded
Open this post in threaded view
|

Re: Exporting to ponoko?

Carl Witty
In reply to this post by Brian Korsedal
On Wed, Jul 14, 2010 at 12:05 PM, Brian Korsedal
<[hidden email]> wrote:
> Hi,
>
> I need to export this design as a *.svg so I can use it with ponoko.
> I'm able to do this using a few different converter programs, but all
> my circles turn into line segments.  The entire design consists of
> line segments and I don't think it will print well.
>
> Any suggestions?

Internally, the libraries that OpenSCAD uses deal with straight lines
and flat surfaces.  Changing this would be infeasible, I believe.  A
couple of ideas: Have you tried playing with the variables $fa, $fs,
$fn described in the "Special Variables" section of
http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language
?  You could make sure the line segments are small enough to be
invisible.

Alternately, if you're willing to write some code, it shouldn't be too
hard to post-process the OpenSCAD output to turn the lines back into
circles.  Here's a simple, although slightly inefficient, algorithm:
  At every vertex where two line segments intersect, check whether the
line segments are (approximately) the same length.  If so, trace along
the line in both directions, finding the longest collection of line
segments that are all approximately the same length, and where the
angle at each intersection is approximately the same.  Replace this
collection with an arc of a circle.

The problem in 3D (turning a mesh into sections of spheres) would be
vastly harder; but in 2D, turning line segments into circular arcs
seems fairly doable.

Carl Witty

Reply | Threaded
Open this post in threaded view
|

Re: Exporting to ponoko?

Brian Korsedal
ouch.

On Wed, Jul 14, 2010 at 12:32 PM, Carl Witty <[hidden email]> wrote:

> On Wed, Jul 14, 2010 at 12:05 PM, Brian Korsedal
> <[hidden email]> wrote:
>> Hi,
>>
>> I need to export this design as a *.svg so I can use it with ponoko.
>> I'm able to do this using a few different converter programs, but all
>> my circles turn into line segments.  The entire design consists of
>> line segments and I don't think it will print well.
>>
>> Any suggestions?
>
> Internally, the libraries that OpenSCAD uses deal with straight lines
> and flat surfaces.  Changing this would be infeasible, I believe.  A
> couple of ideas: Have you tried playing with the variables $fa, $fs,
> $fn described in the "Special Variables" section of
> http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language
> ?  You could make sure the line segments are small enough to be
> invisible.
>
> Alternately, if you're willing to write some code, it shouldn't be too
> hard to post-process the OpenSCAD output to turn the lines back into
> circles.  Here's a simple, although slightly inefficient, algorithm:
>  At every vertex where two line segments intersect, check whether the
> line segments are (approximately) the same length.  If so, trace along
> the line in both directions, finding the longest collection of line
> segments that are all approximately the same length, and where the
> angle at each intersection is approximately the same.  Replace this
> collection with an arc of a circle.
>
> The problem in 3D (turning a mesh into sections of spheres) would be
> vastly harder; but in 2D, turning line segments into circular arcs
> seems fairly doable.
>
> Carl Witty
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>