Radial body copy

Let us know if you have a nice R.U.B.E script to share!
Post Reply
tescott
Posts: 68
Joined: Wed Feb 06, 2013 6:32 pm

Radial body copy

Post by tescott »

This is a variant on the radial copy that is included in "myscripts~" with the RUBE installation. It copies bodies radially, using the cursor as the center point. Additionally, it provides an option to keep the copied bodies orthogonally aligned.

EDIT: added 'select(nf);' so all new bodies are selected for easy translation.

Code: Select all

int n = queryNumericValue("Total object count: ", 12);
bool ortho = queryYesNo("Ortho positioning?");

if ( n < 2 )
	print("Please enter a value greater than 2");
else {
	body [] bf = getSelectedBodies();
	float angle = 360 / n;
	for (int i = 1; i < n; i++) {
		body[] nf = duplicate(bf);
		select(nf);
		if (ortho) rotate(nf, 1,-dr(i*angle)); // keeps the rotation placement orthogonally aligned
		rotate(nf, 0, dr(i*angle));
	}
}
--tim
Post Reply