11 November 2010

'spider evolution'

during the course of my investigation of simplistic model ideas with large number of different outcomes, I found myself working on a circular stack of triangles which are defined by few simple parameters. each parameter was originally defined by the user (the coding was left within the script but deactivated), however, as I was going through different settings to get shapes which are very different from each other for testing purposes, I decided to fully randomise the script. I have settled for the boundary condition of 20 units randomly picked to speed up the process of the shape search. within a matter of several minutes I have generated some 30 random shapes which were eventually dubbed 'spider evolution'. I'm now planning to expand the script or modify it for other purposes.


Option Explicit
'Script written by shane gregoran
'Script version 30 August 2010 00:20:56 updated 28 October 2010

Call p04TriangularSomethings()
Sub p04TriangularSomethings()
'for this purpose all random numbers have been set to max of 20
'Dim nPts : nPts = Rhino.GetReal("how many segments", 12)
Dim nPts : nPts = Floor(rnd*20)
If nPts < 3 Then
nPts = 3
End If
Dim cp : cp = Rhino.WorldXYPlane
cp(0)(2) = Floor(rnd*10)
'Dim iR : iR = Rhino.GetReal("length of short triangulation",10)
Dim iR : iR = Floor(rnd*20)
If iR < 1 Then
iR = 1
End If
'Dim R : R = Rhino.GetReal("length of segments",15)
Dim R : R = Floor(rnd*20)
If R < 1 Then
R = 1
End If

Dim iCirc, iLength, iPts
ReDim iPts(nPts)
iCirc = Rhino.AddCircle (cp,iR)
If Rhino.IsCurve(iCirc) Then
iLength = Rhino.CurveLength(iCirc)
End If
Dim i, S, iSc
For i = 0 To (nPts-1)
iSc = iLength/nPts
If i=0 Then
S = iSc*i
End If
iPts(i) = Rhino.CurveArcLengthPoint(iCirc, S)
Dim oCirc, oLength, oPts
ReDim oPts(nPts)
cp(0)(2) = Floor(rnd*10)
oCirc = Rhino.AddCircle (cp,R)
If Rhino.IsCurve(oCirc) Then
oLength = Rhino.CurveLength(oCirc)
End If
Dim outS, oSc
For i = 0 To (nPts-1)
oSc = oLength/nPts
If i=0 Then
outS = oSc*i
End If
oPts(i) = Rhino.CurveArcLengthPoint(oCirc, outS)
'Dim apxH : apxH = Rhino.GetReal("height of apex guide curvature points", 6)
Dim apxH : apxH = Floor(rnd*20)
Dim Origin, Direction, Normal, hPlane
Origin = array(0,0,apxH)
If IsArray(Origin) Then
Direction = array(0,0,apxH+1)
If IsArray(Direction) Then
Normal = VectorCreate(Direction, Origin)
Normal = VectorUnitize(Normal)
hPlane = Rhino.PlaneFromNormal(Origin, Normal)
End If
End If
'Dim apxR : apxR = Rhino.GetReal("distance of apex point from base", 5)
Dim apxR : apxR = Floor(rnd*20)
If apxR < 1 Then
apxR = 1
End If
Dim hCirc, hLength, hPts
ReDim hPts(nPts-1)
hCirc = Rhino.AddCircle (hPlane,apxR)
If Rhino.IsCurve(hCirc) Then
hLength = Rhino.CurveLength(hCirc)
End If
Dim hS, hSc
For i = 0 To (nPts-1)
hSc = hLength/nPts
If i=0 Then
hS = (hSc/2)+(hSc*i)
End If
hPts(i) = Rhino.CurveArcLengthPoint(hCirc, hS)
Dim wo : wo = array (0,0,(apxH/2))
Dim crvInnerPTS, crvOutterPTS, crvInnerPTSstring, crvOutterPTSstring
ReDim crvOutterPTS(nPts-1), crvInnerPTS(nPts-1), crvInnerPTSstring(nPts-1), crvOutterPTSstring(nPts-1)
For i = 0 To (nPts-1)
crvOutterPTS(i) = array(wo, hPts(i), oPts(i))
crvOutterPTSstring(i) = Rhino.AddCurve (crvOutterPTS(i))
For i = 0 To (nPts-1)
If i = 0 Then
crvInnerPTS(i) = array(wo, hPts(nPts-2), iPts(i))
If i = 1 Then
crvInnerPTS(i) = array(wo, hPts(nPts-1), iPts(i))
crvInnerPTS(i) = array(wo, hPts(i-2), iPts(i))
End If
End If
crvInnerPTSstring(i) = Rhino.AddCurve (crvInnerPTS(i))
Dim capCurve, capCurveString
ReDim capCurve(nPts-1), capCurveString(nPts-1)
For i = 0 To (nPts-1)
If i = (nPts-1) Then
capCurve(i) = array(oPts(i), hPts(i), iPts(1))
If i = (nPts-2) Then
capCurve(i) = array(oPts(i), hPts(i), iPts(0))
capCurve(i) = array(oPts(i),hPts(i), iPts(i+2))
End If
End If
capCurveString(i) = Rhino.AddCurve (capCurve(i))
Dim LoftA, rr, LoftB, SurfA, rrr
ReDim LoftA(nPts-1), LoftB(nPts-1), SurfA(nPts-1)
For rr = 0 To nPts-1
If rr = nPts-2 Then
rrr = 0
If rr = nPts-1 Then
rrr = 1
rrr = rr + 2
End If
End If
LoftA(rr) = Array(crvOutterPTSstring(rr), crvInnerPTSstring(rrr), capCurveString(rr))
rhino.DeleteObject iCirc
rhino.DeleteObject oCirc
rhino.DeleteObject hCirc
Rhino.AddEdgeSrf LoftA(rr)

End Sub

29 October 2010

p4: gravity field visualization experiment

Gfield script is an attempt to visualize the units of space-time as they are distorted by a gravity type field. given that each 'cube' represents a unit of space-time, greatly enlarged for this purpose, the distortions of each said unit will continue until the geometry can no longer represent a 'cube' type space, at which point the 'cube' will vanish. at a later time I plan to add additions to the script to uphold a change in geometry from a standard eight point geometric shape to one that can support seven or less points as well as adding mass value which will increase the strength of field generated by the attractor point for each unit of space-time that has collapsed onto the attractor point. the following video is a top view of the change in the quantity of space-time units and how they are distorted over time.

I will, given time, make another 'perspective view' video to further represent the three dimensionality of the changes taking place. script is available for download.

06 May 2010

project 3 - HField part 3 - functionality

this is after first test run with the dissipating field around a single point based attractor. this process will be refined with much larger array then the one used in this run 3*3*3. i am also going to do a complete breakdown in sections per layer for better visual representation of the way the field generates compressions of unit spaces around itself. i am also going to add a weight unit to all points and attempt to create a generation effect. stay tuned

script so far can be downloaded but it's still a work in progress

project 3 - HField part 2 - derailment

as i continued to modify the bellow posted images of a box space array during my application of the modified Force of Gravity equation in a field manner, a computational matrix ended up yielding some interesting results. the 5*5*5 array was turned into the new format of space, with each of the original box unit corners being scaled dependent on the distance from the attractor point. i will conduct some more test before the script is released to conduct further experiments.

as it is but it's still a work in progress

03 May 2010

project 3 - HField part 1

i have been working on getting the basic point based systems with box geometry set up in such a way that it can easily be adjusted for the sample size. since numerous calculations need to be done for differential field strength, i have decided to split this project into 2, possibly 3 parts. basic system geometry is self adjusting and can easily be modified to cut the computational times - i will be working on that in the last 3rd part if i get sufficient time but eventually i plan on doing it.

these are the images of the space geometry which i'm working on easiest way to apply modifications through a field.


5^3 sample

20 April 2010

project 2 - scripting extended - BojaShell

for this project i used creation of curves with user defined parameters to surface the spine of shell. the script is not user friendly until i start managing the function calls to speed up script building. until such time i am doing everything long way to understand the inner workings of scripting to the full.

'calculation x
Dim M, n, Mx
ReDim M(z), Mx(z)
For n = 0 To z
M(n) = Rhino.Distance(cPt, Pt(n))
Mx(n) = Rhino.Distance(cPt, Ptx(n))

for script details and other info read more.

15 April 2010

revenge of an Entity