# Random Extrude

## Recommended Posts

Here's a tricky one to start the year...

I have a set design that roughly has 1500 circles, all of the same diameter of 60mm. I'm looking to extrude them at a range of different heights, somewhere between 200mm and 800mm.

The dispersion of these different heights should be as random as possible to create an organic feel.

Is there any way of efficiently doing the above, possibly with scripts?

Gabriel

It's possible.

I would post the question on the Marionette forum or the Vectorscript Forum.

• 2

3 hours ago, Gabriel Chan said:

Here's a tricky one to start the year...

I have a set design that roughly has 1500 circles, all of the same diameter of 60mm. I'm looking to extrude them at a range of different heights, somewhere between 200mm and 800mm.

The dispersion of these different heights should be as random as possible to create an organic feel.

Is there any way of efficiently doing the above, possibly with scripts?

Gabriel

I spent a few minutes messing around with this and here's something that might give you a start. Its based on a random node from this thread - link.

This network looks for circles and extrudes them randomly. You can adjust the criteria by clicking on the Objs by Crit node (so for example it could look for circles in a specific class). Note that the network is destructive so the only way to undo it is to use the Undo function.

There might be a way to make your base collection of circles into control geometry ( @Marissa Farrell is it possible to iterate through control geometry? ). There's also likely a way to count how many objects you're selecting and automatically define n, the number of objects you need random numbers for. Otherwise you will need to enter it manually for your situation like I did.

Kevin

Edited by Kevin McAllister
Clarity
• 1

I would do it like this

1. copy to not loose your original circles.

2. get list length and repeat one of the random numbers to get as many random numbers as your number of circles are

All nodes are in the default library

• 3

8 hours ago, DomC said:

^ this is super helpful. When I was playing around I tried using the Random node but couldn't figure out how to get it to repeat.....

Thanks for sharing!

Kevin

This is way over my head... Goodness.. But I'm trying. My very first Marionette!

I think based on all the descriptions of the nodes I understand what is going on, and also the Debugging mode helps to see what data is flowing through.

I have managed in the very first node "Objs by Crit" to get inputs to recognise rectangles (i.e. the default criteria T=Rect) or ovals (T=Oval). However, when I input T=Circle, I get this Execution Error pop up:

Error: Invalid call-back function parameter type. Parameter index= 0 name=objectHandle

So I went to search for the list of Object criteria and I found this

So yes, under types there aren't any circles??

They do appear under Sub types though... How would I get the node to recognise the circles?

Gabriel

Seems I have found the answer to my question after a bit more digging at this weblink:

Subtypes are under ST, so the criteria I had to make was ST=CIRCLE.

Marionette is getting more interesting!

I'm assuming you're using a version prior to 2019 - in 2019, there's a new button in the OIP of the Objects by Criteria node that will display the Criteria dialog and populate that text field for you. Not so helpful if using 2017 still, as stated in your signature, but something to look forward to if you choose to upgrade!

• 2

2 hours ago, Marissa Farrell said:

I'm assuming you're using a version prior to 2019 - in 2019, there's a new button in the OIP of the Objects by Criteria node that will display the Criteria dialog and populate that text field for you. Not so helpful if using 2017 still, as stated in your signature, but something to look forward to if you choose to upgrade!

Thanks Marissa. I am indeed on 2017. Planning to upgrade on a five year cycle - gotta make the price of the software count! Will be certain to look out for improvements in Marionette next time I upgrade. Meanwhile, will be taking baby steps to learn Marionette.

Cheers,

Gabriel

## Create an account

Register a new account