Freestyle Python API improvements - part 9.
* Fix for wild card import statements (e.g., "from Freestyle import *") was done. Now import statements are either without using "from" or with all imported names explicitly listed. * GNU GPL header blocks were added to Python programs. Additional code clean-up was also made. * Removed freestyle_init.py and extra-lines.sml that were no longer used.
This commit is contained in:
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : ChainingIterators.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Chaining Iterators to be used with chaining operators
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,12 +11,17 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : ChainingIterators.py
|
||||||
|
# Author : Stephane Grabli
|
||||||
|
# Date : 04/08/2005
|
||||||
|
# Purpose : Chaining Iterators to be used with chaining operators
|
||||||
|
|
||||||
|
from Freestyle import AdjacencyIterator, ChainingIterator, ExternalContourUP1D, Nature, TVertex
|
||||||
from Freestyle import ContextFunctions as CF
|
from Freestyle import ContextFunctions as CF
|
||||||
|
|
||||||
## the natural chaining iterator
|
## the natural chaining iterator
|
||||||
|
@@ -1,6 +1,29 @@
|
|||||||
from freestyle_init import *
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
from Freestyle import Curvature2DAngleF0D, CurvePoint, ReadCompleteViewMapPixelF0D, \
|
||||||
|
ReadSteerableViewMapPixelF0D, UnaryFunction0DDouble, UnaryFunction0DMaterial, \
|
||||||
|
UnaryFunction0DVec2f
|
||||||
from Freestyle import ContextFunctions as CF
|
from Freestyle import ContextFunctions as CF
|
||||||
|
|
||||||
|
import math
|
||||||
|
import mathutils
|
||||||
|
|
||||||
class CurveMaterialF0D(UnaryFunction0DMaterial):
|
class CurveMaterialF0D(UnaryFunction0DMaterial):
|
||||||
# A replacement of the built-in MaterialF0D for stroke creation.
|
# A replacement of the built-in MaterialF0D for stroke creation.
|
||||||
# MaterialF0D does not work with Curves and Strokes.
|
# MaterialF0D does not work with Curves and Strokes.
|
||||||
@@ -53,23 +76,25 @@ class pyViewMapGradientVectorF0D(UnaryFunction0DVec2f):
|
|||||||
def __init__(self, l):
|
def __init__(self, l):
|
||||||
UnaryFunction0DVec2f.__init__(self)
|
UnaryFunction0DVec2f.__init__(self)
|
||||||
self._l = l
|
self._l = l
|
||||||
self._step = pow(2,self._l)
|
self._step = math.pow(2,self._l)
|
||||||
def __call__(self, iter):
|
def __call__(self, iter):
|
||||||
p = iter.object.point_2d
|
p = iter.object.point_2d
|
||||||
gx = CF.read_complete_view_map_pixel(self._l, int(p.x+self._step), int(p.y))- CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
|
gx = CF.read_complete_view_map_pixel(self._l, int(p.x+self._step), int(p.y)) - \
|
||||||
gy = CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y+self._step))- CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
|
CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
|
||||||
return Vector([gx, gy])
|
gy = CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y+self._step)) - \
|
||||||
|
CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
|
||||||
|
return mathutils.Vector([gx, gy])
|
||||||
|
|
||||||
class pyViewMapGradientNormF0D(UnaryFunction0DDouble):
|
class pyViewMapGradientNormF0D(UnaryFunction0DDouble):
|
||||||
def __init__(self, l):
|
def __init__(self, l):
|
||||||
UnaryFunction0DDouble.__init__(self)
|
UnaryFunction0DDouble.__init__(self)
|
||||||
self._l = l
|
self._l = l
|
||||||
self._step = pow(2,self._l)
|
self._step = math.pow(2,self._l)
|
||||||
def __call__(self, iter):
|
def __call__(self, iter):
|
||||||
p = iter.object.point_2d
|
p = iter.object.point_2d
|
||||||
gx = CF.read_complete_view_map_pixel(self._l, int(p.x+self._step), int(p.y))- CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
|
gx = CF.read_complete_view_map_pixel(self._l, int(p.x+self._step), int(p.y)) - \
|
||||||
gy = CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y+self._step))- CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
|
CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
|
||||||
grad = Vector([gx, gy])
|
gy = CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y+self._step)) - \
|
||||||
|
CF.read_complete_view_map_pixel(self._l, int(p.x), int(p.y))
|
||||||
|
grad = mathutils.Vector([gx, gy])
|
||||||
return grad.length
|
return grad.length
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,5 +1,23 @@
|
|||||||
from freestyle_init import *
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
from Functions0D import *
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
from Freestyle import GetProjectedZF1D, IntegrationType, UnaryFunction1DDouble, integrate
|
||||||
|
from Functions0D import pyDensityAnisotropyF0D, pyViewMapGradientNormF0D
|
||||||
import string
|
import string
|
||||||
|
|
||||||
class pyGetInverseProjectedZF1D(UnaryFunction1DDouble):
|
class pyGetInverseProjectedZF1D(UnaryFunction1DDouble):
|
||||||
|
@@ -1,6 +1,25 @@
|
|||||||
from freestyle_init import *
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
from Functions1D import *
|
#
|
||||||
from random import *
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
from Freestyle import BinaryPredicate1D, GetZF1D, IntegrationType, Nature, SameShapeIdBP1D, ZDiscontinuityF1D
|
||||||
|
from Functions1D import pyViewMapGradientNormF1D
|
||||||
|
|
||||||
|
import random
|
||||||
|
|
||||||
class pyZBP1D(BinaryPredicate1D):
|
class pyZBP1D(BinaryPredicate1D):
|
||||||
def __call__(self, i1, i2):
|
def __call__(self, i1, i2):
|
||||||
@@ -42,8 +61,8 @@ class pyViewMapGradientNormBP1D(BinaryPredicate1D):
|
|||||||
class pyShuffleBP1D(BinaryPredicate1D):
|
class pyShuffleBP1D(BinaryPredicate1D):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
BinaryPredicate1D.__init__(self)
|
BinaryPredicate1D.__init__(self)
|
||||||
seed(1)
|
random.seed(1)
|
||||||
def __call__(self, inter1, inter2):
|
def __call__(self, inter1, inter2):
|
||||||
r1 = uniform(0,1)
|
r1 = random.uniform(0,1)
|
||||||
r2 = uniform(0,1)
|
r2 = random.uniform(0,1)
|
||||||
return (r1<r2)
|
return (r1<r2)
|
||||||
|
@@ -1,5 +1,23 @@
|
|||||||
from freestyle_init import *
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
from Functions0D import *
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
from Freestyle import Curvature2DAngleF0D, Nature, QuantitativeInvisibilityF0D, UnaryPredicate0D
|
||||||
|
from Functions0D import pyCurvilinearLengthF0D
|
||||||
|
|
||||||
class pyHigherCurvature2DAngleUP0D(UnaryPredicate0D):
|
class pyHigherCurvature2DAngleUP0D(UnaryPredicate0D):
|
||||||
def __init__(self,a):
|
def __init__(self,a):
|
||||||
|
@@ -1,5 +1,25 @@
|
|||||||
from freestyle_init import *
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
from Functions1D import *
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
from Freestyle import Curvature2DAngleF0D, CurveNatureF1D, DensityF1D, GetCompleteViewMapDensityF1D, \
|
||||||
|
GetDirectionalViewMapDensityF1D, GetOccludersF1D, GetProjectedZF1D, GetShapeF1D, GetSteerableViewMapDensityF1D, \
|
||||||
|
IntegrationType, ShapeUP1D, TVertex, UnaryPredicate1D
|
||||||
|
from Functions1D import pyDensityAnisotropyF1D, pyViewMapGradientNormF1D
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
class pyNFirstUP1D(UnaryPredicate1D):
|
class pyNFirstUP1D(UnaryPredicate1D):
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : anisotropic_diffusion.py
|
|
||||||
# Author : Fredo Durand
|
|
||||||
# Date : 12/08/2004
|
|
||||||
# Purpose : Smoothes lines using an anisotropic diffusion scheme
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,14 +11,20 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : anisotropic_diffusion.py
|
||||||
from logical_operators import *
|
# Author : Fredo Durand
|
||||||
from shaders import *
|
# Date : 12/08/2004
|
||||||
|
# Purpose : Smoothes lines using an anisotropic diffusion scheme
|
||||||
|
|
||||||
|
from Freestyle import ChainPredicateIterator, ConstantThicknessShader, ExternalContourUP1D, IncreasingColorShader, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, SamplingShader, Stroke, StrokeTextureShader, TrueBP1D, TrueUP1D
|
||||||
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
|
from shaders import pyDiffusion2Shader
|
||||||
|
|
||||||
# pyDiffusion2Shader parameters
|
# pyDiffusion2Shader parameters
|
||||||
offset = 0.25
|
offset = 0.25
|
||||||
@@ -42,6 +39,6 @@ shaders_list = [
|
|||||||
StrokeTextureShader("smoothAlpha.bmp", Stroke.OPAQUE_MEDIUM, False),
|
StrokeTextureShader("smoothAlpha.bmp", Stroke.OPAQUE_MEDIUM, False),
|
||||||
SamplingShader(2),
|
SamplingShader(2),
|
||||||
pyDiffusion2Shader(offset, nbIter),
|
pyDiffusion2Shader(offset, nbIter),
|
||||||
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1)
|
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,15 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : apriori_and_causal_density.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Selects the lines with high a priori density and
|
|
||||||
# subjects them to the causal density so as to avoid
|
|
||||||
# cluttering
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -22,17 +11,22 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
# Filename : apriori_and_causal_density.py
|
||||||
|
# Author : Stephane Grabli
|
||||||
|
# Date : 04/08/2005
|
||||||
|
# Purpose : Selects the lines with high a priori density and
|
||||||
|
# subjects them to the causal density so as to avoid
|
||||||
|
# cluttering
|
||||||
|
|
||||||
from freestyle_init import *
|
from Freestyle import ChainPredicateIterator, ConstantColorShader, ConstantThicknessShader, IntegrationType, \
|
||||||
from logical_operators import *
|
Operators, QuantitativeInvisibilityUP1D, TrueBP1D
|
||||||
from PredicatesB1D import *
|
from PredicatesU1D import pyDensityUP1D, pyHighViewMapDensityUP1D
|
||||||
from PredicatesU1D import *
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
from shaders import *
|
|
||||||
|
|
||||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.3, IntegrationType.LAST))
|
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.3, IntegrationType.LAST))
|
||||||
Operators.select(upred)
|
Operators.select(upred)
|
||||||
@@ -40,6 +34,6 @@ bpred = TrueBP1D()
|
|||||||
Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
shaders_list = [
|
shaders_list = [
|
||||||
ConstantThicknessShader(2),
|
ConstantThicknessShader(2),
|
||||||
ConstantColorShader(0.0, 0.0, 0.0,1)
|
ConstantColorShader(0, 0, 0, 1),
|
||||||
]
|
]
|
||||||
Operators.create(pyDensityUP1D(1, 0.1, IntegrationType.MEAN), shaders_list)
|
Operators.create(pyDensityUP1D(1, 0.1, IntegrationType.MEAN), shaders_list)
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : apriori_density.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws lines having a high a priori density
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,17 +11,20 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
# Filename : apriori_density.py
|
||||||
|
# Author : Stephane Grabli
|
||||||
|
# Date : 04/08/2005
|
||||||
|
# Purpose : Draws lines having a high a priori density
|
||||||
|
|
||||||
from freestyle_init import *
|
from Freestyle import ChainPredicateIterator, ConstantColorShader, ConstantThicknessShader, Operators, \
|
||||||
from logical_operators import *
|
QuantitativeInvisibilityUP1D, TrueBP1D, TrueUP1D
|
||||||
from PredicatesB1D import *
|
from PredicatesU1D import pyHighViewMapDensityUP1D
|
||||||
from PredicatesU1D import *
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
from shaders import *
|
|
||||||
|
|
||||||
Operators.select(AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.1,5)))
|
Operators.select(AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.1,5)))
|
||||||
bpred = TrueBP1D()
|
bpred = TrueBP1D()
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : backbone_stretcher.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Stretches the geometry of visible lines
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,17 +11,25 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : backbone_stretcher.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesB1D import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : Stretches the geometry of visible lines
|
||||||
|
|
||||||
|
from Freestyle import BackboneStretcherShader, ChainSilhouetteIterator, ConstantColorShader, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, TextureAssignerShader, TrueUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
shaders_list = [TextureAssignerShader(4), ConstantColorShader(0.5, 0.5, 0.5), BackboneStretcherShader(20)]
|
shaders_list = [
|
||||||
|
TextureAssignerShader(4),
|
||||||
|
ConstantColorShader(0.5, 0.5, 0.5),
|
||||||
|
BackboneStretcherShader(20),
|
||||||
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : blueprint_circles.py
|
|
||||||
# Author : Emmanuel Turquin
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Produces a blueprint using circular contour strokes
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,16 +11,21 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : blueprint_circles.py
|
||||||
from logical_operators import *
|
# Author : Emmanuel Turquin
|
||||||
from PredicatesB1D import *
|
# Date : 04/08/2005
|
||||||
from PredicatesU1D import *
|
# Purpose : Produces a blueprint using circular contour strokes
|
||||||
from shaders import *
|
|
||||||
|
from Freestyle import ChainPredicateIterator, ConstantThicknessShader, ContourUP1D, IncreasingColorShader, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, SameShapeIdBP1D, TextureAssignerShader, TrueUP1D
|
||||||
|
from PredicatesU1D import pyHigherLengthUP1D
|
||||||
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
|
from shaders import pyBluePrintCirclesShader, pyPerlinNoise1DShader
|
||||||
|
|
||||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
|
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
|
||||||
bpred = SameShapeIdBP1D()
|
bpred = SameShapeIdBP1D()
|
||||||
@@ -41,6 +37,6 @@ shaders_list = [
|
|||||||
pyBluePrintCirclesShader(3),
|
pyBluePrintCirclesShader(3),
|
||||||
pyPerlinNoise1DShader(0.1, 15, 8),
|
pyPerlinNoise1DShader(0.1, 15, 8),
|
||||||
TextureAssignerShader(4),
|
TextureAssignerShader(4),
|
||||||
IncreasingColorShader(0.8, 0.8, 0.3, 0.4, 0.3, 0.3, 0.3, 0.1)
|
IncreasingColorShader(0.8, 0.8, 0.3, 0.4, 0.3, 0.3, 0.3, 0.1),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : blueprint_ellipses.py
|
|
||||||
# Author : Emmanuel Turquin
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Produces a blueprint using elliptic contour strokes
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,16 +11,21 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : blueprint_ellipses.py
|
||||||
from logical_operators import *
|
# Author : Emmanuel Turquin
|
||||||
from PredicatesB1D import *
|
# Date : 04/08/2005
|
||||||
from PredicatesU1D import *
|
# Purpose : Produces a blueprint using elliptic contour strokes
|
||||||
from shaders import *
|
|
||||||
|
from Freestyle import ChainPredicateIterator, ConstantThicknessShader, ContourUP1D, IncreasingColorShader, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, SameShapeIdBP1D, TextureAssignerShader, TrueUP1D
|
||||||
|
from PredicatesU1D import pyHigherLengthUP1D
|
||||||
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
|
from shaders import pyBluePrintEllipsesShader, pyPerlinNoise1DShader
|
||||||
|
|
||||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
|
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
|
||||||
bpred = SameShapeIdBP1D()
|
bpred = SameShapeIdBP1D()
|
||||||
@@ -41,6 +37,6 @@ shaders_list = [
|
|||||||
pyBluePrintEllipsesShader(3),
|
pyBluePrintEllipsesShader(3),
|
||||||
pyPerlinNoise1DShader(0.1, 10, 8),
|
pyPerlinNoise1DShader(0.1, 10, 8),
|
||||||
TextureAssignerShader(4),
|
TextureAssignerShader(4),
|
||||||
IncreasingColorShader(0.6, 0.3, 0.3, 0.7, 0.3, 0.3, 0.3, 0.1)
|
IncreasingColorShader(0.6, 0.3, 0.3, 0.7, 0.3, 0.3, 0.3, 0.1),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,12 +1,4 @@
|
|||||||
# Filename : blueprint_squares.py
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Author : Emmanuel Turquin
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Produces a blueprint using square contour strokes
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -19,15 +11,21 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
from freestyle_init import *
|
|
||||||
from logical_operators import *
|
# Filename : blueprint_squares.py
|
||||||
from PredicatesB1D import *
|
# Author : Emmanuel Turquin
|
||||||
from PredicatesU1D import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : Produces a blueprint using square contour strokes
|
||||||
|
|
||||||
|
from Freestyle import ChainPredicateIterator, ConstantThicknessShader, ContourUP1D, IncreasingColorShader, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, SameShapeIdBP1D, TextureAssignerShader, TrueUP1D
|
||||||
|
from PredicatesU1D import pyHigherLengthUP1D
|
||||||
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
|
from shaders import pyBluePrintSquaresShader, pyPerlinNoise1DShader
|
||||||
|
|
||||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
|
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
|
||||||
bpred = SameShapeIdBP1D()
|
bpred = SameShapeIdBP1D()
|
||||||
@@ -40,6 +38,6 @@ shaders_list = [
|
|||||||
pyPerlinNoise1DShader(0.07, 10, 8),
|
pyPerlinNoise1DShader(0.07, 10, 8),
|
||||||
TextureAssignerShader(4),
|
TextureAssignerShader(4),
|
||||||
IncreasingColorShader(0.6, 0.3, 0.3, 0.7, 0.6, 0.3, 0.3, 0.3),
|
IncreasingColorShader(0.6, 0.3, 0.3, 0.7, 0.6, 0.3, 0.3, 0.3),
|
||||||
ConstantThicknessShader(4)
|
ConstantThicknessShader(4),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,15 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : cartoon.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws colored lines. The color is automatically
|
|
||||||
# infered from each object's material in a cartoon-like
|
|
||||||
# fashion.
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -22,21 +11,28 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : cartoon.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesB1D import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : Draws colored lines. The color is automatically
|
||||||
|
# infered from each object's material in a cartoon-like
|
||||||
|
# fashion.
|
||||||
|
|
||||||
|
from Freestyle import BezierCurveShader, ChainSilhouetteIterator, ConstantThicknessShader, Operators, \
|
||||||
|
QuantitativeInvisibilityUP1D, TrueUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
from shaders import pyMaterialColorShader
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
shaders_list = [
|
shaders_list = [
|
||||||
BezierCurveShader(3),
|
BezierCurveShader(3),
|
||||||
ConstantThicknessShader(4),
|
ConstantThicknessShader(4),
|
||||||
pyMaterialColorShader(0.8)
|
pyMaterialColorShader(0.8),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : contour.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws each object's visible contour
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,23 +11,27 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : contour.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesB1D import *
|
# Date : 04/08/2005
|
||||||
from PredicatesU1D import *
|
# Purpose : Draws each object's visible contour
|
||||||
from shaders import *
|
|
||||||
|
from Freestyle import BezierCurveShader, ChainSilhouetteIterator, ConstantThicknessShader, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, TrueUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
from shaders import pyMaterialColorShader
|
||||||
|
|
||||||
Operators.select(AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D()))
|
Operators.select(AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D()))
|
||||||
bpred = SameShapeIdBP1D();
|
bpred = SameShapeIdBP1D()
|
||||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
|
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
|
||||||
Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
shaders_list = [
|
shaders_list = [
|
||||||
ConstantThicknessShader(5.0),
|
ConstantThicknessShader(5.0),
|
||||||
IncreasingColorShader(0.8,0,0,1,0.1,0,0,1)
|
IncreasingColorShader(0.8,0,0,1,0.1,0,0,1),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,14 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : curvature2d.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : The stroke points are colored in gray levels and depending
|
|
||||||
# on the 2d curvature value
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -21,14 +11,21 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : curvature2d.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from shaders import *
|
# Date : 04/08/2005
|
||||||
|
# Purpose : The stroke points are colored in gray levels and depending
|
||||||
|
# on the 2d curvature value
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantThicknessShader, Operators, \
|
||||||
|
QuantitativeInvisibilityUP1D, Stroke, StrokeTextureShader, TrueUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
from shaders import py2DCurvatureColorShader
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : external_contour.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws the external contour of the scene
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,24 +11,26 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : external_contour.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesB1D import *
|
# Date : 04/08/2005
|
||||||
from PredicatesU1D import *
|
# Purpose : Draws the external contour of the scene
|
||||||
from ChainingIterators import *
|
|
||||||
from shaders import *
|
from Freestyle import ChainPredicateIterator, ConstantColorShader, ConstantThicknessShader, \
|
||||||
|
ExternalContourUP1D, Operators, QuantitativeInvisibilityUP1D, TrueBP1D, TrueUP1D
|
||||||
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
|
|
||||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
|
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
|
||||||
Operators.select(upred)
|
Operators.select(upred)
|
||||||
bpred = TrueBP1D();
|
bpred = TrueBP1D()
|
||||||
Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(upred))
|
Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(upred))
|
||||||
shaders_list = [
|
shaders_list = [
|
||||||
ConstantThicknessShader(3),
|
ConstantThicknessShader(3),
|
||||||
ConstantColorShader(0.0, 0.0, 0.0,1)
|
ConstantColorShader(0.0, 0.0, 0.0, 1),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,15 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : external_contour_sketchy.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws the external contour of the scene using a sketchy
|
|
||||||
# chaining iterator (in particular each ViewEdge can be drawn
|
|
||||||
# several times
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -22,17 +11,23 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
# Filename : external_contour_sketchy.py
|
||||||
|
# Author : Stephane Grabli
|
||||||
|
# Date : 04/08/2005
|
||||||
|
# Purpose : Draws the external contour of the scene using a sketchy
|
||||||
|
# chaining iterator (in particular each ViewEdge can be drawn
|
||||||
|
# several times
|
||||||
|
|
||||||
from freestyle_init import *
|
from ChainingIterators import pySketchyChainingIterator
|
||||||
from logical_operators import *
|
from Freestyle import ExternalContourUP1D, IncreasingColorShader, IncreasingThicknessShader, \
|
||||||
from ChainingIterators import *
|
Operators, QuantitativeInvisibilityUP1D, SamplingShader, SmoothingShader, SpatialNoiseShader, \
|
||||||
from shaders import *
|
TextureAssignerShader, TrueUP1D
|
||||||
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
|
|
||||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
|
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
|
||||||
Operators.select(upred)
|
Operators.select(upred)
|
||||||
@@ -43,6 +38,6 @@ shaders_list = [
|
|||||||
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),
|
||||||
TextureAssignerShader(4)
|
TextureAssignerShader(4),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : external_contour_smooth.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws a smooth external contour
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,25 +11,29 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
from freestyle_init import *
|
|
||||||
from logical_operators import *
|
# Filename : external_contour_smooth.py
|
||||||
from PredicatesB1D import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesU1D import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : Draws a smooth external contour
|
||||||
from ChainingIterators import *
|
|
||||||
|
from Freestyle import ChainPredicateIterator, ExternalContourUP1D, IncreasingColorShader, \
|
||||||
|
IncreasingThicknessShader, Operators, QuantitativeInvisibilityUP1D, SamplingShader, \
|
||||||
|
SmoothingShader, TrueBP1D, TrueUP1D
|
||||||
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
|
|
||||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
|
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
|
||||||
Operators.select(upred)
|
Operators.select(upred)
|
||||||
bpred = TrueBP1D();
|
bpred = TrueBP1D()
|
||||||
Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(upred))
|
Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(upred))
|
||||||
shaders_list = [
|
shaders_list = [
|
||||||
SamplingShader(2),
|
SamplingShader(2),
|
||||||
IncreasingThicknessShader(4,20),
|
IncreasingThicknessShader(4,20),
|
||||||
IncreasingColorShader(1.0, 0.0, 0.5,1, 0.5,1, 0.3, 1),
|
IncreasingColorShader(1.0, 0.0, 0.5,1, 0.5,1, 0.3, 1),
|
||||||
SmoothingShader(100, 0.05, 0, 0.2, 0, 0, 0, 1)
|
SmoothingShader(100, 0.05, 0, 0.2, 0, 0, 0, 1),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,3 +0,0 @@
|
|||||||
1suggestive.py
|
|
||||||
1ridges.py
|
|
||||||
1nor_suggestive_or_ridges.py
|
|
@@ -1,2 +0,0 @@
|
|||||||
from Freestyle import *
|
|
||||||
from mathutils import Vector
|
|
@@ -1,16 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : haloing.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : This style module selects the lines that
|
|
||||||
# are connected (in the image) to a specific
|
|
||||||
# object and trims them in order to produce
|
|
||||||
# a haloing effect around the target shape
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -23,16 +11,24 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : haloing.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesU1D import *
|
# Date : 04/08/2005
|
||||||
from PredicatesB1D import *
|
# Purpose : This style module selects the lines that
|
||||||
from shaders import *
|
# are connected (in the image) to a specific
|
||||||
|
# object and trims them in order to produce
|
||||||
|
# a haloing effect around the target shape
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, Id, IncreasingColorShader, IncreasingThicknessShader, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TipRemoverShader, TrueUP1D
|
||||||
|
from PredicatesU1D import pyIsOccludedByUP1D
|
||||||
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
|
from shaders import 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)
|
||||||
@@ -45,6 +41,6 @@ shaders_list = [
|
|||||||
IncreasingColorShader(1,0,0, 1,0,1,0,1),
|
IncreasingColorShader(1,0,0, 1,0,1,0,1),
|
||||||
SamplingShader(1.0),
|
SamplingShader(1.0),
|
||||||
pyTVertexRemoverShader(),
|
pyTVertexRemoverShader(),
|
||||||
TipRemoverShader(3.0)
|
TipRemoverShader(3.0),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : ignore_small_oclusions.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : The strokes are drawn through small occlusions
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,15 +11,19 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : ignore_small_oclusions.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from ChainingIterators import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : The strokes are drawn through small occlusions
|
||||||
|
|
||||||
|
from ChainingIterators import pyFillOcclusionsAbsoluteChainingIterator
|
||||||
|
from Freestyle import ConstantColorShader, ConstantThicknessShader, Operators, \
|
||||||
|
QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
#Operators.bidirectional_chain(pyFillOcclusionsChainingIterator(0.1))
|
#Operators.bidirectional_chain(pyFillOcclusionsChainingIterator(0.1))
|
||||||
|
@@ -1,14 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : invisible_lines.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws all lines whose Quantitative Invisibility
|
|
||||||
# is different from 0
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -21,15 +11,20 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : invisible_lines.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from ChainingIterators import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : Draws all lines whose Quantitative Invisibility
|
||||||
|
# is different from 0
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
|
||||||
upred = NotUP1D(QuantitativeInvisibilityUP1D(0))
|
upred = NotUP1D(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.select(upred)
|
Operators.select(upred)
|
||||||
@@ -37,6 +32,6 @@ Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred))
|
|||||||
shaders_list = [
|
shaders_list = [
|
||||||
SamplingShader(5.0),
|
SamplingShader(5.0),
|
||||||
ConstantThicknessShader(3.0),
|
ConstantThicknessShader(3.0),
|
||||||
ConstantColorShader(0.7,0.7,0.7)
|
ConstantColorShader(0.7, 0.7, 0.7),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : japanese_bigbrush.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Simulates a big brush fr oriental painting
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,17 +11,25 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : japanese_bigbrush.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesU1D import *
|
# Date : 04/08/2005
|
||||||
from PredicatesB1D import *
|
# Purpose : Simulates a big brush fr oriental painting
|
||||||
from Functions0D import *
|
|
||||||
from shaders import *
|
from Freestyle import BezierCurveShader, ChainSilhouetteIterator, ConstantColorShader, \
|
||||||
|
ConstantThicknessShader, IntegrationType, Operators, QuantitativeInvisibilityUP1D, \
|
||||||
|
SamplingShader, TextureAssignerShader, TipRemoverShader
|
||||||
|
from Functions0D import pyInverseCurvature2DAngleF0D
|
||||||
|
from PredicatesB1D import pyLengthBP1D
|
||||||
|
from PredicatesU0D import pyParameterUP0D
|
||||||
|
from PredicatesU1D import pyDensityUP1D, pyHigherLengthUP1D, pyHigherNumberOfTurnsUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
from shaders import pyNonLinearVaryingThicknessShader, pySamplingShader
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
@@ -51,10 +50,7 @@ shaders_list = [
|
|||||||
pyNonLinearVaryingThicknessShader(4, 25, 0.6),
|
pyNonLinearVaryingThicknessShader(4, 25, 0.6),
|
||||||
TextureAssignerShader(6),
|
TextureAssignerShader(6),
|
||||||
ConstantColorShader(0.2, 0.2, 0.2,1.0),
|
ConstantColorShader(0.2, 0.2, 0.2,1.0),
|
||||||
TipRemoverShader(10)
|
TipRemoverShader(10),
|
||||||
]
|
]
|
||||||
|
|
||||||
## Use the causal density to avoid cluttering
|
## Use the causal density to avoid cluttering
|
||||||
Operators.create(pyDensityUP1D(8, 0.4, IntegrationType.MEAN), shaders_list)
|
Operators.create(pyDensityUP1D(8, 0.4, IntegrationType.MEAN), shaders_list)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,22 @@
|
|||||||
from freestyle_init import *
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
from Freestyle import UnaryPredicate1D
|
||||||
|
|
||||||
class AndUP1D(UnaryPredicate1D):
|
class AndUP1D(UnaryPredicate1D):
|
||||||
def __init__(self, pred1, pred2):
|
def __init__(self, pred1, pred2):
|
||||||
@@ -21,4 +39,4 @@ class NotUP1D(UnaryPredicate1D):
|
|||||||
UnaryPredicate1D.__init__(self)
|
UnaryPredicate1D.__init__(self)
|
||||||
self.__pred = pred
|
self.__pred = pred
|
||||||
def __call__(self, inter):
|
def __call__(self, inter):
|
||||||
return self.__pred(inter) == 0
|
return not self.__pred(inter)
|
||||||
|
@@ -1,20 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : long_anisotropically_dense.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Selects the lines that are long and have a high anisotropic
|
|
||||||
# a priori density and uses causal density
|
|
||||||
# to draw without cluttering. Ideally, half of the
|
|
||||||
# selected lines are culled using the causal density.
|
|
||||||
#
|
|
||||||
# ********************* WARNING *************************************
|
|
||||||
# ******** The Directional a priori density maps must ******
|
|
||||||
# ******** have been computed prior to using this style module ******
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -27,19 +11,28 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : long_anisotropically_dense.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesU1D import *
|
# Date : 04/08/2005
|
||||||
from PredicatesU0D import *
|
# Purpose : Selects the lines that are long and have a high anisotropic
|
||||||
from PredicatesB1D import *
|
# a priori density and uses causal density
|
||||||
from Functions0D import *
|
# to draw without cluttering. Ideally, half of the
|
||||||
from Functions1D import *
|
# selected lines are culled using the causal density.
|
||||||
from shaders import *
|
#
|
||||||
|
# ********************* WARNING *************************************
|
||||||
|
# ******** The Directional a priori density maps must ******
|
||||||
|
# ******** have been computed prior to using this style module ******
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, DensityF1D, \
|
||||||
|
IntegrationType, Operators, QuantitativeInvisibilityUP1D, SamplingShader, UnaryPredicate1D
|
||||||
|
from PredicatesB1D import pyLengthBP1D
|
||||||
|
from PredicatesU1D import pyHighDensityAnisotropyUP1D, pyHigherLengthUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
|
||||||
## custom density predicate
|
## custom density predicate
|
||||||
class pyDensityUP1D(UnaryPredicate1D):
|
class pyDensityUP1D(UnaryPredicate1D):
|
||||||
@@ -53,10 +46,10 @@ class pyDensityUP1D(UnaryPredicate1D):
|
|||||||
def __call__(self, inter):
|
def __call__(self, inter):
|
||||||
c = self._func(inter)
|
c = self._func(inter)
|
||||||
m = self._func2(inter)
|
m = self._func2(inter)
|
||||||
if(c < self._threshold):
|
if c < self._threshold:
|
||||||
return 1
|
return 1
|
||||||
if( m > 4* c ):
|
if m > 4*c:
|
||||||
if ( c < 1.5*self._threshold ):
|
if c < 1.5*self._threshold:
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -73,5 +66,3 @@ shaders_list = [
|
|||||||
]
|
]
|
||||||
## uniform culling
|
## uniform culling
|
||||||
Operators.create(pyDensityUP1D(3.0,2.0e-2, IntegrationType.MEAN, 0.1), shaders_list)
|
Operators.create(pyDensityUP1D(3.0,2.0e-2, IntegrationType.MEAN, 0.1), shaders_list)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,19 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : multiple_parameterization.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : The thickness and the color of the strokes vary continuously
|
|
||||||
# independently from occlusions although only
|
|
||||||
# visible lines are actually drawn. This is equivalent
|
|
||||||
# to assigning the thickness using a parameterization covering
|
|
||||||
# the complete silhouette (visible+invisible) and drawing
|
|
||||||
# the strokes using a second parameterization that only
|
|
||||||
# covers the visible portions.
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -26,15 +11,26 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : multiple_parameterization.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from ChainingIterators import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : The thickness and the color of the strokes vary continuously
|
||||||
|
# independently from occlusions although only
|
||||||
|
# visible lines are actually drawn. This is equivalent
|
||||||
|
# to assigning the thickness using a parameterization covering
|
||||||
|
# the complete silhouette (visible+invisible) and drawing
|
||||||
|
# the strokes using a second parameterization that only
|
||||||
|
# covers the visible portions.
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, IncreasingColorShader, \
|
||||||
|
IncreasingThicknessShader, Operators, QuantitativeInvisibilityUP1D, SamplingShader, \
|
||||||
|
TextureAssignerShader, TrueUP1D
|
||||||
|
from shaders import 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
|
||||||
@@ -46,6 +42,6 @@ shaders_list = [
|
|||||||
ConstantColorShader(0.0, 0.0, 0.0),
|
ConstantColorShader(0.0, 0.0, 0.0),
|
||||||
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
|
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
|
||||||
TextureAssignerShader(-1),
|
TextureAssignerShader(-1),
|
||||||
pyHLRShader() ## this shader draws only visible portions
|
pyHLRShader(), ## this shader draws only visible portions
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,17 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : nature.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Uses the NatureUP1D predicate to select the lines
|
|
||||||
# of a given type (among Nature.SILHOUETTE, Nature.CREASE, Nature.SUGGESTIVE_CONTOURS,
|
|
||||||
# Nature.BORDERS).
|
|
||||||
# The suggestive contours must have been enabled in the
|
|
||||||
# options dialog to appear in the View Map.
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -24,20 +11,29 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : nature.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesB1D import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : Uses the NatureUP1D predicate to select the lines
|
||||||
|
# of a given type (among Nature.SILHOUETTE, Nature.CREASE, Nature.SUGGESTIVE_CONTOURS,
|
||||||
|
# Nature.BORDERS).
|
||||||
|
# The suggestive contours must have been enabled in the
|
||||||
|
# options dialog to appear in the View Map.
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, IncreasingColorShader, \
|
||||||
|
IncreasingThicknessShader, Nature, Operators, TrueUP1D
|
||||||
|
from PredicatesU1D import pyNatureUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
|
||||||
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)))
|
||||||
shaders_list = [
|
shaders_list = [
|
||||||
IncreasingThicknessShader(3, 10),
|
IncreasingThicknessShader(3, 10),
|
||||||
IncreasingColorShader(0.0,0.0,0.0, 1, 0.8,0,0,1)
|
IncreasingColorShader(0.0, 0.0, 0.0, 1, 0.8, 0, 0, 1),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,14 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : near_lines.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws the lines that are "closer" than a threshold
|
|
||||||
# (between 0 and 1)
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -21,17 +11,21 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
# Filename : near_lines.py
|
||||||
|
# Author : Stephane Grabli
|
||||||
|
# Date : 04/08/2005
|
||||||
|
# Purpose : Draws the lines that are "closer" than a threshold
|
||||||
|
# (between 0 and 1)
|
||||||
|
|
||||||
from freestyle_init import *
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \
|
||||||
from logical_operators import *
|
IntegrationType, Operators, QuantitativeInvisibilityUP1D, TextureAssignerShader, TrueUP1D
|
||||||
from PredicatesB1D import *
|
from PredicatesU1D import pyZSmallerUP1D
|
||||||
from PredicatesU1D import *
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
from shaders import *
|
|
||||||
|
|
||||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyZSmallerUP1D(0.5, IntegrationType.MEAN))
|
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyZSmallerUP1D(0.5, IntegrationType.MEAN))
|
||||||
Operators.select(upred)
|
Operators.select(upred)
|
||||||
@@ -39,6 +33,6 @@ Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred))
|
|||||||
shaders_list = [
|
shaders_list = [
|
||||||
TextureAssignerShader(-1),
|
TextureAssignerShader(-1),
|
||||||
ConstantThicknessShader(5),
|
ConstantThicknessShader(5),
|
||||||
ConstantColorShader(0.0, 0.0, 0.0)
|
ConstantColorShader(0.0, 0.0, 0.0),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : occluded_by_specific_object.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws only the lines that are occluded by a given object
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,26 +11,30 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : occluded_by_specific_object.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesU1D import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : Draws only the lines that are occluded by a given object
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \
|
||||||
|
Id, Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D
|
||||||
|
from PredicatesU1D import pyIsInOccludersListUP1D
|
||||||
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
|
|
||||||
## 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)
|
||||||
id = Id(3,0)
|
id = Id(3,0)
|
||||||
upred = AndUP1D(NotUP1D(QuantitativeInvisibilityUP1D(0)),
|
upred = AndUP1D(NotUP1D(QuantitativeInvisibilityUP1D(0)), pyIsInOccludersListUP1D(id))
|
||||||
pyIsInOccludersListUP1D(id))
|
|
||||||
Operators.select(upred)
|
Operators.select(upred)
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred))
|
||||||
shaders_list = [
|
shaders_list = [
|
||||||
SamplingShader(5),
|
SamplingShader(5),
|
||||||
ConstantThicknessShader(3),
|
ConstantThicknessShader(3),
|
||||||
ConstantColorShader(0.3,0.3,0.3,1)
|
ConstantColorShader(0.3, 0.3, 0.3, 1),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -21,10 +21,17 @@ import math
|
|||||||
import mathutils
|
import mathutils
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from freestyle_init import *
|
from ChainingIterators import pySketchyChainSilhouetteIterator, pySketchyChainingIterator
|
||||||
from logical_operators import *
|
from Freestyle import BackboneStretcherShader, BezierCurveShader, BinaryPredicate1D, ChainPredicateIterator, \
|
||||||
from ChainingIterators import *
|
ChainSilhouetteIterator, ConstantColorShader, ContourUP1D, Curvature2DAngleF0D, ExternalContourUP1D, \
|
||||||
from shaders import *
|
FalseBP1D, FalseUP1D, GuidingLinesShader, Interface0DIterator, Nature, Noise, Normal2DF0D, Operators, \
|
||||||
|
PolygonalizationShader, QuantitativeInvisibilityF1D, QuantitativeInvisibilityUP1D, SamplingShader, \
|
||||||
|
SpatialNoiseShader, StrokeAttribute, StrokeShader, TipRemoverShader, TrueBP1D, TrueUP1D, UnaryPredicate0D, \
|
||||||
|
UnaryPredicate1D, VertexOrientation2DF0D, WithinImageBoundaryUP1D
|
||||||
|
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):
|
||||||
@@ -498,7 +505,7 @@ class PerlinNoise1DShader(StrokeShader):
|
|||||||
self.__freq = freq
|
self.__freq = freq
|
||||||
self.__amp = amp
|
self.__amp = amp
|
||||||
self.__oct = oct
|
self.__oct = oct
|
||||||
self.__dir = Vector([cos(angle), sin(angle)])
|
self.__dir = mathutils.Vector([math.cos(angle), math.sin(angle)])
|
||||||
def shade(self, stroke):
|
def shade(self, stroke):
|
||||||
length = stroke.length_2d
|
length = stroke.length_2d
|
||||||
it = stroke.stroke_vertices_begin()
|
it = stroke.stroke_vertices_begin()
|
||||||
@@ -516,12 +523,12 @@ class PerlinNoise2DShader(StrokeShader):
|
|||||||
self.__freq = freq
|
self.__freq = freq
|
||||||
self.__amp = amp
|
self.__amp = amp
|
||||||
self.__oct = oct
|
self.__oct = oct
|
||||||
self.__dir = Vector([cos(angle), sin(angle)])
|
self.__dir = mathutils.Vector([math.cos(angle), math.sin(angle)])
|
||||||
def shade(self, stroke):
|
def shade(self, stroke):
|
||||||
it = stroke.stroke_vertices_begin()
|
it = stroke.stroke_vertices_begin()
|
||||||
while not it.is_end:
|
while not it.is_end:
|
||||||
v = it.object
|
v = it.object
|
||||||
vec = Vector([v.projected_x, v.projected_y])
|
vec = mathutils.Vector([v.projected_x, v.projected_y])
|
||||||
nres = self.__noise.turbulence2(vec, self.__freq, self.__amp, self.__oct)
|
nres = self.__noise.turbulence2(vec, self.__freq, self.__amp, self.__oct)
|
||||||
v.point = v.point + nres * self.__dir
|
v.point = v.point + nres * self.__dir
|
||||||
it.increment()
|
it.increment()
|
||||||
@@ -532,7 +539,7 @@ class Offset2DShader(StrokeShader):
|
|||||||
StrokeShader.__init__(self)
|
StrokeShader.__init__(self)
|
||||||
self.__start = start
|
self.__start = start
|
||||||
self.__end = end
|
self.__end = end
|
||||||
self.__xy = Vector([x, y])
|
self.__xy = mathutils.Vector([x, y])
|
||||||
self.__getNormal = Normal2DF0D()
|
self.__getNormal = Normal2DF0D()
|
||||||
def shade(self, stroke):
|
def shade(self, stroke):
|
||||||
it = stroke.stroke_vertices_begin()
|
it = stroke.stroke_vertices_begin()
|
||||||
@@ -582,7 +589,7 @@ class Transform2DShader(StrokeShader):
|
|||||||
delta = u - self.__pivot_u
|
delta = u - self.__pivot_u
|
||||||
pivot = p + delta * (prev - p)
|
pivot = p + delta * (prev - p)
|
||||||
elif self.__pivot == "CENTER":
|
elif self.__pivot == "CENTER":
|
||||||
pivot = Vector([0.0, 0.0])
|
pivot = mathutils.Vector([0.0, 0.0])
|
||||||
n = 0
|
n = 0
|
||||||
it = stroke.stroke_vertices_begin()
|
it = stroke.stroke_vertices_begin()
|
||||||
while not it.is_end:
|
while not it.is_end:
|
||||||
@@ -593,7 +600,7 @@ class Transform2DShader(StrokeShader):
|
|||||||
pivot.x = pivot.x / n
|
pivot.x = pivot.x / n
|
||||||
pivot.y = pivot.y / n
|
pivot.y = pivot.y / n
|
||||||
elif self.__pivot == "ABSOLUTE":
|
elif self.__pivot == "ABSOLUTE":
|
||||||
pivot = Vector([self.__pivot_x, self.__pivot_y])
|
pivot = mathutils.Vector([self.__pivot_x, self.__pivot_y])
|
||||||
# apply scaling and rotation operations
|
# apply scaling and rotation operations
|
||||||
cos_theta = math.cos(self.__angle)
|
cos_theta = math.cos(self.__angle)
|
||||||
sin_theta = math.sin(self.__angle)
|
sin_theta = math.sin(self.__angle)
|
||||||
@@ -662,7 +669,7 @@ class RoundCapShader(StrokeShader):
|
|||||||
# save the location and attribute of stroke vertices
|
# save the location and attribute of stroke vertices
|
||||||
buffer = []
|
buffer = []
|
||||||
for sv in iter_stroke_vertices(stroke):
|
for sv in iter_stroke_vertices(stroke):
|
||||||
buffer.append((Vector(sv.point), StrokeAttribute(sv.attribute)))
|
buffer.append((mathutils.Vector(sv.point), StrokeAttribute(sv.attribute)))
|
||||||
nverts = len(buffer)
|
nverts = len(buffer)
|
||||||
if nverts < 2:
|
if nverts < 2:
|
||||||
return
|
return
|
||||||
@@ -714,7 +721,7 @@ class SquareCapShader(StrokeShader):
|
|||||||
# save the location and attribute of stroke vertices
|
# save the location and attribute of stroke vertices
|
||||||
buffer = []
|
buffer = []
|
||||||
for sv in iter_stroke_vertices(stroke):
|
for sv in iter_stroke_vertices(stroke):
|
||||||
buffer.append((Vector(sv.point), StrokeAttribute(sv.attribute)))
|
buffer.append((mathutils.Vector(sv.point), StrokeAttribute(sv.attribute)))
|
||||||
nverts = len(buffer)
|
nverts = len(buffer)
|
||||||
if nverts < 2:
|
if nverts < 2:
|
||||||
return
|
return
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : polygonalize.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Make the strokes more "polygonal"
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,14 +11,19 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
from freestyle_init import *
|
|
||||||
from logical_operators import *
|
# Filename : polygonalize.py
|
||||||
from ChainingIterators import *
|
# Author : Stephane Grabli
|
||||||
from shaders import *
|
# Date : 04/08/2005
|
||||||
|
# Purpose : Make the strokes more "polygonal"
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \
|
||||||
|
Operators, PolygonalizationShader, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
@@ -35,6 +31,6 @@ shaders_list = [
|
|||||||
SamplingShader(2.0),
|
SamplingShader(2.0),
|
||||||
ConstantThicknessShader(3),
|
ConstantThicknessShader(3),
|
||||||
ConstantColorShader(0.0, 0.0, 0.0),
|
ConstantColorShader(0.0, 0.0, 0.0),
|
||||||
PolygonalizationShader(8)
|
PolygonalizationShader(8),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,14 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : qi0.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws the visible lines (chaining follows same nature lines)
|
|
||||||
# (most basic style module)
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -21,15 +11,20 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : qi0.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from ChainingIterators import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : Draws the visible lines (chaining follows same nature lines)
|
||||||
|
# (most basic style module)
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
|
@@ -1,14 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : qi0_not_external_contour.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws the visible lines (chaining follows same nature lines)
|
|
||||||
# that do not belong to the external contour of the scene
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -21,13 +11,21 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : qi0_not_external_contour.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
|
# Date : 04/08/2005
|
||||||
|
# Purpose : Draws the visible lines (chaining follows same nature lines)
|
||||||
|
# that do not belong to the external contour of the scene
|
||||||
|
|
||||||
|
from Freestyle import BackboneStretcherShader, ChainSilhouetteIterator, ExternalContourUP1D, \
|
||||||
|
IncreasingColorShader, IncreasingThicknessShader, Operators, QuantitativeInvisibilityUP1D, \
|
||||||
|
SamplingShader, SpatialNoiseShader, TextureAssignerShader, TrueUP1D
|
||||||
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
|
|
||||||
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
|
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ExternalContourUP1D())
|
||||||
Operators.select(upred)
|
Operators.select(upred)
|
||||||
@@ -38,6 +36,6 @@ shaders_list = [
|
|||||||
IncreasingThicknessShader(2, 5),
|
IncreasingThicknessShader(2, 5),
|
||||||
BackboneStretcherShader(20),
|
BackboneStretcherShader(20),
|
||||||
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
|
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
|
||||||
TextureAssignerShader(4)
|
TextureAssignerShader(4),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,15 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : qi1.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws lines hidden by one surface.
|
|
||||||
# *** Quantitative Invisibility must have been
|
|
||||||
# enabled in the options dialog to use this style module ****
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -22,15 +11,21 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : qi1.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesB1D import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : Draws lines hidden by one surface.
|
||||||
|
# *** Quantitative Invisibility must have been
|
||||||
|
# enabled in the options dialog to use this style module ****
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(1))
|
Operators.select(QuantitativeInvisibilityUP1D(1))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(1)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(1)))
|
||||||
|
@@ -1,15 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : qi2.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws lines hidden by two surfaces.
|
|
||||||
# *** Quantitative Invisibility must have been
|
|
||||||
# enabled in the options dialog to use this style module ****
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -22,21 +11,27 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : qi2.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesB1D import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : Draws lines hidden by two surfaces.
|
||||||
|
# *** Quantitative Invisibility must have been
|
||||||
|
# enabled in the options dialog to use this style module ****
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(2))
|
Operators.select(QuantitativeInvisibilityUP1D(2))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(2)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(2)))
|
||||||
shaders_list = [
|
shaders_list = [
|
||||||
SamplingShader(10),
|
SamplingShader(10),
|
||||||
ConstantThicknessShader(1.5),
|
ConstantThicknessShader(1.5),
|
||||||
ConstantColorShader(0.7,0.7,0.7, 1)
|
ConstantColorShader(0.7, 0.7, 0.7, 1),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,15 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : sequentialsplit_sketchy.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Use the sequential split with two different
|
|
||||||
# predicates to specify respectively the starting and
|
|
||||||
# the stopping extremities for strokes
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -22,16 +11,22 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : sequentialsplit_sketchy.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesU1D import *
|
# Date : 04/08/2005
|
||||||
from PredicatesU0D import *
|
# Purpose : Use the sequential split with two different
|
||||||
from Functions0D import *
|
# predicates to specify respectively the starting and
|
||||||
|
# the stopping extremities for strokes
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, IncreasingThicknessShader, Nature, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, SpatialNoiseShader, TextureAssignerShader, TrueUP1D
|
||||||
|
from PredicatesU0D import pyBackTVertexUP0D, pyVertexNatureUP0D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
|
||||||
upred = QuantitativeInvisibilityUP1D(0)
|
upred = QuantitativeInvisibilityUP1D(0)
|
||||||
Operators.select(upred)
|
Operators.select(upred)
|
||||||
@@ -44,7 +39,6 @@ shaders_list = [
|
|||||||
SpatialNoiseShader(7, 120, 2, True, True),
|
SpatialNoiseShader(7, 120, 2, True, True),
|
||||||
IncreasingThicknessShader(5, 8),
|
IncreasingThicknessShader(5, 8),
|
||||||
ConstantColorShader(0.2, 0.2, 0.2, 1),
|
ConstantColorShader(0.2, 0.2, 0.2, 1),
|
||||||
TextureAssignerShader(4)
|
TextureAssignerShader(4),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
|
||||||
|
@@ -1,12 +1,30 @@
|
|||||||
from freestyle_init import *
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
from Freestyle import AdjacencyIterator, Curvature2DAngleF0D, DensityF0D, GetProjectedZF0D, \
|
||||||
|
Interface0DIterator, MaterialF0D, Nature, Noise, Normal2DF0D, Orientation2DF1D, \
|
||||||
|
StrokeAttribute, StrokeShader, StrokeVertexIterator, ZDiscontinuityF0D
|
||||||
from Freestyle import ContextFunctions as CF
|
from Freestyle import ContextFunctions as CF
|
||||||
from PredicatesU0D import *
|
from PredicatesU0D import pyVertexNatureUP0D
|
||||||
from PredicatesB1D import *
|
|
||||||
from PredicatesU1D import *
|
import math
|
||||||
from logical_operators import *
|
import mathutils
|
||||||
from ChainingIterators import *
|
import random
|
||||||
from random import *
|
|
||||||
from math import *
|
|
||||||
|
|
||||||
## thickness modifiers
|
## thickness modifiers
|
||||||
######################
|
######################
|
||||||
@@ -149,8 +167,7 @@ class pyDecreasingThicknessShader(StrokeShader):
|
|||||||
it.increment()
|
it.increment()
|
||||||
|
|
||||||
def smoothC(a, exp):
|
def smoothC(a, exp):
|
||||||
c = pow(float(a),exp)*pow(2.0,exp)
|
return math.pow(float(a), exp) * math.pow(2.0, exp)
|
||||||
return c
|
|
||||||
|
|
||||||
class pyNonLinearVaryingThicknessShader(StrokeShader):
|
class pyNonLinearVaryingThicknessShader(StrokeShader):
|
||||||
def __init__(self, thicknessExtremity, thicknessMiddle, exponent):
|
def __init__(self, thicknessExtremity, thicknessMiddle, exponent):
|
||||||
@@ -192,9 +209,9 @@ class pySLERPThicknessShader(StrokeShader):
|
|||||||
while not it.is_end:
|
while not it.is_end:
|
||||||
c = float(i)/float(n)
|
c = float(i)/float(n)
|
||||||
if i < float(n)/2.0:
|
if i < float(n)/2.0:
|
||||||
t = sin((1-c)*self._omega)/sinh(self._omega)*self._thicknessMin + sin(c*self._omega)/sinh(self._omega) * maxT
|
t = math.sin((1-c)*self._omega)/math.sinh(self._omega)*self._thicknessMin + math.sin(c*self._omega)/math.sinh(self._omega) * maxT
|
||||||
else:
|
else:
|
||||||
t = sin((1-c)*self._omega)/sinh(self._omega)*maxT + sin(c*self._omega)/sinh(self._omega) * self._thicknessMin
|
t = math.sin((1-c)*self._omega)/math.sinh(self._omega)*maxT + math.sin(c*self._omega)/math.sinh(self._omega) * self._thicknessMin
|
||||||
it.object.attribute.thickness = (t/2.0, t/2.0)
|
it.object.attribute.thickness = (t/2.0, t/2.0)
|
||||||
i = i+1
|
i = i+1
|
||||||
it.increment()
|
it.increment()
|
||||||
@@ -255,11 +272,11 @@ class pyImportance2DThicknessShader(StrokeShader):
|
|||||||
self._kmin = float(kmin)
|
self._kmin = float(kmin)
|
||||||
self._kmax = float(kmax)
|
self._kmax = float(kmax)
|
||||||
def shade(self, stroke):
|
def shade(self, stroke):
|
||||||
origin = Vector([self._x, self._y])
|
origin = mathutils.Vector([self._x, self._y])
|
||||||
it = stroke.stroke_vertices_begin()
|
it = stroke.stroke_vertices_begin()
|
||||||
while not it.is_end:
|
while not it.is_end:
|
||||||
v = it.object
|
v = it.object
|
||||||
p = Vector([v.projected_x, v.projected_y])
|
p = mathutils.Vector([v.projected_x, v.projected_y])
|
||||||
d = (p-origin).length
|
d = (p-origin).length
|
||||||
if d > self._w:
|
if d > self._w:
|
||||||
k = self._kmin
|
k = self._kmin
|
||||||
@@ -280,7 +297,7 @@ class pyImportance3DThicknessShader(StrokeShader):
|
|||||||
self._kmin = float(kmin)
|
self._kmin = float(kmin)
|
||||||
self._kmax = float(kmax)
|
self._kmax = float(kmax)
|
||||||
def shade(self, stroke):
|
def shade(self, stroke):
|
||||||
origin = Vector([self._x, self._y, self._z])
|
origin = mathutils.Vector([self._x, self._y, self._z])
|
||||||
it = stroke.stroke_vertices_begin()
|
it = stroke.stroke_vertices_begin()
|
||||||
while not it.is_end:
|
while not it.is_end:
|
||||||
v = it.object
|
v = it.object
|
||||||
@@ -373,7 +390,7 @@ class pyInterpolateColorShader(StrokeShader):
|
|||||||
while not it.is_end:
|
while not it.is_end:
|
||||||
att = it.object.attribute
|
att = it.object.attribute
|
||||||
u = float(inc)/float(n)
|
u = float(inc)/float(n)
|
||||||
c = 1-2*(fabs(u-0.5))
|
c = 1-2*(math.fabs(u-0.5))
|
||||||
att.color = ((1-c)*self._c1[0] + c*self._c2[0],
|
att.color = ((1-c)*self._c1[0] + c*self._c2[0],
|
||||||
(1-c)*self._c1[1] + c*self._c2[1],
|
(1-c)*self._c1[1] + c*self._c2[1],
|
||||||
(1-c)*self._c1[2] + c*self._c2[2])
|
(1-c)*self._c1[2] + c*self._c2[2])
|
||||||
@@ -411,7 +428,7 @@ class pyMaterialColorShader(StrokeShader):
|
|||||||
u = 4.*X / (X + 15.*Y + 3.*Z)
|
u = 4.*X / (X + 15.*Y + 3.*Z)
|
||||||
v = 9.*Y / (X + 15.*Y + 3.*Z)
|
v = 9.*Y / (X + 15.*Y + 3.*Z)
|
||||||
|
|
||||||
L= 116. * pow((Y/Yn),(1./3.)) -16
|
L= 116. * math.pow((Y/Yn),(1./3.)) -16
|
||||||
U = 13. * L * (u - un)
|
U = 13. * L * (u - un)
|
||||||
V = 13. * L * (v - vn)
|
V = 13. * L * (v - vn)
|
||||||
|
|
||||||
@@ -425,7 +442,7 @@ class pyMaterialColorShader(StrokeShader):
|
|||||||
u = U / (13. * L) + un
|
u = U / (13. * L) + un
|
||||||
v = V / (13. * L) + vn
|
v = V / (13. * L) + vn
|
||||||
|
|
||||||
Y = Yn * pow( ((L+16.)/116.), 3.)
|
Y = Yn * math.pow( ((L+16.)/116.), 3.)
|
||||||
X = -9. * Y * u / ((u - 4.)* v - u * v)
|
X = -9. * Y * u / ((u - 4.)* v - u * v)
|
||||||
Z = (9. * Y - 15*v*Y - v*X) /( 3. * v)
|
Z = (9. * Y - 15*v*Y - v*X) /( 3. * v)
|
||||||
|
|
||||||
@@ -443,12 +460,12 @@ class pyMaterialColorShader(StrokeShader):
|
|||||||
class pyRandomColorShader(StrokeShader):
|
class pyRandomColorShader(StrokeShader):
|
||||||
def __init__(self, s=1):
|
def __init__(self, s=1):
|
||||||
StrokeShader.__init__(self)
|
StrokeShader.__init__(self)
|
||||||
seed(s)
|
random.seed(s)
|
||||||
def shade(self, stroke):
|
def shade(self, stroke):
|
||||||
## pick a random color
|
## pick a random color
|
||||||
c0 = float(uniform(15,75))/100.0
|
c0 = float(random.uniform(15,75))/100.0
|
||||||
c1 = float(uniform(15,75))/100.0
|
c1 = float(random.uniform(15,75))/100.0
|
||||||
c2 = float(uniform(15,75))/100.0
|
c2 = float(random.uniform(15,75))/100.0
|
||||||
print(c0, c1, c2)
|
print(c0, c1, c2)
|
||||||
it = stroke.stroke_vertices_begin()
|
it = stroke.stroke_vertices_begin()
|
||||||
while not it.is_end:
|
while not it.is_end:
|
||||||
@@ -506,10 +523,10 @@ class pyBackboneStretcherShader(StrokeShader):
|
|||||||
v1 = it1.object
|
v1 = it1.object
|
||||||
vn_1 = itn_1.object
|
vn_1 = itn_1.object
|
||||||
vn = itn.object
|
vn = itn.object
|
||||||
p0 = Vector([v0.projected_x, v0.projected_y])
|
p0 = mathutils.Vector([v0.projected_x, v0.projected_y])
|
||||||
pn = Vector([vn.projected_x, vn.projected_y])
|
pn = mathutils.Vector([vn.projected_x, vn.projected_y])
|
||||||
p1 = Vector([v1.projected_x, v1.projected_y])
|
p1 = mathutils.Vector([v1.projected_x, v1.projected_y])
|
||||||
pn_1 = Vector([vn_1.projected_x, vn_1.projected_y])
|
pn_1 = mathutils.Vector([vn_1.projected_x, vn_1.projected_y])
|
||||||
d1 = p0-p1
|
d1 = p0-p1
|
||||||
d1.normalize()
|
d1.normalize()
|
||||||
dn = pn-pn_1
|
dn = pn-pn_1
|
||||||
@@ -538,10 +555,10 @@ class pyLengthDependingBackboneStretcherShader(StrokeShader):
|
|||||||
v1 = it1.object
|
v1 = it1.object
|
||||||
vn_1 = itn_1.object
|
vn_1 = itn_1.object
|
||||||
vn = itn.object
|
vn = itn.object
|
||||||
p0 = Vector([v0.projected_x, v0.projected_y])
|
p0 = mathutils.Vector([v0.projected_x, v0.projected_y])
|
||||||
pn = Vector([vn.projected_x, vn.projected_y])
|
pn = mathutils.Vector([vn.projected_x, vn.projected_y])
|
||||||
p1 = Vector([v1.projected_x, v1.projected_y])
|
p1 = mathutils.Vector([v1.projected_x, v1.projected_y])
|
||||||
pn_1 = Vector([vn_1.projected_x, vn_1.projected_y])
|
pn_1 = mathutils.Vector([vn_1.projected_x, vn_1.projected_y])
|
||||||
d1 = p0-p1
|
d1 = p0-p1
|
||||||
d1.normalize()
|
d1.normalize()
|
||||||
dn = pn-pn_1
|
dn = pn-pn_1
|
||||||
@@ -683,8 +700,8 @@ class pyTVertexRemoverShader(StrokeShader):
|
|||||||
class pyExtremitiesOrientationShader(StrokeShader):
|
class pyExtremitiesOrientationShader(StrokeShader):
|
||||||
def __init__(self, x1,y1,x2=0,y2=0):
|
def __init__(self, x1,y1,x2=0,y2=0):
|
||||||
StrokeShader.__init__(self)
|
StrokeShader.__init__(self)
|
||||||
self._v1 = Vector([x1,y1])
|
self._v1 = mathutils.Vector([x1,y1])
|
||||||
self._v2 = Vector([x2,y2])
|
self._v2 = mathutils.Vector([x2,y2])
|
||||||
def shade(self, stroke):
|
def shade(self, stroke):
|
||||||
#print(self._v1.x,self._v1.y)
|
#print(self._v1.x,self._v1.y)
|
||||||
stroke.setBeginningOrientation(self._v1.x,self._v1.y)
|
stroke.setBeginningOrientation(self._v1.x,self._v1.y)
|
||||||
@@ -808,11 +825,11 @@ class pySinusDisplacementShader(StrokeShader):
|
|||||||
n = self._getNormal(Interface0DIterator(it))
|
n = self._getNormal(Interface0DIterator(it))
|
||||||
p = v.point
|
p = v.point
|
||||||
u = v.u
|
u = v.u
|
||||||
a = self._a*(1-2*(fabs(u-0.5)))
|
a = self._a*(1-2*(math.fabs(u-0.5)))
|
||||||
n = n*a*cos(self._f*u*6.28)
|
n = n*a*math.cos(self._f*u*6.28)
|
||||||
#print(n.x, n.y)
|
#print(n.x, n.y)
|
||||||
v.point = p+n
|
v.point = p+n
|
||||||
#v.point = v.point+n*a*cos(f*v.u)
|
#v.point = v.point+n*a*math.cos(f*v.u)
|
||||||
it.increment()
|
it.increment()
|
||||||
stroke.update_length()
|
stroke.update_length()
|
||||||
|
|
||||||
@@ -844,7 +861,7 @@ class pyPerlinNoise2DShader(StrokeShader):
|
|||||||
it = stroke.stroke_vertices_begin()
|
it = stroke.stroke_vertices_begin()
|
||||||
while not it.is_end:
|
while not it.is_end:
|
||||||
v = it.object
|
v = it.object
|
||||||
vec = Vector([v.projected_x, v.projected_y])
|
vec = mathutils.Vector([v.projected_x, v.projected_y])
|
||||||
nres = self.__noise.turbulence2(vec, self.__freq, self.__amp, self.__oct)
|
nres = self.__noise.turbulence2(vec, self.__freq, self.__amp, self.__oct)
|
||||||
v.point = (v.projected_x + nres, v.projected_y + nres)
|
v.point = (v.projected_x + nres, v.projected_y + nres)
|
||||||
it.increment()
|
it.increment()
|
||||||
@@ -883,7 +900,7 @@ class pyBluePrintCirclesShader(StrokeShader):
|
|||||||
sv_nb = sv_nb // self.__turns
|
sv_nb = sv_nb // self.__turns
|
||||||
center = (p_min + p_max) / 2
|
center = (p_min + p_max) / 2
|
||||||
radius = (center.x - p_min.x + center.y - p_min.y) / 2
|
radius = (center.x - p_min.x + center.y - p_min.y) / 2
|
||||||
p_new = Vector([0, 0])
|
p_new = mathutils.Vector([0, 0])
|
||||||
#######################################################
|
#######################################################
|
||||||
R = self.__random_radius
|
R = self.__random_radius
|
||||||
C = self.__random_center
|
C = self.__random_center
|
||||||
@@ -892,14 +909,14 @@ class pyBluePrintCirclesShader(StrokeShader):
|
|||||||
for j in range(self.__turns):
|
for j in range(self.__turns):
|
||||||
prev_radius = radius
|
prev_radius = radius
|
||||||
prev_center = center
|
prev_center = center
|
||||||
radius = radius + randint(-R, R)
|
radius = radius + random.randint(-R, R)
|
||||||
center = center + Vector([randint(-C, C), randint(-C, C)])
|
center = center + mathutils.Vector([random.randint(-C, C), random.randint(-C, C)])
|
||||||
while i < sv_nb and not it.is_end:
|
while i < sv_nb and not it.is_end:
|
||||||
t = float(i) / float(sv_nb - 1)
|
t = float(i) / float(sv_nb - 1)
|
||||||
r = prev_radius + (radius - prev_radius) * t
|
r = prev_radius + (radius - prev_radius) * t
|
||||||
c = prev_center + (center - prev_center) * t
|
c = prev_center + (center - prev_center) * t
|
||||||
p_new.x = c.x + r * cos(2 * pi * t)
|
p_new.x = c.x + r * math.cos(2 * math.pi * t)
|
||||||
p_new.y = c.y + r * sin(2 * pi * t)
|
p_new.y = c.y + r * math.sin(2 * math.pi * t)
|
||||||
it.object.point = p_new
|
it.object.point = p_new
|
||||||
i = i + 1
|
i = i + 1
|
||||||
it.increment()
|
it.increment()
|
||||||
@@ -940,7 +957,7 @@ class pyBluePrintEllipsesShader(StrokeShader):
|
|||||||
sv_nb = sv_nb // self.__turns
|
sv_nb = sv_nb // self.__turns
|
||||||
center = (p_min + p_max) / 2
|
center = (p_min + p_max) / 2
|
||||||
radius = center - p_min
|
radius = center - p_min
|
||||||
p_new = Vector([0, 0])
|
p_new = mathutils.Vector([0, 0])
|
||||||
#######################################################
|
#######################################################
|
||||||
R = self.__random_radius
|
R = self.__random_radius
|
||||||
C = self.__random_center
|
C = self.__random_center
|
||||||
@@ -949,14 +966,14 @@ class pyBluePrintEllipsesShader(StrokeShader):
|
|||||||
for j in range(self.__turns):
|
for j in range(self.__turns):
|
||||||
prev_radius = radius
|
prev_radius = radius
|
||||||
prev_center = center
|
prev_center = center
|
||||||
radius = radius + Vector([randint(-R, R), randint(-R, R)])
|
radius = radius + mathutils.Vector([random.randint(-R, R), random.randint(-R, R)])
|
||||||
center = center + Vector([randint(-C, C), randint(-C, C)])
|
center = center + mathutils.Vector([random.randint(-C, C), random.randint(-C, C)])
|
||||||
while i < sv_nb and not it.is_end:
|
while i < sv_nb and not it.is_end:
|
||||||
t = float(i) / float(sv_nb - 1)
|
t = float(i) / float(sv_nb - 1)
|
||||||
r = prev_radius + (radius - prev_radius) * t
|
r = prev_radius + (radius - prev_radius) * t
|
||||||
c = prev_center + (center - prev_center) * t
|
c = prev_center + (center - prev_center) * t
|
||||||
p_new.x = c.x + r.x * cos(2 * pi * t)
|
p_new.x = c.x + r.x * math.cos(2 * math.pi * t)
|
||||||
p_new.y = c.y + r.y * sin(2 * pi * t)
|
p_new.y = c.y + r.y * math.sin(2 * math.pi * t)
|
||||||
it.object.point = p_new
|
it.object.point = p_new
|
||||||
i = i + 1
|
i = i + 1
|
||||||
it.increment()
|
it.increment()
|
||||||
@@ -1001,28 +1018,28 @@ class pyBluePrintSquaresShader(StrokeShader):
|
|||||||
second = 2 * first
|
second = 2 * first
|
||||||
third = 3 * first
|
third = 3 * first
|
||||||
fourth = sv_nb
|
fourth = sv_nb
|
||||||
p_first = Vector([p_min.x - self.__bb_len, p_min.y])
|
p_first = mathutils.Vector([p_min.x - self.__bb_len, p_min.y])
|
||||||
p_first_end = Vector([p_max.x + self.__bb_len, p_min.y])
|
p_first_end = mathutils.Vector([p_max.x + self.__bb_len, p_min.y])
|
||||||
p_second = Vector([p_max.x, p_min.y - self.__bb_len])
|
p_second = mathutils.Vector([p_max.x, p_min.y - self.__bb_len])
|
||||||
p_second_end = Vector([p_max.x, p_max.y + self.__bb_len])
|
p_second_end = mathutils.Vector([p_max.x, p_max.y + self.__bb_len])
|
||||||
p_third = Vector([p_max.x + self.__bb_len, p_max.y])
|
p_third = mathutils.Vector([p_max.x + self.__bb_len, p_max.y])
|
||||||
p_third_end = Vector([p_min.x - self.__bb_len, p_max.y])
|
p_third_end = mathutils.Vector([p_min.x - self.__bb_len, p_max.y])
|
||||||
p_fourth = Vector([p_min.x, p_max.y + self.__bb_len])
|
p_fourth = mathutils.Vector([p_min.x, p_max.y + self.__bb_len])
|
||||||
p_fourth_end = Vector([p_min.x, p_min.y - self.__bb_len])
|
p_fourth_end = mathutils.Vector([p_min.x, p_min.y - self.__bb_len])
|
||||||
#######################################################
|
#######################################################
|
||||||
R = self.__bb_rand
|
R = self.__bb_rand
|
||||||
r = self.__bb_rand // 2
|
r = self.__bb_rand // 2
|
||||||
it = stroke.stroke_vertices_begin()
|
it = stroke.stroke_vertices_begin()
|
||||||
visible = True
|
visible = True
|
||||||
for j in range(self.__turns):
|
for j in range(self.__turns):
|
||||||
p_first = p_first + Vector([randint(-R, R), randint(-r, r)])
|
p_first = p_first + mathutils.Vector([random.randint(-R, R), random.randint(-r, r)])
|
||||||
p_first_end = p_first_end + Vector([randint(-R, R), randint(-r, r)])
|
p_first_end = p_first_end + mathutils.Vector([random.randint(-R, R), random.randint(-r, r)])
|
||||||
p_second = p_second + Vector([randint(-r, r), randint(-R, R)])
|
p_second = p_second + mathutils.Vector([random.randint(-r, r), random.randint(-R, R)])
|
||||||
p_second_end = p_second_end + Vector([randint(-r, r), randint(-R, R)])
|
p_second_end = p_second_end + mathutils.Vector([random.randint(-r, r), random.randint(-R, R)])
|
||||||
p_third = p_third + Vector([randint(-R, R), randint(-r, r)])
|
p_third = p_third + mathutils.Vector([random.randint(-R, R), random.randint(-r, r)])
|
||||||
p_third_end = p_third_end + Vector([randint(-R, R), randint(-r, r)])
|
p_third_end = p_third_end + mathutils.Vector([random.randint(-R, R), random.randint(-r, r)])
|
||||||
p_fourth = p_fourth + Vector([randint(-r, r), randint(-R, R)])
|
p_fourth = p_fourth + mathutils.Vector([random.randint(-r, r), random.randint(-R, R)])
|
||||||
p_fourth_end = p_fourth_end + Vector([randint(-r, r), randint(-R, R)])
|
p_fourth_end = p_fourth_end + mathutils.Vector([random.randint(-r, r), random.randint(-R, R)])
|
||||||
vec_first = p_first_end - p_first
|
vec_first = p_first_end - p_first
|
||||||
vec_second = p_second_end - p_second
|
vec_second = p_second_end - p_second
|
||||||
vec_third = p_third_end - p_third
|
vec_third = p_third_end - p_third
|
||||||
@@ -1074,7 +1091,7 @@ class pyBluePrintDirectedSquaresShader(StrokeShader):
|
|||||||
self.__bb_len = 1 + float(bb_len) / 100
|
self.__bb_len = 1 + float(bb_len) / 100
|
||||||
def shade(self, stroke):
|
def shade(self, stroke):
|
||||||
stroke.resample(32 * self.__turns)
|
stroke.resample(32 * self.__turns)
|
||||||
p_mean = Vector([0, 0])
|
p_mean = mathutils.Vector([0, 0])
|
||||||
it = stroke.stroke_vertices_begin()
|
it = stroke.stroke_vertices_begin()
|
||||||
while not it.is_end:
|
while not it.is_end:
|
||||||
p = it.object.point
|
p = it.object.point
|
||||||
@@ -1088,8 +1105,8 @@ class pyBluePrintDirectedSquaresShader(StrokeShader):
|
|||||||
it = stroke.stroke_vertices_begin()
|
it = stroke.stroke_vertices_begin()
|
||||||
while not it.is_end:
|
while not it.is_end:
|
||||||
p = it.object.point
|
p = it.object.point
|
||||||
p_var_xx = p_var_xx + pow(p.x - p_mean.x, 2)
|
p_var_xx = p_var_xx + math.pow(p.x - p_mean.x, 2)
|
||||||
p_var_yy = p_var_yy + pow(p.y - p_mean.y, 2)
|
p_var_yy = p_var_yy + math.pow(p.y - p_mean.y, 2)
|
||||||
p_var_xy = p_var_xy + (p.x - p_mean.x) * (p.y - p_mean.y)
|
p_var_xy = p_var_xy + (p.x - p_mean.x) * (p.y - p_mean.y)
|
||||||
it.increment()
|
it.increment()
|
||||||
p_var_xx = p_var_xx / sv_nb
|
p_var_xx = p_var_xx / sv_nb
|
||||||
@@ -1098,18 +1115,18 @@ class pyBluePrintDirectedSquaresShader(StrokeShader):
|
|||||||
## print(p_var_xx, p_var_yy, p_var_xy)
|
## print(p_var_xx, p_var_yy, p_var_xy)
|
||||||
trace = p_var_xx + p_var_yy
|
trace = p_var_xx + p_var_yy
|
||||||
det = p_var_xx * p_var_yy - p_var_xy * p_var_xy
|
det = p_var_xx * p_var_yy - p_var_xy * p_var_xy
|
||||||
sqrt_coeff = sqrt(trace * trace - 4 * det)
|
sqrt_coeff = math.sqrt(trace * trace - 4 * det)
|
||||||
lambda1 = (trace + sqrt_coeff) / 2
|
lambda1 = (trace + sqrt_coeff) / 2
|
||||||
lambda2 = (trace - sqrt_coeff) / 2
|
lambda2 = (trace - sqrt_coeff) / 2
|
||||||
## print(lambda1, lambda2)
|
## print(lambda1, lambda2)
|
||||||
theta = atan(2 * p_var_xy / (p_var_xx - p_var_yy)) / 2
|
theta = math.atan(2 * p_var_xy / (p_var_xx - p_var_yy)) / 2
|
||||||
## print(theta)
|
## print(theta)
|
||||||
if p_var_yy > p_var_xx:
|
if p_var_yy > p_var_xx:
|
||||||
e1 = Vector([cos(theta + pi / 2), sin(theta + pi / 2)]) * sqrt(lambda1) * self.__mult
|
e1 = mathutils.Vector([math.cos(theta + math.pi / 2), math.sin(theta + math.pi / 2)]) * math.sqrt(lambda1) * self.__mult
|
||||||
e2 = Vector([cos(theta + pi), sin(theta + pi)]) * sqrt(lambda2) * self.__mult
|
e2 = mathutils.Vector([math.cos(theta + math.pi), math.sin(theta + math.pi)]) * math.sqrt(lambda2) * self.__mult
|
||||||
else:
|
else:
|
||||||
e1 = Vector([cos(theta), sin(theta)]) * sqrt(lambda1) * self.__mult
|
e1 = mathutils.Vector([math.cos(theta), math.sin(theta)]) * math.sqrt(lambda1) * self.__mult
|
||||||
e2 = Vector([cos(theta + pi / 2), sin(theta + pi / 2)]) * sqrt(lambda2) * self.__mult
|
e2 = mathutils.Vector([math.cos(theta + math.pi / 2), math.sin(theta + math.pi / 2)]) * math.sqrt(lambda2) * self.__mult
|
||||||
#######################################################
|
#######################################################
|
||||||
sv_nb = sv_nb // self.__turns
|
sv_nb = sv_nb // self.__turns
|
||||||
first = sv_nb // 4
|
first = sv_nb // 4
|
||||||
@@ -1117,7 +1134,7 @@ class pyBluePrintDirectedSquaresShader(StrokeShader):
|
|||||||
third = 3 * first
|
third = 3 * first
|
||||||
fourth = sv_nb
|
fourth = sv_nb
|
||||||
bb_len1 = self.__bb_len
|
bb_len1 = self.__bb_len
|
||||||
bb_len2 = 1 + (bb_len1 - 1) * sqrt(lambda1 / lambda2)
|
bb_len2 = 1 + (bb_len1 - 1) * math.sqrt(lambda1 / lambda2)
|
||||||
p_first = p_mean - e1 - e2 * bb_len2
|
p_first = p_mean - e1 - e2 * bb_len2
|
||||||
p_second = p_mean - e1 * bb_len1 + e2
|
p_second = p_mean - e1 * bb_len1 + e2
|
||||||
p_third = p_mean + e1 + e2 * bb_len2
|
p_third = p_mean + e1 + e2 * bb_len2
|
||||||
|
@@ -1,15 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : sketchy_multiple_parameterization.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Builds sketchy strokes whose topology relies on a
|
|
||||||
# parameterization that covers the complete lines (visible+invisible)
|
|
||||||
# whereas only the visible portions are actually drawn
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -22,20 +11,26 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : sketchy_multiple_parameterization.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from ChainingIterators import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : Builds sketchy strokes whose topology relies on a
|
||||||
|
# parameterization that covers the complete lines (visible+invisible)
|
||||||
|
# whereas only the visible portions are actually drawn
|
||||||
|
|
||||||
|
from ChainingIterators import pySketchyChainSilhouetteIterator
|
||||||
|
from Freestyle import IncreasingColorShader, IncreasingThicknessShader, Operators, \
|
||||||
|
QuantitativeInvisibilityUP1D, SamplingShader, SmoothingShader, SpatialNoiseShader, \
|
||||||
|
TextureAssignerShader, TrueUP1D
|
||||||
|
from shaders import pyHLRShader
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
## 0: don't restrict to selection
|
Operators.bidirectional_chain(pySketchyChainSilhouetteIterator(3, False))
|
||||||
Operators.bidirectional_chain(pySketchyChainSilhouetteIterator(3,0))
|
|
||||||
shaders_list = [
|
shaders_list = [
|
||||||
SamplingShader(2),
|
SamplingShader(2),
|
||||||
SpatialNoiseShader(15, 120, 2, True, True),
|
SpatialNoiseShader(15, 120, 2, True, True),
|
||||||
@@ -43,6 +38,6 @@ shaders_list = [
|
|||||||
SmoothingShader(100, 0.05, 0, 0.2, 0, 0, 0, 1),
|
SmoothingShader(100, 0.05, 0, 0.2, 0, 0, 0, 1),
|
||||||
IncreasingColorShader(0, 0.2, 0, 1, 0.2, 0.7, 0.2, 1),
|
IncreasingColorShader(0, 0.2, 0, 1, 0.2, 0.7, 0.2, 1),
|
||||||
TextureAssignerShader(6),
|
TextureAssignerShader(6),
|
||||||
pyHLRShader()
|
pyHLRShader(),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,15 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : sketchy_topology_broken.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : The topology of the strokes is, first, built
|
|
||||||
# independantly from the 3D topology of objects,
|
|
||||||
# and, second, so as to chain several times the same ViewEdge.
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -22,15 +11,23 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : sketchy_topology_broken.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from ChainingIterators import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : The topology of the strokes is, first, built
|
||||||
|
# independantly from the 3D topology of objects,
|
||||||
|
# and, second, so as to chain several times the same ViewEdge.
|
||||||
|
|
||||||
|
from ChainingIterators import pySketchyChainingIterator
|
||||||
|
from Freestyle import IncreasingColorShader, IncreasingThicknessShader, Operators, \
|
||||||
|
QuantitativeInvisibilityUP1D, SamplingShader, SmoothingShader, SpatialNoiseShader, \
|
||||||
|
TextureAssignerShader, TrueUP1D
|
||||||
|
from shaders import 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
|
||||||
@@ -45,6 +42,6 @@ shaders_list = [
|
|||||||
#ConstantColorShader(0.0, 0.0, 0.0)
|
#ConstantColorShader(0.0, 0.0, 0.0)
|
||||||
IncreasingColorShader(0.2, 0.2, 0.2, 1, 0.5, 0.5, 0.5, 1),
|
IncreasingColorShader(0.2, 0.2, 0.2, 1, 0.5, 0.5, 0.5, 1),
|
||||||
#IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
|
#IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
|
||||||
TextureAssignerShader(4)
|
TextureAssignerShader(4),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,15 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : sketchy_topology_preserved.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : The topology of the strokes is built
|
|
||||||
# so as to chain several times the same ViewEdge.
|
|
||||||
# The topology of the objects is preserved
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -22,20 +11,26 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : sketchy_topology_preserved.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from ChainingIterators import *
|
# Date : 04/08/2005
|
||||||
from PredicatesU1D import *
|
# Purpose : The topology of the strokes is built
|
||||||
from shaders import *
|
# so as to chain several times the same ViewEdge.
|
||||||
|
# The topology of the objects is preserved
|
||||||
|
|
||||||
|
from ChainingIterators import pySketchyChainSilhouetteIterator
|
||||||
|
from Freestyle import ConstantColorShader, IncreasingThicknessShader, Operators, \
|
||||||
|
QuantitativeInvisibilityUP1D, SamplingShader, SmoothingShader, SpatialNoiseShader, \
|
||||||
|
TextureAssignerShader, TrueUP1D
|
||||||
|
|
||||||
upred = QuantitativeInvisibilityUP1D(0)
|
upred = QuantitativeInvisibilityUP1D(0)
|
||||||
Operators.select(upred)
|
Operators.select(upred)
|
||||||
Operators.bidirectional_chain(pySketchyChainSilhouetteIterator(3,1))
|
Operators.bidirectional_chain(pySketchyChainSilhouetteIterator(3, True))
|
||||||
shaders_list = [
|
shaders_list = [
|
||||||
SamplingShader(4),
|
SamplingShader(4),
|
||||||
SpatialNoiseShader(20, 220, 2, True, True),
|
SpatialNoiseShader(20, 220, 2, True, True),
|
||||||
@@ -44,6 +39,4 @@ shaders_list = [
|
|||||||
ConstantColorShader(0.6, 0.2, 0.0),
|
ConstantColorShader(0.6, 0.2, 0.0),
|
||||||
TextureAssignerShader(4),
|
TextureAssignerShader(4),
|
||||||
]
|
]
|
||||||
|
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
|
||||||
|
@@ -1,14 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : split_at_highest_2d_curvature.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws the visible lines (chaining follows same nature lines)
|
|
||||||
# (most basic style module)
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -21,21 +11,31 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : split_at_highest_2d_curvature.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesU0D import *
|
# Date : 04/08/2005
|
||||||
from PredicatesU1D import *
|
# Purpose : Draws the visible lines (chaining follows same nature lines)
|
||||||
from Functions0D import *
|
# (most basic style module)
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantThicknessShader, IncreasingColorShader, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, TextureAssignerShader, TrueUP1D
|
||||||
|
from Functions0D import pyInverseCurvature2DAngleF0D
|
||||||
|
from PredicatesU0D import pyParameterUP0D
|
||||||
|
from PredicatesU1D import pyHigherLengthUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
func = pyInverseCurvature2DAngleF0D()
|
func = pyInverseCurvature2DAngleF0D()
|
||||||
Operators.recursive_split(func, pyParameterUP0D(0.4, 0.6), NotUP1D(pyHigherLengthUP1D(100)), 2)
|
Operators.recursive_split(func, pyParameterUP0D(0.4, 0.6), NotUP1D(pyHigherLengthUP1D(100)), 2)
|
||||||
shaders_list = [ConstantThicknessShader(10), IncreasingColorShader(1,0,0,1,0,1,0,1), TextureAssignerShader(3)]
|
shaders_list = [
|
||||||
|
ConstantThicknessShader(10),
|
||||||
|
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
|
||||||
|
TextureAssignerShader(3),
|
||||||
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : split_at_tvertices.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws strokes that starts and stops at Tvertices (visible or not)
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,16 +11,20 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : split_at_tvertices.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesU1D import *
|
# Date : 04/08/2005
|
||||||
from PredicatesU0D import *
|
# Purpose : Draws strokes that starts and stops at Tvertices (visible or not)
|
||||||
from Functions0D import *
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantThicknessShader, IncreasingColorShader, \
|
||||||
|
Nature, Operators, QuantitativeInvisibilityUP1D, TextureAssignerShader, TrueUP1D
|
||||||
|
from PredicatesU0D import pyVertexNatureUP0D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
@@ -37,6 +32,9 @@ start = pyVertexNatureUP0D(Nature.T_VERTEX)
|
|||||||
## use the same predicate to decide where to start and where to stop
|
## use the same predicate to decide where to start and where to stop
|
||||||
## the strokes:
|
## the strokes:
|
||||||
Operators.sequential_split(start, start, 10)
|
Operators.sequential_split(start, start, 10)
|
||||||
shaders_list = [ConstantThicknessShader(5), IncreasingColorShader(1,0,0,1,0,1,0,1), TextureAssignerShader(3)]
|
shaders_list = [
|
||||||
|
ConstantThicknessShader(5),
|
||||||
|
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
|
||||||
|
TextureAssignerShader(3),
|
||||||
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : stroke_texture.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws textured strokes (illustrate the StrokeTextureShader shader)
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,16 +11,20 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : stroke_texture.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesB1D import *
|
# Date : 04/08/2005
|
||||||
from shaders import *
|
# Purpose : Draws textured strokes (illustrate the StrokeTextureShader shader)
|
||||||
from ChainingIterators import *
|
|
||||||
|
from Freestyle import BezierCurveShader, ChainSilhouetteIterator, ConstantColorShader, \
|
||||||
|
ConstantThicknessShader, Operators, QuantitativeInvisibilityUP1D, SamplingShader, \
|
||||||
|
Stroke, StrokeTextureShader, TrueUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
|
@@ -1,15 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : suggestive.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Draws the suggestive contours.
|
|
||||||
# ***** The suggestive contours must be enabled
|
|
||||||
# in the options dialog *****
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -22,22 +11,28 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : suggestive.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from PredicatesB1D import *
|
# Date : 04/08/2005
|
||||||
from PredicatesU1D import *
|
# Purpose : Draws the suggestive contours.
|
||||||
from shaders import *
|
# ***** The suggestive contours must be enabled
|
||||||
|
# in the options dialog *****
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, IncreasingThicknessShader, \
|
||||||
|
Nature, Operators, QuantitativeInvisibilityUP1D, TrueUP1D
|
||||||
|
from PredicatesU1D import pyNatureUP1D
|
||||||
|
from logical_operators import AndUP1D, NotUP1D
|
||||||
|
|
||||||
upred = AndUP1D(pyNatureUP1D(Nature.SUGGESTIVE_CONTOUR), QuantitativeInvisibilityUP1D(0))
|
upred = AndUP1D(pyNatureUP1D(Nature.SUGGESTIVE_CONTOUR), QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.select(upred)
|
Operators.select(upred)
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred))
|
||||||
shaders_list = [
|
shaders_list = [
|
||||||
IncreasingThicknessShader(1, 3),
|
IncreasingThicknessShader(1, 3),
|
||||||
ConstantColorShader(0.2,0.2,0.2, 1)
|
ConstantColorShader(0.2, 0.2, 0.2, 1),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : thickness_fof_depth_discontinuity.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Assigns to strokes a thickness that depends on the depth discontinuity
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,14 +11,20 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
from freestyle_init import *
|
# Filename : thickness_fof_depth_discontinuity.py
|
||||||
from logical_operators import *
|
# Author : Stephane Grabli
|
||||||
from shaders import *
|
# Date : 04/08/2005
|
||||||
|
# Purpose : Assigns to strokes a thickness that depends on the depth discontinuity
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D
|
||||||
|
from logical_operators import NotUP1D
|
||||||
|
from shaders import pyDepthDiscontinuityThicknessShader
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
@@ -35,6 +32,6 @@ shaders_list = [
|
|||||||
SamplingShader(1),
|
SamplingShader(1),
|
||||||
ConstantThicknessShader(3),
|
ConstantThicknessShader(3),
|
||||||
ConstantColorShader(0.0, 0.0, 0.0),
|
ConstantColorShader(0.0, 0.0, 0.0),
|
||||||
pyDepthDiscontinuityThicknessShader(0.8, 6)
|
pyDepthDiscontinuityThicknessShader(0.8, 6),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : tipremover.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Removes strokes extremities
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,16 +11,19 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
# Filename : tipremover.py
|
||||||
|
# Author : Stephane Grabli
|
||||||
|
# Date : 04/08/2005
|
||||||
|
# Purpose : Removes strokes extremities
|
||||||
|
|
||||||
from freestyle_init import *
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, \
|
||||||
from logical_operators import *
|
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TipRemoverShader, TrueUP1D
|
||||||
from ChainingIterators import *
|
from logical_operators import NotUP1D
|
||||||
from shaders import *
|
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
@@ -37,6 +31,6 @@ shaders_list = [
|
|||||||
SamplingShader(5),
|
SamplingShader(5),
|
||||||
ConstantThicknessShader(3),
|
ConstantThicknessShader(3),
|
||||||
ConstantColorShader(0, 0, 0),
|
ConstantColorShader(0, 0, 0),
|
||||||
TipRemoverShader(20)
|
TipRemoverShader(20),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
#
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
# Filename : tvertex_remover.py
|
|
||||||
# Author : Stephane Grabli
|
|
||||||
# Date : 04/08/2005
|
|
||||||
# Purpose : Removes TVertices
|
|
||||||
#
|
|
||||||
#############################################################################
|
|
||||||
#
|
|
||||||
# Copyright (C) : Please refer to the COPYRIGHT file distributed
|
|
||||||
# with this source distribution.
|
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@@ -20,16 +11,20 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#
|
#
|
||||||
#############################################################################
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
# Filename : tvertex_remover.py
|
||||||
|
# Author : Stephane Grabli
|
||||||
|
# Date : 04/08/2005
|
||||||
|
# Purpose : Removes TVertices
|
||||||
|
|
||||||
from freestyle_init import *
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, IncreasingThicknessShader, \
|
||||||
from logical_operators import *
|
Operators, QuantitativeInvisibilityUP1D, SamplingShader, TrueUP1D
|
||||||
from PredicatesB1D import *
|
from logical_operators import NotUP1D
|
||||||
from shaders import *
|
from shaders import pyTVertexRemoverShader
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
|
||||||
@@ -37,6 +32,6 @@ shaders_list = [
|
|||||||
IncreasingThicknessShader(3, 5),
|
IncreasingThicknessShader(3, 5),
|
||||||
ConstantColorShader(0.2, 0.2, 0.2, 1),
|
ConstantColorShader(0.2, 0.2, 0.2, 1),
|
||||||
SamplingShader(10.0),
|
SamplingShader(10.0),
|
||||||
pyTVertexRemoverShader()
|
pyTVertexRemoverShader(),
|
||||||
]
|
]
|
||||||
Operators.create(TrueUP1D(), shaders_list)
|
Operators.create(TrueUP1D(), shaders_list)
|
||||||
|
@@ -1,11 +1,25 @@
|
|||||||
from freestyle_init import *
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||||
from logical_operators import *
|
#
|
||||||
from PredicatesU1D import *
|
# This program is free software; you can redistribute it and/or
|
||||||
from PredicatesU0D import *
|
# modify it under the terms of the GNU General Public License
|
||||||
from PredicatesB1D import *
|
# as published by the Free Software Foundation; either version 2
|
||||||
from Functions0D import *
|
# of the License, or (at your option) any later version.
|
||||||
from Functions1D import *
|
#
|
||||||
from shaders import *
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
#
|
||||||
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
from Freestyle import ChainSilhouetteIterator, ConstantColorShader, ConstantThicknessShader, IntegrationType, \
|
||||||
|
Operators, QuantitativeInvisibilityUP1D, SamplingShader, Stroke, StrokeTextureShader
|
||||||
|
from PredicatesB1D import pyZBP1D
|
||||||
|
from PredicatesU1D import pyDensityUP1D
|
||||||
|
|
||||||
Operators.select(QuantitativeInvisibilityUP1D(0))
|
Operators.select(QuantitativeInvisibilityUP1D(0))
|
||||||
Operators.bidirectional_chain(ChainSilhouetteIterator())
|
Operators.bidirectional_chain(ChainSilhouetteIterator())
|
||||||
@@ -15,8 +29,7 @@ shaders_list = [
|
|||||||
StrokeTextureShader("smoothAlpha.bmp", Stroke.OPAQUE_MEDIUM, False),
|
StrokeTextureShader("smoothAlpha.bmp", Stroke.OPAQUE_MEDIUM, False),
|
||||||
ConstantThicknessShader(3),
|
ConstantThicknessShader(3),
|
||||||
SamplingShader(5.0),
|
SamplingShader(5.0),
|
||||||
ConstantColorShader(0,0,0,1)
|
ConstantColorShader(0, 0, 0, 1),
|
||||||
]
|
]
|
||||||
Operators.create(pyDensityUP1D(2, 0.05, IntegrationType.MEAN, 4), shaders_list)
|
Operators.create(pyDensityUP1D(2, 0.05, IntegrationType.MEAN, 4), shaders_list)
|
||||||
#Operators.create(pyDensityFunctorUP1D(8, 0.03, pyGetInverseProjectedZF1D(), 0, 1, IntegrationType.MEAN), shaders_list)
|
#Operators.create(pyDensityFunctorUP1D(8, 0.03, pyGetInverseProjectedZF1D(), 0, 1, IntegrationType.MEAN), shaders_list)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user