forked from mcneel/rhino-developer-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ellipsoid.rvb
34 lines (26 loc) · 950 Bytes
/
Ellipsoid.rvb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Ellipsoid.rvb -- June 2011
' 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
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Another ellipsoid maker
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub Ellipsoid()
Dim a, b, c
Dim origin, xaxis, yaxis
Dim plane, xform, obj
' Semi-principal axes
a = 6.0
b = 3.0
c = 4.0
origin = Array(0,0,0) ' world orogin
xaxis = Array(1,0,0) ' world x-axis
yaxis = Array(0,1,0) ' world y-axis
plane = Rhino.PlaneFromFrame(origin, xaxis, yaxis)
obj = Rhino.AddSphere(plane, 1.0)
xform = Rhino.XformScale(plane, a, b, c)
Call Rhino.TransformObject(obj, xform)
End Sub