View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000650 | FreeCAD | Feature | public | 2012-03-23 10:32 | 2012-03-28 11:48 |
| Reporter | shoogen | Assigned To | yorik | ||
| Priority | normal | Severity | feature | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Fixed in Version | 0.13 | ||||
| Summary | 0000650: Placement API extension | ||||
| Description | add a function to test a placement to be obsolete | ||||
| Additional Information | I've ssen people calculating the rotation axis and angle in order to check whether a placement does any change to the object. The efficent way to check this would be ((placement.Rotation.Q == (0,0,0,1) or placement.Rotation.Q == (0,0,0,-1)) and placement.Base.Length == 0) But this should be hidden from the users. This could also be be taken for the boolean value of the Placement object | ||||
| Tags | No tags attached. | ||||
| FreeCAD Information | |||||
|
|
there is such a function in Draft fcgeo module: from draftlibs import fcgeo fcgeo.isNull(myPlacement) But indeed the placement could easily have such a function... |
|
|
i think there is a flaw in 'rotation'. I don't think that this will give the correct result for q == -q the comparrsion should check for both representations of the rotation bool Rotation::operator==(const Rotation & q) const { bool equal = true; bool negative = true; for (int i=0; i<4;i++) { equal &= (fabs(this->quat[i] - q.quat[i]) < 0.005 ); negative &= (fabs(this->quat[i] + q.quat[i]) < 0.005 ); } return (equal || negative); } |
|
|
Done in commit 9656a98 Placements now have an isNull() function that returns True if its Base = (0,0,0) and its Rotation = (0,0,0,1) or (0,0,0,-1) |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-03-23 10:32 | shoogen | New Issue | |
| 2012-03-23 12:58 | yorik | Note Added: 0001807 | |
| 2012-03-23 12:58 | yorik | Status | new => assigned |
| 2012-03-23 12:58 | yorik | Assigned To | => yorik |
| 2012-03-23 13:39 | shoogen | Note Added: 0001808 | |
| 2012-03-26 09:56 | shoogen | Note Edited: 0001808 | |
| 2012-03-26 09:57 | shoogen | Note Edited: 0001808 | |
| 2012-03-28 11:48 | yorik | Note Added: 0001825 | |
| 2012-03-28 11:48 | yorik | Status | assigned => closed |
| 2012-03-28 11:48 | yorik | Resolution | open => fixed |
| 2012-03-28 11:48 | yorik | Fixed in Version | => 0.13 |
FreeCAD