Class: Layout::Path
Overview
A path entity represents a continuous, multi-segment polyline or bezier curve.
Constant Summary #
- Layout::Path::POINT_TYPE_MOVE_TO
- Layout::Path::POINT_TYPE_LINE_TO
- Layout::Path::POINT_TYPE_BEZIER_TO
- Layout::Path::POINT_TYPE_ARC_CENTER
- Layout::Path::POINT_TYPE_BEZIER_CONTROL
- Layout::Path::POINT_TYPE_CLOSE
- Layout::Path::PATH_WINDING_NONE
- Layout::Path::PATH_WINDING_CLOCKWISE
- Layout::Path::PATH_WINDING_COUNTER_CLOCKWISE
Class Method Summary # collapse
-
.new_arc(center_point, radius, start_angle, end_angle) ⇒ Layout::Path
The Path.new_arc method creates a new arc-shaped Path.
Instance Method Summary # collapse
-
#append_point(*args) ⇒ Object
The #append_point method appends a Geom::Point2d to the end of the Path.
- #arc ⇒ Array(Geom::Point2d, Float, Float, Float)?
- #circle ⇒ Array(Geom::Point2d, Float)?
- #close ⇒ Object
- #closed? ⇒ Boolean
-
#end_arrow ⇒ Layout::Path?
The #end_arrow method creates a new Path from an end arrow.
-
#end_point ⇒ Geom::Point2d
The #end_point method returns the end point of the Path.
-
#initialize(*args) ⇒ Object
constructor
The #initialize method creates a new Path between a start point and an end point, or from a provided Rectangle or Ellipse.
-
#parametric_length ⇒ Float
The #parametric_length method returns the parametric length for the Path.
-
#point_at(parametric_value) ⇒ Geom::Point2d
The #point_at method returns the Geom::Point2d at a given parametric value.
-
#point_types ⇒ Array<Integer>
The #point_types method returns an array of point types corresponding to the Geom::Point2ds in the Path.
-
#points ⇒ Array<Geom::Point2d>
The #points method returns an array of Geom::Point2ds in the Path.
-
#start_arrow ⇒ Layout::Path?
The #start_arrow method creates a new Path from a start arrow.
-
#start_point ⇒ Geom::Point2d
The #start_point method returns the start point of the Path.
-
#tangent_at(parametric_value) ⇒ Geom::Vector2d
The #tangent_at method returns the tangent Geom::Vector2d at the given parametric value.
- #winding ⇒ Integer
Methods inherited from Entity
#==, #bounds, #document, #drawing_bounds, #group, #layer_instance, #locked=, #locked?, #move_to_group, #move_to_layer, #on_shared_layer?, #page, #style, #style=, #transform!, #transformation, #untransformed_bounds, #untransformed_bounds=
Constructor Details
↑ #initialize(start_point, end_point) ⇒ Layout::Path #initialize(start_point, control_point_1, control_point_2, end_point) ⇒ Layout::Path #initialize(rectangle) ⇒ Layout::Path #initialize(ellipse) ⇒ Layout::Path
The #initialize method creates a new Layout::Path between a start point and an end point, or from a provided Rectangle or Ellipse.
Class Method Details
↑ .new_arc(center_point, radius, start_angle, end_angle) ⇒ Layout::Path
The new_arc method creates a new arc-shaped Layout::Path.
Instance Method Details
↑ #append_point(point) ⇒ Layout::Path #append_point(control_point1, control_point2, point) ⇒ Layout::Path
The #append_point method appends a Geom::Point2d to the end of the Layout::Path.
↑ #arc ⇒ Array(Geom::Point2d, Float, Float, Float)?
The #arc method returns the parameters of an arc from the Layout::Path, or nil
if path is not an arc.
↑ #circle ⇒ Array(Geom::Point2d, Float)?
The #circle method returns the parameters of a circle from the Layout::Path, or nil
if path is not a circle.
↑ #close ⇒ Object
The #close method closes the Layout::Path.
↑ #closed? ⇒ Boolean
The #closed? method returns whether the Layout::Path is closed.
↑ #end_arrow ⇒ Layout::Path?
The #end_arrow method creates a new Layout::Path from an end arrow.
↑ #end_point ⇒ Geom::Point2d
The #end_point method returns the end point of the Layout::Path.
↑ #parametric_length ⇒ Float
The #parametric_length method returns the parametric length for the Layout::Path. The parametric length is the length with respect to the curve of the Layout::Path.
↑ #point_at(parametric_value) ⇒ Geom::Point2d
The #point_at method returns the Geom::Point2d at a given parametric value.
↑ #point_types ⇒ Array<Integer>
The #point_types method returns an array of point types corresponding to the Geom::Point2ds in the Layout::Path.
A point type can be one of the following values:
POINT_TYPE_MOVE_TO
POINT_TYPE_LINE_TO
POINT_TYPE_BEZIER_TO
POINT_TYPE_ARC_CENTER
POINT_TYPE_BEZIER_CONTROL
POINT_TYPE_CLOSE
↑ #points ⇒ Array<Geom::Point2d>
The #points method returns an array of Geom::Point2ds in the Layout::Path.
↑ #start_arrow ⇒ Layout::Path?
The #start_arrow method creates a new Layout::Path from a start arrow.
↑ #start_point ⇒ Geom::Point2d
The #start_point method returns the start point of the Layout::Path.
↑ #tangent_at(parametric_value) ⇒ Geom::Vector2d
The #tangent_at method returns the tangent Geom::Vector2d at the given parametric value.
↑ #winding ⇒ Integer
The #winding method returns the winding type of the Layout::Path.
A point type can be one of the following values:
PATH_WINDING_NONE
PATH_WINDING_CLOCKWISE
PATH_WINDING_COUNTER_CLOCKWISE