diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-05-29 03:53:28 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-05-29 03:53:28 +0400 |
commit | eabf741a8d76aa9400a071c37227504378fc6315 (patch) | |
tree | 705e01ce1aaf4a4282aa3abb19d44933c48fb7b2 /release/scripts/freestyle | |
parent | b6a9a953bc6aa7d81921a796e8ce1123fdedefc7 (diff) |
Fix for the WithinImageBorderUP1D predicate not working with a ViewEdge such that
none of the SVertices are within the image boundary but an FEdge intersects with
the image boundary.
The problem was reported by edna through the BA Freestyle thread, with a .blend
file for reproducing the bug. Thanks!
Diffstat (limited to 'release/scripts/freestyle')
-rw-r--r-- | release/scripts/freestyle/style_modules/parameter_editor.py | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/release/scripts/freestyle/style_modules/parameter_editor.py b/release/scripts/freestyle/style_modules/parameter_editor.py index 9b94a2e3f20..e817771732a 100644 --- a/release/scripts/freestyle/style_modules/parameter_editor.py +++ b/release/scripts/freestyle/style_modules/parameter_editor.py @@ -697,27 +697,6 @@ class ObjectNamesUP1D(UnaryPredicate1D): return not found return found -class WithinImageBorderUP1D(UnaryPredicate1D): - def __init__(self, xmin, xmax, ymin, ymax): - UnaryPredicate1D.__init__(self) - self._xmin = xmin - self._xmax = xmax - self._ymin = ymin - self._ymax = ymax - def getName(self): - return "WithinImageBorderUP1D" - def __call__(self, inter): - it = inter.verticesBegin() - while not it.isEnd(): - if self.withinBorder(it.getObject()): - return True - it.increment() - return False - def withinBorder(self, vert): - x = vert.getProjectedX() - y = vert.getProjectedY() - return self._xmin <= x <= self._xmax and self._ymin <= y <= self._ymax - # Stroke caps def iter_stroke_vertices(stroke): @@ -1108,7 +1087,7 @@ def process(layer_name, lineset_name): else: xmin, xmax = 0.0, float(w) ymin, ymax = 0.0, float(h) - upred = WithinImageBorderUP1D(xmin, xmax, ymin, ymax) + upred = WithinImageBoundaryUP1D(xmin, ymin, xmax, ymax) selection_criteria.append(upred) # select feature edges upred = join_unary_predicates(selection_criteria, AndUP1D) |