Rotate 3D object with Attractor Line

Hello!

CustomShapeRotation.gh (9.7 KB)

I’m attempting to rotate some costum-made 3D objects in the X and Z axis in my definition. Each one being rotated individually from their own center similar to the image of the circles, and the angle of rotation being influenced by the attractor line. So far I can only make the scale to change with the attractor line and I have tried to rotate the objects individually, but so far they only rotate all together from a common reference point only. I found this image of the rotated circles very similar to what I’m trying to achive with the 3D objects.CustomShapeRotation.3dm (3.1 MB)

I attached the definition, any help would be very much appreciated.

There was no rotation in your definition so not sure what rotation you want to use. However, based on your description the issue seems like an obvious non use of a list. For each object you plug in to rotate you should supply also a center of rotation - maybe each objects center point (and / or rotation axis / plane depending on what rotation you are using) and then a rotation value for each object (presumably from the attractor)

Thank you so much. I have been using Rotate axis and Rotate 3D and I’ve been trying to use a list item to get each object to rotate 3D along it’s own axis, but haven’t been able to get that result, because all the objects still rotate together along one of the edges of the surface and they are still not affected by the attractor line…I highly appreciate your help!
CustomShapeAppliedToAttractorPts-panel1-Rotation2 - 180115-copy.gh (20.0 KB)
geometry1 - Rotation2 -180115.3dm (8.1 MB)

I think you just don’t understand data trees and lists. There should be no need for list item here. Also, you want to use an attractor to rotate but you have just one value in rotate - it should be a list of attractor values, one value for each object to rotate. You also don’t have any axis plugged in. See attached example that should help. You need to align a rotation axis to your curve (in this case I aligned planes then used their y axis, then rotate via attractor values).

In this example you could use directly the grid points as center of rotation and finding the vector (will be faster) but I used area for your clarity to understand whats going on.


AlignedCurveAttractorRotation.gh (15.1 KB)

Thanks. Yes I’m trying to compare your definition with mine. There are a few differences…
your definition is clear, and thanks for labeling them, it helps a lot. However my definition has custom-shaped 3d objects instead of a 2d circle surface, and my definition does not start from a grid, because there is a surface instead. My final product is a trimmed/perforated surface.

your explanation helped a lot, but I’m still trying to understand data threes and how to incorporate them into my definition. My question is how can I align 3D custom shaped objects to rotation axis? and how to align via attractor lines?

I understand that I have to have a list of attractor values for each object, but I’m trying to figure out how and I’m comparing my definition with yours right now. I hope I can adjust my definition to yours in a way that it gives me a trimmed surface with the rotated objects. I appreciate your help!

My question is how can I align 3D custom shaped objects to rotation axis?

You need to first determine what will be the center of your geometry (maybe the volume centroid - with volume components)- this can also be your center of rotation. Then you need to determine a plane for each geometry that represents its existing orientation (in my example I just used and XY plane to each center). Then you align this plane to the curve as I did. I would then rotate the actual aligned plane and orient the geometry to it at the end (it is a lighter way to work by doing all the manipulation of the planes - then assign geometry to it last, rather than rotating the actual geometry). See attached.


AlignedCurveAttractorRotationGeometry.gh (19.4 KB)

1 Like

Thank you so much!!! Thanks for the clear explanation and your help. It’s much more clear to me now and I learned so much. One of the things that I notice I was doing wrong previously is that I was plugging in area instead of volume to my geometry. Thank you so much!

My next questionis that is there a way or Is it possible to add the elements of scale and movement in relation to the attractor line to this definition? ( I don’t want the objects to both rotate and scale, but want to have both options to either scale, rotate or move, in the same definition) in other words to have a definition that would give me three different separate outputs? because my old definition was set up in a way that the scales of the objects would get smaller, the closer they were to the attractor line. So I have tried to add the scale factor back to the rotation definition that you sent me. This is something I’m asked to do and I’m wondering what you think …

Is it too unrealistic to want to have scale, rotation and movement in relation to three attractor lines?
I really appreciate your help!

AlignedCurveAttractorRotationGeometry-addedScale.gh (23.2 KB)
Rotation.3dm (1.7 MB)
in the same definition?

Your question now is just to vague. There are infinite ways to use and combine transformations. (For instance move, how to move, where to move, ect. these things require more description to reach your goal)

See attached definition that will let you use a transformation separately or in combination depending what you turn on and off by using stream gates (grouped in red) to determine what the transformation does.


AlignedCurveAttractorTransform.gh (28.5 KB)

Thank you so much!!! I can’t say how thankful I am, this has answered most of my questions! Thanks you so much! Now I’m trying to add x and y units to the movement part. Also I’m adding a point attractor to each of the sections so that each of them has a curve and point attractor. I really appreciate your help and cant thank you enough!

If you want to add a point attractor just replace the curve component with a geometry component. Then you can add curves and points in the same place.

Thank you so much! I just replaced the curve component with geometry component. Another question Iwanted to ask is…is it possible to move the objects in x,y, and z units at the same time or do they only move in either x, y, or z at a time?

Just look at the vector components. There are many ways to make a vector. With xyz is one of them.

Hi again! Thanks! I added a vector xyz and added number sliders for x and y units, but still only z unit moves in relation to the attractor line and x and y dont show any reaction to the line…

Capture1|690x241

If you want X and Y to move via attractor than you need to use attractor values. Not sliders. I think this book will help you understand the fundamentals of GH: http://www.liftarchitects.com/blog/2009/3/25/grasshopper-primer-english-edition