Commit 666a0fbe authored by sumpfralle's avatar sumpfralle

fixed a DropCutter bug (exposed with SphericalCutter) that happens after scaling the model


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@903 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent e7f1b929
...@@ -114,7 +114,7 @@ class Point(object): ...@@ -114,7 +114,7 @@ class Point(object):
if n == 0: if n == 0:
return None return None
else: else:
return Point(self.x / n, self.y / n, self.z / n) return self.__class__(self.x / n, self.y / n, self.z / n)
def is_inside(self, minx=None, maxx=None, miny=None, maxy=None, minz=None, def is_inside(self, minx=None, maxx=None, miny=None, maxy=None, minz=None,
maxz=None): maxz=None):
......
...@@ -65,6 +65,8 @@ class Triangle(TransformableContainer): ...@@ -65,6 +65,8 @@ class Triangle(TransformableContainer):
self.p1)).normalized() self.p1)).normalized()
if not isinstance(self.normal, Vector): if not isinstance(self.normal, Vector):
self.normal = self.normal.get_vector() self.normal = self.normal.get_vector()
# make sure that the normal has always a unit length
self.normal = self.normal.normalized()
self.center = self.p1.add(self.p2).add(self.p3).div(3) self.center = self.p1.add(self.p2).add(self.p3).div(3)
self.plane = Plane(self.center, self.normal) self.plane = Plane(self.center, self.normal)
# calculate circumcircle (resulting in radius and middle) # calculate circumcircle (resulting in radius and middle)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment