processing imported DXF

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: processing imported DXF

Post by keithsloan52 »

yorikvanhavre wrote:Wow! Excellent results!
As yorikvnhavre says Wow Excellent results, but where is all this headed are you going to rewrite your parser?
Or use the parser I did on my version of ImportCSG.py

Do you want me to update my code to parser for dxf import so that you can add your code to that?
Just wondering.
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: processing imported DXF

Post by shoogen »

keithsloan52 wrote:but where is all this headed are you going to rewrite your parser?
Or use the parser I did on my version of ImportCSG.py
Do you want me to update my code to parser for dxf import so that you can add your code to that?
Just wondering.
I consider my prototype to have two seperate parts. The first is to parse an CSG file and to put it into intermediate tree structure (of python objects of my class 'Node'). The second one is to traverse my tree stucture and to create the FreeCAD 'Features'.
I consider my prototype as example code how to create FreeCAD Features and did the 'parser part' only to aid that.
The dxf processing is bit beyond that, I might reuse it for SVG file import where there are faces with holes, as well.
I'll be happy if you think that you can reuse parts of my prototype in your project. I don't want you to change your plans on your project.

One important lesson in FreeCAD is to often check for you ShapeType and call shape.check() in case you have trouble. You can do a boolean operation of a solid and a face. I this used it to implement the 'project cut=true'. But if you extrude wires (from the dxf) to faces and do boolean operation afterwards you won't get your desired result. And I had a hard time leraning that ;)
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: processing imported DXF

Post by shoogen »

The current approch seams to be to simple for example009.scad.
djreichel
Posts: 49
Joined: Sat Feb 18, 2012 2:18 pm

Re: processing imported DXF

Post by djreichel »

User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: processing imported DXF

Post by shoogen »

djreichel wrote:Heh - example008 came from: http://en.wikipedia.org/wiki/G%C3%B6del,_Escher,_Bach
And the Object form example012 seems to apear in M.C. Eschers Waterfall. Though there is a subtile difference.

i implemented a new alogorithm that does a boolean intersection for every 2-combination and can iterate top-down to crate a feature tree and bottom up do create a single face. Unfortunatly this is not enough for example008.

Code: Select all

endpointdistance max:0.000057 min:0.000012, ends:0.000022
endpointdistance max:0.000057 min:0.000012, ends:7.485297
endpointdistance max:0.000042 min:0.000019, ends:0.000042
endpointdistance max:0.000057 min:0.000012, ends:0.000022
endpointdistance max:0.000057 min:0.000012, ends:7.485297
endpointdistance max:0.000042 min:0.000019, ends:0.000042
endpointdistance max:0.000062 min:0.000044, ends:3.999984
endpointdistance max:0.000058 min:0.000000, ends:20.880613
I tried using draftutils.fcgeo.superWire. But this gives a bad result for the 'Base' layer.
Post Reply