Import of dxf file with a circle.

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

Import of dxf file with a circle.

KeithSloan52
I am trying to debug a problem with FreeCAD import of an OpenSCAD file.
see  https://forum.freecadweb.org/viewtopic.php?f=3&t=28119&p=228042#p228042
<https://forum.freecadweb.org/viewtopic.php?f=3&t=28119&p=228042#p228042>  
for full details.

One problem seems to be that I have a dxf file with a circle, displays as
circle in LibreCAD.
If in OpenSCAD I import it with
import(file = "file1.dxf");
OpenSCAD creates it as an 8 sided polygon.

Now I understand that OpenSCAD does not do circles just polygons, but my
question is there a way to control the number of elements of an imported dxf
file given there is no $fn involved with an import. Or am I stuck with a
default of 8.



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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Import of dxf file with a circle.

tp3
On 04/16/2018 03:50 PM, KeithSloan52 wrote:
> ...given there is no $fn involved with an import.
 >
There is the wrong assumption. The import module, and
specifically also the DXF import does use $fa/$fs/$fn
to convert curves to polygons.

Try import("circle.dxf", $fn = 3); and you will even
end up with a triangle instead of a circle.

ciao,
   Torsten.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Import of dxf file with a circle.

KeithSloan52
If I try import("circle.dxf", $fn = 12);
I get a 12 sided polygon, but if I try import("circle.dxf", $fn = 0);
It defaults back to 8 sided.  



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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Import of dxf file with a circle.

kintel
Administrator

> On Apr 21, 2018, at 3:46 PM, KeithSloan52 <[hidden email]> wrote:
>
> If I try import("circle.dxf", $fn = 12);
> I get a 12 sided polygon, but if I try import("circle.dxf", $fn = 0);
> It defaults back to 8 sided.  
>
That’s correct; $fn=0 disables $fn and it falls back to calculating the number of sides using $fs and $fa.

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Import of dxf file with a circle.

tsingi
In reply to this post by KeithSloan52
Just a guess, but $fn=0; means no faces, not legal?  Going to a default value seems like proper behaviour in that case.

On Sat, Apr 21, 2018 at 3:46 PM, KeithSloan52 <[hidden email]> wrote:
If I try import("circle.dxf", $fn = 12);
I get a 12 sided polygon, but if I try import("circle.dxf", $fn = 0);
It defaults back to 8 sided. 



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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



--
"Rumors of my death have been greatly exaggerated."
  -- Jesus Christ

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Import of dxf file with a circle.

tsingi
In reply to this post by kintel
Or that.

On Sat, Apr 21, 2018 at 3:50 PM, Marius Kintel <[hidden email]> wrote:

> On Apr 21, 2018, at 3:46 PM, KeithSloan52 <[hidden email]> wrote:
>
> If I try import("circle.dxf", $fn = 12);
> I get a 12 sided polygon, but if I try import("circle.dxf", $fn = 0);
> It defaults back to 8 sided. 
>
That’s correct; $fn=0 disables $fn and it falls back to calculating the number of sides using $fs and $fa.

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



--
"Rumors of my death have been greatly exaggerated."
  -- Jesus Christ

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org