SketchUp  Ruby API Reference 

Class Index

Method Index

Developers Guide

Examples

ArcCurve class

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

Parent:Curve

Methods:center,end_angle, normal, plane , radius, start_angle, xaxis, yaxis

Example Code: arccurvetests.rb

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

Return Value

point - a Point3d at the center of the arc if successful

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

Return Value

angle - the angle of the end of the arc if successful

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

Return Value

vector - a Vector3d object if successful

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

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

Return Value

radius - the radius of the arc if successful

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

Return Value

angle - the angle of the start of the arc if successful

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

Return Value

vector - a Vector3d object if successful

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

Return Value

vector - a Vector3d object if successful

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