Updated Freestyle API modules according to the new hierarchical package structure.

Additional bug fixes were also done along with the code updates:
* Fix for the use of old Interface1D.pointsBegin() and .pointsEnd() method names
in the definition of pyDensityAnisotropyF1D and pyViewMapGradientNormF1D.
* Fix for wrong data types (int instead of bool) for:
- pyChainSilhouetteGenericIterator constructor and its .orientation property in
modules/freestyle/chainingiterators.py.
- SpatialNoiseShader constructor in styles/external_contour_sketchy.py.
- ChainSilhouetteIterator constructor in styles/multiple_parameterization.py.
This commit is contained in:
Tamito Kajiyama 2013-11-24 22:18:38 +00:00
parent 6498b96ce7
commit 54e9016770
44 changed files with 714 additions and 217 deletions

@ -26,6 +26,11 @@ from _freestyle import (
from freestyle.types import ( from freestyle.types import (
AdjacencyIterator, AdjacencyIterator,
ChainingIterator, ChainingIterator,
Nature,
TVertex,
)
from freestyle.predicates import (
ExternalContourUP1D,
) )
from freestyle.utils import ContextFunctions as CF from freestyle.utils import ContextFunctions as CF
import bpy import bpy
@ -283,7 +288,7 @@ class pyFillOcclusionsRelativeChainingIterator(ChainingIterator):
self._length = 0 self._length = 0
def traverse(self, iter): def traverse(self, iter):
winner = None winner = None
winnerOrientation = 0 winnerOrientation = False
#print(self.current_edge.id.first, self.current_edge.id.second) #print(self.current_edge.id.first, self.current_edge.id.second)
it = AdjacencyIterator(iter) it = AdjacencyIterator(iter)
tvertex = self.next_vertex tvertex = self.next_vertex
@ -294,9 +299,9 @@ class pyFillOcclusionsRelativeChainingIterator(ChainingIterator):
if ve.id == mateVE.id: if ve.id == mateVE.id:
winner = ve winner = ve
if not it.is_incoming: if not it.is_incoming:
winnerOrientation = 1 winnerOrientation = True
else: else:
winnerOrientation = 0 winnerOrientation = False
break break
it.increment() it.increment()
else: else:
@ -311,9 +316,9 @@ class pyFillOcclusionsRelativeChainingIterator(ChainingIterator):
count = count+1 count = count+1
winner = ve winner = ve
if not it.is_incoming: if not it.is_incoming:
winnerOrientation = 1 winnerOrientation = True
else: else:
winnerOrientation = 0 winnerOrientation = False
it.increment() it.increment()
if count != 1: if count != 1:
winner = None winner = None
@ -328,7 +333,7 @@ class pyFillOcclusionsRelativeChainingIterator(ChainingIterator):
# Did we compute the prospective chain length already ? # Did we compute the prospective chain length already ?
if self._length == 0: if self._length == 0:
#if not, let's do it #if not, let's do it
_it = pyChainSilhouetteGenericIterator(0,0) _it = pyChainSilhouetteGenericIterator(False, False)
_it.begin = winner _it.begin = winner
_it.current_edge = winner _it.current_edge = winner
_it.orientation = winnerOrientation _it.orientation = winnerOrientation
@ -354,7 +359,7 @@ class pyFillOcclusionsRelativeChainingIterator(ChainingIterator):
# let's do the comparison: # let's do the comparison:
# nw let's compute the length of this connex non selected part: # nw let's compute the length of this connex non selected part:
connexl = 0 connexl = 0
_cit = pyChainSilhouetteGenericIterator(0,0) _cit = pyChainSilhouetteGenericIterator(False, False)
_cit.begin = winner _cit.begin = winner
_cit.current_edge = winner _cit.current_edge = winner
_cit.orientation = winnerOrientation _cit.orientation = winnerOrientation
@ -380,7 +385,7 @@ class pyFillOcclusionsAbsoluteChainingIterator(ChainingIterator):
pass pass
def traverse(self, iter): def traverse(self, iter):
winner = None winner = None
winnerOrientation = 0 winnerOrientation = False
#print(self.current_edge.id.first, self.current_edge.id.second) #print(self.current_edge.id.first, self.current_edge.id.second)
it = AdjacencyIterator(iter) it = AdjacencyIterator(iter)
tvertex = self.next_vertex tvertex = self.next_vertex
@ -391,9 +396,9 @@ class pyFillOcclusionsAbsoluteChainingIterator(ChainingIterator):
if ve.id == mateVE.id: if ve.id == mateVE.id:
winner = ve winner = ve
if not it.is_incoming: if not it.is_incoming:
winnerOrientation = 1 winnerOrientation = True
else: else:
winnerOrientation = 0 winnerOrientation = False
break break
it.increment() it.increment()
else: else:
@ -408,9 +413,9 @@ class pyFillOcclusionsAbsoluteChainingIterator(ChainingIterator):
count = count+1 count = count+1
winner = ve winner = ve
if not it.is_incoming: if not it.is_incoming:
winnerOrientation = 1 winnerOrientation = True
else: else:
winnerOrientation = 0 winnerOrientation = False
it.increment() it.increment()
if count != 1: if count != 1:
winner = None winner = None
@ -421,7 +426,7 @@ class pyFillOcclusionsAbsoluteChainingIterator(ChainingIterator):
#print("---", winner.id.first, winner.id.second) #print("---", winner.id.first, winner.id.second)
# nw let's compute the length of this connex non selected part: # nw let's compute the length of this connex non selected part:
connexl = 0 connexl = 0
_cit = pyChainSilhouetteGenericIterator(0,0) _cit = pyChainSilhouetteGenericIterator(False, False)
_cit.begin = winner _cit.begin = winner
_cit.current_edge = winner _cit.current_edge = winner
_cit.orientation = winnerOrientation _cit.orientation = winnerOrientation
@ -453,7 +458,7 @@ class pyFillOcclusionsAbsoluteAndRelativeChainingIterator(ChainingIterator):
self._length = 0 self._length = 0
def traverse(self, iter): def traverse(self, iter):
winner = None winner = None
winnerOrientation = 0 winnerOrientation = False
#print(self.current_edge.id.first, self.current_edge.id.second) #print(self.current_edge.id.first, self.current_edge.id.second)
it = AdjacencyIterator(iter) it = AdjacencyIterator(iter)
tvertex = self.next_vertex tvertex = self.next_vertex
@ -464,9 +469,9 @@ class pyFillOcclusionsAbsoluteAndRelativeChainingIterator(ChainingIterator):
if ve.id == mateVE.id: if ve.id == mateVE.id:
winner = ve winner = ve
if not it.is_incoming: if not it.is_incoming:
winnerOrientation = 1 winnerOrientation = True
else: else:
winnerOrientation = 0 winnerOrientation = False
break break
it.increment() it.increment()
else: else:
@ -481,9 +486,9 @@ class pyFillOcclusionsAbsoluteAndRelativeChainingIterator(ChainingIterator):
count = count+1 count = count+1
winner = ve winner = ve
if not it.is_incoming: if not it.is_incoming:
winnerOrientation = 1 winnerOrientation = True
else: else:
winnerOrientation = 0 winnerOrientation = False
it.increment() it.increment()
if count != 1: if count != 1:
winner = None winner = None
@ -498,7 +503,7 @@ class pyFillOcclusionsAbsoluteAndRelativeChainingIterator(ChainingIterator):
# Did we compute the prospective chain length already ? # Did we compute the prospective chain length already ?
if self._length == 0: if self._length == 0:
#if not, let's do it #if not, let's do it
_it = pyChainSilhouetteGenericIterator(0,0) _it = pyChainSilhouetteGenericIterator(False, False)
_it.begin = winner _it.begin = winner
_it.current_edge = winner _it.current_edge = winner
_it.orientation = winnerOrientation _it.orientation = winnerOrientation
@ -524,7 +529,7 @@ class pyFillOcclusionsAbsoluteAndRelativeChainingIterator(ChainingIterator):
# let's do the comparison: # let's do the comparison:
# nw let's compute the length of this connex non selected part: # nw let's compute the length of this connex non selected part:
connexl = 0 connexl = 0
_cit = pyChainSilhouetteGenericIterator(0,0) _cit = pyChainSilhouetteGenericIterator(False, False)
_cit.begin = winner _cit.begin = winner
_cit.current_edge = winner _cit.current_edge = winner
_cit.orientation = winnerOrientation _cit.orientation = winnerOrientation
@ -556,7 +561,7 @@ class pyFillQi0AbsoluteAndRelativeChainingIterator(ChainingIterator):
self._length = 0 self._length = 0
def traverse(self, iter): def traverse(self, iter):
winner = None winner = None
winnerOrientation = 0 winnerOrientation = False
#print(self.current_edge.id.first, self.current_edge.id.second) #print(self.current_edge.id.first, self.current_edge.id.second)
it = AdjacencyIterator(iter) it = AdjacencyIterator(iter)
tvertex = self.next_vertex tvertex = self.next_vertex
@ -567,9 +572,9 @@ class pyFillQi0AbsoluteAndRelativeChainingIterator(ChainingIterator):
if ve.id == mateVE.id: if ve.id == mateVE.id:
winner = ve winner = ve
if not it.is_incoming: if not it.is_incoming:
winnerOrientation = 1 winnerOrientation = True
else: else:
winnerOrientation = 0 winnerOrientation = False
break break
it.increment() it.increment()
else: else:
@ -584,9 +589,9 @@ class pyFillQi0AbsoluteAndRelativeChainingIterator(ChainingIterator):
count = count+1 count = count+1
winner = ve winner = ve
if not it.is_incoming: if not it.is_incoming:
winnerOrientation = 1 winnerOrientation = True
else: else:
winnerOrientation = 0 winnerOrientation = False
it.increment() it.increment()
if count != 1: if count != 1:
winner = None winner = None
@ -601,7 +606,7 @@ class pyFillQi0AbsoluteAndRelativeChainingIterator(ChainingIterator):
# Did we compute the prospective chain length already ? # Did we compute the prospective chain length already ?
if self._length == 0: if self._length == 0:
#if not, let's do it #if not, let's do it
_it = pyChainSilhouetteGenericIterator(0,0) _it = pyChainSilhouetteGenericIterator(False, False)
_it.begin = winner _it.begin = winner
_it.current_edge = winner _it.current_edge = winner
_it.orientation = winnerOrientation _it.orientation = winnerOrientation
@ -627,7 +632,7 @@ class pyFillQi0AbsoluteAndRelativeChainingIterator(ChainingIterator):
# let's do the comparison: # let's do the comparison:
# nw let's compute the length of this connex non selected part: # nw let's compute the length of this connex non selected part:
connexl = 0 connexl = 0
_cit = pyChainSilhouetteGenericIterator(0,0) _cit = pyChainSilhouetteGenericIterator(False, False)
_cit.begin = winner _cit.begin = winner
_cit.current_edge = winner _cit.current_edge = winner
_cit.orientation = winnerOrientation _cit.orientation = winnerOrientation

@ -73,6 +73,7 @@ from _freestyle import (
# modules for implementing functions # modules for implementing functions
from freestyle.types import ( from freestyle.types import (
CurvePoint,
IntegrationType, IntegrationType,
UnaryFunction0DDouble, UnaryFunction0DDouble,
UnaryFunction0DMaterial, UnaryFunction0DMaterial,
@ -80,6 +81,7 @@ from freestyle.types import (
UnaryFunction1DDouble, UnaryFunction1DDouble,
) )
from freestyle.utils import ContextFunctions as CF from freestyle.utils import ContextFunctions as CF
from freestyle.utils import integrate
import math import math
import mathutils import mathutils
@ -183,7 +185,7 @@ class pyDensityAnisotropyF1D(UnaryFunction1DDouble):
self._integration = integrationType self._integration = integrationType
self._sampling = sampling self._sampling = sampling
def __call__(self, inter): def __call__(self, inter):
v = integrate(self._func, inter.pointsBegin(self._sampling), inter.pointsEnd(self._sampling), self._integration) v = integrate(self._func, inter.points_begin(self._sampling), inter.points_end(self._sampling), self._integration)
return v return v
class pyViewMapGradientNormF1D(UnaryFunction1DDouble): class pyViewMapGradientNormF1D(UnaryFunction1DDouble):
@ -193,5 +195,5 @@ class pyViewMapGradientNormF1D(UnaryFunction1DDouble):
self._integration = integrationType self._integration = integrationType
self._sampling = sampling self._sampling = sampling
def __call__(self, inter): def __call__(self, inter):
v = integrate(self._func, inter.pointsBegin(self._sampling), inter.pointsEnd(self._sampling), self._integration) v = integrate(self._func, inter.points_begin(self._sampling), inter.points_end(self._sampling), self._integration)
return v return v

@ -39,12 +39,27 @@ from _freestyle import (
# modules for implementing predicates # modules for implementing predicates
from freestyle.types import ( from freestyle.types import (
IntegrationType,
BinaryPredicate1D, BinaryPredicate1D,
IntegrationType,
Nature,
TVertex,
UnaryPredicate0D, UnaryPredicate0D,
UnaryPredicate1D, UnaryPredicate1D,
) )
from freestyle.functions import ( from freestyle.functions import (
Curvature2DAngleF0D,
CurveNatureF1D,
DensityF1D,
GetCompleteViewMapDensityF1D,
GetCurvilinearAbscissaF0D,
GetDirectionalViewMapDensityF1D,
GetOccludersF1D,
GetProjectedZF1D,
GetShapeF1D,
GetSteerableViewMapDensityF1D,
GetZF1D,
QuantitativeInvisibilityF0D,
ZDiscontinuityF1D,
pyCurvilinearLengthF0D, pyCurvilinearLengthF0D,
pyDensityAnisotropyF1D, pyDensityAnisotropyF1D,
pyViewMapGradientNormF1D, pyViewMapGradientNormF1D,

@ -48,8 +48,26 @@ from _freestyle import (
) )
# modules for implementing shaders # modules for implementing shaders
from freestyle.types import StrokeShader from freestyle.types import (
from freestyle.predicates import pyVertexNatureUP0D Interface0DIterator,
Nature,
Noise,
StrokeAttribute,
StrokeShader,
StrokeVertexIterator,
)
from freestyle.functions import (
Curvature2DAngleF0D,
DensityF0D,
GetProjectedZF0D,
MaterialF0D,
Normal2DF0D,
Orientation2DF1D,
ZDiscontinuityF0D,
)
from freestyle.predicates import (
pyVertexNatureUP0D,
)
from freestyle.utils import ContextFunctions as CF from freestyle.utils import ContextFunctions as CF
import math import math
import mathutils import mathutils

@ -21,25 +21,71 @@
# Date : 26/07/2010 # Date : 26/07/2010
# Purpose : Interactive manipulation of stylization parameters # Purpose : Interactive manipulation of stylization parameters
import freestyle from freestyle import Operators
from freestyle.types import (
BinaryPredicate1D,
Interface0DIterator,
Nature,
Noise,
StrokeAttribute,
UnaryPredicate0D,
UnaryPredicate1D,
TVertex,
)
from freestyle.chainingiterators import (
ChainPredicateIterator,
ChainSilhouetteIterator,
pySketchyChainSilhouetteIterator,
pySketchyChainingIterator,
)
from freestyle.functions import (
Curvature2DAngleF0D,
CurveMaterialF0D,
Normal2DF0D,
QuantitativeInvisibilityF1D,
VertexOrientation2DF0D,
)
from freestyle.predicates import (
AndUP1D,
ContourUP1D,
ExternalContourUP1D,
FalseBP1D,
FalseUP1D,
NotUP1D,
OrUP1D,
QuantitativeInvisibilityUP1D,
TrueBP1D,
TrueUP1D,
WithinImageBoundaryUP1D,
pyNatureUP1D,
)
from freestyle.shaders import (
BackboneStretcherShader,
BezierCurveShader,
ConstantColorShader,
GuidingLinesShader,
PolygonalizationShader,
SamplingShader,
SpatialNoiseShader,
StrokeShader,
TipRemoverShader,
pyBluePrintCirclesShader,
pyBluePrintEllipsesShader,
pyBluePrintSquaresShader,
)
from freestyle.utils import (
ContextFunctions,
getCurrentScene,
)
from _freestyle import (
blendRamp,
evaluateColorRamp,
evaluateCurveMappingF,
)
import math import math
import mathutils import mathutils
import time import time
from _freestyle import blendRamp, evaluateColorRamp, evaluateCurveMappingF
from ChainingIterators import pySketchyChainSilhouetteIterator, pySketchyChainingIterator
from freestyle import BackboneStretcherShader, BezierCurveShader, BinaryPredicate1D, ChainPredicateIterator, \
ChainSilhouetteIterator, ConstantColorShader, ContourUP1D, Curvature2DAngleF0D, ExternalContourUP1D, \
FalseBP1D, FalseUP1D, GuidingLinesShader, Interface0DIterator, Nature, Noise, Normal2DF0D, Operators, \
PolygonalizationShader, QuantitativeInvisibilityF1D, QuantitativeInvisibilityUP1D, SamplingShader, \
SpatialNoiseShader, StrokeAttribute, StrokeShader, TipRemoverShader, TrueBP1D, TrueUP1D, UnaryPredicate0D, \
UnaryPredicate1D, VertexOrientation2DF0D, WithinImageBoundaryUP1D, ContextFunctions, TVertex
from Functions0D import CurveMaterialF0D
from PredicatesU1D import pyNatureUP1D
from logical_operators import AndUP1D, NotUP1D, OrUP1D
from shaders import pyBluePrintCirclesShader, pyBluePrintEllipsesShader, pyBluePrintSquaresShader
class ColorRampModifier(StrokeShader): class ColorRampModifier(StrokeShader):
def __init__(self, blend, influence, ramp): def __init__(self, blend, influence, ramp):
@ -49,12 +95,12 @@ class ColorRampModifier(StrokeShader):
self.__ramp = ramp self.__ramp = ramp
def evaluate(self, t): def evaluate(self, t):
col = freestyle.evaluateColorRamp(self.__ramp, t) col = evaluateColorRamp(self.__ramp, t)
col = col.xyz # omit alpha col = col.xyz # omit alpha
return col return col
def blend_ramp(self, a, b): def blend_ramp(self, a, b):
return freestyle.blendRamp(self.__blend, a, self.__influence, b) return blendRamp(self.__blend, a, self.__influence, b)
class ScalarBlendModifier(StrokeShader): class ScalarBlendModifier(StrokeShader):
@ -106,7 +152,7 @@ class CurveMappingModifier(ScalarBlendModifier):
return t return t
def CURVE(self, t): def CURVE(self, t):
return freestyle.evaluateCurveMappingF(self.__curve, 0, t) return evaluateCurveMappingF(self.__curve, 0, t)
def evaluate(self, t): def evaluate(self, t):
return self.__mapping(t) return self.__mapping(t)
@ -114,7 +160,7 @@ class CurveMappingModifier(ScalarBlendModifier):
class ThicknessModifierMixIn: class ThicknessModifierMixIn:
def __init__(self): def __init__(self):
scene = freestyle.getCurrentScene() scene = getCurrentScene()
self.__persp_camera = (scene.camera.data.type == 'PERSP') self.__persp_camera = (scene.camera.data.type == 'PERSP')
def set_thickness(self, sv, outer, inner): def set_thickness(self, sv, outer, inner):
@ -312,7 +358,7 @@ class ThicknessDistanceFromCameraShader(ThicknessBlenderMixIn, CurveMappingModif
# Distance from Object modifiers # Distance from Object modifiers
def iter_distance_from_object(stroke, object, range_min, range_max): def iter_distance_from_object(stroke, object, range_min, range_max):
scene = freestyle.getCurrentScene() scene = getCurrentScene()
mv = scene.camera.matrix_world.copy() # model-view matrix mv = scene.camera.matrix_world.copy() # model-view matrix
mv.invert() mv.invert()
loc = mv * object.location # loc in the camera coordinate loc = mv * object.location # loc in the camera coordinate
@ -1114,7 +1160,7 @@ class StrokeCleaner(StrokeShader):
# main function for parameter processing # main function for parameter processing
def process(layer_name, lineset_name): def process(layer_name, lineset_name):
scene = freestyle.getCurrentScene() scene = getCurrentScene()
layer = scene.render.layers[layer_name] layer = scene.render.layers[layer_name]
lineset = layer.freestyle_settings.linesets[lineset_name] lineset = layer.freestyle_settings.linesets[lineset_name]
linestyle = lineset.linestyle linestyle = lineset.linestyle

@ -21,10 +21,24 @@
# Date : 12/08/2004 # Date : 12/08/2004
# Purpose : Smoothes lines using an anisotropic diffusion scheme # Purpose : Smoothes lines using an anisotropic diffusion scheme
from freestyle import ChainPredicateIterator, ConstantThicknessShader, ExternalContourUP1D, IncreasingColorShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SamplingShader, Stroke, StrokeTextureShader, TrueBP1D, TrueUP1D from freestyle.types import Stroke
from logical_operators import AndUP1D, NotUP1D from freestyle.chainingiterators import ChainPredicateIterator
from shaders import pyDiffusion2Shader from freestyle.predicates import (
AndUP1D,
ExternalContourUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueBP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
SamplingShader,
StrokeTextureShader,
pyDiffusion2Shader,
)
# pyDiffusion2Shader parameters # pyDiffusion2Shader parameters
offset = 0.25 offset = 0.25

@ -23,10 +23,21 @@
# subjects them to the causal density so as to avoid # subjects them to the causal density so as to avoid
# cluttering # cluttering
from freestyle import ChainPredicateIterator, ConstantColorShader, ConstantThicknessShader, IntegrationType, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, TrueBP1D from freestyle.types import IntegrationType
from PredicatesU1D import pyDensityUP1D, pyHighViewMapDensityUP1D from freestyle.chainingiterators import ChainPredicateIterator
from logical_operators import AndUP1D, NotUP1D from freestyle.predicates import (
AndUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueBP1D,
pyDensityUP1D,
pyHighViewMapDensityUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
)
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.3, IntegrationType.LAST)) upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.3, IntegrationType.LAST))
Operators.select(upred) Operators.select(upred)

@ -21,10 +21,20 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Draws lines having a high a priori density # Purpose : Draws lines having a high a priori density
from freestyle import ChainPredicateIterator, ConstantColorShader, ConstantThicknessShader, Operators, \ from freestyle import Operators
QuantitativeInvisibilityUP1D, TrueBP1D, TrueUP1D from freestyle.chainingiterators import ChainPredicateIterator
from PredicatesU1D import pyHighViewMapDensityUP1D from freestyle.predicates import (
from logical_operators import AndUP1D, NotUP1D AndUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueBP1D,
TrueUP1D,
pyHighViewMapDensityUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
)
Operators.select(AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.1,5))) Operators.select(AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.1,5)))
bpred = TrueBP1D() bpred = TrueBP1D()

@ -21,9 +21,18 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Stretches the geometry of visible lines # Purpose : Stretches the geometry of visible lines
from freestyle import BackboneStretcherShader, ChainSilhouetteIterator, ConstantColorShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, TextureAssignerShader, TrueUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
BackboneStretcherShader,
ConstantColorShader,
TextureAssignerShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))

@ -21,11 +21,24 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Produces a blueprint using circular contour strokes # Purpose : Produces a blueprint using circular contour strokes
from freestyle import ChainPredicateIterator, ConstantThicknessShader, ContourUP1D, IncreasingColorShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SameShapeIdBP1D, TextureAssignerShader, TrueUP1D from freestyle.chainingiterators import ChainPredicateIterator
from PredicatesU1D import pyHigherLengthUP1D from freestyle.predicates import (
from logical_operators import AndUP1D, NotUP1D AndUP1D,
from shaders import pyBluePrintCirclesShader, pyPerlinNoise1DShader ContourUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
SameShapeIdBP1D,
TrueUP1D,
pyHigherLengthUP1D,
)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
TextureAssignerShader,
pyBluePrintCirclesShader,
pyPerlinNoise1DShader,
)
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D()) upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
bpred = SameShapeIdBP1D() bpred = SameShapeIdBP1D()

@ -21,11 +21,24 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Produces a blueprint using elliptic contour strokes # Purpose : Produces a blueprint using elliptic contour strokes
from freestyle import ChainPredicateIterator, ConstantThicknessShader, ContourUP1D, IncreasingColorShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SameShapeIdBP1D, TextureAssignerShader, TrueUP1D from freestyle.chainingiterators import ChainPredicateIterator
from PredicatesU1D import pyHigherLengthUP1D from freestyle.predicates import (
from logical_operators import AndUP1D, NotUP1D AndUP1D,
from shaders import pyBluePrintEllipsesShader, pyPerlinNoise1DShader ContourUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
SameShapeIdBP1D,
TrueUP1D,
pyHigherLengthUP1D,
)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
TextureAssignerShader,
pyBluePrintEllipsesShader,
pyPerlinNoise1DShader,
)
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D()) upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
bpred = SameShapeIdBP1D() bpred = SameShapeIdBP1D()

@ -21,11 +21,24 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Produces a blueprint using square contour strokes # Purpose : Produces a blueprint using square contour strokes
from freestyle import ChainPredicateIterator, ConstantThicknessShader, ContourUP1D, IncreasingColorShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SameShapeIdBP1D, TextureAssignerShader, TrueUP1D from freestyle.chainingiterators import ChainPredicateIterator
from PredicatesU1D import pyHigherLengthUP1D from freestyle.predicates import (
from logical_operators import AndUP1D, NotUP1D AndUP1D,
from shaders import pyBluePrintSquaresShader, pyPerlinNoise1DShader ContourUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
SameShapeIdBP1D,
TrueUP1D,
pyHigherLengthUP1D,
)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
TextureAssignerShader,
pyBluePrintSquaresShader,
pyPerlinNoise1DShader,
)
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D()) upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
bpred = SameShapeIdBP1D() bpred = SameShapeIdBP1D()

@ -23,10 +23,18 @@
# infered from each object's material in a cartoon-like # infered from each object's material in a cartoon-like
# fashion. # fashion.
from freestyle import BezierCurveShader, ChainSilhouetteIterator, ConstantThicknessShader, Operators, \ from freestyle import Operators
QuantitativeInvisibilityUP1D, TrueUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
from shaders import pyMaterialColorShader NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
BezierCurveShader,
ConstantThicknessShader,
pyMaterialColorShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))

@ -21,9 +21,20 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Draws each object's visible contour # Purpose : Draws each object's visible contour
from freestyle import ChainPredicateIterator, ConstantThicknessShader, ContourUP1D, IncreasingColorShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SameShapeIdBP1D, TrueUP1D from freestyle.chainingiterators import ChainPredicateIterator
from logical_operators import AndUP1D, NotUP1D from freestyle.predicates import (
AndUP1D,
ContourUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
SameShapeIdBP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
)
Operators.select(AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())) Operators.select(AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D()))
bpred = SameShapeIdBP1D() bpred = SameShapeIdBP1D()

@ -22,10 +22,19 @@
# Purpose : The stroke points are colored in gray levels and depending # Purpose : The stroke points are colored in gray levels and depending
# on the 2d curvature value # on the 2d curvature value
from freestyle import ChainSilhouetteIterator, ConstantThicknessShader, Operators, \ from freestyle import Operators
QuantitativeInvisibilityUP1D, Stroke, StrokeTextureShader, TrueUP1D from freestyle.types import Stroke
from logical_operators import NotUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from shaders import py2DCurvatureColorShader from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantThicknessShader,
StrokeTextureShader,
py2DCurvatureColorShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))

@ -21,9 +21,20 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Draws the external contour of the scene # Purpose : Draws the external contour of the scene
from freestyle import ChainPredicateIterator, ConstantColorShader, ConstantThicknessShader, \ from freestyle import Operators
ExternalContourUP1D, Operators, QuantitativeInvisibilityUP1D, TrueBP1D, TrueUP1D from freestyle.chainingiterators import ChainPredicateIterator
from logical_operators import AndUP1D, NotUP1D from freestyle.predicates import (
AndUP1D,
ExternalContourUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueBP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
)
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D()) upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
Operators.select(upred) Operators.select(upred)

@ -23,18 +23,30 @@
# chaining iterator (in particular each ViewEdge can be drawn # chaining iterator (in particular each ViewEdge can be drawn
# several times # several times
from ChainingIterators import pySketchyChainingIterator from freestyle import Operators
from freestyle import ExternalContourUP1D, IncreasingColorShader, IncreasingThicknessShader, \ from freestyle.chainingiterators import pySketchyChainingIterator
Operators, QuantitativeInvisibilityUP1D, SamplingShader, SmoothingShader, SpatialNoiseShader, \ from freestyle.predicates import (
TextureAssignerShader, TrueUP1D AndUP1D,
from logical_operators import AndUP1D, NotUP1D ExternalContourUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
IncreasingColorShader,
IncreasingThicknessShader,
SamplingShader,
SmoothingShader,
SpatialNoiseShader,
TextureAssignerShader,
)
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D()) upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
Operators.select(upred) Operators.select(upred)
Operators.bidirectional_chain(pySketchyChainingIterator(), NotUP1D(upred)) Operators.bidirectional_chain(pySketchyChainingIterator(), NotUP1D(upred))
shaders_list = [ shaders_list = [
SamplingShader(4), SamplingShader(4),
SpatialNoiseShader(10, 150, 2, 1, 1), SpatialNoiseShader(10, 150, 2, True, True),
IncreasingThicknessShader(4, 10), IncreasingThicknessShader(4, 10),
SmoothingShader(400, 0.1, 0, 0.2, 0, 0, 0, 1), SmoothingShader(400, 0.1, 0, 0.2, 0, 0, 0, 1),
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1), IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),

@ -21,10 +21,22 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Draws a smooth external contour # Purpose : Draws a smooth external contour
from freestyle import ChainPredicateIterator, ExternalContourUP1D, IncreasingColorShader, \ from freestyle import Operators
IncreasingThicknessShader, Operators, QuantitativeInvisibilityUP1D, SamplingShader, \ from freestyle.chainingiterators import ChainPredicateIterator
SmoothingShader, TrueBP1D, TrueUP1D from freestyle.predicates import (
from logical_operators import AndUP1D, NotUP1D AndUP1D,
ExternalContourUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueBP1D,
TrueUP1D,
)
from freestyle.shaders import (
IncreasingColorShader,
IncreasingThicknessShader,
SamplingShader,
SmoothingShader,
)
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D()) upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
Operators.select(upred) Operators.select(upred)

@ -24,11 +24,23 @@
# object and trims them in order to produce # object and trims them in order to produce
# a haloing effect around the target shape # a haloing effect around the target shape
from freestyle import ChainSilhouetteIterator, Id, IncreasingColorShader, IncreasingThicknessShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TipRemoverShader, TrueUP1D from freestyle.types import Id
from PredicatesU1D import pyIsOccludedByUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import AndUP1D, NotUP1D from freestyle.predicates import (
from shaders import pyTVertexRemoverShader AndUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
pyIsOccludedByUP1D,
)
from freestyle.shaders import (
IncreasingColorShader,
IncreasingThicknessShader,
SamplingShader,
TipRemoverShader,
pyTVertexRemoverShader,
)
# id corresponds to the id of the target object # id corresponds to the id of the target object
# (accessed by SHIFT+click) # (accessed by SHIFT+click)

@ -21,9 +21,17 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : The strokes are drawn through small occlusions # Purpose : The strokes are drawn through small occlusions
from ChainingIterators import pyFillOcclusionsAbsoluteChainingIterator from freestyle import Operators
from freestyle import ConstantColorShader, ConstantThicknessShader, Operators, \ from freestyle.chainingiterators import pyFillOcclusionsAbsoluteChainingIterator
QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
#Operators.bidirectional_chain(pyFillOcclusionsChainingIterator(0.1)) #Operators.bidirectional_chain(pyFillOcclusionsChainingIterator(0.1))

@ -22,9 +22,18 @@
# Purpose : Draws all lines whose Quantitative Invisibility # Purpose : Draws all lines whose Quantitative Invisibility
# is different from 0 # is different from 0
from freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
)
upred = NotUP1D(QuantitativeInvisibilityUP1D(0)) upred = NotUP1D(QuantitativeInvisibilityUP1D(0))
Operators.select(upred) Operators.select(upred)

@ -21,15 +21,29 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Simulates a big brush fr oriental painting # Purpose : Simulates a big brush fr oriental painting
from freestyle import BezierCurveShader, ChainSilhouetteIterator, ConstantColorShader, \ from freestyle import Operators
ConstantThicknessShader, IntegrationType, Operators, QuantitativeInvisibilityUP1D, \ from freestyle.types import IntegrationType
SamplingShader, TextureAssignerShader, TipRemoverShader from freestyle.chainingiterators import ChainSilhouetteIterator
from Functions0D import pyInverseCurvature2DAngleF0D from freestyle.functions import pyInverseCurvature2DAngleF0D
from PredicatesB1D import pyLengthBP1D from freestyle.predicates import (
from PredicatesU0D import pyParameterUP0D NotUP1D,
from PredicatesU1D import pyDensityUP1D, pyHigherLengthUP1D, pyHigherNumberOfTurnsUP1D QuantitativeInvisibilityUP1D,
from logical_operators import NotUP1D pyDensityUP1D,
from shaders import pyNonLinearVaryingThicknessShader, pySamplingShader pyHigherLengthUP1D,
pyHigherNumberOfTurnsUP1D,
pyLengthBP1D,
pyParameterUP0D,
)
from freestyle.shaders import (
BezierCurveShader,
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
TextureAssignerShader,
TipRemoverShader,
pyNonLinearVaryingThicknessShader,
pySamplingShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))

@ -28,11 +28,23 @@
# ******** The Directional a priori density maps must ****** # ******** The Directional a priori density maps must ******
# ******** have been computed prior to using this style module ****** # ******** have been computed prior to using this style module ******
from freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, DensityF1D, \ from freestyle import Operators
IntegrationType, Operators, QuantitativeInvisibilityUP1D, SamplingShader, UnaryPredicate1D from freestyle.types import IntegrationType
from PredicatesB1D import pyLengthBP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from PredicatesU1D import pyHighDensityAnisotropyUP1D, pyHigherLengthUP1D from freestyle.functions import DensityF1D
from logical_operators import NotUP1D from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
UnaryPredicate1D,
pyHighDensityAnisotropyUP1D,
pyHigherLengthUP1D,
pyLengthBP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
)
## custom density predicate ## custom density predicate
class pyDensityUP1D(UnaryPredicate1D): class pyDensityUP1D(UnaryPredicate1D):

@ -27,15 +27,25 @@
# the strokes using a second parameterization that only # the strokes using a second parameterization that only
# covers the visible portions. # covers the visible portions.
from freestyle import ChainSilhouetteIterator, ConstantColorShader, IncreasingColorShader, \ from freestyle import Operators
IncreasingThicknessShader, Operators, QuantitativeInvisibilityUP1D, SamplingShader, \ from freestyle.chainingiterators import ChainSilhouetteIterator
TextureAssignerShader, TrueUP1D from freestyle.predicates import (
from shaders import pyHLRShader QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
IncreasingColorShader,
IncreasingThicknessShader,
SamplingShader,
TextureAssignerShader,
pyHLRShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
## Chain following the same nature, but without the restriction ## Chain following the same nature, but without the restriction
## of staying inside the selection (0). ## of staying inside the selection (False).
Operators.bidirectional_chain(ChainSilhouetteIterator(0)) Operators.bidirectional_chain(ChainSilhouetteIterator(False))
shaders_list = [ shaders_list = [
SamplingShader(20), SamplingShader(20),
IncreasingThicknessShader(1.5, 30), IncreasingThicknessShader(1.5, 30),

@ -25,10 +25,18 @@
# The suggestive contours must have been enabled in the # The suggestive contours must have been enabled in the
# options dialog to appear in the View Map. # options dialog to appear in the View Map.
from freestyle import ChainSilhouetteIterator, IncreasingColorShader, \ from freestyle import Operators
IncreasingThicknessShader, Nature, Operators, TrueUP1D from freestyle.types import Nature
from PredicatesU1D import pyNatureUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
NotUP1D,
TrueUP1D,
pyNatureUP1D,
)
from freestyle.shaders import (
IncreasingColorShader,
IncreasingThicknessShader,
)
Operators.select(pyNatureUP1D(Nature.SILHOUETTE)) Operators.select(pyNatureUP1D(Nature.SILHOUETTE))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(pyNatureUP1D(Nature.SILHOUETTE))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(pyNatureUP1D(Nature.SILHOUETTE)))

@ -22,10 +22,21 @@
# Purpose : Draws the lines that are "closer" than a threshold # Purpose : Draws the lines that are "closer" than a threshold
# (between 0 and 1) # (between 0 and 1)
from freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \ from freestyle import Operators
IntegrationType, Operators, QuantitativeInvisibilityUP1D, TextureAssignerShader, TrueUP1D from freestyle.types import IntegrationType
from PredicatesU1D import pyZSmallerUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import AndUP1D, NotUP1D from freestyle.predicates import (
AndUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
pyZSmallerUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
TextureAssignerShader,
)
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyZSmallerUP1D(0.5, IntegrationType.MEAN)) upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyZSmallerUP1D(0.5, IntegrationType.MEAN))
Operators.select(upred) Operators.select(upred)

@ -21,10 +21,21 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Draws only the lines that are occluded by a given object # Purpose : Draws only the lines that are occluded by a given object
from freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \ from freestyle import Operators
Id, Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D from freestyle.types import Id
from PredicatesU1D import pyIsInOccludersListUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import AndUP1D, NotUP1D from freestyle.predicates import (
AndUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
pyIsInOccludersListUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
)
## the id of the occluder (use SHIFT+click on the ViewMap to ## the id of the occluder (use SHIFT+click on the ViewMap to
## retrieve ids) ## retrieve ids)

@ -21,9 +21,19 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Make the strokes more "polygonal" # Purpose : Make the strokes more "polygonal"
from freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \ from freestyle import Operators
Operators, PolygonalizationShader, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
PolygonalizationShader,
SamplingShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))

@ -22,9 +22,18 @@
# Purpose : Draws the visible lines (chaining follows same nature lines) # Purpose : Draws the visible lines (chaining follows same nature lines)
# (most basic style module) # (most basic style module)
from freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))

@ -22,10 +22,23 @@
# Purpose : Draws the visible lines (chaining follows same nature lines) # Purpose : Draws the visible lines (chaining follows same nature lines)
# that do not belong to the external contour of the scene # that do not belong to the external contour of the scene
from freestyle import BackboneStretcherShader, ChainSilhouetteIterator, ExternalContourUP1D, \ from freestyle import Operators
IncreasingColorShader, IncreasingThicknessShader, Operators, QuantitativeInvisibilityUP1D, \ from freestyle.chainingiterators import ChainSilhouetteIterator
SamplingShader, SpatialNoiseShader, TextureAssignerShader, TrueUP1D from freestyle.predicates import (
from logical_operators import AndUP1D, NotUP1D AndUP1D,
ExternalContourUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
BackboneStretcherShader,
IncreasingColorShader,
IncreasingThicknessShader,
SamplingShader,
SpatialNoiseShader,
TextureAssignerShader,
)
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D()) upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
Operators.select(upred) Operators.select(upred)

@ -23,9 +23,18 @@
# *** Quantitative Invisibility must have been # *** Quantitative Invisibility must have been
# enabled in the options dialog to use this style module **** # enabled in the options dialog to use this style module ****
from freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
)
Operators.select(QuantitativeInvisibilityUP1D(1)) Operators.select(QuantitativeInvisibilityUP1D(1))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(1))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(1)))

@ -23,9 +23,18 @@
# *** Quantitative Invisibility must have been # *** Quantitative Invisibility must have been
# enabled in the options dialog to use this style module **** # enabled in the options dialog to use this style module ****
from freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
)
Operators.select(QuantitativeInvisibilityUP1D(2)) Operators.select(QuantitativeInvisibilityUP1D(2))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(2))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(2)))

@ -23,10 +23,22 @@
# predicates to specify respectively the starting and # predicates to specify respectively the starting and
# the stopping extremities for strokes # the stopping extremities for strokes
from freestyle import ChainSilhouetteIterator, ConstantColorShader, IncreasingThicknessShader, Nature, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SpatialNoiseShader, TextureAssignerShader, TrueUP1D from freestyle.types import Nature
from PredicatesU0D import pyBackTVertexUP0D, pyVertexNatureUP0D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
pyBackTVertexUP0D,
pyVertexNatureUP0D,
)
from freestyle.shaders import (
ConstantColorShader,
IncreasingThicknessShader,
SpatialNoiseShader,
TextureAssignerShader,
)
upred = QuantitativeInvisibilityUP1D(0) upred = QuantitativeInvisibilityUP1D(0)
Operators.select(upred) Operators.select(upred)

@ -23,11 +23,21 @@
# parameterization that covers the complete lines (visible+invisible) # parameterization that covers the complete lines (visible+invisible)
# whereas only the visible portions are actually drawn # whereas only the visible portions are actually drawn
from ChainingIterators import pySketchyChainSilhouetteIterator from freestyle import Operators
from freestyle import IncreasingColorShader, IncreasingThicknessShader, Operators, \ from freestyle.chainingiterators import pySketchyChainSilhouetteIterator
QuantitativeInvisibilityUP1D, SamplingShader, SmoothingShader, SpatialNoiseShader, \ from freestyle.predicates import (
TextureAssignerShader, TrueUP1D QuantitativeInvisibilityUP1D,
from shaders import pyHLRShader TrueUP1D,
)
from freestyle.shaders import (
IncreasingColorShader,
IncreasingThicknessShader,
SamplingShader,
SmoothingShader,
SpatialNoiseShader,
TextureAssignerShader,
pyHLRShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(pySketchyChainSilhouetteIterator(3, False)) Operators.bidirectional_chain(pySketchyChainSilhouetteIterator(3, False))

@ -23,11 +23,21 @@
# independantly from the 3D topology of objects, # independantly from the 3D topology of objects,
# and, second, so as to chain several times the same ViewEdge. # and, second, so as to chain several times the same ViewEdge.
from ChainingIterators import pySketchyChainingIterator from freestyle import Operators
from freestyle import IncreasingColorShader, IncreasingThicknessShader, Operators, \ from freestyle.chainingiterators import pySketchyChainingIterator
QuantitativeInvisibilityUP1D, SamplingShader, SmoothingShader, SpatialNoiseShader, \ from freestyle.predicates import (
TextureAssignerShader, TrueUP1D QuantitativeInvisibilityUP1D,
from shaders import pyBackboneStretcherNoCuspShader TrueUP1D,
)
from freestyle.shaders import (
IncreasingColorShader,
IncreasingThicknessShader,
SamplingShader,
SmoothingShader,
SpatialNoiseShader,
TextureAssignerShader,
pyBackboneStretcherNoCuspShader
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
## Chain 3 times each ViewEdge indpendantly from the ## Chain 3 times each ViewEdge indpendantly from the

@ -23,10 +23,20 @@
# so as to chain several times the same ViewEdge. # so as to chain several times the same ViewEdge.
# The topology of the objects is preserved # The topology of the objects is preserved
from ChainingIterators import pySketchyChainSilhouetteIterator from freestyle import Operators
from freestyle import ConstantColorShader, IncreasingThicknessShader, Operators, \ from freestyle.chainingiterators import pySketchyChainSilhouetteIterator
QuantitativeInvisibilityUP1D, SamplingShader, SmoothingShader, SpatialNoiseShader, \ from freestyle.predicates import (
TextureAssignerShader, TrueUP1D QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
IncreasingThicknessShader,
SamplingShader,
SmoothingShader,
SpatialNoiseShader,
TextureAssignerShader,
)
upred = QuantitativeInvisibilityUP1D(0) upred = QuantitativeInvisibilityUP1D(0)
Operators.select(upred) Operators.select(upred)

@ -22,12 +22,21 @@
# Purpose : Draws the visible lines (chaining follows same nature lines) # Purpose : Draws the visible lines (chaining follows same nature lines)
# (most basic style module) # (most basic style module)
from freestyle import ChainSilhouetteIterator, ConstantThicknessShader, IncreasingColorShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, TextureAssignerShader, TrueUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from Functions0D import pyInverseCurvature2DAngleF0D from freestyle.functions import pyInverseCurvature2DAngleF0D
from PredicatesU0D import pyParameterUP0D from freestyle.predicates import (
from PredicatesU1D import pyHigherLengthUP1D NotUP1D,
from logical_operators import NotUP1D QuantitativeInvisibilityUP1D,
TrueUP1D,
pyHigherLengthUP1D,
pyParameterUP0D,
)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
TextureAssignerShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))

@ -21,10 +21,20 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Draws strokes that starts and stops at Tvertices (visible or not) # Purpose : Draws strokes that starts and stops at Tvertices (visible or not)
from freestyle import ChainSilhouetteIterator, ConstantThicknessShader, IncreasingColorShader, \ from freestyle import Operators
Nature, Operators, QuantitativeInvisibilityUP1D, TextureAssignerShader, TrueUP1D from freestyle.types import Nature
from PredicatesU0D import pyVertexNatureUP0D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
pyVertexNatureUP0D,
)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
TextureAssignerShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))

@ -21,10 +21,21 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Draws textured strokes (illustrate the StrokeTextureShader shader) # Purpose : Draws textured strokes (illustrate the StrokeTextureShader shader)
from freestyle import BezierCurveShader, ChainSilhouetteIterator, ConstantColorShader, \ from freestyle import Operators
ConstantThicknessShader, Operators, QuantitativeInvisibilityUP1D, SamplingShader, \ from freestyle.types import Stroke
Stroke, StrokeTextureShader, TrueUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
BezierCurveShader,
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
StrokeTextureShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))

@ -23,10 +23,20 @@
# ***** The suggestive contours must be enabled # ***** The suggestive contours must be enabled
# in the options dialog ***** # in the options dialog *****
from freestyle import ChainSilhouetteIterator, ConstantColorShader, IncreasingThicknessShader, \ from freestyle import Operators
Nature, Operators, QuantitativeInvisibilityUP1D, TrueUP1D from freestyle.types import Nature
from PredicatesU1D import pyNatureUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import AndUP1D, NotUP1D from freestyle.predicates import (
AndUP1D,
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
pyNatureUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
IncreasingThicknessShader,
)
upred = AndUP1D(pyNatureUP1D(Nature.SUGGESTIVE_CONTOUR), QuantitativeInvisibilityUP1D(0)) upred = AndUP1D(pyNatureUP1D(Nature.SUGGESTIVE_CONTOUR), QuantitativeInvisibilityUP1D(0))
Operators.select(upred) Operators.select(upred)

@ -21,10 +21,19 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Assigns to strokes a thickness that depends on the depth discontinuity # Purpose : Assigns to strokes a thickness that depends on the depth discontinuity
from freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
from shaders import pyDepthDiscontinuityThicknessShader NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
pyDepthDiscontinuityThicknessShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))

@ -21,9 +21,19 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Removes strokes extremities # Purpose : Removes strokes extremities
from freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TipRemoverShader, TrueUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
TipRemoverShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))

@ -21,10 +21,19 @@
# Date : 04/08/2005 # Date : 04/08/2005
# Purpose : Removes TVertices # Purpose : Removes TVertices
from freestyle import ChainSilhouetteIterator, ConstantColorShader, IncreasingThicknessShader, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from logical_operators import NotUP1D from freestyle.predicates import (
from shaders import pyTVertexRemoverShader NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
)
from freestyle.shaders import (
ConstantColorShader,
IncreasingThicknessShader,
SamplingShader,
pyTVertexRemoverShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0))) Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))

@ -20,10 +20,20 @@
# Authors : Fredo Durand, Stephane Grabli, Francois Sillion, Emmanuel Turquin # Authors : Fredo Durand, Stephane Grabli, Francois Sillion, Emmanuel Turquin
# Date : 08/04/2005 # Date : 08/04/2005
from freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, IntegrationType, \ from freestyle import Operators
Operators, QuantitativeInvisibilityUP1D, SamplingShader, Stroke, StrokeTextureShader from freestyle.types import IntegrationType, Stroke
from PredicatesB1D import pyZBP1D from freestyle.chainingiterators import ChainSilhouetteIterator
from PredicatesU1D import pyDensityUP1D from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
pyDensityUP1D,
pyZBP1D,
)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
StrokeTextureShader,
)
Operators.select(QuantitativeInvisibilityUP1D(0)) Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator()) Operators.bidirectional_chain(ChainSilhouetteIterator())