Following with what we did in the previous class. I created for the initial script one line based on this variable:
x = i+y * sin(i)
y = i * cos (i)
z = i
For then with the command Rhino.CopyObject and Rhino.RotateObjects create another one with a rotation angle of 180º.
In the second script I just created cones using the points of both lines and in witch of these created a torus. The final object turned out pretty interesting.
You can Find the script here:
x = i+y * sin(i)
y = i * cos (i)
z = i
For then with the command Rhino.CopyObject and Rhino.RotateObjects create another one with a rotation angle of 180º.
In the second script I just created cones using the points of both lines and in witch of these created a torus. The final object turned out pretty interesting.
You can Find the script here:
Script1
Option Explicit'Script written by
'Script copyrighted by
'Script version Tuesday, January 15, 2008 1:25:35 PM
Call Main()Sub Main() Dim point(50)
'my array Dim i, x, y, z 'more variables
For i = 0 To 50 'looping
x =i+y * sin(i) 'coordinates
y = i * cos (i)
z = i point(i) = array(x,y,z) ' for each hole inside of the array, there is anather array, who create the point
Next
rhino.AddPoints(point) 'here we print the points Call mifunction(point) ' we call here the function
End Sub
Function mifunction(point) 'declare the function Dim Curve1: Curve1 = rhino.AddCurve(point) 'the code
Dim Curve2: Curve2 = Rhino.CopyObject(Curve1) Dim arrObjects, arrPoint
arrObjects = Rhino.GetObjects
If IsArray(arrObjects) Then
arrPoint = Rhino.GetPoint("Center point of rotation")
If IsArray(arrPoint) Then
Rhino.RotateObjects arrObjects, arrPoint, 180.0, ,vbTrue
End If
End If
End Function 'end of the function
Function mifunction(point) 'declare the function Dim Curve1: Curve1 = rhino.AddCurve(point) 'the code
Dim Curve2: Curve2 = Rhino.CopyObject(Curve1) Dim arrObjects, arrPoint
arrObjects = Rhino.GetObjects
If IsArray(arrObjects) Then
arrPoint = Rhino.GetPoint("Center point of rotation")
If IsArray(arrPoint) Then
Rhino.RotateObjects arrObjects, arrPoint, 180.0, ,vbTrue
End If
End If
End Function 'end of the function
Script2
Option Explicit'Script written by
'Script copyrighted by
'Script version terça-feira, 22 de Janeiro de 2008 00:59:29
Call Main()Sub Main()
Dim strCurve, strCurve2, strCurve3
Call Main()Sub Main()
Dim strCurve, strCurve2, strCurve3
Dim Domain, Domain2, Domain3, Param, Param2, Param3, Point, Point2, Point3, i, sections
sections = 50
ReDim collection(sections)
ReDim collection2(sections)
ReDim collection3(sections)
strCurve = rhino.GetObject
If isnull (strCurve) Then Exit Sub
strCurve2 = rhino.GetObject
If isnull (strCurve2) Then Exit Sub
strCurve3 = rhino.GetObject
If isnull (strCurve3) Then Exit Sub
Domain = Rhino.CurveDomain(strCurve)
Domain2 = Rhino.CurveDomain(strCurve2)
Domain3 = Rhino.CurveDomain(strCurve3)
For i = 0 To sections Param = i*((Domain(1)-Domain(0))/sections)
Param2 = i*((Domain2(1)-Domain2(0))/sections)
Param3 = i*((Domain3(1)-Domain3(0))/sections)
point = Rhino.EvaluateCurve(strCurve, Param)
Rhino.AddPoint point point2 = Rhino.EvaluateCurve(strCurve2, Param2)
Rhino.AddPoint point2 point3 = Rhino.EvaluateCurve(strCurve3, Param3) Rhino.AddPoint point3
collection(i) = point
collection2(i) = point2
collection3(i) = point3
Next
Dim Newpoint, Newpoint2, Newpoint3
Dim dblradius, dblradius1, arrheight, arrheight2, arrheight3, arrbase, arrbase2, arrbase3
Dim arrcircle, arrcircle2, arrcircle3
Dim dblMajorRadius, dblMinorRadius
dblradius = 3 dblradius1 = 2
dblMajorRadius =3 dblMinorRadius =2
For i = 0 To sections
Newpoint = collection(i) Newpoint2 = collection2(i) Newpoint3 = collection3(i)
arrbase = Newpoint arrbase2 = Newpoint2 arrbase3 = Newpoint3 If isarray(arrbase) Then arrheight = Newpoint2 If isarray(arrheight)
arrbase = Newpoint arrbase2 = Newpoint2 arrbase3 = Newpoint3 If isarray(arrbase) Then arrheight = Newpoint2 If isarray(arrheight)
Then
rhino.AddCone arrbase, arrheight, dblradius1
If isarray(arrbase2)
Then arrheight2 = Newpoint3
If isarray(arrheight)
Then rhino.AddCone arrbase2, arrheight2, dblradius
If isarray(arrbase3)
Then arrheight3 = Newpoint
If isarray(arrheight3)
Then rhino.AddCone arrbase3, arrheight3, dblradius
End If End If End If End If End If End If
Rhino.AddTorus Newpoint, dblMajorRadius, dblMinorRadius
Rhino.AddTorus Newpoint, dblMajorRadius, dblMinorRadius
Rhino.AddTorus Newpoint2, dblMajorRadius, dblMinorRadius
Rhino.AddTorus Newpoint3, dblMajorRadius, dblMinorRadius
Next
End Sub
End Sub
P.s_Once you paste the script in the script editor, you have to repair the spaces since here is incorrectly formatted because it is posted in html (different Language)
No comments:
Post a Comment