Convert SVG Path to Sketch fails Draft_Draft2Sketch

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
freinhard
Posts: 2
Joined: Sun Nov 27, 2022 12:03 pm

Convert SVG Path to Sketch fails Draft_Draft2Sketch

Post by freinhard »

Freecad installed from launchpad / freecad-maintainers:

Code: Select all

OS: Ubuntu 22.04.1 LTS (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.1.
Build type: Release
Branch: unknown
Hash: 22f524c0c755003c12234fab1bad6a9f696b661a
Python 3.10.6, Qt 5.15.3, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.1
Locale: German/Germany (de_DE)
Steps to reproduce:
- I got this svg from https://openclipart.org/detail/196277/chainsaw and edited it in inkscape so there is finally just the contour of it left (see attachment)
- I Imported the svg using file->import
- i switched to draft workbench and clicked draft to sketch icon
- The output window pops up stating the following error:

Code: Select all

Running the Python command 'Draft_Draft2Sketch' failed:
Traceback (most recent call last):
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_draft2sketch.py", line 62, in Activated
    super(Draft2Sketch, self).Activated(name="Convert Draft/Sketch")
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_base_original.py", line 307, in Activated
    super(Modifier, self).Activated(name, noplanesetup, is_subtool)
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_base_original.py", line 152, in Activated
    Gui.Snapper.setTrackers()
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_snapper.py", line 1673, in setTrackers
    self.grid = trackers.gridTracker()
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_trackers.py", line 972, in __init__
    pick.style.setValue(coin.SoPickStyle.UNPICKABLE)
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 3989, in __getattr__
    field = self.getField(name)
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 3873, in getField
    return _coin.SoFieldContainer_getField(self, name)

<built-in function SoFieldContainer_getField> returned a result with an exception setRunning the Python command 'Draft_Draft2Sketch' failed:
Traceback (most recent call last):
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_draft2sketch.py", line 62, in Activated
    super(Draft2Sketch, self).Activated(name="Convert Draft/Sketch")
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_base_original.py", line 307, in Activated
    super(Modifier, self).Activated(name, noplanesetup, is_subtool)
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_base_original.py", line 152, in Activated
    Gui.Snapper.setTrackers()
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_snapper.py", line 1673, in setTrackers
    self.grid = trackers.gridTracker()
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_trackers.py", line 972, in __init__
    pick.style.setValue(coin.SoPickStyle.UNPICKABLE)
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 3989, in __getattr__
    field = self.getField(name)
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 3873, in getField
    return _coin.SoFieldContainer_getField(self, name)

<built-in function SoFieldContainer_getField> returned a result with an exception set
Attachments
Chainsaw_edit.svg
(5.43 KiB) Downloaded 37 times
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: Convert SVG Path to Sketch fails Draft_Draft2Sketch

Post by chrisb »

Hi and welcome to the forum!

It works here. Please retry with 0.21.

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.21.31035 (Git)
Build type: Release
Branch: master
Hash: c8074a972ee233d303e50e5d525aecae09c1cd04
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: C/Default (C)
Installed mods: 
  * FC_SU
  * DynamicData 2.46.0
  * FeedsAndSpeeds 0.4.0
  * fcgear 1.0.0
  * fasteners 0.4.16
  * sheetmetal 0.2.57
  * ExplodedAssembly
  * Curves 0.6.1
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Convert SVG Path to Sketch fails Draft_Draft2Sketch

Post by heda »

launchpad, py3.10, errors with pivy/coin in them...

plenty of posts for that particular error, including what goes wrong.

quickest way out: use appimage / snap or something else that bundles it correctly (for time being).
freinhard
Posts: 2
Joined: Sun Nov 27, 2022 12:03 pm

Re: Convert SVG Path to Sketch fails Draft_Draft2Sketch

Post by freinhard »

Thank you heda and chrisb for the quick help!

From the trace i didn't figure that there's a problem with pivy/coin, thus didn't search for it but for "Draft_Draft2Sketch".

I did try 19.2 from Ubuntu 22.04 repo which didn't work as well.
Now tried the dev AppImage which works well!
Post Reply