Constrain curve offset direction

Hello everyone,

I’m working on a script that will create pipe segments along a cable tray. So far I’ve got it working for the horizontal parts, but the sloped parts are giving me some trouble. I use the Curve.Offset node to create a first curve along the side of the cable tray. After that I offset 4 more curves that will serve as the location for the creation of the pipes. The problem I’m facing are those 4 curves that sometimes offset in a Z-direction.



Is there a way to limit the direction of the curve offset so that they won’t be offset in a Z-direction? I know there’s a node in de springnodes that can do this, but I don’t know how to implement this in way that I’ll get a similar result as I’ve done with my Python script.

Any help would be greatly appreciated.

-Taco

Did you try “Geometry.Translate”? It does the same job :slight_smile:

I did try the Geometry.Translate but that doesn’t work for curves that aren’t aligned to the X-axis.


I’d have to figure out the perpendicular vector for every cable tray and than also make sure it points inward to the cable tray. I don’t know if that’s possible.

Hi @T_Pover ,
how about this:


2 Likes

Its working fine!


I suggest you use “Element.Location” node from clockwork package to extract curves. It works fine with that.
Good Luck!

1 Like

@Kulkul maybe the reason it doesnt work for @T_Pover is the fact that his cable trays arent all along the X axis.

here is the previous proposition in design script:

if the justification of your cable tray is set to centerline you don’t have to worry about the vector pointing inwards.

2 Likes

@Mostafa_El_Ayoubi +1 :+1:

Thanks guys,

Mostafa’s solution seems to work, I had fiddled with the Curve.NormalAtParameter but didn’t know how to apply it in this case. Great work!

Thanks again, this’ll save me hours of time modeling pipes!

Greetings,
Taco