View Issue Details

IDProjectCategoryView StatusLast Update
0004301DraftBugpublic2020-10-19 12:50
Reporterclifcox Assigned Toyorik  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.19 
Fixed in Version0.19 
Summary0004301: Draft Pattern problem
DescriptionGreetings,
There seems to be a regression here between 0.18 (where it works) and 0.19 (where it doesn't). I was following the the draft WB tutorial in the manual when I noticed the problem. Here is the forum discussion:

https://forum.freecadweb.org/viewtopic.php?f=22&t=17628&start=20
https://forum.freecadweb.org/viewtopic.php?f=23&t=51283
Steps To ReproduceWhen I run the example code:


import Draft
pl = FreeCAD.Placement()
pl.Rotation.Q = (0.0,0.0,0.0,1.0)
pl.Base = FreeCAD.Vector(-3.46933150291,0.713757812977,0.0)
rect = Draft.makeRectangle(length=4.00172472,height=-1.73174029589,placement=pl,face=True,support=None)
rect.MakeFace = True
App.ActiveDocument.recompute()
rect.ViewObject.Pattern = "simple"

I do get the rectangle filled with the simple pattern in 0.18. If I save that file and try to view it in 0.19 I only get a solid grey filled one, no matter what pattern I try. If I then delete that one and run the python script again (in 0.19), I just get a plain empty rectangle, though the relevant properties are set correctly.
Additional InformationThe error message seems to come from Coin (pivy), as if the necessary method "removeChild" was removed in a new version of Coin. Or maybe Draft's code was changed.


Traceback (most recent call last):
  File "/opt/freecad-build-debug-vocx/Mod/Draft/Draft.py", line 3240, in onChanged
    r.removeChild(self.texture)
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 4746, in __getattr__
    raise e
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 4738, in __getattr__
    return SoBase.__getattribute__(self, name)
<class 'AttributeError'>: 'SoPolygonOffset' object has no attribute 'removeChild'
Tags#pending-forum, Coin3d
FreeCAD InformationOS: Debian GNU/Linux 10 (buster)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.
Build type: Release
Python version: 2.7.16rc1
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: C/Default (C)

AND:

OS: Debian GNU/Linux 10 (buster) (MATE/lightdm-xsession)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20325 (Git)
Build type: Release
Branch: master
Hash: 7c9d5fe57c94eeec0289317e6be8a99bdceea11f
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: C/Default (C)

Activities

Kunda1

2020-10-18 11:53

administrator   ~0014906

per @vocx:

The error message seems to come from Coin (pivy), as if the necessary method "removeChild" was removed in a new version of Coin. Or maybe Draft's code was changed.

Traceback (most recent call last):
  File "/opt/freecad-build-debug-vocx/Mod/Draft/Draft.py", line 3240, in onChanged
    r.removeChild(self.texture)
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 4746, in __getattr__
    raise e
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 4738, in __getattr__
    return SoBase.__getattribute__(self, name)
<class 'AttributeError'>: 'SoPolygonOffset' object has no attribute 'removeChild'

vocx

Kunda1

2020-10-18 12:04

administrator   ~0014907

Ticket was split off from older thread and is now at https://forum.freecadweb.org/viewtopic.php?f=23&t=51283

yorik

2020-10-19 12:50

administrator   ~0014912

Fixed with https://github.com/FreeCAD/FreeCAD/commit/5609b38e9a120e20b4917e770138e6bd36cd98a0#diff-78e43e7846dd660f56ed98781e4979e8c2994f99bb2187f4438f41412ba1b254

Issue History

Date Modified Username Field Change
2020-04-03 17:11 clifcox New Issue
2020-04-04 10:56 Kunda1 Tag Attached: #pending-forum
2020-10-18 11:53 Kunda1 Note Added: 0014906
2020-10-18 11:54 Kunda1 Tag Attached: Coin3d
2020-10-18 11:54 Kunda1 Status new => confirmed
2020-10-18 12:04 Kunda1 Note Added: 0014907
2020-10-18 12:04 Kunda1 Description Updated View Revisions
2020-10-19 12:50 yorik Assigned To => yorik
2020-10-19 12:50 yorik Status confirmed => closed
2020-10-19 12:50 yorik Resolution open => fixed
2020-10-19 12:50 yorik Fixed in Version => 0.19
2020-10-19 12:50 yorik Note Added: 0014912