Commit d5743d63 authored by sumpfralle's avatar sumpfralle

fixed remaining issues with SphericalCutter and ToroidalCutter (new triangle...

fixed remaining issues with SphericalCutter and ToroidalCutter (new triangle collision return value was missing)


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@677 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 033e183c
......@@ -153,8 +153,8 @@ class SphericalCutter(BaseCutter):
def intersect_sphere_triangle(self, direction, triangle):
(cl, ccp, cp, d) = self.intersect_sphere_plane(direction, triangle)
if cp and triangle.point_inside(cp):
return (cl, d)
return (None, INFINITE)
return (cl, d, cp)
return (None, INFINITE, None)
def intersect_sphere_point(self, direction, point):
(ccp, cp, l) = intersect_sphere_point(self.center, self.distance_radius,
......@@ -193,13 +193,14 @@ class SphericalCutter(BaseCutter):
return self.intersect_sphere_point(direction, point)
def intersect(self, direction, triangle):
(cl_t, d_t) = self.intersect_sphere_triangle(direction, triangle)
(cl_t, d_t, cp_t) = self.intersect_sphere_triangle(direction, triangle)
d = INFINITE
cl = None
cp = None
if d_t < d:
d = d_t
cl = cl_t
cp = cp_t
if cl and (direction.x == 0) and (direction.y == 0):
return (cl, d, cp)
(cl_e1, d_e1, cp_e1) = self.intersect_sphere_edge(direction, triangle.e1)
......
......@@ -127,8 +127,8 @@ class ToroidalCutter(BaseCutter):
def intersect_torus_triangle(self, direction, triangle):
(cl, ccp, cp, d) = self.intersect_torus_plane(direction, triangle)
if cp and triangle.point_inside(cp):
return (cl, d)
return (None, INFINITE)
return (cl, d, cp)
return (None, INFINITE, None)
def intersect_torus_point(self, direction, point):
(ccp, cp, l) = intersect_torus_point(self.center, self.axis,
......@@ -237,13 +237,14 @@ class ToroidalCutter(BaseCutter):
return (None, None, None, INFINITE)
def intersect(self, direction, triangle):
(cl_t, d_t) = self.intersect_torus_triangle(direction, triangle)
(cl_t, d_t, cp_t) = self.intersect_torus_triangle(direction, triangle)
d = INFINITE
cl = None
cp = None
if d_t < d:
d = d_t
cl = cl_t
cp = cp_t
(cl_e1, d_e1, cp_e1) = self.intersect_torus_edge(direction, triangle.e1)
(cl_e2, d_e2, cp_e2) = self.intersect_torus_edge(direction, triangle.e2)
(cl_e3, d_e3, cp_e3) = self.intersect_torus_edge(direction, triangle.e3)
......
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