The Curve class is used by SketchUp to unite a series of Edge objects into
one conceptual entity. Since SketchUp is a surface modeler, all circles,
arcs, and arbitrary curves are really just edges that are bound together in
sequence.
There is a subclass of Curve called ArcCurve, which is any curve that makes
up part of a circle. You can think of ArcCurves as entities that were created
with SketchUp's Arc or Circle drawing tools and Curves as entities that were
created with the Freehand drawing tool.
The count_edges method is used to retrieve the number of Edge objects that make up the Curve.
Returns:
centerpoint = Geom::Point3d.new # Create a circle perpendicular to the normal or Z axis vector = Geom::Vector3d.new 0,0,1 vector2 = vector.normalize! model = Sketchup.active_model entities = model.entities edgearray = entities.add_circle centerpoint, vector2, 10 edge = edgearray[0] curve = edge.curve number = curve.count_edges
The each_edge method is used to iterate through all of the Edge objects in the curve.
Returns:
centerpoint = Geom::Point3d.new
# Create a circle perpendicular to the normal or Z axis
vector = Geom::Vector3d.new 0,0,1
vector2 = vector.normalize!
model = Sketchup.active_model
entities = model.entities
edgearray = entities.add_circle centerpoint, vector2, 10
edge = edgearray[0]
curve = edge.curve
curve.each_edge {|e| UI.messagebox e}The edges method is used to retrieve an array of Edge objects that make up the Curve.
Returns:
centerpoint = Geom::Point3d.new # Create a circle perpendicular to the normal or Z axis vector = Geom::Vector3d.new 0,0,1 vector2 = vector.normalize! model = Sketchup.active_model entities = model.entities edgearray = entities.add_circle centerpoint, vector2, 10 edge = edgearray[0] curve = edge.curve edges = curve.edges
The first_edge method is used to retrieve the first edge of the curve.
Returns:
centerpoint = Geom::Point3d.new # Create a circle perpendicular to the normal or Z axis vector = Geom::Vector3d.new 0,0,1 vector2 = vector.normalize! model = Sketchup.active_model entities = model.entities edgearray = entities.add_circle centerpoint, vector2, 10 edge = edgearray[0] curve = edge.curve firstedge = curve.first_edge
The last_edge method is used to retrieve the last edge of the curve.
Returns:
centerpoint = Geom::Point3d.new # Create a circle perpendicular to the normal or Z axis vector = Geom::Vector3d.new 0,0,1 vector2 = vector.normalize! model = Sketchup.active_model entities = model.entities edgearray = entities.add_circle centerpoint, vector2, 10 edge = edgearray[7] curve = edge.curve lastedge = curve.last_edge
The length method retrieves the length of the curve.
Returns:
centerpoint = Geom::Point3d.new # Create a circle perpendicular to the normal or Z axis vector = Geom::Vector3d.new 0,0,1 vector2 = vector.normalize! model = Sketchup.active_model entities = model.entities edgearray = entities.add_circle centerpoint, vector2, 10 edge = edgearray[7] curve = edge.curve length = curve.length
The vertices method retrieves a collection of all vertices in a curve.
Arguments:
Returns:
# Need example ruby code here.
The vertices method retrieves a collection of all vertices in a curve.
Returns:
centerpoint = Geom::Point3d.new # Create a circle perpendicular to the normal or Z axis vector = Geom::Vector3d.new 0,0,1 vector2 = vector.normalize! model = Sketchup.active_model entities = model.entities edgearray = entities.add_circle centerpoint, vector2, 10 edge = edgearray[7] curve = edge.curve vertices = curve.vertices