research.05


Geometrical concepts: swale/sine curve modules, low polygon ‘units’, spherical packing/aggregation recursive growth.
New concept for geometry could be utilization of spherical packing; spheres recursively grow towards attractor points. This concept uses the geometry of the sphere, rather than that of the “swale”, but still has convex surfaces. The other two geometrical forms I believe are still valid are the sine curve module/sine wave surfaces and the low polygon count geometry which is more like that of the boulder/voronoi geometry.
Here is a possible example script, although it uses domes. Ours would use spheres, packed at different scales on top of one another to build up a ‘mound’ or stoop more like the larger formations we are looking for. Where spheres intersect, a brep/brep intersection curve is found and the hidden geometry is booleaned away. The result would be a more ‘cloudlike’ formation of spherical geometry.

–another example of spherical packing; click here



Option Explicit

‘Script written by ian.gordon
‘Script copyrighted by isgStudio.com
‘Script version Friday, February 06, 2009 1:21:07 AM

Call cloud9Maker()
Sub cloud9Maker()
‘parameters
Dim diam:diam=rhino.getReal(“enter size of boundary”,12)
If isnull(diam) Then Exit Sub
Dim rad:rad=diam/2
Dim qty:qty=rhino.getInteger(“how many domes?”,4)
If isnull(qty) Then Exit Sub

rhino.UnselectAllObjects

‘create seed dome
Dim origin:origin=array(0,0,0)
Dim dome:dome=Rhino.AddSphere(origin,rad)
Dim strCutter:strCutter=rhino.AddPlaneSurface(rhino.WorldXYPlane,rad+1,rad+1)
rhino.ScaleObject strCutter,Array(rad+1,rad+1,0),Array(2,2,2)
Dim splits:splits=Rhino.SplitBrep(dome,strCutter,vbTrue)
rhino.deleteObject strCutter
rhino.deleteObject splits(1)
Dim srcDome:srcDome=splits(0)
Rhino.CapPlanarHoles srcDome

””MAKE CLOUDS””
Dim matrixPts:matrixPts=matrix9(diam)
Dim matrixPt
Dim color:color=50
For Each matrixPt In matrixPts
Dim xpySrcDome:xpySrcDome=rhino.copyObject(srcDome)
‘create seed ring
Dim ring:ring=newCircle(origin,rad)
‘get a set of random pts on the ring
Dim newPts:newPts=ptsOnCrv(ring,qty)
Dim miniClouds:miniClouds=newClouds(srcDome,xpySrcDome,ring,newPts,origin,color)
‘move to matrix pt
rhino.moveObject miniClouds,origin,matrixPt
color=color+5
Next

rhino.deleteObject srcDome

rhino.print “OPERATION COMPELTE”
End Sub

Function newClouds(srcDome,xpySrcDome,ring,newPts,origin,color)
newClouds=vbNull
‘copy dome to each new pt
Dim arrInput()
Dim j:j=0
Dim newPt
For Each newPt In newPts
Dim newPtC:newPtC=rhino.pointCoordinates(newPt)
Dim xpyDome:xpyDome=rhino.copyObject(srcDome,origin,newPtC)
Dim scl:scl=rndScale
rhino.print “RANDOM SCALE: “&scl
Rhino.scaleObject xpyDome,newPtC,Array(scl,scl,scl)
ReDim Preserve arrInput(j)
arrInput(j)=xpyDome
j=j+1
Next
‘add the original xpyDome
ReDim Preserve arrInput(j)
arrInput(j)=xpySrcDome
‘clean up
rhino.deleteObjects newPts
rhino.deleteObject ring
rhino.unselectallObjects
‘union polysurfaces
Dim strUnion:strUnion=Rhino.BooleanUnion(arrInput,vbTrue)
Dim cmd:cmd=”_mergeAllFaces selID “&strUnion(0)&” enter enter”
rhino.command cmd
‘colorful cloud
rhino.ObjectColor strUnion(0),RGB(80,(80+color),(250-color))
newClouds=strUnion(0)
End Function

‘grid of point coordinates
Function matrix9(diam)
Dim unit:unit=diam*2
rhino.print “matrix9 unit”&unit
Dim arrPts(8)
Dim i,j,k
Dim col:col=0
Dim x:x=0
Dim y:y=0
k=0
For i=0 To 2
For j=0 To 2
arrPts(k)=array(x,y,0)
‘rhino.addPoint arrPts(k)
x=x+unit
k=k+1
Next
x=0
y=y+unit
Next
matrix9=arrPts
End Function

‘random scale within a range
Function rndScale
rndScale=vbNull
Dim num:num=rnd(1)
Dim n:n=round(num,2)
‘check if it’s within range
Dim check
If n>0.8 Then
check=”MORE”
End If
If n<0.5 Then
check="LESS"
End If

Select Case check
Case "MORE"
'rhino.Print "RND IS MORE"
rndScale
Case "LESS"
'rhino.Print "RND IS LESS"
rndScale
Case Else
rhino.Print "FINAL RND: "&n
rndScale=num
End Select
End Function

'random points on curve
Function ptsOnCrv(crv,qty)
Dim dom:dom=rhino.CurveDomain(crv)
Rhino.Print "Curve domain: " & CStr(dom(0)) & " to " & CStr(dom(1))
Dim divs:divs=qty
Dim arrPts()
Dim i
For i=0 To divs
Dim dblParameter:dblParameter=(rnd*dom(1))
'rhino.Print i&" : "&dblParameter
Dim pt:pt=Rhino.CurveEvaluate (crv, dblParameter,1)
Dim newPt:newPt=rhino.addpoint(pt(0))
ReDim Preserve arrPts(i)
arrPts(i)=newPt
Next
ptsOnCrv=arrPts
End Function

'circle maker give centerpt and radius
Function newCircle(originPt,rad)
newCircle=vbNull
Dim deltaX:deltaX=originPt(0)+rad
Dim pt1:pt1=Array(deltaX,originPt(1),originPt(2))
Dim deltaY:deltaY=originPt(1)+rad
Dim pt2:pt2=Array(originPt(0),deltaY,originPt(2))
Dim arrPlane:arrPlane=rhino.planeFromPoints(originPt,pt1,pt2)
Dim circ:circ=rhino.addCircle(arrPlane,rad)
newCircle=circ
End Function

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s