Skip to content

M_Rhino_Geometry_Circle__ctor_2

Will Pearson edited this page Aug 12, 2016 · 2 revisions

Circle Constructor (Plane, Double)

Initializes a circle on a plane with a given radius.

Namespace: Rhino.Geometry
Assembly: RhinoCommon (in RhinoCommon.dll) Version: Rhino 6.0

Syntax

C#

public Circle(
	Plane plane,
	double radius
)

VB

Public Sub New ( 
	plane As Plane,
	radius As Double
)

Parameters

 

plane
Type: Rhino.Geometry.Plane
Plane of circle. Plane origin defines the center of the circle.
radius
Type: System.Double
Radius of circle (should be a positive value).

Examples

VB

Partial Class Examples
  Public Shared Function AddCircle(ByVal doc As Rhino.RhinoDoc) As Rhino.Commands.Result
    Dim center As New Rhino.Geometry.Point3d(0, 0, 0)
    Const radius As Double = 10.0
    Dim c As New Rhino.Geometry.Circle(center, radius)
    If doc.Objects.AddCircle(c) <> Guid.Empty Then
      doc.Views.Redraw()
      Return Rhino.Commands.Result.Success
    End If
    Return Rhino.Commands.Result.Failure
  End Function
End Class

C#

using System;

partial class Examples
{
  public static Rhino.Commands.Result AddCircle(Rhino.RhinoDoc doc)
  {
    Rhino.Geometry.Point3d center = new Rhino.Geometry.Point3d(0, 0, 0);
    const double radius = 10.0;
    Rhino.Geometry.Circle c = new Rhino.Geometry.Circle(center, radius);
    if (doc.Objects.AddCircle(c) != Guid.Empty)
    {
      doc.Views.Redraw();
      return Rhino.Commands.Result.Success;
    }
    return Rhino.Commands.Result.Failure;
  }
}

Python

import Rhino
import scriptcontext
import System.Guid

def AddCircle():
    center = Rhino.Geometry.Point3d(0, 0, 0)
    radius = 10.0
    c = Rhino.Geometry.Circle(center, radius)
    if scriptcontext.doc.Objects.AddCircle(c)!=System.Guid.Empty:
        scriptcontext.doc.Views.Redraw()
        return Rhino.Commands.Result.Success
    return Rhino.Commands.Result.Failure

if __name__=="__main__":
    AddCircle()

Version Information

Supported in: 6.0.16224.21491, 5D58w

See Also

Reference

Circle Structure
Circle Overload
Rhino.Geometry Namespace

Clone this wiki locally