# Class: Sketchup::ArcCurve

Inherits:
Curve
show all
Defined in:
lib/arccurve.rb

## Overview

An ArcCurve is a Curve that makes up part of a circle. This is the underlying class for circles as well.

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.

However, keep in mind that all Curves in SketchUp are really edges with some extra data attached to them. When you use the API to draw a Curve or ArcCurve, you are really drawing edges.

ArcCurve is a subclass of Curve, so all of the methods that are available to Curves are also available to ArcCurves.

Examples:

``````# Draw a circle on the ground plane around the origin.
center_point = Geom::Point3d.new(0,0,0)
normal_vector = Geom::Vector3d.new(0,0,1)
radius = 10

entities = Sketchup.active_model.entities
edge_array = entities.add_circle center_point, normal_vector, radius
first_edge = edge_array[0]
arc_curve = first_edge.curve
``````

See Also:

Since:

• SketchUp 6.0

## Instance Method Summary collapse

• Get center of the circular arc.

• Get the angle of the end of the arc measured from the X axis in radians.

• Get arc normal, the vector that is perpendicular to the plane of the arc.

• Get arc plane.

• Get arc radius.

• Get the angle of the start of the arc, measured from the X axis in radians.

• Get the X axis of the arc's coordinate system.

• Get the Y axis of the arc's coordinate system.

## Instance Method Details

### #center ⇒ Geom::Point3d

Get center of the circular arc.

Examples:

``````center_point = 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
edge_array = entities.add_circle center_point, vector2, 10
edge = edge_array[0]
arc_curve = edge.curve
point = arc_curve.center
``````

Since:

• SketchUp 6.0

 ``` 48 49``` ```# File 'lib/arccurve.rb', line 48 def center end ```

### #end_angle ⇒ Numeric

Get the angle of the end of the arc measured from the X axis in radians.

Examples:

``````# Create a 1/2 circle, normal to the Z axis
center = Geom::Point3d.new
normal = Geom::Vector3d.new 0,0,1
xaxis = Geom::Vector3d.new 1,0,0
start_a = 0.0
end_a = Math::PI
model = Sketchup.active_model
entities = model.entities
edge_array = entities.add_arc center, xaxis, normal, 5, start_a, end_a
edge = edge_array[0]
arc_curve = edge.curve
end_angle = arc_curve.end_angle
``````

Since:

• SketchUp 6.0

 ``` 69 70``` ```# File 'lib/arccurve.rb', line 69 def end_angle end ```

### #normal ⇒ Geom::Vector3d

Get arc normal, the vector that is perpendicular to the plane of the arc.

Examples:

``````center_point = 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
edge_array = entities.add_circle center_point, vector2, 10
edge = edge_array[0]
arc_curve = edge.curve
v = arc_curve.normal
``````

Since:

• SketchUp 6.0

 ``` 87 88``` ```# File 'lib/arccurve.rb', line 87 def normal end ```

### #plane ⇒ Array<Numeric>

Note:

Refer to the Geom module for instructions to create a plane.

Get arc plane.

Examples:

``````center_point = 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
edge_array = entities.add_circle center_point, vector2, 10
edge = edge_array[0]
arc_curve = edge.curve
plane = arc_curve.plane
``````

Since:

• SketchUp 6.0

 ``` 108 109``` ```# File 'lib/arccurve.rb', line 108 def plane end ```

### #radius ⇒ Numeric

Get arc radius.

Examples:

``````center_point = 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
edge_array = entities.add_circle center_point, vector2, 10
edge = edge_array[0]
arc_curve = edge.curve
radius = arc_curve.radius
``````

Since:

• SketchUp 6.0

 ``` 126 127``` ```# File 'lib/arccurve.rb', line 126 def radius end ```

### #start_angle ⇒ Numeric

Get the angle of the start of the arc, measured from the X axis in radians.

Examples:

``````# Create a 1/4 circle, radius of 5, normal to the Z axis
center = Geom::Point3d.new 0, 0, -1
normal = Geom::Vector3d.new 0,0,1
xaxis = Geom::Vector3d.new 1,0,0
start_a = Math::PI/2
end_a = Math::PI
model = Sketchup.active_model
entities = model.entities
edge_array = entities.add_arc center, xaxis, normal, 5, start_a, end_a
edge = edge_array[0]
arc_curve = edge.curve
start_angle = arc_curve.start_angle
``````

Since:

• SketchUp 6.0

 ``` 148 149``` ```# File 'lib/arccurve.rb', line 148 def start_angle end ```

### #xaxis ⇒ Geom::Vector3d

Note:

The length of the returned vector is equal to the radius of the underlying curve.

Get the X axis of the arc's coordinate system.

Examples:

``````center_point = 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
edge_array = entities.add_circle center_point, vector2, 10
edge = edge_array[0]
arc_curve = edge.curve
v = arc_curve.xaxis
``````

Since:

• SketchUp 6.0

 ``` 170 171``` ```# File 'lib/arccurve.rb', line 170 def xaxis end ```

### #yaxis ⇒ Geom::Vector3d

Note:

The length of the returned vector is equal to the radius of the underlying curve.

Get the Y axis of the arc's coordinate system.

Examples:

``````center_point = 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
edge_array = entities.add_circle center_point, vector2, 10
edge = edge_array[0]
arc_curve = edge.curve
v = arc_curve.yaxis
``````

Since:

• SketchUp 6.0

 ``` 192 193``` ```# File 'lib/arccurve.rb', line 192 def yaxis end ```