View Issue Details

IDProjectCategoryView StatusLast Update
0002375FreeCADBugpublic2016-01-19 14:19
Reportermichel.dagenais Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionwon't fix 
PlatformPC Intel 64 bitsOSUbuntu LinuxOS Version15.10
Product Version0.15 
Fixed in Version0.16 
Summary0002375: Placement center incorrectly reset by user interface
DescriptionThe user interface allows to change the placement center clicking on the ... besides the "placement" property in the Data view. However, when we later exit this interface and come back or if we later change the placement "angle" property in the user interface, it resets the center. Indeed, the code generated in the Python interface is:

FreeCAD.getDocument("test1").getObject("Box002").Placement = App.Placement(App.Vector(-15,-22.0711,1),App.Rotation(App.Vector(0,0,1),0))

Thus, the placement "angle" is changed but the Placement "center" is not specified in the constructor and a center of (0,0,0) is reset by default.
Steps To ReproduceCreate a cube, edit its placement "..." center to (5,5,0), apply, OK, come back to placement "..." and the center is back to (0,0,0).

You can also set the placement center by script to (5,5,0) and then, if you change the placement angle property in the user interface, the center is reset to (0,0,0).
Additional InformationI have tried it also on the daily build 0.16, 6090, 21/12/2015
TagsNo tags attached.
FreeCAD Information

Activities

wmayer

2015-12-26 09:50

administrator   ~0006638

Internally a placement only holds a translation (a 3d vector) and a rotation (handled as quaternion). It does not keep an explicit center of rotation.

In the GUI there is a center of rotation field offered for convenience. But of course, as soon as you close the panel the entered placement of translation + rotation + center of rotation is transformed into a placement of only translation + rotation.

This means that the translation part of the new placement includes the translation and center information of the first placement. But this also means that this step can't be reversed.
Actually, from a given placement the center field can be set to anything and the translation field can be computed accordingly but we simply set the center to (0,0,0).

michel.dagenais

2015-12-27 16:07

reporter   ~0006643

Thanks for the clarification! Then, it is not a bug in the code but rather something that could be clarified in the documentation. There are two pages that seem directly related to placement, one about the placement itself and one for the task of modifying the placement:

http://www.freecadweb.org/wiki/index.php?title=Placement
http://www.freecadweb.org/wiki/index.php?title=Tasks_Placement

I would suggest explaining that internally the placement is stored as base and matrix and thus that any "center point" defined in the dialog is only used for adjusting the angle / translation this one time, to obtain the desired effect. The center is not stored and cannot be seen or recovered the next time the dialog is used or a new angle is specified.

I am relatively new with FreeCAD, do you want me to edit the Wiki in this way? To close the bug?

wmayer

2015-12-27 22:11

administrator   ~0006646

> I am relatively new with FreeCAD, do you want me to edit the Wiki in this way?
Yes, it would be nice if you change the Wiki. Please tell me your Wiki account (needs to be a separate account from Mantis or forum) so I can give you write permission.

michel.dagenais

2016-01-05 21:09

reporter   ~0006673

I just created a forum account but I am not allowed yet to pm the wiki administrators. This is needed to get an account created as per the procedure detailed in http://forum.freecadweb.org/viewtopic.php?f=21&t=6830

wmayer

2016-01-06 18:15

administrator   ~0006681

You first have to post a message that needs to be approved. Afterwards the PM is enabled. As mentioned in the post you should PM to yorik and jmaustpc giving them you desired user name and a valid email address. The system then sends you a message where you can set a password.

michel.dagenais

2016-01-18 21:02

reporter   ~0006731

I added clarifications in the documentation about placement / placement_task. The bug can be closed as far as I am concerned.

wmayer

2016-01-19 14:19

administrator   ~0006733

Documentation updated.

Issue History

Date Modified Username Field Change
2015-12-24 14:18 michel.dagenais New Issue
2015-12-26 09:50 wmayer Note Added: 0006638
2015-12-27 16:07 michel.dagenais Note Added: 0006643
2015-12-27 22:11 wmayer Note Added: 0006646
2016-01-05 21:09 michel.dagenais Note Added: 0006673
2016-01-06 18:15 wmayer Note Added: 0006681
2016-01-18 21:02 michel.dagenais Note Added: 0006731
2016-01-19 14:19 wmayer Note Added: 0006733
2016-01-19 14:19 wmayer Status new => closed
2016-01-19 14:19 wmayer Resolution open => won't fix
2016-01-19 14:19 wmayer Fixed in Version => 0.16