View Issue Details

IDProjectCategoryView StatusLast Update
0001279FreeCADBugpublic2017-03-27 08:29
Reporterpkoning Assigned Toyorik  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.13 
Fixed in Version0.14 
Summary0001279: Wrong operator in DraftGeomUtils.getRotation
DescriptionThe code says:

    angle = math.degrees(math.sqrt((v1.Length ^ 2) * (v2.Length ^ 2)) + v1.dot(v2))

but ^ is the XOR operator, which is not valid for float. Presumably squaring was intended, which would be:

    angle = math.degrees(math.sqrt((v1.Length ** 2) * (v2.Length ** 2)) + v1.dot(v2))
TagsNo tags attached.
FreeCAD Information

Activities

pkoning

2013-10-18 15:49

reporter   ~0003765

Actually, the bigger problem is that this line doesn't produce the correct answer. I can't figure out how the product of two squares has any relationship to an angle.

If I replace the line by:

    angle = math.degrees(DraftVecUtils.angle(v1,v2,axis))

I get the right answer.

yorik

2013-10-18 19:32

administrator   ~0003772

Good catch, thanks for the fix!
Committed with 5233aa7

Related Changesets

FreeCAD: master 5233aa7e

2013-10-18 23:31:53

Yorik van Havre

Details Diff
0001279: Wrong operator in DraftGeomUtils.getRotation Affected Issues
0001279
mod - src/Mod/Draft/DraftGeomUtils.py Diff File

Issue History

Date Modified Username Field Change
2013-10-18 14:47 pkoning New Issue
2013-10-18 15:49 pkoning Note Added: 0003765
2013-10-18 19:31 yorik Status new => assigned
2013-10-18 19:31 yorik Assigned To => yorik
2013-10-18 19:32 yorik Note Added: 0003772
2013-10-18 19:32 yorik Status assigned => closed
2013-10-18 19:32 yorik Resolution open => fixed
2013-10-18 19:32 yorik Fixed in Version => 0.14
2017-03-27 08:29 Kunda1 Changeset attached => FreeCAD master 5233aa7e