SVG import is empty

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!
PunyTune
Posts: 103
Joined: Sun Jan 06, 2019 1:59 am

SVG import is empty

Post by PunyTune »

I'm trying to import an outline from Adobe Illustrator as an SVG and nothing shows. Is there anything more to try?

OS: OS X El Capitan (10.11)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15310 (Git)
Build type: Release
Branch: (HEAD detached at c88a64e8e)
Hash: c88a64e8e7a3bb66a23b965b655b5a5040dfa4d2
Python version: 2.7.15
Qt version: 5.11.2
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
Attachments
Puny C half.svg
(1.69 KiB) Downloaded 109 times
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: SVG import is empty

Post by openBrain »

No problem here with file you provided (or at least something is imported, looking like a mountain landscape shape... :) )
How did you import the file ? "New file" then "Import" ? Or direct "Open" ? What import type (here I can choose "Drawing" or "SVG as a geometry" ?
Did the Report panel raise an error ?

PS : notice on my side any import way/type correctly works
---
OS: Ubuntu 18.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15611 (Git)
Build type: Release
Branch: master
Hash: 64a94ae0f7c60fc981086fe157150a9c0dca29c6
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)
PunyTune
Posts: 103
Joined: Sun Jan 06, 2019 1:59 am

Re: SVG import is empty

Post by PunyTune »

Sorry for not giving more detail.

New file.
Import.
Select "as geometry".
A red error line appears at the bottom of the screen, but it's very long. I'll just include a screenshot of it.

I don't know if it matters, but I see the word "Draft" and reference to Draft Tools, and I see that in my Draft workbench there are no tools shown.
Attachments
error.png
error.png (25.33 KiB) Viewed 1696 times
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: SVG import is empty

Post by bejant »

PunyTune wrote: Tue Jan 22, 2019 5:29 pm Is there anything more to try?
After Importing the .svg file (shoose the "SVG as geometry" radio button), press the keyboard V key, release and then press the F key. Or from the View toolbar click the Fit All tool (magnifying glass icon on white background).

Here's the resulting file, if that doesn't work.
20190122a-PunyTune.FCStd
(10.3 KiB) Downloaded 45 times
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: SVG import is empty

Post by openBrain »

PunyTune wrote: Tue Jan 22, 2019 6:02 pm A red error line appears at the bottom of the screen, but it's very long. I'll just include a screenshot of it.
Looks like ImportSVG.py script needs routines that it can found on your install.
Maybe you could display the Report pane or run FreeCAD from the CLI to get the whole error message. ;)
PunyTune
Posts: 103
Joined: Sun Jan 06, 2019 1:59 am

Re: SVG import is empty

Post by PunyTune »

I displayed the Report pane and get the following:

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Applications/ Bryan's/ CAD/FreeCAD 0.18.app/Contents/Mod/Draft/importSVG.py", line 53, in <module>
from DraftTools import translate
File "/Applications/ Bryan's/ CAD/FreeCAD 0.18.app/Contents/Mod/Draft/DraftTools.py", line 43, in <module>
from DraftGui import todo, QtCore, QtGui, translate, utf8_decode
File "/Applications/ Bryan's/ CAD/FreeCAD 0.18.app/Contents/Mod/Draft/DraftGui.py", line 103, in <module>
"Relative": ["R",translate("draft","Relative"), "isRelative"],
File "/Applications/ Bryan's/ CAD/FreeCAD 0.18.app/Contents/Mod/Draft/DraftGui.py", line 87, in translate
return QtGui.QApplication.translate(context, text, None, _encoding).encode("utf8")
<type 'exceptions.NameError'>: global name '_encoding' is not defined
PunyTune
Posts: 103
Joined: Sun Jan 06, 2019 1:59 am

Re: SVG import is empty

Post by PunyTune »

bejant-

I will want to import other SVG files in the future.

But for now, I can open your file. The shape is the outline (and centerline) a cylinder. I can't seem to make this available for rotation.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: SVG import is empty

Post by openBrain »

What do the following lines reply if you enter them in the Python console ?

Code: Select all

reload(sys)
sys.getdefaultencoding()
EDIT : does the problem also exist if you select another language in the preferences ?
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: SVG import is empty

Post by wandererfan »

PunyTune wrote: Tue Jan 22, 2019 6:31 pm File "/Applications/ Bryan's/ CAD/FreeCAD 0.18.app/Contents/Mod/Draft/DraftGui.py", line 87, in translate
return QtGui.QApplication.translate(context, text, None, _encoding).encode("utf8")
<type 'exceptions.NameError'>: global name '_encoding' is not defined
This error affects Py2/Qt5 builds and was fixed approx 2018-12-03.

Your version is 300+ commits behind master. Can you try with a more recent version?
PunyTune
Posts: 103
Joined: Sun Jan 06, 2019 1:59 am

Re: SVG import is empty

Post by PunyTune »

Downloading the current version of FreeCAD for Macintosh allows me to import the SVG just fine. Thanks very much.

I have now got a sketch with my outline in it.

But it doesn't seem to be like other sketches I've drawn. I can't extrude it or rotate it about an axis to make a solid. which is my goal.
Attachments
Puny C half.FCStd
(18.18 KiB) Downloaded 39 times
Post Reply