Help with array and rotate along path

Hi,

I am trying to array a chair along a curved model line and rotate each instance of the chair so that it is “facing” the curve.

I followed a tutorial and had some luck but my results aren’t quite right and I am hoping somebody can suggest a way to get the desired result.

The red edge is the back of the chair and the green edge is the front, so you can see the first instance needs to be rotated 180.

In this case, It seems that applying 180-x (or maybe 90-x) would give me the correct rotation, assuming the chair back starts perpendicular to the x axis. But i dont think the same translation would apply to each condition as you move around the quandrants of the grid.

What I really want is the X axis of the family to align with the tangent vector.

Thanks for any input.

Adding a translation to the angle creates the correct condition on the end point but as you move along the curve in this direction, the chairs are rotating in the wrong direction.

I have tried using the normal vector at the parameter and applying a variety of translations

@ct_studio here’s some thoughts - hopefully helpful!

Depending on how you have created your curves, they will have an innate or derived normal to them. In the case of “many” curves, they could be alternating like so:

To get around this, you can do a geometric equation (Shout-out to @Dimitar_Venkov for this one!) to calculate if the normal is the correct direction, and flip it if not.

test = ((Point.X(b) - Point.X(a)) * (Point.Y(c) - Point.Y(a))) >
	((Point.Y(b) - Point.Y(a)) * (Point.X(c) - Point.X(a)));

test ? vec : Vector.Reverse(vec);

This then gives you the correct normals for your SetRotation node. You’ll need to use the same geometric test and the Vector.AngleAboutAxis node to correctly orient them.

Resulting in the correctly angled chairs :slight_smile:

This workflow is definitely way too hard for a beginner, so we can look at making it easier with smarter nodes.

Graph: ct_studio_FamilyOrientationAroundTable.dyn (39.2 KB)

FYI @Aparajit_Pratap

7 Likes

Hi Sol thats a really a smart way, didnt know that, I have always do it this way here, but in the future it shouldnt be necessary, with the new great normal with side :wink: :wink: so great,thx

2 Likes

Hey sol,

I was able to get this to work for the chairs and additional elements, super useful!

But now for some reason it doesn’t seem to run, I have it on automatic and its not throwing any errors but the geometry isn’t appearing:


I am also trying to connect two families at the family by point because one contains the symbolic geometry.

1 Like

The image failed to upload - can you repost and make sure the preview is good before you hit ‘post’?

Hmm, it shows up for me.

But I figured out how to move ahead.
Thanks!

3 Likes

Ah - yeah. Must have been an issue on my side. Glad you’re making progress though. :slight_smile:

1 Like