Difference between revisions of "ShapePath"

From Silhouette Wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 24: Line 24:
 
|-
 
|-
 
|points
 
|points
|a List of tuples containing the control point information
+
|a List of tuples containing the control point information. The format of the tuples is dependent on the shape type.<br/>
 +
''Bezier'' - (in_tangent, control_point, out_tangent)<br/>
 +
''Bspline'' - (control_point, repeat, weight)<br/>
 +
''Xspline'' - (control_point, weight)
 
|-
 
|-
 
|range
 
|range
Line 38: Line 41:
 
! scope="col" | Name
 
! scope="col" | Name
 
! scope="col" class="unsortable" | Description
 
! scope="col" class="unsortable" | Description
 +
| scope="col" | Added
 
|-
 
|-
|__init__(label, menu=None, type=Action, extension=None)
+
|clone()
|Constructor - Initializes the base class. The menu can be listed separately or prefixed to the label with the '<nowiki>|</nowiki>' character.
+
|returns a copy of the path
 
|-
 
|-
|available()
+
|evalDerivative(t)
|Should return True (the default) if the Action is available. The Action should examine the current state in this method and assert (with an optional error message) that conditions are good for execution.
+
|evaluate the [[Point3D|derivative]] at ''t''
 
|-
 
|-
|execute(path=None)
+
|interpolate(path, t)
|Called to execute the Action. UI Actions should be undoable. Importer/Exporter actions are passed the path to the file to operate on.
+
|generate and return a new ShapePath by interpolating with <tt>path</tt> using ''t''
 +
|-
 +
|selected(index)
 +
|True if the control point at index is selected
 +
|-
 +
|transform([[Matrix]], selected=False)
 +
|transform all (or just the selected) points by the [[Matrix]]
 +
|-
 +
|insertPoint(t)
 +
|inserts a new control point at <tt>t</tt>
 +
|6.0
 +
|-
 +
|deletePoint(index)
 +
|deletes the point at <tt>index</tt>
 +
|6.0
 +
|-
 +
|evalNormal(t)
 +
|returns the normal at <tt>t</tt>
 +
|6.0
 +
|-
 +
|evalPoint(t)
 +
|returns the point information  at <tt>t</tt>
 +
|6.0
 
|}
 
|}
  
Line 62: Line 88:
 
|Flag_Tagged
 
|Flag_Tagged
 
|The control point is tagged
 
|The control point is tagged
 +
|}
 +
 +
 +
{| class="wikitable"
 +
! Shape Type!!No Feather!!Per-point Feather
 +
|-
 +
|Closed Bezier||(in_tangent, point, out_tangent)||(in_tangent, point, out_tangent, feather_point, feather_in_tangent, feather_out_tangent)
 +
|-
 +
|Open Bezier||(in_tangent, point, out_tangent)||(in_tangent, point, out_tangent, stroke_width, feather_width)
 +
|-
 +
|Closed Bspline||(point, repeat, weight)||(point, repeat, weight, feather_point, feather_weight)
 +
|-
 +
|Open Bspline||(point, repeat, weight)||(point, repeat, weight, width, feather_width)
 +
|-
 +
|Closed Xspline||(point, weight)||(point, weight, feather_point, feather_weight)
 +
|-
 +
|Open Xspline||(point, weight)||(point,  weight, width, feather_width)
 +
|-
 
|}
 
|}

Latest revision as of 13:36, 26 July 2018

A ShapePath represents one key of spline data for a shape.

Attributes

Read-only unless otherwise noted.

Name Description
bounds the bounding box
clockwise True if clock-wise
closed True if closed (read/write)
flags a List of Integers representing the flags for each control point
numPoints the number of control points
points a List of tuples containing the control point information. The format of the tuples is dependent on the shape type.

Bezier - (in_tangent, control_point, out_tangent)
Bspline - (control_point, repeat, weight)
Xspline - (control_point, weight)

range a Tuple (start, end) with the t-value range for this shape type
type the Shape Type

Methods

Name Description Added
clone() returns a copy of the path
evalDerivative(t) evaluate the derivative at t
interpolate(path, t) generate and return a new ShapePath by interpolating with path using t
selected(index) True if the control point at index is selected
transform(Matrix, selected=False) transform all (or just the selected) points by the Matrix
insertPoint(t) inserts a new control point at t 6.0
deletePoint(index) deletes the point at index 6.0
evalNormal(t) returns the normal at t 6.0
evalPoint(t) returns the point information at t 6.0

Constants

Control Point Flags

Name Description
Flag_Selected The control point is selected
Flag_Tagged The control point is tagged


Shape Type No Feather Per-point Feather
Closed Bezier (in_tangent, point, out_tangent) (in_tangent, point, out_tangent, feather_point, feather_in_tangent, feather_out_tangent)
Open Bezier (in_tangent, point, out_tangent) (in_tangent, point, out_tangent, stroke_width, feather_width)
Closed Bspline (point, repeat, weight) (point, repeat, weight, feather_point, feather_weight)
Open Bspline (point, repeat, weight) (point, repeat, weight, width, feather_width)
Closed Xspline (point, weight) (point, weight, feather_point, feather_weight)
Open Xspline (point, weight) (point, weight, width, feather_width)