[SOLVED] importing SVG: arc path is not being imported

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!
kingkro123
Posts: 2
Joined: Tue Mar 03, 2020 1:45 pm

[SOLVED] importing SVG: arc path is not being imported

Postby kingkro123 » Tue Mar 03, 2020 1:58 pm

Dear Forum,

I have an SVG of 4 objects.

When importing into freecad one of the objects is not shown (path3065). It happens to be an arc shape.

I've searched the forum and web and can't find a solution

I have attached the SVG and FCStd, as well as a screenshot.

thanks in advance for your assistance
Annotation 2020-03-03 135634.png
Annotation 2020-03-03 135634.png (106.84 KiB) Viewed 335 times


Regards,
Richard


OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
Attachments
coral6a_plain.svg
(2.73 KiB) Downloaded 7 times
coral6a_plain.FCStd
(4.63 KiB) Downloaded 4 times
Last edited by kingkro123 on Wed Mar 04, 2020 12:37 pm, edited 1 time in total.
chrisb
Posts: 27930
Joined: Tue Mar 17, 2015 9:14 am

Re: importing SVG: arc path is not being imported

Postby chrisb » Tue Mar 03, 2020 6:07 pm

Hi and welcome to the forum!

Interesting issue. I have tried with a recent 0.19 and get the same result when importing as geometry. However, if I import as drawing all 4 are present. This means to me that FreeCAD can recognize all four subpaths.
chrisb
Posts: 27930
Joined: Tue Mar 17, 2015 9:14 am

Re: importing SVG: arc path is not being imported

Postby chrisb » Tue Mar 03, 2020 6:10 pm

The problem seems to be that FreeCAD cannot handle an inkscape path with just one point. If you add another point (in inkscape by double clicking somewhere on the path) it is imported correctly into FreeCAD.
kingkro123
Posts: 2
Joined: Tue Mar 03, 2020 1:45 pm

Re: importing SVG: arc path is not being imported

Postby kingkro123 » Wed Mar 04, 2020 12:36 pm

Many thanks Chris.

I've taken your advice and executed 'Convert selected object's stroke to path' which added in the nodes needed for freecad to read in the geometry.

Seems an obvious step now that I know :)

Kind regards,
Richard
User avatar
Kunda1
Posts: 8405
Joined: Thu Jan 05, 2017 9:03 pm

Re: [SOLVED] importing SVG: arc path is not being imported

Postby Kunda1 » Wed Mar 04, 2020 4:35 pm

Where should this be documented if it isn't yet?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
openBrain
Posts: 4617
Joined: Fri Nov 09, 2018 5:38 pm

Re: [SOLVED] importing SVG: arc path is not being imported

Postby openBrain » Wed Mar 04, 2020 5:22 pm

Kunda1 wrote:
Wed Mar 04, 2020 4:35 pm
Where should this be documented if it isn't yet?
Good to document but better to fix IMO. ;)
User avatar
Roy_043
Posts: 1884
Joined: Thu Dec 27, 2018 12:28 pm

Re: [SOLVED] importing SVG: arc path is not being imported

Postby Roy_043 » Fri Mar 06, 2020 5:50 pm

Kunda1 wrote:
Wed Mar 04, 2020 4:35 pm
Where should this be documented if it isn't yet?
I have added this as a limitation on this page:
https://wiki.freecadweb.org/Draft_SVG
User avatar
Kunda1
Posts: 8405
Joined: Thu Jan 05, 2017 9:03 pm

Re: [SOLVED] importing SVG: arc path is not being imported

Postby Kunda1 » Fri Mar 06, 2020 5:57 pm

Roy_043 wrote:
Fri Mar 06, 2020 5:50 pm
Kunda1 wrote:
Wed Mar 04, 2020 4:35 pm
Where should this be documented if it isn't yet?
I have added this as a limitation on this page:
https://wiki.freecadweb.org/Draft_SVG
Thank you very much
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
openBrain
Posts: 4617
Joined: Fri Nov 09, 2018 5:38 pm

Re: [SOLVED] importing SVG: arc path is not being imported

Postby openBrain » Sun Mar 08, 2020 2:41 pm

Here is the culprit => https://github.com/FreeCAD/FreeCAD/blob ... G.py#L1105
It checks that ending point is different from starting point. Which of course can make sense for cubic Bezier curves.
I disabled the check and everything runs fine.
Same problem may happen with quadratic Bezier curve.
Also I find this condition is checked for lines (which is OK), tested with different coding for vertical lines and not tested at all for horizontal lines.
yorik wrote: Ping
May you remember why these checks were added and if they can be safely removed ?