test: impove naming

This commit is contained in:
looooo
2024-01-04 20:13:18 +01:00
parent dcf5edd4f0
commit 5760caf820

View File

@@ -9,20 +9,20 @@ from freecad.gears.basegear import helical_extrusion
class GearTests(unittest.TestCase):
def test_helical_extrusion(self):
"""check if helical extrusion is working correctly"""
n = app.Vector(0, 0, 1)
m = app.Vector(0, 0, 0)
r = 10
h = 10
degree = 3.1415926535 / 4
normal = app.Vector(0, 0, 1)
midpoint = app.Vector(0, 0, 0)
radius = 10
height = 10
rotation = 3.1415926535 / 4
a = part.Circle(m, n, r)
face = part.Face(part.Wire(a.toShape()))
s = helical_extrusion(face, h, 1)
circle = part.Circle(midpoint, normal, radius)
face = part.Face(part.Wire(circle.toShape()))
solid = helical_extrusion(face, height, rotation)
# face 0 is the cylinder
# face 1 is pointing in positive z direction
# face 2 is pointing in negative z direction
self.asserTrue((s.Faces[1].normalAt(0,0) - n).Length < 10e-15)
self.asserTrue((s.Faces[2].normalAt(0,0) + n).Length < 10e-15)
self.asserTrue(s.Faces[1].valueAt(0,0)[2] - h < 10e-15)
self.asserTrue(s.Faces[2].valueAt(0,0)[2] - 0. < 10e-15)
self.asserTrue((solid.Faces[1].normalAt(0,0) - n).Length < 10e-15)
self.asserTrue((solid.Faces[2].normalAt(0,0) + n).Length < 10e-15)
self.asserTrue(solid.Faces[1].valueAt(0,0)[2] - h < 10e-15)
self.asserTrue(solid.Faces[2].valueAt(0,0)[2] - 0. < 10e-15)