Commit 90a0fe85 authored by sumpfralle's avatar sumpfralle

prevent the DropCutter from going down to zero, if the model exceeds the...

prevent the DropCutter from going down to zero, if the model exceeds the height of the bounding box (introduced by the new dropcutter code)
 - this (obviously) violates the boundary box limits


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@166 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent e5819cfd
...@@ -157,7 +157,9 @@ class DropCutter: ...@@ -157,7 +157,9 @@ class DropCutter:
height_max = cut.z height_max = cut.z
cut_max = cut cut_max = cut
triangle_max = t triangle_max = t
if not cut_max or not dim_height.check_bounds(cut_max.z): # don't do a complete boundary check for the height
# this avoids zero-cuts for models that exceed the bounding box height
if not cut_max or cut_max.z < dim_height.min:
cut_max = Point(x.get(), y.get(), dim_height.end) cut_max = Point(x.get(), y.get(), dim_height.end)
if self._cut_last and ((triangle_max and not self._triangle_last) or (self._triangle_last and not triangle_max)): if self._cut_last and ((triangle_max and not self._triangle_last) or (self._triangle_last and not triangle_max)):
if dim_height.check_bounds(self._cut_last.z): if dim_height.check_bounds(self._cut_last.z):
......
...@@ -8,8 +8,8 @@ class Dimension: ...@@ -8,8 +8,8 @@ class Dimension:
def __init__(self, start, end): def __init__(self, start, end):
self.start = float(start) self.start = float(start)
self.end = float(end) self.end = float(end)
self._min = float(min(start, end)) self.min = float(min(start, end))
self._max = float(max(start, end)) self.max = float(max(start, end))
self.downward = start > end self.downward = start > end
self.value = 0.0 self.value = 0.0
...@@ -17,9 +17,9 @@ class Dimension: ...@@ -17,9 +17,9 @@ class Dimension:
if value is None: if value is None:
value = self.value value = self.value
if tolerance is None: if tolerance is None:
return (value >= self._min) and (value <= self._max) return (value >= self.min) and (value <= self.max)
else: else:
return (value > self._min - tolerance) and (value < self._max + tolerance) return (value > self.min - tolerance) and (value < self.max + tolerance)
def shift(self, distance): def shift(self, distance):
if self.downward: if self.downward:
......
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