arch after arch
Now how would I go about doing this.
I'm trying to randomly rotate the position of each arc 90 degrees from the previous arch. Trying to make it look like something similar to the image below.
( clearlistener() delete objects local radiusA = 10.0 local steps = 4 local knotsPerArch = 6 local rotAngle = 180.0 / knotsPerArch local startPos = [0,0,0] local sp = splineShape wirecolor:yellow local posArr = #() fn shuffleIndexes count = --unique Random order ( list = #() list.count = count for k = 1 to count do ( i = random 1 k list[k] = list[i] list[i] = k ) return list ) addnewSpline sp addKnot sp 1 #corner #curve sp.pos --first knot created at origin for s = 1 to steps do ( format "Arch: %\n" s ids = shuffleIndexes 3 for k = 2 to knotsPerArch+1 do --skip first knot which is always created at origin ( calcX = radiusA * cos((k-1) * rotAngle) calcY = radiusA * sin((k-1)* rotAngle) pos = [0,calcX,calcY] + startPos --include nodes matrix newPos = [pos[ids[1]],pos[ids[2]],pos[ids[3]]] append posArr pos point pos:newPos size:2 wirecolor:(red/(s as float)) ) startPos += [0,(radiusA*2),0] ) )
Comments
or maybe this
bga
closer ( delete
closer
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
;)
bga
Try to create separate arrays
Try to create separate arrays for the every arch points.(multidimensional array)
Then in coordsys of first point in array change transform (rotation) of other points.
Use rotate "about" first point in array. In your examle you have 4 arrays with 6 points.You can to start from last array:
--rotate about point[19] others (21,22,23,24,25)
--then about point[13] others (14..25) etc.
bga