Draft Bezier Copy/Paste

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
wandererfan
Posts: 3685
Joined: Tue Nov 06, 2012 5:42 pm

Draft Bezier Copy/Paste

Postby wandererfan » Mon Jan 27, 2014 3:53 pm

Can anybody confirm this behaviour?

. create BezCurve
. select BezCurve
. Edit->Copy ==> "Gui::Command::activated(0): Unknown C++ exception thrown"
. Edit->Paste ==> no result

Edit->Duplicate Selection appears to work correctly.

wf

OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3055 (Git)
Branch: BezierProto
Hash: 95d4e1852ee05d2fb065eb3e242c73febbf0ccdb
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.6.0
User avatar
quick61
Posts: 3793
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Draft Bezier Copy/Paste

Postby quick61 » Mon Jan 27, 2014 5:11 pm

wandererfan wrote:Can anybody confirm this behaviour?

. create BezCurve
. select BezCurve
. Edit->Copy ==> "Gui::Command::activated(0): Unknown C++ exception thrown"
. Edit->Paste ==> no result

Edit->Duplicate Selection appears to work correctly.

wf

OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3055 (Git)
Branch: BezierProto
Hash: 95d4e1852ee05d2fb065eb3e242c73febbf0ccdb
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.6.0

Sure can wf, my build does the exact same thing.

Confirmed - ui::Command::activated(0): Unknown C++ exception thrown

OS: Ubuntu 13.10
Platform: 64-bit
Version: 0.14.3053 (Git)
Branch: BezierProto
Hash: 34bc68bd3d4b57e48838b2f8652062eb10d6b5d3
Python version: 2.7.5+
Qt version: 4.8.4
Coin version: 4.0.0a
SoQt version: 1.5.0
OCC version: 6.7.0


And the same behavior is in the piecewise-bezier build as well.

OS: Ubuntu 13.10
Platform: 64-bit
Version: 0.14.3054 (Git)
Branch: piecewise-bezier
Hash: 4fd4741a31a660845d982f675aa2ac86126bb6d2
Python version: 2.7.5+
Qt version: 4.8.4
Coin version: 4.0.0a
SoQt version: 1.5.0
OCC version: 6.7.0
This post made with 0.0% Micro$oft products - GOT LINUX?
jmaustpc
Posts: 9633
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Draft Bezier Copy/Paste

Postby jmaustpc » Mon Jan 27, 2014 5:20 pm

Hi
I've got the same error happening here on
OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3051 (Git)
Branch: piecewise-bezier
Hash: db63d5f067d3c1ab3807db605a32c497ee745f01
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0

I just pulled shoogen's latest updates

and the problem is still there
OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3055 (Git)
Branch: piecewise-bezier
Hash: 95d4e1852ee05d2fb065eb3e242c73febbf0ccdb
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0


Is this problem related to the undo/redo system that I think shoogen or someone else was still working on?
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Draft Bezier Copy/Paste

Postby shoogen » Mon Jan 27, 2014 6:47 pm

For a debug build it returns "Unhandled unknown exception caught in GUIApplication::notify"
OS: Debian GNU/Linux 7.3 (wheezy)
Platform: 64-bit
Version: 0.14.3078 (Git)
Branch: (remotes/github/master-12-ga3cbd92)
Hash: a3cbd92b0e3778c407ca866e44325d6f9bfc0a11
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.2
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Draft Bezier Copy/Paste

Postby shoogen » Mon Jan 27, 2014 7:09 pm

Code: Select all

>>> App.ActiveDocument.BezCurve.Shape.MemSize
Traceback (most recent call last):
  File "<input>", line 1, in <module>
Exception: Unknown exception while reading attribute 'MemSize' of object 'Persistence'
reproduces the problem

EDIT: http://www.freecadweb.org/tracker/view.php?id=1369
User avatar
wandererfan
Posts: 3685
Joined: Tue Nov 06, 2012 5:42 pm

Re: Draft Bezier Copy/Paste

Postby wandererfan » Tue Jan 28, 2014 3:08 pm

Thanks shoogen/wmayer. BezCurve copy works with this change.

Pretty sure the patch for BezierSurface needs attention. NbUPoles*NbVpoles, not NbUpoles+NbUPoles.

Code: Select all

-                        memsize += (surface.NbUKnots()+surface.NbVKnots()) * sizeof(Standard_Real);
+                        memsize += (surface.NbUPoles()+surface.NbUPoles()) * sizeof(Standard_Real);
                         memsize += (surface.NbUPoles()*surface.NbVPoles()) * sizeof(Geom_CartesianPoint);
wf
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Draft Bezier Copy/Paste

Postby shoogen » Tue Jan 28, 2014 3:34 pm

applying a patch which differs from werners fix creates merge conflicts. I would make more sense to cherry pick werners commit. Another idea would be to abandon the current branch an rebase on top of the current master.
wmayer
Site Admin
Posts: 15501
Joined: Thu Feb 19, 2009 10:32 am

Re: Draft Bezier Copy/Paste

Postby wmayer » Tue Jan 28, 2014 4:20 pm

Oops, git show 06e7723
User avatar
wandererfan
Posts: 3685
Joined: Tue Nov 06, 2012 5:42 pm

Re: Draft Bezier Copy/Paste

Postby wandererfan » Tue Jan 28, 2014 6:45 pm

shoogen wrote:applying a patch which differs from werners fix creates merge conflicts. I would make more sense to cherry pick werners commit. Another idea would be to abandon the current branch an rebase on top of the current master.
Should be sorted out now.
https://github.com/WandererFan/freecad- ... ezierProto