Let's talk about libredwg support

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!
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Let's talk about libredwg support

Post by vocx »

carlopav wrote: Thu Apr 02, 2020 7:31 am Yes, I am, the python dxf importer is really slow... do you think it worths working on it or you think it would be better to just have one only improved C++ one?
I think the Python importer could definitely be improved. Maybe there are some lines that make is slow, and those could be optimized. We would need to profile the code, as explained in this recent thread, Python profiling tutorial.

I like Python, so I think it makes sense to have a Python importer that is simple to test and use. Of course, if you can make a better C++ importer that would also be good. My problem is I'm not good at C++, so it would take me a while to get some progress done on that. But if you can get a C++ programmer to work on it, hey, that'd be great.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Let's talk about libredwg support

Post by looo »

some little updates:

- from now on libredwg is included also in the win conda bundle
- there is still a problem with overwriting existing files which should be fixed with this commit.

Some tests show that basic import-export works with default settings (circles, arcs, lines, ellipses). Not sure about splines as I couldn't create them with draft-workbench...
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Let's talk about libredwg support

Post by vocx »

looo wrote: Sat Apr 11, 2020 9:38 am ... Not sure about splines as I couldn't create them with draft-workbench...
What do you mean? There is a Draft_BSpline tool.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Let's talk about libredwg support

Post by looo »

vocx wrote: Sat Apr 11, 2020 2:58 pm
looo wrote: Sat Apr 11, 2020 9:38 am ... Not sure about splines as I couldn't create them with draft-workbench...
What do you mean? There is a Draft_BSpline tool.
After resetting the preferences splines worked again but libredwg doesn't seem to support them (or teh dxf export already doesn't support splines, I don't know)


edit: all splines of draft (interpolated bspline, bezier spline, cubic bezier) are not supported by dxf export. Therefore translation to dwg via libredwg can't work.
prokoudine
Posts: 125
Joined: Sat Feb 21, 2015 5:56 pm

Re: Let's talk about libredwg support

Post by prokoudine »

looo wrote: Sat Apr 11, 2020 9:38 am some little updates:

- from now on libredwg is included also in the win conda bundle
But not in the AppImage yet?
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Let's talk about libredwg support

Post by looo »

prokoudine wrote: Fri Aug 14, 2020 8:56 am
looo wrote: Sat Apr 11, 2020 9:38 am some little updates:

- from now on libredwg is included also in the win conda bundle
But not in the AppImage yet?
It should be included. Try in the python console:

Code: Select all

import LibreDWG
But currently it doesn't work. It is difficult to tell if the problem is the dxf export or the conversation from dxf2dwg.
prokoudine
Posts: 125
Joined: Sat Feb 21, 2015 5:56 pm

Re: Let's talk about libredwg support

Post by prokoudine »

looo wrote: Fri Aug 14, 2020 9:39 am It should be included. Try in the python console:

Code: Select all

import LibreDWG
But currently it doesn't work. It is difficult to tell if the problem is the dxf export or the conversation from dxf2dwg.
I have FreeCAD-asm3-Conda-Py3-Qt5-20200725-glibc2.12-x86_64.AppImage

Code: Select all

>>> import LibreDWG
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ModuleNotFoundError: No module named 'LibreDWG'
Wrong AppImage file maybe? Or do I need LibreDWG installed system-wide?
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Let's talk about libredwg support

Post by looo »

prokoudine wrote: Sat Aug 15, 2020 10:12 pm
I have FreeCAD-asm3-Conda-Py3-Qt5-20200725-glibc2.12-x86_64.AppImage


Wrong AppImage file maybe?
yes, please use 0.19 appimage (not @realthunder branch)
User avatar
duncan.lithgow
Posts: 42
Joined: Sat Jan 11, 2014 6:29 pm
Location: Denmark
Contact:

Re: Let's talk about libredwg support

Post by duncan.lithgow »

I'm working on this page about the state of DWG support in free software.
https://wiki.osarch.org/index.php?title ... wing_(DWG)

I've made some edits to https://wiki.freecadweb.org/FreeCAD_and_DWG_Import which I think the reflect the current situation. Please check I've done that correctly.

Would you agree that we need to make/describe some kind of switch between ODA converter and LibreDWG? We want to encourage use of LibreDWG be people should be able to have both available and switch between them. Is this currently possible?
Last edited by duncan.lithgow on Sun Dec 27, 2020 12:04 am, edited 2 times in total.
User avatar
duncan.lithgow
Posts: 42
Joined: Sat Jan 11, 2014 6:29 pm
Location: Denmark
Contact:

Re: Let's talk about libredwg support

Post by duncan.lithgow »

looo wrote: Sat Apr 11, 2020 9:38 am - from now on libredwg is included also in the win conda bundle
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23323 (Git)
Build type: Release
Branch: master
Hash: 512d5c6141aec52b6eecc67370336a28fde862a6
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Danish/Denmark (da_DK)

For me it first complained that the Teigha converter was missing (should be renamed ODA Converter or whatever). I then followed carlopavs instructions and have it working.
Post Reply