This module contains core classes of the Freestyle Python API, including data types of view map components (0D and 1D elements), base classes for user-defined line stylization rules (predicates, functions, chaining iterators, and stroke shaders), and operators.
Class hierarchy:
Class hierarchy: Iterator > AdjacencyIterator
Class for representing adjacency iterators used in the chaining process. An AdjacencyIterator is created in the increment() and decrement() methods of a ChainingIterator and passed to the traverse() method of the ChainingIterator.
Default constructor.
Copy constructor.
Parameters: | brother (AdjacencyIterator) – An AdjacencyIterator object. |
---|
Builds a AdjacencyIterator object.
Parameters: |
|
---|
True if the current ViewEdge is coming towards the iteration vertex, and False otherwise.
Type: | bool |
---|
Base class for binary predicates working on Interface0D objects. A BinaryPredicate0D is typically an ordering relation between two Interface0D objects. The predicate evaluates a relation between the two Interface0D instances and returns a boolean value (true or false). It is used by invoking the __call__() method.
Default constructor.
Must be overload by inherited classes. It evaluates a relation between two Interface0D objects.
Parameters: |
|
---|---|
Returns: | True or false. |
Return type: | bool |
The name of the binary 0D predicate.
Type: | str |
---|
Base class for binary predicates working on Interface1D objects. A BinaryPredicate1D is typically an ordering relation between two Interface1D objects. The predicate evaluates a relation between the two Interface1D instances and returns a boolean value (true or false). It is used by invoking the __call__() method.
Default constructor.
Must be overload by inherited classes. It evaluates a relation between two Interface1D objects.
Parameters: |
|
---|---|
Returns: | True or false. |
Return type: | bool |
The name of the binary 1D predicate.
Type: | str |
---|
Class hierarchy: Interface1D > Curve > Chain
Class to represent a 1D elements issued from the chaining process. A Chain is the last step before the Stroke and is used in the Splitting and Creation processes.
Default constructor.
Copy constructor.
Parameters: | brother (Chain) – A Chain object. |
---|
Builds a chain from its Id.
Parameters: | id (Id) – An Id object. |
---|
Class hierarchy: Iterator > ViewEdgeIterator > ChainingIterator
Base class for chaining iterators. This class is designed to be overloaded in order to describe chaining rules. It makes the description of chaining rules easier. The two main methods that need to overloaded are traverse() and init(). traverse() tells which ViewEdge to follow, among the adjacent ones. If you specify restriction rules (such as “Chain only ViewEdges of the selection”), they will be included in the adjacency iterator (i.e, the adjacent iterator will only stop on “valid” edges).
Builds a Chaining Iterator from the first ViewEdge used for iteration and its orientation.
Parameters: |
|
---|
Copy constructor.
Parameters: | brother (ChainingIterator) – |
---|
Initializes the iterator context. This method is called each time a new chain is started. It can be used to reset some history information that you might want to keep.
This method iterates over the potential next ViewEdges and returns the one that will be followed next. Returns the next ViewEdge to follow or None when the end of the chain is reached.
Parameters: | it (AdjacencyIterator) – The iterator over the ViewEdges adjacent to the end vertex of the current ViewEdge. The adjacency iterator reflects the restriction rules by only iterating over the valid ViewEdges. |
---|---|
Returns: | Returns the next ViewEdge to follow, or None if chaining ends. |
Return type: | ViewEdge or None |
True if the current iteration is an incrementation.
Type: | bool |
---|
The ViewVertex that is the next crossing.
Type: | ViewVertex |
---|
Class hierarchy: Interface1D > Curve
Base class for curves made of CurvePoints. SVertex is the type of the initial curve vertices. A Chain is a specialization of a Curve.
Default Constructor.
Copy Constructor.
Parameters: | brother (Curve) – A Curve object. |
---|
Builds a Curve from its Id.
Parameters: | id (Id) – An Id object. |
---|
Adds a single vertex at the end of the Curve.
Parameters: | vertex (SVertex or CurvePoint) – A vertex object. |
---|
Adds a single vertex at the front of the Curve.
Parameters: | vertex (SVertex or CurvePoint) – A vertex object. |
---|
True if the Curve doesn’t have any Vertex yet.
Type: | bool |
---|
The number of segments in the polyline constituting the Curve.
Type: | int |
---|
Class hierarchy: Interface0D > CurvePoint
Class to represent a point of a curve. A CurvePoint can be any point of a 1D curve (it doesn’t have to be a vertex of the curve). Any Interface1D is built upon ViewEdges, themselves built upon FEdges. Therefore, a curve is basically a polyline made of a list of SVertex objects. Thus, a CurvePoint is built by linearly interpolating two SVertex instances. CurvePoint can be used as virtual points while querying 0D information along a curve at a given resolution.
Defult constructor.
Copy constructor.
Parameters: | brother (CurvePoint) – A CurvePoint object. |
---|
Builds a CurvePoint from two SVertex objects and an interpolation parameter.
Parameters: |
---|
Builds a CurvePoint from two CurvePoint objects and an interpolation parameter.
Parameters: |
|
---|
Gets the FEdge for the two SVertices that given CurvePoints consists out of. A shortcut for CurvePoint.first_svertex.get_fedge(CurvePoint.second_svertex).
Type: | FEdge |
---|
The 2D interpolation parameter.
Type: | float |
---|
Class hierarchy: Iterator > CurvePointIterator
Class representing an iterator on a curve. Allows an iterating outside initial vertices. A CurvePoint is instanciated and returned through the .object attribute.
Default constructor.
Copy constructor.
Parameters: | brother (CurvePointIterator) – A CurvePointIterator object. |
---|
Builds a CurvePointIterator object.
Parameters: | step (float) – A resampling resolution with which the curve is resampled. If zero, no resampling is done (i.e., the iterator iterates over initial vertices). |
---|
The CurvePoint object currently pointed by this iterator.
Type: | CurvePoint |
---|
The curvilinear abscissa of the current point.
Type: | float |
---|
The point parameter at the current point in the stroke (0 <= u <= 1).
Type: | float |
---|
Class hierarchy: Interface1D > FEdge
Base Class for feature edges. This FEdge can represent a silhouette, a crease, a ridge/valley, a border or a suggestive contour. For silhouettes, the FEdge is oriented so that the visible face lies on the left of the edge. For borders, the FEdge is oriented so that the face lies on the left of the edge. An FEdge can represent an initial edge of the mesh or runs across a face of the initial mesh depending on the smoothness or sharpness of the mesh. This class is specialized into a smooth and a sharp version since their properties slightly vary from one to the other.
Default constructor.
Copy constructor.
Parameters: | brother (FEdge) – An FEdge object. |
---|
Builds an FEdge going from the first vertex to the second.
Parameters: |
---|
True if this FEdge is a smooth FEdge.
Type: | bool |
---|
The FEdge following this one in the ViewEdge. The value is None if this FEdge is the last of the ViewEdge.
Type: | FEdge |
---|
Class hierarchy: Interface1D > FEdge > FEdgeSharp
Class defining a sharp FEdge. A Sharp FEdge corresponds to an initial edge of the input mesh. It can be a silhouette, a crease or a border. If it is a crease edge, then it is borded by two faces of the mesh. Face a lies on its right whereas Face b lies on its left. If it is a border edge, then it doesn’t have any face on its right, and thus Face a is None.
Default constructor.
Copy constructor.
Parameters: | brother (FEdgeSharp) – An FEdgeSharp object. |
---|
Builds an FEdgeSharp going from the first vertex to the second.
Parameters: |
---|
The face mark of the face lying on the left of the FEdge.
Type: | bool |
---|
The face mark of the face lying on the right of the FEdge. If this FEdge is a border, it has no face on the right and thus this property is set to false.
Type: | bool |
---|
The index of the material of the face lying on the left of the FEdge.
Type: | int |
---|
The index of the material of the face lying on the right of the FEdge. If this FEdge is a border, it has no Face on its right and therefore no material.
Type: | int |
---|
The material of the face lying on the right of the FEdge. If this FEdge is a border, it has no Face on its right and therefore no material.
Type: | Material |
---|
The normal to the face lying on the left of the FEdge.
Type: | mathutils.Vector |
---|
The normal to the face lying on the right of the FEdge. If this FEdge is a border, it has no Face on its right and therefore no normal.
Type: | mathutils.Vector |
---|
Class hierarchy: Interface1D > FEdge > FEdgeSmooth
Class defining a smooth edge. This kind of edge typically runs across a face of the input mesh. It can be a silhouette, a ridge or valley, a suggestive contour.
Default constructor.
Copy constructor.
Parameters: | brother (FEdgeSmooth) – An FEdgeSmooth object. |
---|
Builds an FEdgeSmooth going from the first to the second.
Parameters: |
---|
The face mark of the face that this FEdge is running across.
Type: | bool |
---|
The index of the material of the face that this FEdge is running across.
Type: | int |
---|
The normal of the face that this FEdge is running across.
Type: | mathutils.Vector |
---|
Class for representing an object Id.
Build the Id from two numbers.
Parameters: |
|
---|
Copy constructor.
Parameters: | brother (Id) – An Id object. |
---|
The first number constituting the Id.
Type: | int |
---|
The second number constituting the Id.
Type: | int |
---|
Class hierarchy: int > IntegrationType
Different integration methods that can be invoked to integrate into a single value the set of values obtained from each 0D element of an 1D element:
Base class for any 0D element.
Default constructor.
Returns the FEdge that lies between this 0D element and the 0D element given as the argument.
Parameters: | inter (Interface0D) – A 0D element. |
---|---|
Returns: | The FEdge lying between the two 0D elements. |
Return type: | FEdge |
The string of the name of this 0D element.
Type: | str |
---|
The 2D point of this 0D element.
Type: | mathutils.Vector |
---|
The 3D point of this 0D element.
Type: | mathutils.Vector |
---|
The X coordinate of the projected 3D point of this 0D element.
Type: | float |
---|
The Y coordinate of the projected 3D point of this 0D element.
Type: | float |
---|
The Z coordinate of the projected 3D point of this 0D element.
Type: | float |
---|
Class hierarchy: Iterator > Interface0DIterator
Class defining an iterator over Interface0D elements. An instance of this iterator is always obtained from a 1D element.
Copy constructor.
Parameters: | brother (Interface0DIterator) – An Interface0DIterator object. |
---|
Construct a nested Interface0DIterator that can be the argument of a Function0D.
Parameters: | it (SVertexIterator, CurvePointIterator, or StrokeVertexIterator) – An iterator object to be nested. |
---|
True if the interator points to the last valid element. For its counterpart (pointing to the first valid element), use it.is_begin.
Type: | bool |
---|
The 0D object currently pointed to by this iterator. Note that the object may be an instance of an Interface0D subclass. For example if the iterator has been created from the vertices_begin() method of the Stroke class, the .object property refers to a StrokeVertex object.
Type: | Interface0D or one of its subclasses. |
---|
The curvilinear abscissa of the current point.
Type: | float |
---|
The point parameter at the current point in the 1D element (0 <= u <= 1).
Type: | float |
---|
Base class for any 1D element.
Default constructor.
Returns an iterator over the Interface1D points, pointing to the first point. The difference with vertices_begin() is that here we can iterate over points of the 1D element at a any given sampling. Indeed, for each iteration, a virtual point is created.
Parameters: | t (float) – A sampling with which we want to iterate over points of this 1D element. |
---|---|
Returns: | An Interface0DIterator pointing to the first point. |
Return type: | Interface0DIterator |
Returns an iterator over the Interface1D points, pointing after the last point. The difference with vertices_end() is that here we can iterate over points of the 1D element at a given sampling. Indeed, for each iteration, a virtual point is created.
Parameters: | t (float) – A sampling with which we want to iterate over points of this 1D element. |
---|---|
Returns: | An Interface0DIterator pointing after the last point. |
Return type: | Interface0DIterator |
Returns an iterator over the Interface1D vertices, pointing to the first vertex.
Returns: | An Interface0DIterator pointing to the first vertex. |
---|---|
Return type: | Interface0DIterator |
Returns an iterator over the Interface1D vertices, pointing after the last vertex.
Returns: | An Interface0DIterator pointing after the last vertex. |
---|---|
Return type: | Interface0DIterator |
The 2D length of this Interface1D.
Type: | float |
---|
The string of the name of the 1D element.
Type: | str |
---|
The time stamp of the 1D element, mainly used for selection.
Type: | int |
---|
Base class to define iterators.
Default constructor.
Makes the iterator point the previous element.
Makes the iterator point the next element.
True if the interator points the first element.
Type: | bool |
---|
True if the interator points the last element.
Type: | bool |
---|
The string of the name of this iterator.
Type: | str |
---|
Class defining a material.
Default constructor.
Copy constructor.
Parameters: | brother (Material) – A Material object. |
---|
Builds a Material from its line, diffuse, ambient, specular, emissive colors, a shininess coefficient and line color priority.
Parameters: |
|
---|
RGBA components of the ambient color of the material.
Type: | mathutils.Color |
---|
RGBA components of the diffuse color of the material.
Type: | mathutils.Vector |
---|
RGBA components of the emissive color of the material.
Type: | mathutils.Color |
---|
RGBA components of the line color of the material.
Type: | mathutils.Vector |
---|
Line color priority of the material.
Type: | int |
---|
Shininess coefficient of the material.
Type: | float |
---|
RGBA components of the specular color of the material.
Type: | mathutils.Vector |
---|
Class hierarchy: int > MediumType
The different blending modes available to similate the interaction media-medium:
Class hierarchy: int > Nature
Different possible natures of 0D and 1D elements of the ViewMap.
Vertex natures:
Edge natures:
Class to provide Perlin noise functionalities.
Builds a Noise object. Seed is an optional argument. The seed value is used as a seed for random number generation if it is equal to or greater than zero; otherwise, time is used as a seed.
Parameters: | seed (int) – Seed for random number generation. |
---|
Returns a smooth noise value for a 1D element.
Parameters: | v (float) – One-dimensional sample point. |
---|---|
Returns: | A smooth noise value. |
Return type: | float |
Returns a smooth noise value for a 2D element.
Parameters: | v (mathutils.Vector, list or tuple of 2 real numbers) – Two-dimensional sample point. |
---|---|
Returns: | A smooth noise value. |
Return type: | float |
Returns a smooth noise value for a 3D element.
Parameters: | v (mathutils.Vector, list or tuple of 3 real numbers) – Three-dimensional sample point. |
---|---|
Returns: | A smooth noise value. |
Return type: | float |
Returns a noise value for a 1D element.
Parameters: |
|
---|---|
Returns: | A noise value. |
Return type: | float |
Returns a noise value for a 2D element.
Parameters: |
|
---|---|
Returns: | A noise value. |
Return type: | float |
Returns a noise value for a 3D element.
Parameters: |
|
---|---|
Returns: | A noise value. |
Return type: | float |
Class hierarchy: Interface0D > ViewVertex > NonTVertex
View vertex for corners, cusps, etc. associated to a single SVertex. Can be associated to 2 or more view edges.
Default constructor.
Build a NonTVertex from a SVertex.
Parameters: | svertex (SVertex) – An SVertex object. |
---|
Class defining the operators used in a style module. There are five types of operators: Selection, chaining, splitting, sorting and creation. All these operators are user controlled through functors, predicates and shaders that are taken as arguments.
Builds a set of chains from the current set of ViewEdges. Each ViewEdge of the current list potentially starts a new chain. The chaining operator then iterates over the ViewEdges of the ViewMap using the user specified iterator. This operator iterates both using the increment and decrement operators and is therefore bidirectional. This operator works with a ChainingIterator which contains the chaining rules. It is this last one which can be told to chain only edges that belong to the selection or not to process twice a ViewEdge during the chaining. Each time a ViewEdge is added to a chain, its chaining time stamp is incremented. This allows you to keep track of the number of chains to which a ViewEdge belongs to.
Parameters: |
|
---|
The only difference with the above bidirectional chaining algorithm is that we don’t need to pass a stopping criterion. This might be desirable when the stopping criterion is already contained in the iterator definition. Builds a set of chains from the current set of ViewEdges. Each ViewEdge of the current list potentially starts a new chain. The chaining operator then iterates over the ViewEdges of the ViewMap using the user specified iterator. This operator iterates both using the increment and decrement operators and is therefore bidirectional. This operator works with a ChainingIterator which contains the chaining rules. It is this last one which can be told to chain only edges that belong to the selection or not to process twice a ViewEdge during the chaining. Each time a ViewEdge is added to a chain, its chaining time stamp is incremented. This allows you to keep track of the number of chains to which a ViewEdge belongs to.
Parameters: | it (ChainingIterator) – The ChainingIterator on the ViewEdges of the ViewMap. It contains the chaining rule. |
---|
Builds a set of chains from the current set of ViewEdges. Each ViewEdge of the current list starts a new chain. The chaining operator then iterates over the ViewEdges of the ViewMap using the user specified iterator. This operator only iterates using the increment operator and is therefore unidirectional.
Parameters: |
|
---|
Builds a set of chains from the current set of ViewEdges. Each ViewEdge of the current list starts a new chain. The chaining operator then iterates over the ViewEdges of the ViewMap using the user specified iterator. This operator only iterates using the increment operator and is therefore unidirectional. This chaining operator is different from the previous one because it doesn’t take any modifier as argument. Indeed, the time stamp (insuring that a ViewEdge is processed one time) is automatically managed in this case.
Parameters: |
|
---|
Creates and shades the strokes from the current set of chains. A predicate can be specified to make a selection pass on the chains.
Parameters: |
|
---|
Returns the Chain at the index in the current set of Chains.
Parameters: | i (int) – index (0 <= i < Operators.get_chains_size()). |
---|---|
Returns: | The Chain object. |
Return type: | Chain |
Returns the number of Chains.
Returns: | The number of Chains. |
---|---|
Return type: | int |
Returns the Stroke at the index in the current set of Strokes.
Parameters: | i (int) – index (0 <= i < Operators.get_strokes_size()). |
---|---|
Returns: | The Stroke object. |
Return type: | Stroke |
Returns the number of Strokes.
Returns: | The number of Strokes. |
---|---|
Return type: | int |
Returns the number of ViewEdges.
Returns: | The number of ViewEdges. |
---|---|
Return type: | int |
Returns the ViewEdge at the index in the current set of ViewEdges.
Parameters: | i (int) – index (0 <= i < Operators.get_view_edges_size()). |
---|---|
Returns: | The ViewEdge object. |
Return type: | ViewEdge |
Splits the current set of chains in a recursive way. We process the points of each chain (with a specified sampling) to find the point minimizing a specified function. The chain is split in two at this point and the two new chains are processed in the same way. The recursivity level is controlled through a predicate 1D that expresses a stopping condition on the chain that is about to be processed.
Parameters: |
|
---|
Splits the current set of chains in a recursive way. We process the points of each chain (with a specified sampling) to find the point minimizing a specified function. The chain is split in two at this point and the two new chains are processed in the same way. The user can specify a 0D predicate to make a first selection on the points that can potentially be split. A point that doesn’t verify the 0D predicate won’t be candidate in realizing the min. The recursivity level is controlled through a predicate 1D that expresses a stopping condition on the chain that is about to be processed.
Parameters: |
|
---|
Selects the ViewEdges of the ViewMap verifying a specified condition.
Parameters: | pred (UnaryPredicate1D) – The predicate expressing this condition. |
---|
Splits each chain of the current set of chains in a sequential way. The points of each chain are processed (with a specified sampling) sequentially. Each time a user specified starting condition is verified, a new chain begins and ends as soon as a user-defined stopping predicate is verified. This allows chains overlapping rather than chains partitioning. The first point of the initial chain is the first point of one of the resulting chains. The splitting ends when no more chain can start.
Parameters: |
|
---|
Splits each chain of the current set of chains in a sequential way. The points of each chain are processed (with a specified sampling) sequentially and each time a user specified condition is verified, the chain is split into two chains. The resulting set of chains is a partition of the initial chain
Parameters: |
|
---|
Sorts the current set of chains (or viewedges) according to the comparison predicate given as argument.
Parameters: | pred (BinaryPredicate1D) – The binary predicate used for the comparison. |
---|
Class to define a feature shape. It is the gathering of feature elements from an identified input shape.
Default constructor.
Copy constructor.
Parameters: | brother (SShape) – An SShape object. |
---|
Adds an SVertex to the list of SVertex of this Shape. The SShape attribute of the SVertex is also set to this SShape.
Parameters: | vertex (SVertex) – An SVertex object. |
---|
Compute the bbox of the SShape.
The name of the SShape.
Type: | str |
---|
Class hierarchy: Interface0D > SVertex
Class to define a vertex of the embedding.
Default constructor.
Copy constructor.
Parameters: | brother (SVertex) – A SVertex object. |
---|
Builds a SVertex from 3D coordinates and an Id.
Parameters: |
|
---|
Add an FEdge to the list of edges emanating from this SVertex.
Parameters: | fedge (FEdge) – An FEdge. |
---|
Adds a normal to the SVertex’s set of normals. If the same normal is already in the set, nothing changes.
Parameters: | normal (mathutils.Vector, list or tuple of 3 real numbers) – A three-dimensional vector. |
---|
Curvature information expressed in the form of a seven-element tuple (K1, e1, K2, e2, Kr, er, dKr), where K1 and K2 are scalar values representing the first (maximum) and second (minimum) principal curvatures at this SVertex, respectively; e1 and e2 are three-dimensional vectors representing the first and second principal directions, i.e. the directions of the normal plane where the curvature takes its maximum and minimum values, respectively; and Kr, er and dKr are the radial curvature, radial direction, and the derivative of the radial curvature at this SVertex, repectively.
Type: | tuple |
---|
The normals for this Vertex as a list. In a sharp surface, an SVertex has exactly one normal. In a smooth surface, an SVertex can have any number of normals.
Type: | list of mathutils.Vector objects |
---|
The number of different normals for this SVertex.
Type: | int |
---|
The projected 3D coordinates of the SVertex.
Type: | mathutils.Vector |
---|
The 3D coordinates of the SVertex.
Type: | mathutils.Vector |
---|
If this SVertex is also a ViewVertex, this property refers to the ViewVertex, and None otherwise.
Type: | ViewVertex |
---|
Class hierarchy: Iterator > SVertexIterator
Class representing an iterator over SVertex of a ViewEdge. An instance of an SVertexIterator can be obtained from a ViewEdge by calling verticesBegin() or verticesEnd().
Default constructor.
Copy constructor.
Parameters: | brother (SVertexIterator) – An SVertexIterator object. |
---|
Build an SVertexIterator that starts iteration from an SVertex object v.
Parameters: |
---|
The curvilinear abscissa of the current point.
Type: | float |
---|
The point parameter at the current point in the 1D element (0 <= u <= 1).
Type: | float |
---|
Class hierarchy: Interface1D > Stroke
Class to define a stroke. A stroke is made of a set of 2D vertices (StrokeVertex), regularly spaced out. This set of vertices defines the stroke’s backbone geometry. Each of these stroke vertices defines the stroke’s shape and appearance at this vertex position.
Default constructor
Copy constructor
Compute the sampling needed to get N vertices. If the specified number of vertices is less than the actual number of vertices, the actual sampling value is returned. (To remove Vertices, use the RemoveVertex() method of this class.)
Parameters: | n (int) – The number of stroke vertices we eventually want in our Stroke. |
---|---|
Returns: | The sampling that must be used in the Resample(float) method. |
Return type: | float |
Inserts the StrokeVertex given as argument into the Stroke before the point specified by next. The length and curvilinear abscissa are updated consequently.
Parameters: |
|
---|
Removes all vertices from the Stroke.
Removes the StrokeVertex given as argument from the Stroke. The length and curvilinear abscissa are updated consequently.
Parameters: | vertex (StrokeVertex) – the StrokeVertex to remove from the Stroke. |
---|
Resamples the stroke so that it eventually has N points. That means it is going to add N-vertices_size, where vertices_size is the number of points we already have. If vertices_size >= N, no resampling is done.
Parameters: | n (int) – The number of vertices we eventually want in our stroke. |
---|
Resamples the stroke with a given sampling. If the sampling is smaller than the actual sampling value, no resampling is done.
Parameters: | sampling (float) – The new sampling value. |
---|
Returns a StrokeVertexIterator pointing on the first StrokeVertex of the Stroke. One can specify a sampling value to resample the Stroke on the fly if needed.
Parameters: | t (float) – The resampling value with which we want our Stroke to be resampled. If 0 is specified, no resampling is done. |
---|---|
Returns: | A StrokeVertexIterator pointing on the first StrokeVertex. |
Return type: | StrokeVertexIterator |
Returns a StrokeVertexIterator pointing after the last StrokeVertex of the Stroke.
Returns: | A StrokeVertexIterator pointing after the last StrokeVertex. |
---|---|
Return type: | StrokeVertexIterator |
Returns the number of StrokeVertex constituting the Stroke.
Returns: | The number of stroke vertices. |
---|---|
Return type: | int |
Updates the 2D length of the Stroke.
The 2D length of the Stroke.
Type: | float |
---|
The MediumType used for this Stroke.
Type: | MediumType |
---|
The ID of the texture used to simulate th marks system for this Stroke.
Type: | int |
---|
True if this Stroke uses a texture with tips, and false otherwise.
Type: | bool |
---|
Class to define a set of attributes associated with a StrokeVertex. The attribute set stores the color, alpha and thickness values for a Stroke Vertex.
Default constructor.
Copy constructor.
Parameters: | brother (StrokeAttribute) – A StrokeAttribute object. |
---|
Build a stroke vertex attribute from a set of parameters.
Parameters: |
|
---|
Interpolation constructor. Build a StrokeAttribute from two StrokeAttribute objects and an interpolation parameter.
Parameters: |
|
---|
Returns an attribute of float type.
Parameters: | name (str) – The name of the attribute. |
---|---|
Returns: | The attribute value. |
Return type: | float |
Returns an attribute of two-dimensional vector type.
Parameters: | name (str) – The name of the attribute. |
---|---|
Returns: | The attribute value. |
Return type: | mathutils.Vector |
Returns an attribute of three-dimensional vector type.
Parameters: | name (str) – The name of the attribute. |
---|---|
Returns: | The attribute value. |
Return type: | mathutils.Vector |
Checks whether the attribute name of float type is available.
Parameters: | name (str) – The name of the attribute. |
---|---|
Returns: | True if the attribute is availbale. |
Return type: | bool |
Checks whether the attribute name of two-dimensional vector type is available.
Parameters: | name (str) – The name of the attribute. |
---|---|
Returns: | True if the attribute is availbale. |
Return type: | bool |
Checks whether the attribute name of three-dimensional vector type is available.
Parameters: | name (str) – The name of the attribute. |
---|---|
Returns: | True if the attribute is availbale. |
Return type: | bool |
Adds a user-defined attribute of float type. If there is no attribute of the given name, it is added. Otherwise, the new value replaces the old one.
Parameters: |
|
---|
Adds a user-defined attribute of two-dimensional vector type. If there is no attribute of the given name, it is added. Otherwise, the new value replaces the old one.
Parameters: |
|
---|
Adds a user-defined attribute of three-dimensional vector type. If there is no attribute of the given name, it is added. Otherwise, the new value replaces the old one.
Parameters: |
|
---|
Alpha component of the stroke color.
Type: | float |
---|
RGB components of the stroke color.
Type: | mathutils.Color |
---|
Right and left components of the stroke thickness. The right (left) component is the thickness on the right (left) of the vertex when following the stroke.
Type: | mathutils.Vector |
---|
The visibility flag. True if the StrokeVertex is visible.
Type: | bool |
---|
Base class for stroke shaders. Any stroke shader must inherit from this class and overload the shade() method. A StrokeShader is designed to modify stroke attributes such as thickness, color, geometry, texture, blending mode, and so on. The basic way for this operation is to iterate over the stroke vertices of the Stroke and to modify the StrokeAttribute of each vertex. Here is a code example of such an iteration:
it = ioStroke.strokeVerticesBegin()
while not it.is_end:
att = it.object.attribute
## perform here any attribute modification
it.increment()
Default constructor.
The shading method. Must be overloaded by inherited classes.
Parameters: | stroke (Stroke) – A Stroke object. |
---|
The name of the stroke shader.
Type: | str |
---|
Class hierarchy: Interface0D > CurvePoint > StrokeVertex
Class to define a stroke vertex.
Default constructor.
Copy constructor.
Parameters: | brother (StrokeVertex) – A StrokeVertex object. |
---|
Build a stroke vertex from 2 stroke vertices and an interpolation parameter.
Parameters: |
|
---|
Build a stroke vertex from a CurvePoint
Parameters: | point (CurvePoint) – A CurvePoint object. |
---|
Build a stroke vertex from a SVertex
Parameters: | svertex (SVertex) – An SVertex object. |
---|
Build a stroke vertex from an SVertex and a StrokeAttribute object.
Parameters: |
|
---|
StrokeAttribute for this StrokeVertex.
Type: | StrokeAttribute |
---|
Curvilinear abscissa of this StrokeVertex in the Stroke.
Type: | float |
---|
2D point coordinates.
Type: | mathutils.Vector |
---|
Stroke length (it is only a value retained by the StrokeVertex, and it won’t change the real stroke length).
Type: | float |
---|
Curvilinear abscissa of this StrokeVertex in the Stroke.
Type: | float |
---|
Class hierarchy: Iterator > StrokeVertexIterator
Class defining an iterator designed to iterate over the StrokeVertex of a Stroke. An instance of a StrokeVertexIterator can be obtained from a Stroke by calling iter(), stroke_vertices_begin() or stroke_vertices_begin(). It is iterating over the same vertices as an Interface0DIterator. The difference resides in the object access: an Interface0DIterator only allows access to an Interface0D while one might need to access the specialized StrokeVertex type. In this case, one should use a StrokeVertexIterator. To call functions of the UnaryFuntion0D type, a StrokeVertexIterator can be converted to an Interface0DIterator by by calling Interface0DIterator(it).
Default constructor.
Copy constructor.
Parameters: | brother (StrokeVertexIterator) – A StrokeVertexIterator object. |
---|
Returns a copy of a decremented StrokeVertexIterator.
Returns: | A StrokeVertexIterator pointing the previous StrokeVertex. |
---|---|
Return type: | StrokeVertexIterator |
Returns a copy of an incremented StrokeVertexIterator.
Returns: | A StrokeVertexIterator pointing the next StrokeVertex. |
---|---|
Return type: | StrokeVertexIterator |
Returns a StrokeVertexIterator that traverses stroke vertices in the reversed order.
Returns: | A StrokeVertexIterator traversing stroke vertices backward. |
---|---|
Return type: | StrokeVertexIterator |
True if the interator points to the last valid element. For its counterpart (pointing to the first valid element), use it.is_begin.
Type: | bool |
---|
The StrokeVertex object currently pointed to by this iterator.
Type: | StrokeVertex |
---|
The curvilinear abscissa of the current point.
Type: | float |
---|
The point parameter at the current point in the stroke (0 <= u <= 1).
Type: | float |
---|
Class hierarchy: Interface0D > ViewVertex > TVertex
Class to define a T vertex, i.e. an intersection between two edges. It points towards two SVertex and four ViewEdges. Among the ViewEdges, two are front and the other two are back. Basically a front edge hides part of a back edge. So, among the back edges, one is of invisibility N and the other of invisibility N+1.
Default constructor.
Returns the mate edge of the ViewEdge given as argument. If the ViewEdge is frontEdgeA, frontEdgeB is returned. If the ViewEdge is frontEdgeB, frontEdgeA is returned. Same for back edges.
Parameters: | viewedge (ViewEdge) – A ViewEdge object. |
---|---|
Returns: | The mate edge of the given ViewEdge. |
Return type: | ViewEdge |
Base class for Unary Functions (functors) working on Interface0DIterator. A unary function will be used by invoking __call__() on an Interface0DIterator. In Python, several different subclasses of UnaryFunction0D are used depending on the types of functors’ return values. For example, you would inherit from a UnaryFunction0DDouble if you wish to define a function that returns a double value. Available UnaryFunction0D subclasses are:
The name of the unary 0D function.
Type: | str |
---|
Class hierarchy: UnaryFunction0D > UnaryFunction0DDouble
Base class for unary functions (functors) that work on Interface0DIterator and return a float value.
Default constructor.
Class hierarchy: UnaryFunction0D > UnaryFunction0DEdgeNature
Base class for unary functions (functors) that work on Interface0DIterator and return a Nature object.
Default constructor.
Class hierarchy: UnaryFunction0D > UnaryFunction0DFloat
Base class for unary functions (functors) that work on Interface0DIterator and return a float value.
Default constructor.
Class hierarchy: UnaryFunction0D > UnaryFunction0DId
Base class for unary functions (functors) that work on Interface0DIterator and return an Id object.
Default constructor.
Class hierarchy: UnaryFunction0D > UnaryFunction0DMaterial
Base class for unary functions (functors) that work on Interface0DIterator and return a Material object.
Default constructor.
Class hierarchy: UnaryFunction0D > UnaryFunction0DUnsigned
Base class for unary functions (functors) that work on Interface0DIterator and return an int value.
Default constructor.
Class hierarchy: UnaryFunction0D > UnaryFunction0DVec2f
Base class for unary functions (functors) that work on Interface0DIterator and return a 2D vector.
Default constructor.
Class hierarchy: UnaryFunction0D > UnaryFunction0DVec3f
Base class for unary functions (functors) that work on Interface0DIterator and return a 3D vector.
Default constructor.
Class hierarchy: UnaryFunction0D > UnaryFunction0DVectorViewShape
Base class for unary functions (functors) that work on Interface0DIterator and return a list of ViewShape objects.
Default constructor.
Class hierarchy: UnaryFunction0D > UnaryFunction0DViewShape
Base class for unary functions (functors) that work on Interface0DIterator and return a ViewShape object.
Default constructor.
Base class for Unary Functions (functors) working on Interface1D. A unary function will be used by invoking __call__() on an Interface1D. In Python, several different subclasses of UnaryFunction1D are used depending on the types of functors’ return values. For example, you would inherit from a UnaryFunction1DDouble if you wish to define a function that returns a double value. Available UnaryFunction1D subclasses are:
The name of the unary 1D function.
Type: | str |
---|
Class hierarchy: UnaryFunction1D > UnaryFunction1DDouble
Base class for unary functions (functors) that work on Interface1D and return a float value.
Default constructor.
Builds a unary 1D function using the integration method given as argument.
Parameters: | integration_type (IntegrationType) – An integration method. |
---|
The integration method.
Type: | IntegrationType |
---|
Class hierarchy: UnaryFunction1D > UnaryFunction1DEdgeNature
Base class for unary functions (functors) that work on Interface1D and return a Nature object.
Default constructor.
Builds a unary 1D function using the integration method given as argument.
Parameters: | integration_type (IntegrationType) – An integration method. |
---|
The integration method.
Type: | IntegrationType |
---|
Class hierarchy: UnaryFunction1D > UnaryFunction1DFloat
Base class for unary functions (functors) that work on Interface1D and return a float value.
Default constructor.
Builds a unary 1D function using the integration method given as argument.
Parameters: | integration_type (IntegrationType) – An integration method. |
---|
The integration method.
Type: | IntegrationType |
---|
Class hierarchy: UnaryFunction1D > UnaryFunction1DUnsigned
Base class for unary functions (functors) that work on Interface1D and return an int value.
Default constructor.
Builds a unary 1D function using the integration method given as argument.
Parameters: | integration_type (IntegrationType) – An integration method. |
---|
The integration method.
Type: | IntegrationType |
---|
Class hierarchy: UnaryFunction1D > UnaryFunction1DVec2f
Base class for unary functions (functors) that work on Interface1D and return a 2D vector.
Default constructor.
Builds a unary 1D function using the integration method given as argument.
Parameters: | integration_type (IntegrationType) – An integration method. |
---|
The integration method.
Type: | IntegrationType |
---|
Class hierarchy: UnaryFunction1D > UnaryFunction1DVec3f
Base class for unary functions (functors) that work on Interface1D and return a 3D vector.
Default constructor.
Builds a unary 1D function using the integration method given as argument.
Parameters: | integration_type (IntegrationType) – An integration method. |
---|
The integration method.
Type: | IntegrationType |
---|
Class hierarchy: UnaryFunction1D > UnaryFunction1DVectorViewShape
Base class for unary functions (functors) that work on Interface1D and return a list of ViewShape objects.
Default constructor.
Builds a unary 1D function using the integration method given as argument.
Parameters: | integration_type (IntegrationType) – An integration method. |
---|
The integration method.
Type: | IntegrationType |
---|
Class hierarchy: UnaryFunction1D > UnaryFunction1DVoid
Base class for unary functions (functors) working on Interface1D.
Default constructor.
Builds a unary 1D function using the integration method given as argument.
Parameters: | integration_type (IntegrationType) – An integration method. |
---|
The integration method.
Type: | IntegrationType |
---|
Base class for unary predicates that work on Interface0DIterator. A UnaryPredicate0D is a functor that evaluates a condition on an Interface0DIterator and returns true or false depending on whether this condition is satisfied or not. The UnaryPredicate0D is used by invoking its __call__() method. Any inherited class must overload the __call__() method.
Default constructor.
Must be overload by inherited classes.
Parameters: | it (Interface0DIterator) – The Interface0DIterator pointing onto the Interface0D at which we wish to evaluate the predicate. |
---|---|
Returns: | True if the condition is satisfied, false otherwise. |
Return type: | bool |
The name of the unary 0D predicate.
Type: | str |
---|
Base class for unary predicates that work on Interface1D. A UnaryPredicate1D is a functor that evaluates a condition on a Interface1D and returns true or false depending on whether this condition is satisfied or not. The UnaryPredicate1D is used by invoking its __call__() method. Any inherited class must overload the __call__() method.
Default constructor.
Must be overload by inherited classes.
Parameters: | inter (Interface1D) – The Interface1D on which we wish to evaluate the predicate. |
---|---|
Returns: | True if the condition is satisfied, false otherwise. |
Return type: | bool |
The name of the unary 1D predicate.
Type: | str |
---|
Class hierarchy: Interface1D > ViewEdge
Class defining a ViewEdge. A ViewEdge in an edge of the image graph. it connects two ViewVertex objects. It is made by connecting a set of FEdges.
Default constructor.
Copy constructor.
Parameters: | brother (ViewEdge) – A ViewEdge object. |
---|
Sets Viewedge to this for all embedded fedges.
The time stamp of this ViewEdge.
Type: | int |
---|
The first ViewVertex.
Type: | ViewVertex |
---|
True if this ViewEdge forms a closed loop.
Type: | bool |
---|
The second ViewVertex.
Type: | ViewVertex |
---|
The shape that is occluded by the ViewShape to which this ViewEdge belongs to. If no object is occluded, this property is set to None.
Type: | ViewShape |
---|
The quantitative invisibility.
Type: | int |
---|
Class hierarchy: Iterator > ViewEdgeIterator
Base class for iterators over ViewEdges of the ViewMap Graph. Basically the increment() operator of this class should be able to take the decision of “where” (on which ViewEdge) to go when pointing on a given ViewEdge.
Builds a ViewEdgeIterator from a starting ViewEdge and its orientation.
Parameters: |
|
---|
Copy constructor.
Parameters: | brother (ViewEdgeIterator) – A ViewEdgeIterator object. |
---|
Changes the current orientation.
The orientation of the pointed ViewEdge in the iteration. If true, the iterator looks for the next ViewEdge among those ViewEdges that surround the ending ViewVertex of the “begin” ViewEdge. If false, the iterator searches over the ViewEdges surrounding the ending ViewVertex of the “begin” ViewEdge.
Type: | bool |
---|
Class defining the ViewMap.
Default constructor.
Gets the FEdge nearest to the 2D point specified as arguments.
Parameters: |
|
---|---|
Returns: | The FEdge nearest to the specified 2D point. |
Return type: |
Gets the ViewEdge nearest to the 2D point specified as arguments.
Parameters: |
|
---|---|
Returns: | The ViewEdge nearest to the specified 2D point. |
Return type: |
Class gathering the elements of the ViewMap (i.e., ViewVertex and ViewEdge) that are issued from the same input shape.
Default constructor.
Copy constructor.
Parameters: | brother (ViewShape) – A ViewShape object. |
---|
Builds a ViewShape from an SShape.
Parameters: | sshape (SShape) – An SShape object. |
---|
Adds a ViewEdge to the list of ViewEdge objects.
Parameters: | edge (ViewEdge) – A ViewEdge object. |
---|
Adds a ViewVertex to the list of the ViewVertex objects.
Parameters: | vertex (ViewVertex) – A ViewVertex object. |
---|
The name of the ViewShape.
Type: | str |
---|
The list of ViewVertex objects contained in this ViewShape.
Type: | List of ViewVertex objects |
---|
Class hierarchy: Interface0D > ViewVertex
Class to define a view vertex. A view vertex is a feature vertex corresponding to a point of the image graph, where the characteristics of an edge (e.g., nature and visibility) might change. A ViewVertex can be of two kinds: A TVertex when it corresponds to the intersection between two ViewEdges or a NonTVertex when it corresponds to a vertex of the initial input mesh (it is the case for vertices such as corners for example). Thus, this class can be specialized into two classes, the TVertex class and the NonTVertex class.
Returns an iterator over the ViewEdges that goes to or comes from this ViewVertex pointing to the first ViewEdge of the list. The orientedViewEdgeIterator allows to iterate in CCW order over these ViewEdges and to get the orientation for each ViewEdge (incoming/outgoing).
Returns: | An orientedViewEdgeIterator pointing to the first ViewEdge. |
---|---|
Return type: | orientedViewEdgeIterator |
Returns an orientedViewEdgeIterator over the ViewEdges around this ViewVertex, pointing after the last ViewEdge.
Returns: | An orientedViewEdgeIterator pointing after the last ViewEdge. |
---|---|
Return type: | orientedViewEdgeIterator |
Returns an orientedViewEdgeIterator pointing to the ViewEdge given as argument.
Parameters: | edge (ViewEdge) – A ViewEdge object. |
---|---|
Returns: | An orientedViewEdgeIterator pointing to the given ViewEdge. |
Return type: | orientedViewEdgeIterator |
Class hierarchy: Iterator > orientedViewEdgeIterator
Class representing an iterator over oriented ViewEdges around a ViewVertex. This iterator allows a CCW iteration (in the image plane). An instance of an orientedViewEdgeIterator can only be obtained from a ViewVertex by calling edges_begin() or edges_end().
Default constructor.
Copy constructor.
Parameters: | iBrother (orientedViewEdgeIterator) – An orientedViewEdgeIterator object. |
---|