Code: Select all
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.2.29177 +426 (Git)
Build type: Release
Branch: (HEAD detached from 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods:
* Help 1.0.3
I was just testing out some geometry, and ran across this:
I used the macro: Align_View_to_Face.FCMacro
I also had a sketch where I bisected an angle.
The sketch shows the correct angle of 62.63 degrees.
@edwilliams16 python script he helped me with also show the correct, here is script:
Code: Select all
import FreeCAD, FreeCADGui
# -*- coding: utf-8 -*-
import FreeCAD, FreeCADGui
import Draft
import math
# from math import cos, sin, radians
from PySide import QtGui
convert = 25.4
TOTAL = 0
getDouble = QtGui.QInputDialog.getDouble
Vector, Placement = App.Vector, App.Placement
doc = App.ActiveDocument
start_point = Vector(0, 0, 0)
selX = FreeCADGui.Selection.getSelectionEx()
PrintMsg = FreeCAD.Console.PrintMessage
PrintMsg("Objects selected:\n")
KOUNT = 0
# added
for sel in selX:
KOUNT = KOUNT + 1
v = sel.Object.Shape
X = v.Point.x * .039370078
Y = v.Point.y * .039370078
Z = v.Point.z * .039370078
if KOUNT == 1:
multlist = [[X, Y, Z]]
if KOUNT > 1:
multlist.append([X, Y, Z])
# added new
p1 = App.Vector(multlist[0][0], multlist[0][1], multlist[0][2])
p2 = App.Vector(multlist[1][0], multlist[1][1], multlist[1][2])
p3 = App.Vector(multlist[2][0], multlist[2][1], multlist[2][2])
#p = App.Vector(multlist[3][0], multlist[3][1], multlist[3][2])
#q = App.Vector(multlist[4][0], multlist[4][1], multlist[4][2])
#=========================================================================
#===============================================================================================
ang1 = math.degrees((p2 - p1).getAngle(p3 - p1))
print(ang1)
#good ang2 = math.degrees((p3 - p2).getAngle(p1 - p2))
#ang2 = math.degrees((p1 - p2).getAngle(p3 - p2))
#print(ang2)
#ang3 = degrees((p1 - p3).getAngle(p2 - p3))
#The side lengths are:
#Code: Select all
#L12 = (p1 - p2).Length
L12 = (p2 - p1).Length
print(L12)
#L23 = (p2 - p3).Length
#L31 = (p3 - p1).Length
Drawing and images attached: