diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-10-13 22:17:46 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-10-13 22:17:46 +0400 |
commit | e4b9e28b8691d668095ddd2c20cbd64166213120 (patch) | |
tree | ec234d7e85960077bdb39ac57083e9cb30e2d7e0 /release/scripts/freestyle/style_modules/parameter_editor.py | |
parent | 6d54ff5d833c93220b46f051a6955648661be83e (diff) |
Fix for a bug in StrokeCleaner identified through a discussion for Bug #36425 (freestyle edge marks not working).
Many thanks for Anthony Edlin who helped fix the issue.
Diffstat (limited to 'release/scripts/freestyle/style_modules/parameter_editor.py')
-rw-r--r-- | release/scripts/freestyle/style_modules/parameter_editor.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/release/scripts/freestyle/style_modules/parameter_editor.py b/release/scripts/freestyle/style_modules/parameter_editor.py index dd6206fff99..83bd8dbda5e 100644 --- a/release/scripts/freestyle/style_modules/parameter_editor.py +++ b/release/scripts/freestyle/style_modules/parameter_editor.py @@ -32,7 +32,7 @@ from freestyle import BackboneStretcherShader, BezierCurveShader, BinaryPredicat FalseBP1D, FalseUP1D, GuidingLinesShader, Interface0DIterator, Nature, Noise, Normal2DF0D, Operators, \ PolygonalizationShader, QuantitativeInvisibilityF1D, QuantitativeInvisibilityUP1D, SamplingShader, \ SpatialNoiseShader, StrokeAttribute, StrokeShader, TipRemoverShader, TrueBP1D, TrueUP1D, UnaryPredicate0D, \ - UnaryPredicate1D, VertexOrientation2DF0D, WithinImageBoundaryUP1D, ContextFunctions + UnaryPredicate1D, VertexOrientation2DF0D, WithinImageBoundaryUP1D, ContextFunctions, TVertex from Functions0D import CurveMaterialF0D from PredicatesU1D import pyNatureUP1D from logical_operators import AndUP1D, NotUP1D, OrUP1D @@ -1085,6 +1085,8 @@ def iter_three_segments(stroke): it3.increment() it4.increment() +def is_tvertex(svertex): + return type(svertex.viewvertex) is TVertex class StrokeCleaner(StrokeShader): def shade(self, stroke): @@ -1092,7 +1094,10 @@ class StrokeCleaner(StrokeShader): seg1 = sv2.point - sv1.point seg2 = sv3.point - sv2.point seg3 = sv4.point - sv3.point - if seg1.dot(seg2) < 0.0 and seg2.dot(seg3) < 0.0: + if not ((is_tvertex(sv2.first_svertex) and is_tvertex(sv2.second_svertex)) or + (is_tvertex(sv3.first_svertex) and is_tvertex(sv3.second_svertex))): + continue + if seg1.dot(seg2) < 0.0 and seg2.dot(seg3) < 0.0 and seg2.length < 0.01: #print(sv2.first_svertex.viewvertex) #print(sv2.second_svertex.viewvertex) #print(sv3.first_svertex.viewvertex) |