IsCurveConicSection

Tests a curve to see if it is a conic section based on the curve's shape.

Syntax

Rhino.IsCurveConicSection (strObject)

Parameters

strObject

Required.  String.  The object's identifier.

Returns

Array

An array of curvature information if successful.  The array will contain the following information:

Element

Type

Description

0

Number

The type of conic, where:

0 = Unknown

1 = Circle

2 = Ellipse

3 = Hyperbola

4 = Parabola

1

Array

This first focus point, valid for ellipses, hyperbolas, and parabolas.

2

Array

This second focus point., valid for ellipses, hyperbolas, and parabolas.

3

Array

The center point, valid for circles, ellipses, and hyperbolas.

Null

If not successful, or on error.

Example

Dim arrCurve, arrConic

arrCurve = Rhino.GetCurveObject("Select curve")

If IsArray(arrCurve) Then

  arrConic = Rhino.IsCurveConicSection(arrCurve(0))

  If IsArray(arrConic) Then

    Select Case arrConic(0)

      Case 0

        Call Rhino.Print("Unknown")

      Case 1

        Call Rhino.Print("Circle")

        Call Rhino.AddPoint(arrConic(3))

      Case 2

        Call Rhino.Print("Ellipse")

        Call Rhino.AddPoint(arrConic(1))

        Call Rhino.AddPoint(arrConic(2))

      Case 3

        Call Rhino.Print("Hyperbola")

        Call Rhino.AddPoint(arrConic(1))

        Call Rhino.AddPoint(arrConic(2))

      Case 4  

        Call Rhino.Print("Parabola")

        Call Rhino.AddPoint(arrConic(1))

    End Select

  End If

End If

Also See

IsCircle

IsEllipse