Difference between revisions of "Bezier Class"

From Derivative
Jump to navigation Jump to search
Line 12: Line 12:
 
     |class=Bezier
 
     |class=Bezier
 
     |name=anchors
 
     |name=anchors
     |type=
+
     |type=list
 
     |set=0
 
     |set=0
 
     |text=Returns the list of anchor vertices.
 
     |text=Returns the list of anchor vertices.
Line 19: Line 19:
 
     |class=Bezier
 
     |class=Bezier
 
     |name=basis
 
     |name=basis
     |type=
+
     |type=list
 
     |set=0
 
     |set=0
 
     |text=Return the bezier basis as a list of float values.
 
     |text=Return the bezier basis as a list of float values.
Line 26: Line 26:
 
     |class=Bezier
 
     |class=Bezier
 
     |name=closed
 
     |name=closed
     |type=
+
     |type=bool
     |set=0
+
     |set=1
     |text=Controls whether the curve is closed or open.
+
     |text=Get or set whether the curve is closed or open.
 
}}
 
}}
 
{{ClassMember
 
{{ClassMember
 
     |class=Bezier
 
     |class=Bezier
 
     |name=order
 
     |name=order
     |type=
+
     |type=float
 
     |set=0
 
     |set=0
 
     |text=Return the bezier order. The order is one more than the degree.
 
     |text=Return the bezier order. The order is one more than the degree.
Line 40: Line 40:
 
     |class=Bezier
 
     |class=Bezier
 
     |name=segments
 
     |name=segments
     |type=
+
     |type=list
 
     |set=0
 
     |set=0
 
     |text=Returns a list of segments, where each segment is a list of vertices.
 
     |text=Returns a list of segments, where each segment is a list of vertices.
Line 47: Line 47:
 
     |class=Bezier
 
     |class=Bezier
 
     |name=tangents
 
     |name=tangents
     |type=
+
     |type=list
 
     |set=0
 
     |set=0
 
     |text=Returns the tangents as a list of vertex pairs.
 
     |text=Returns the tangents as a list of vertex pairs.

Revision as of 11:21, 6 June 2018

A Bezier describes an instance of a single geometry Bezier primitive (containing a set of connected Bezier curves). It is an instance of a Prim Class. It can be created from either a Model SOP or Script SOP. Each curve is described by a set of segments, where each segment is a list of vertices. The first and last vertex of each segment is an anchor position, while its neighboring vertices describe tangent handles.

The members and methods below allow modification of the Bezier in a modelling context, however the Bezier can also be modified by direction manipulation of its vertices. See Prim Class for more details.


Members[edit]

anchorslist (Read Only):

Returns the list of anchor vertices.

basislist (Read Only):

Return the bezier basis as a list of float values.

closedbool :

Get or set whether the curve is closed or open.

orderfloat (Read Only):

Return the bezier order. The order is one more than the degree.

segmentslist (Read Only):

Returns a list of segments, where each segment is a list of vertices.

tangentslist (Read Only):

Returns the tangents as a list of vertex pairs.

Methods[edit]

insertAnchor(u)Vertex:

inserts anchor at given position (u from 0..1) and returns anchor vertex.

updateAnchor(anchorIndex, targetPosition, tangents=True)tdu.Position:

Modify the anchor vertex to the new position. If tangents is True, modify neighboring tangent vertices as well. Returns resulting position.

appendAnchor(targetPosition, preserveShape=True)Vertex:

Appends a set of vertices, creating a new segment on the curve, ending with the targetPosition.

Returns final anchor vertex.

  • preserveShape - (Keyword, Optional) Specifies whether the new tangent will align with the previous segment or not.

updateTangent(tangentIndex, targetPosition, rotate=True, scale=True, rotateLock=True, scaleLock=True)tdu.Position:

Modify the vertex vertex to the new position, constraining either rotation or scale. Locked controls matching tangent. Returns resulting position.

deleteAnchor(anchorIndex)None:

Deletes the anchor and its neighbouring tangents.

TouchDesigner Build: