positioning.inc

Various macros for positioning objects.

In the following examples, S is a sphere primitive with radius 0.5, and C is a cube of length 0.4.


RotSpace(N, R, Ob):

Constructs a union containing N copies of object Ob at evenly spaced angles in a circle of radius R.
RotSpace example
RotSpace(5,2,S)


RotSpace_SR(N, R, Ob, Sc, Rt):

Same as RotSpace(N, R, Ob, with the Kth copy of Ob scaled by 1+Sc*K and rotated by Rt*K for each K in 0,...,N.
RotSpace_SR example
RotSpace_SR(3, 2, C, 0.25, 25*z)


Row(Ob, Start, N, Space):

Constructs a union containing N copies of object Ob in a row, starting at point Start and spaced apart by vector Space.
Row example
Row(S, <-3, 0, 2>, 4, <2, 0, 0>)
Another row example
Row(S, <-3, 0, 2>, 4, <2, 0.5, 1>)
Rows may be iterated to produce more complex objects. For example:
A row
#declare R = Row(X, <-1, 0, 0.5>, 3, 1.25*z)
Grid of spheres
#declare R2 = Row(R, <-3, 0, 2>, 3, <1.25,0,0>)
Layered grids of spheres
#declare R3 = Row(R2, <0, 0.5, 0>, 3, <0, 1.25, 0>)


Row_SR(Ob, Start, N, Space, R, S):

Same as Row(Ob, Start, N, Space) but with the Kth copy of Ob scaled by 1+S*K and rotated by R*K for each 0,...,K.
Row_SR example
Row_SR(C, <-3, 0, 2>, 4, <2, 0.5, 1>, <45,45,45>, 0.15)


mktextures.inc Main Page