Rotate family after insert along curve to the tangent

geometry

#1

I am trying to insert a family along a curve, and then rotate it to point to the center or be on the normal at each point. I have tried to follow this post Place family along curve but it has not worked as intended. I am sure it is something minor that I am not doing, and I am only using the Fans because it is easy to tell if they are aligned to the curve or not. I have attached the file I am using for your use.

Place Families_With Rotation.dyn (26.6 KB)



Perpendicular to the tangent of a curve by points
Align objects with a 3d curve
#2

Hi, you’ll probably find what you need here: Align objects with a 3d curve


#3
  1. Measure the angle manually that’s required to align the first family to the horizontal line
  2. Generate a list of angles which increment by the angle of each segment (I.e. 180/count of segments).
  3. Plus 1 to 2
  4. Use the resultant list of angles to rotate the list of Families

#4

@Thomas_Mahon, thanks for the suggestion, but one I want to be able to handle more complex curves than just a semicircle, and two I would prefer not to do anything “manually”.


#6

Agree, but you’ll quickly discover that trying to fully automate this will be fraught with problems and ultimately fail to achieve its main objective.

For example:
You could extract the curves from each Family then find the curve at the tip of the fin closest to the grid line, then work out the angle of rotation…and deal with the fact its curved…but not before getting the centre point of the Family (this wont always be possible depending on the geometry in the Family)! The only way I know to get curves from say, a Detail Family, is via the API and that’s before you’ve even started to solve the problem. Also, you would need to create a set of rules to handle the + or - rotation that will result from the family position relative to its fin closest to the grid line.

It gets worse: even if you did get it working, this approach would only work with this family and no other since you are looking for a curve specific to the makeup of this Family. The amount of time you’ll spend doing this will be grossly disproportional to the length of time that single manual intervention at the start would provide, which is why its the most sensible approach with this kind of problem. In addition a hybrid approach would ensure the solution would work on any Family type as you wont need to concern yourself with finding a specific piece of geometry to get the whole thing functional. Maintenance also becomes a lot more easier and manageable. If you work in a team, this is a key consideration. A single-use solution with any script is never worth it.

What I would say is that with any process, particularly where computation is concerned, its critical to establish what should be automated and what shouldn’t.


Lighting fitting on a series of x,y,z coordinates
#7

To all useful ends, I’ve written something quite simple that works with regular curves:


I created little circle faces along tangents to place instances on thanks to Springs node. For the moment, I can’t divide a spline equally, but there’s probably an answer to that somewhere (?)…


Automatic road creation: How to generate solid between section profiles?
Rebar link problem
#8

Thanks to @Dimitar_Venkov on this thread Align objects with a 3d curve I was able to resolve the issue. I modified some of the code blocks he used with core nodes now available, but it has resolved the problem for me currently. More complex curves may still need work, but thanks for all of the help.


Pipe Fitting Rotation Around Pipe
Place all family types
#9

Hi everybody.
I tried to do the same thing described above, placing a desk family along a spline, but i noticed 2 weird results:
i) the PointAtParameter node does’nt place points at an equal distance.

so i solved the issue as in the image below.

ii) when i run my script, family instances are correctly distributed, rotated by correct angles, but it seems that their base point is displaced compared to points on curve (1).
The weird thing is that if i move manually (from Revit) any one of the istances (2), and run the script again, everytingh seems to move back to the correct position (3).

As you can see, trying to force dyanmo to firstly place instances, then rotating them, i used transact nodes, but the result is the same.

(1)

(2)

(3)

Anyone have any suggestion about, or can tell me what i don’t understand or where i go wrong?

Thank you! :blush: