user: Show practical ways to work with Freestyle.Types in a Blender add-on or script – include code.

assistant:  ) ¶ Adds a ViewEdge at the end of the Chain. Parameters : viewedge ( ViewEdge ) – The ViewEdge that must be added. orientation ( bool ) – The orientation with which the ViewEdge must be processed. push_viewedge_front ( viewedge , orientation ) ¶ Adds a ViewEdge at the beginning of the Chain. Parameters : viewedge ( ViewEdge ) – The ViewEdge that must be added. orientation ( bool ) – The orientation with which the ViewEdge must be processed. class freestyle.types. ChainingIterator ¶ 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). __init__ ( restrict_to_selection = True , restrict_to_unvisited = True , begin = None , orientation = True ) ¶ __init__ ( brother ) Builds a Chaining Iterator from the first ViewEdge used for iteration and its orientation or by using the copy constructor. Parameters : restrict_to_selection ( bool ) – Indicates whether to force the chaining to stay within the set of selected ViewEdges or not. restrict_to_unvisited ( bool ) – Indicates whether a ViewEdge that has already been chained must be ignored ot not. begin ( ViewEdge | None) – The ViewEdge from which to start the chain. orientation ( bool ) – The direction to follow to explore the graph. If true, the direction indicated by the first ViewEdge is used. brother ( ChainingIterator ) init ( ) ¶ 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. traverse ( it ) ¶ 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 | None is_incrementing ¶ True if the current iteration is an incrementation. Type : bool next_vertex ¶ The ViewVertex that is the next crossing. Type : ViewVertex object ¶ The ViewEdge object currently pointed by this iterator. Type : ViewEdge class freestyle.types. Curve ¶ 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. __init__ ( ) ¶ __init__ ( brother ) __init__ ( id ) Builds a FrsCurve using a default constructor, copy constructor or from an Id . Parameters : brother ( Curve ) – A Curve object. id ( Id ) – An Id object. push_vertex_back ( vertex ) ¶ Adds a single vertex at the end of the Curve. Parameters : vertex ( SVertex | CurvePoint ) – A vertex object. push_vertex_front ( vertex ) ¶ Adds a single vertex at the front of the Curve. Parameters : vertex ( SVertex | CurvePoint ) – A vertex object. is_empty ¶ True if the Curve doesn’t have any Vertex yet. Type : bool segments_size ¶ The number of segments in the polyline constituting the Curve. Type : int class freestyle.types. CurvePoint ¶ 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. __init__ ( ) ¶ __init__ ( brother ) __init__ ( first_vertex , second_vertex , t2d ) __init__ ( first_point , second_point , t2d ) Builds a CurvePoint using the default constructor, copy constructor, or one of the overloaded constructors. The over loaded constructors can either take two SVertex or two CurvePoint objects and an interpolation parameter Parameters : brother ( CurvePoint ) – A CurvePoint object. first_vertex ( SVertex ) – The first SVertex. second_vertex ( SVertex ) – The second SVertex. first_point ( CurvePoint ) – The first CurvePoint. second_point ( CurvePoint ) – The second CurvePoint. t2d ( float ) – A 2D interpolation parameter used to linearly interpolate first_vertex and second_vertex or first_point and second_point. fedge ¶ 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 first_svertex ¶ The first SVertex upon which the CurvePoint is built. Type : SVertex second_svertex ¶ The second SVertex upon which the CurvePoint is built. Type : SVertex t2d ¶ The 2D interpolation parameter. Type : float class freestyle.types. CurvePointIterator ¶ Class hierarchy: Iterator > CurvePointIterator Class representing an iterator on a curve. Allows an iterating outside initial vertices. A CurvePoint is instantiated and returned through the .object attribute. __init__ ( ) ¶ __init__ ( brother ) __init__ ( step = 0.0 ) Builds a CurvePointIterator object using either the default constructor, copy constructor, or the overloaded constructor. Parameters : brother ( CurvePointIterator ) – A CurvePointIterator object. 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). object ¶ The CurvePoint object currently pointed by this iterator. Type : CurvePoint t ¶ The curvilinear abscissa of the current point. Type : float u ¶ The point parameter at the current point in the stroke (0 Type : float class freestyle.types. FEdge ¶ 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. FEdge ( ) ¶ FEdge ( brother ) Builds an FEdge using the default constructor, copy constructor, or between two SVertex objects. Parameters : brother ( FEdge ) – An FEdge object. first_vertex ( SVertex ) – The first SVertex. second_vertex ( SVertex ) – The second SVertex. first_svertex ¶ The first SVertex constituting this FEdge. Type : SVertex id ¶ The Id of this FEdge. Type : Id is_smooth ¶ True if this FEdge is a smooth FEdge. Type : bool nature ¶ The nature of this FEdge. Type : Nature next_fedge ¶ The FEdge following this one in the ViewEdge. The value is None if this FEdge is the last of the ViewEdge. Type : FEdge previous_fedge ¶ The FEdge preceding this one in the ViewEdge. The value is None if this FEdge is the first one of the ViewEdge. Type : FEdge second_svertex ¶ The second SVertex constituting this FEdge. Type : SVertex viewedge ¶ The ViewEdge to which this FEdge belongs to. Type : ViewEdge class freestyle.types. FEdgeSharp ¶ 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 bordered 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. __init__ ( ) ¶ __init__ ( brother ) __init__ ( first_vertex , second_vertex ) Builds an FEdgeSharp using the default constructor, copy constructor, or between two SVertex objects. Parameters : brother ( FEdgeSharp ) – An FEdgeSharp object. first_vertex ( SVertex ) – The first SVertex object. second_vertex ( SVertex ) – The second SVertex object. face_mark_left ¶ The face mark of the face lying on the left of the FEdge. Type : bool face_mark_right ¶ 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 material_index_left ¶ The index of the material of the face lying on the left of the FEdge. Type : int material_index_right ¶ 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 material_left ¶ The material of the face lying on the left of the FEdge. Type : Material material_right ¶ 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 normal_left ¶ The normal to the face lying on the left of the FEdge. Type : mathutils.Vector normal_right ¶ 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 freestyle.types. FEdgeSmooth ¶ 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. __init__ ( ) ¶ __init__ ( brother ) __init__ ( first_vertex , second_vertex ) Builds an FEdgeSmooth using the default constructor, copy constructor, or between two SVertex . Parameters : brother ( FEdgeSmooth ) – An FEdgeSmooth object. first_vertex ( SVertex ) – The first SVertex object. second_vertex ( SVertex ) – The second SVertex object. face_mark ¶ The face mark of the face that this FEdge is running across. Type : bool material ¶ The material of the face that this FEdge is running across. Type : Material material_index ¶ The index of the material of the face that this FEdge is running across. Type : int normal ¶ The normal of the face that this FEdge is running across. Type : mathutils.Vector class freestyle.types. Id ¶ Class for representing an object Id. __init__ ( brother ) ¶ __init__ ( first = 0 , second = 0 ) Build the Id from two numbers or another Id using the copy constructor. Parameters : brother ( Id :arg first: The first number.) – An Id object. second ( int ) – The second number. first ¶ The first number constituting the Id. Type : int second ¶ The second number constituting the Id. Type : int class freestyle.types. IntegrationType ¶ 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: IntegrationType.MEAN: The value computed for the 1D element is the mean of the values obtained for the 0D elements. IntegrationType.MIN: The value computed for the 1D element is the minimum of the values obtained for the 0D elements. IntegrationType.MAX: The value computed for the 1D element is the maximum of the values obtained for the 0D elements. IntegrationType.FIRST: The value computed for the 1D element is the first of the values obtained for the 0D elements. IntegrationType.LAST: The value computed for the 1D element is the last of the values obtained for the 0D elements. class freestyle.types. Interface0D ¶ Base class for any 0D element. __init__ ( ) ¶ Default constructor. get_fedge ( inter ) ¶ 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 id ¶ The Id of this 0D element. Type : Id name ¶ The string of the name of this 0D element. Type : str nature ¶ The nature of this 0D element. Type : Nature point_2d ¶ The 2D point of this 0D element. Type : mathutils.Vector point_3d ¶ The 3D point of this 0D element. Type : mathutils.Vector projected_x ¶ The X coordinate of the projected 3D point of this 0D element. Type : float projected_y ¶ The Y coordinate of the projected 3D point of this 0D element. Type : float projected_z ¶ The Z coordinate of the projected 3D point of this 0D element. Type : float class freestyle.types. Interface0DIterator ¶ Class hierarchy: Iterator > Interface0DIterator Class defining an iterator over Interface0D elements. An instance of this iterator is always obtained from a 1D element. __init__ ( brother ) ¶ __init__ ( it ) Construct a nested Interface0DIterator using either the copy constructor or the constructor that takes an argument of a Function0D. Parameters : brother ( Interface0DIterator ) – An Interface0DIterator object. it ( SVertexIterator | CurvePointIterator | StrokeVertexIterator ) – An iterator object to be nested. at_last ¶ True if the iterator points to the last valid element. For its counterpart (pointing to the first valid element), use it.is_begin. Type : bool object ¶ 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. t ¶ The curvilinear abscissa of the current point. Type : float u ¶ The point parameter at the current point in the 1D element (0 Type : float class freestyle.types. Interface1D ¶ Base class for any 1D element. __init__ ( ) ¶ Default constructor. points_begin ( t = 0.0 ) ¶ 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 points_end ( t = 0.0 ) ¶ 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 vertices_begin ( ) ¶ Returns an iterator over the Interface1D vertices, pointing to the first vertex. Returns : An Interface0DIterator pointing to the first vertex. Return type : Interface0DIterator vertices_end ( ) ¶ Returns an iterator over the Interface1D vertices, pointing after the last vertex. Returns : An Interface0DIterator pointing after the last vertex. Return type : Interface0DIterator id ¶ The Id of this Interface1D. Type : Id length_2d ¶ The 2D length of this Interface1D. Type : float name ¶ The string of the name of the 1D element. Type : str nature ¶ The nature of this Interface1D. Type : Nature time_stamp ¶ The time stamp of the 1D element, mainly used for selection. Type : int class freestyle.types. Iterator ¶ Base class to define iterators. __init__ ( ) ¶ Default constructor. decrement ( ) ¶ Makes the iterator point the previous element. increment ( ) ¶ Makes the iterator point the next element. is_begin ¶ True if the iterator points to the first element. Type : bool is_end ¶ True if the iterator points to the last element. Type : bool name ¶ The string of the name of this iterator. Type : str class freestyle.types. Material ¶ Class defining a material. __init__ ( ) ¶ __init__ ( brother ) __init__ ( line , diffuse , ambient , specular , emission , shininess , priority ) Creates a FrsMaterial using either default constructor, copy constructor, or an overloaded constructor Parameters : brother ( Material ) – A Material object to be used as a copy constructor. line ( mathutils.Vector | tuple[float, float, float, float] | list[float]) – The line color. diffuse – The diffuse color. ambient ( mathutils.Vector | tuple[float, float, float, float] | list[float]) – The ambient color. specular ( mathutils.Vector | tuple[float, float, float, float] | list[float]) – The specular color. emission ( mathutils.Vector | tuple[float, float, float, float] | list[float]) – The emissive color. shininess ( float ) – The shininess coefficient. priority ( int ) – The line color priority. ambient ¶ RGBA components of the ambient color of the material. Type : mathutils.Color diffuse ¶ RGBA components of the diffuse color of the material. Type : mathutils.Vector emission ¶ RGBA components of the emissive color of the material. Type : mathutils.Color line ¶ RGBA components of the line color of the material. Type : mathutils.Vector priority ¶ Line color priority of the material. Type : int shininess ¶ Shininess coefficient of the material. Type : float specular ¶ RGBA components of the specular color of the material. Type : mathutils.Vector class freestyle.types. MediumType ¶ Class hierarchy: int > MediumType The different blending modes available to simulate the interaction media-medium: Stroke.DRY_MEDIUM: To simulate a dry medium such as Pencil or Charcoal. Stroke.HUMID_MEDIUM: To simulate ink painting (color subtraction blending). Stroke.OPAQUE_MEDIUM: To simulate an opaque medium (oil, spray…). class freestyle.types. Nature ¶ Class hierarchy: int > Nature Different possible natures of 0D and 1D