Jump to content
Developer Wiki and Function Reference Links ×

Randomly place pyramids inside sphere


kongdesignld

Recommended Posts

so I've created a sphere of a specific size, and my goal is to create 10 pyramids of random sizes that are randomly spaced within the sphere at random angles. I've used tapered extrude and some math in order to make the random pyramids, and get them close aligned close to the center of the sphere, however instead of a single extrude object, I end up with 50 nurbs surfaces.

Questions:

1) Is there a way to stitch nurbs and trim surfaces with a marionette node?

2) When I want to use the Move node to move objects in 3D, I'm having trouble figuring out how to tell that node to move the node a random offset in a random direction away from center.

3) How would you get the bounds of a sphere?

Link to comment
  • Marionette Maven

So I played with your file and hopefully this can help to point you in the right direction.

As for your issue with it producing NURBS surfaces, I replaced the Tapered Extrude node with one that will be updated in the default content soon which outputs Generic Solids (just as the tapered extrude command does).

As for your questions:

1) Currently, not with the default content. I've been working to find the best solution to this and will update you if anything changes.

2) I've added some nodes to your network that hopefully can help you understand the process of moving in 3D with random values. I used the Random Node, Point 3D, Rotate List, and Move to show a demonstration. My example isn't perfect, though, as some of the pyramids still pop out of the bounds of the sphere. More math will be required. (you can change the int node with the thicker line style to kind of see what I mean)

The move node takes in a vector, just to help avoid any confusion. Let me know if you need further explanation.

3) I've also added a "Get 3D Info" node to your network to help with this. In the case of a sphere, the radius would be half of height or width or the difference between top and bottom Z (in this case, 5). Again, if you need a deeper explanation, feel free to reach out!

I hope this was helpful

Marissa

Link to comment

Thanks!

I totally understand how the 3d point acts as a vector now. Also definitely understand rotating at random directions, as well as using the length of the list to determine how many times to repeat a process!

I haven't started playing with limiting the pyramids to being within the sphere yet, by finding the edges, but I have some ideas about another way to do it (moving the objects from the sphere's center with an If statement that says move no more than the radius minus the object's width, or something of that nature).

One thing I had trouble with actually was naming nodes. Some of the names of the Input nodes gave me conflicts when I changed them. Is there a list of characters that aren't allowed? For example, I tried to use "#" and VW recognized the name of the node as a string.

Link to comment
  • Marionette Maven

We don't currently have an active list of characters to avoid while naming nodes, for now I would suggest avoiding all characters that aren't letters or numbers. This has to do with the way Marionette is written and executed, I think the names are actually converted into something similar to variable names (I don't really remember, though. I may be wrong), so special characters will essentially mess up how the script runs. Somewhat unfortunate, I'll look into if we can try to modify this at all.

Link to comment
We don't currently have an active list of characters to avoid while naming nodes, for now I would suggest avoiding all characters that aren't letters or numbers. This has to do with the way Marionette is written and executed, I think the names are actually converted into something similar to variable names (I don't really remember, though. I may be wrong), so special characters will essentially mess up how the script runs. Somewhat unfortunate, I'll look into if we can try to modify this at all.

I think this has been wish listed. The current state is unfortunate. There are certain characters that are often used in names like _ + - &. I also don't think its possible to use the Pi or other math symbols which would be visually more identifiable than writing out their name.

KM

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...