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
Posts: 4990
Joined: Thu Oct 18, 2018 9:18 pm

Re: Let's talk about libredwg support

Postby vocx » Thu Apr 02, 2020 7:38 am

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.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
looo
Posts: 3429
Joined: Mon Nov 11, 2013 5:29 pm

Re: Let's talk about libredwg support

Postby looo » Sat Apr 11, 2020 9:38 am

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
Posts: 4990
Joined: Thu Oct 18, 2018 9:18 pm

Re: Let's talk about libredwg support

Postby vocx » 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.
Always add the important information to your posts if you need help.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
looo
Posts: 3429
Joined: Mon Nov 11, 2013 5:29 pm

Re: Let's talk about libredwg support

Postby looo » Sat Apr 11, 2020 3:25 pm

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: 4
Joined: Sat Feb 21, 2015 5:56 pm

Re: Let's talk about libredwg support

Postby prokoudine » 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?
User avatar
looo
Posts: 3429
Joined: Mon Nov 11, 2013 5:29 pm

Re: Let's talk about libredwg support

Postby looo » Fri Aug 14, 2020 9:39 am

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: 4
Joined: Sat Feb 21, 2015 5:56 pm

Re: Let's talk about libredwg support

Postby prokoudine » Sat Aug 15, 2020 10:12 pm

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
Posts: 3429
Joined: Mon Nov 11, 2013 5:29 pm

Re: Let's talk about libredwg support

Postby looo » Sun Aug 16, 2020 4:16 am

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)