ArcCurve

class ArcCurve

Parent: Curve | Class Index
Methods:center,end_angle, normal, plane, radius, start_angle, xaxis, yaxis |
Sample Code: arccurvetests.rb |

An ArcCurve is a Curve that makes up part of a circle. This class can be treated as though it were a representation of a circle entity.

Instance Methods

center
The center method is used to retrieve the Point3d that is at the center of the circular arc.
Syntax:
point = arc.center
Arguments:
Return Value:
point - a Point3d at the center of the arc if successful
Comments:
Example:

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.active_entities
edgearray = entities.add_circle centerpoint, vector2, 10
edge = edgearray[0]
arccurve = edge.curve
point = arccurve.center

end_angle
The end_angle method is used to retrieve the angle of the end of the arc measured from the X axis in radians.
Syntax:
angle = arc.end_angle
Arguments:
Return Value:
angle - the angle of the end of the arc if successful
Comments:
Example:

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.active_entities
edgearray = entities.add_circle centerpoint, vector2, 10
edge = edgearray[0]
arccurve = edge.curve
endangle = arccurve.end_angle

normal
The normal method retrieves a Vector3d that is perpendicular to the plane of the arc.
Syntax:
vector = arc.normal
Arguments:
Return Value:
vector - a Vector3d object if successful
Comments:
Example:

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.active_entities
edgearray = entities.add_circle centerpoint, vector2, 10
edge = edgearray[0]
arccurve = edge.curve
v = arccurve.normal

plane
The plane method is used to retrieve the plane of the arc.
Syntax:
plane = arc.plane
Arguments:
Return Value:
plane - the plane of the arc if successful
Comments:
Refer to the Geom module for instructions to create a plane.
Example:

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.active_entities
edgearray = entities.add_circle centerpoint, vector2, 10
edge = edgearray[0]
arccurve = edge.curve
plane = arccurve.plane

radius
The radius method is used to retrieve the radius of the arc.
Syntax:
radius = arc.radius
Arguments:
Return Value:
radius - the radius of the arc if successful
Comments:
Example:

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.active_entities
edgearray = entities.add_circle centerpoint, vector2, 10
edge = edgearray[0]
arccurve = edge.curve
radius = arccurve.radius

start_angle
The start_angle method is used to retrieve the angle of the start of the arc, measured from the X axis in radians.
Syntax:
angle = arc.start_angle
Arguments:
Return Value:
angle - the angle of the start of the arc if successful
Comments:
Example:

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.active_entities
edgearray = entities.add_circle centerpoint, vector2, 10
edge = edgearray[0]
arccurve = edge.curve
startangle = arccurve.start_angle

xaxis
The xaxis method is used to retrieve the X axis of the coordinate system for the curve.
Syntax:
vector = arc.xaxis
Arguments:
Return Value:
vector - a Vector3d object if successful
Comments:
Example:

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.active_entities
edgearray = entities.add_circle centerpoint, vector2, 10
edge = edgearray[0]
arccurve = edge.curve
v = arccurve.xaxis

yaxis
The yaxis method is used to retrieve the Y axis of the coordinate system for the curve.
Syntax:
vector = arc.yaxis
Arguments:
Return Value:
vector - a Vector3d object if successful
Comments:
Example:

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.active_entities
edgearray = entities.add_circle centerpoint, vector2, 10
edge = edgearray[0]
arccurve = edge.curve
v = arccurve.yaxis