LibreCad To FreeCad importing tool

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
MarcX
Posts: 26
Joined: Tue Nov 28, 2017 1:15 pm
Location: France, Grenoble

LibreCad To FreeCad importing tool

Post by MarcX »

Hi there,

I had plenty of LibreCad DXFs to import so I made a lil python script to convert them to FreeCAD sketches.

The process creates an individual sketch for each layer present in the DXF and attempts to create basic constraints between the entities in order to directly obtain closed shapes. Here it is:

https://framagit.org/MarcusFecit/LibreCadToFreeCad

git clone https://framagit.org/MarcusFecit/LibreCadToFreeCad

There might be some interesting ideas for those in charge of the FreeCAD's embedded importing tool.

Feel free to use it and share your thoughts.

Enjoy !
--
Marc BERLIOUX
--
Marc BERLIOUX
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: LibreCad To FreeCad importing tool

Post by Kunda1 »

Nice!
This would be wicked cool as a FreeCAD Addon
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
MarcX
Posts: 26
Joined: Tue Nov 28, 2017 1:15 pm
Location: France, Grenoble

Re: LibreCad To FreeCad importing tool

Post by MarcX »

Thanks Kunda1,

I'm very newbee with FreeCAD. And with Python too..

Is there a kind of tutorial somewhere on how to integrate an add-on in the FreeCAD's GUI ?

Have a nice day
--
Marc BERLIOUX
--
Marc BERLIOUX
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: LibreCad To FreeCad importing tool

Post by Kunda1 »

MarcX wrote: Sun Sep 16, 2018 7:46 am I'm very newbee with FreeCAD. And with Python too..
Is there a kind of tutorial somewhere on how to integrate an add-on in the FreeCAD's GUI ?
https://github.com/FreeCAD/Workbench-Starterkit
Feel free to look at some of the other more established workbenches in https://github.com/FreeCAD/FreeCAD-addons
and of course ask the community for support if you need it. This type of tool has the potential to effectively and efficiently harness the power of both FOSS projects.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: LibreCad To FreeCad importing tool

Post by Kunda1 »

MarcX wrote: Sun Sep 16, 2018 7:46 am Is there a kind of tutorial somewhere on how to integrate an add-on in the FreeCAD's GUI ?
looo wrote:ping
Any resources for folks like @MarcX that would like to integrate an addon like this in to FC ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: LibreCad To FreeCad importing tool

Post by Kunda1 »

MarcX wrote: Sat Sep 15, 2018 2:30 pm
What's on the Roadmap for this project? Do you prefer people to post feedback/bugs on the gitlab repo or in this thread?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
nemesis
Posts: 373
Joined: Tue Mar 25, 2014 11:24 pm
Location: France, Lyon

Re: LibreCad To FreeCad importing tool

Post by nemesis »

MarcX wrote: Sat Sep 15, 2018 2:30 pm Hi there,

I had plenty of LibreCad DXFs to import so I made a lil python script to convert them to FreeCAD sketches.

The process creates an individual sketch for each layer present in the DXF and attempts to create basic constraints between the entities in order to directly obtain closed shapes. Here it is:

https://framagit.org/MarcusFecit/LibreCadToFreeCad

git clone https://framagit.org/MarcusFecit/LibreCadToFreeCad

There might be some interesting ideas for those in charge of the FreeCAD's embedded importing tool.

Feel free to use it and share your thoughts.

Enjoy !
--
Marc BERLIOUX
Maybe it is important to specify that ezdxf must be install ..... ;)
User avatar
MarcX
Posts: 26
Joined: Tue Nov 28, 2017 1:15 pm
Location: France, Grenoble

Re: LibreCad To FreeCad importing tool

Post by MarcX »

Hi all,
My script can now extract and process LWPOLYLINE entities too. They are converted to lines and/or circle arcs. So you can now, for example, process gears generated from Inkscape.

Still here:

https://framagit.org/MarcusFecit/LibreCadToFreeCad

git clone https://framagit.org/MarcusFecit/LibreCadToFreeCad

Profitez !


Nemesis: Maybe it is important to specify that ezdxf must be install ..... ;)
OK, done. Thanks

Kunda1: What's on the Roadmap for this project? Do you prefer people to post feedback/bugs on the gitlab repo or in this thread?
You can continue to drop your comments or suggestions here, or through the git repo. Both are OK for me

Have a nice day !
--
Marc BERLIOUX
--
Marc BERLIOUX
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: LibreCad To FreeCad importing tool

Post by looo »

Kunda1 wrote: Tue Sep 18, 2018 5:18 pm Any resources for folks like @MarcX that would like to integrate an addon like this in to FC ?
As far as I have seen this is a standalone application, so I guess it's best to provide it via a cross-platform-packagemanger (pypi). For packaging scripts you can have a look at this:
https://python-packaging.readthedocs.io ... ripts.html

If you want to add some gui-stuff for freecad you can add a extension-module...
https://github.com/FreeCAD/Workbench-Starterkit
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: LibreCad To FreeCad importing tool

Post by Kunda1 »

looo wrote: Wed Sep 19, 2018 11:34 am If you want to add some gui-stuff for freecad you can add a extension-module...
https://github.com/FreeCAD/Workbench-Starterkit
+1
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply