Rotate Multiple Objects

I’m trying to take an object and rotate it & translate it based on real world measurements I have taken this past week and stored in a CSV file. I have everything working except my rotation…

I need to rotate about the Y axis, then the Z axis, then the X axis. These are independent axes of rotation, not like a gumball. Rotating about the Y axis is very straight forward, however, I need the Z and X axes to rotate about the Y axis with the object. Then I need to rotate the object and the X axis about the Z axis. Then finally rotate the object alone about the Z axis.

The Rotate axis command only accepts 1 input for geometry - is there anyway to group geometry together prior to rotation?

image

Grasshopper Rotate Example.3dm (32.1 KB)
Rotation Example.gh (7.4 KB)

Try the Group component? Your .3dm file requires R7 and can’t be opened in R6. You could internaize your geometry in the GH file.

Sorry, attached is internalized file.

Rotation Example.gh (9.7 KB)

It’s not very clear to me what you want to do?

Your second and third Rotate Axis components appear to be using the same axis, a line in the X direction from the origin?

Here is a way to perform all three rotations around the brep’s center point, though I’m not sure that’s what you want?


Rotation_2021_Jun27a.gh (9.6 KB)

P.S. Version ‘B’ uses your three axes and rotates them as a group, per your description?


Rotation_2021_Jun27b.gh (14.3 KB)

Thank you. Version B is exactly what I needed! I was trying to group previously, but did not know about the ‘merge’ function.

Group isn’t actually necessary, sorry about that.


Rotation_2021_Jun27c.gh (15.7 KB)

So this is somewhat related to the original post:

I have a “collection” of 3 BREPs going into the merge with my 2 axes. That works great:

image

BUT, I really need to use 3 BREPs, 2 of which are the result of another rotation operation beforehand. When I try and combine these, they results are not the same, and it causes downstream errors. How do I properly combine these BREPs?

input to merge:
image
results:
image

Without any code, there isn’t much I can do… But I see double broken lines coming out of the Merge component which tells me that you have more than once branch. ‘Simplify’ in the right places might fix this problem, or flattening the Merge output?

Thanks. Flatten Tree was what I was after, so your response was helpful!

A Brep after the Rotate Axis command somehow turns into a tree - the {0;0;16} above, so feeding those into the merge command was making a mess of things!

Yeah, I could see that without being able to inspect a GH file. Until you understand how/why it got messed up and why flatten fixes it (data trees!), it will be a recurring issue. Flatten is not always the best recourse.

P.S. And by the way, flattening the output of Merge won’t always work because the sequence of inputs can get mixed up by the internal branching before flatten. In cases like this, flattening the output of Entwine instead of Merge will be more reliable.