Notifications
Clear all
[Closed] inverted archs
Page 2 / 2
Prev
Mar 14, 2013 9:24 pm
On the left are the two arcs being created at [0,0,0]
To the right are two different examples of what the end result could look like.
How do I find the direction ‘normal’ of the last two points in the green arc? Then use that normal to place the yellow arc’s points?
(
delete objects
local columns = 9
local steps = 3
local origin = [0,0,0]
local allArchs = #()
/*Set Vertices*/
for s = 1 to steps do
(
local columnAngle = (random 45.0 180.0) / (columns-1)
local radius = random 5.0 10.0
local col = random [150,150,150] [255,255,255]
local archArr = #()
for v = 1 to columns do
(
calcX = radius * cos((v-1) * columnAngle)
calcY = radius * sin((v-1)* columnAngle)
pos = [0,calcX,calcY]--include nodes matrix
if v == 1 do origin = [0,0,0] - pos
setPos = pos + origin
p = point pos:setPos size:2 wirecolor:col
append archArr p
)
append allArchs archArr
)
)
1 Reply
I not understand your question.
To get direction of las two points:
a – last point
b – second last
dir = normalize (a-b)
tm = matrixFromNormal dir
Mar 14, 2013 9:24 pm
This shall help.
So on the left is the shape I’d like to create at the start.
It is essentially a spiral but in segments
Green – radius of 20
Yellow – radius of 15
Red – radius of 10
On the right I took each group and rotated them on the local Y axis a random 90 degrees.
Page 2 / 2
Prev