# RhinoScript

Version: Rhino 4.0
Summary: RhinoScript 를 사용하여 원 지오메트리를 선으로 만드는 방법을 소개합니다.

## 질문

Rhino 에서 원을 직선화할 수 있나요?

## 답변

다음의 하위 루틴을 참조하세요:

``` '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' StraightenCircles.rvb -- September 2008
' If this code works, it was written by Dale Fugier.
' If not, I don't know who wrote it.
' Works with Rhino 4.0.

Option Explicit

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' StraightenCircles
' Creates lines based on the circumferences of circles.
' Lines will be oriented based on the plane of the circle.

Sub StraightenCircles

Dim obj_list, obj
Dim length, plane, origin, xaxis
Dim endpt, line

obj_list = Rhino.GetObjects("Select circles to straighten", 4, True, True)
If IsArray(obj_list) Then

Call Rhino.EnableRedraw(False)

For Each obj In obj_list
If Rhino.IsCircle(obj) Then
' Gather data
length = Rhino.CurveLength(obj)
plane = Rhino.CurvePlane(obj)
origin = plane(0)
xaxis = plane(1)
' Calculate
xaxis = Rhino.VectorUnitize(xaxis)
xaxis = Rhino.VectorScale(xaxis, length)
Call Rhino.SelectObject(line)
End If

Next

Call Rhino.EnableRedraw(True)

End If

End Sub

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''