Rotating a sweep along its own axis


Quite new to grasshopper so this might be an easier fix than I think. I created a diagonal truss with a rectangular sweep along it but I’m having trouble figuring out how to rotate the sweep profile so that it aligns with its host curve at any point along the curveOVERALL

1 Like

can you post the GH file? maybe I can help you.

1 Like

Rectangular truss attempt (orientation problem).gh (6.3 KB)

It should work!
Rectangular truss attempt (orientation problem).gh (10.7 KB)

1 Like

hey man you’re a legend!! I’m looking at it and kinda get how it works (I’m still quite new) but if you happen to have a spare moment could you explain your thought process/how it works? Can sum it up in a sentence or 2. Thanks again!

Also how would you then move the sweep origin point from the corner of the rectangle to the centroid?

I think I solved it actually

Rectangular truss attempt (CENTROID).gh (13.2 KB)

1 Like

Sorry for the late reply.

I will explain how it works.

First. From the Diagrid Structure object I take the generated structure lines (truss) and I identify the starting points of each line using Ends Points object. To each starting point I assign a plane.

Second. Once each point has been associated with a plane, it is necessary to align (rotate) each one with respect to the corresponding baseline (using Align object).

Third. Once again it is neccesary to rotate the planes but in the required direction to generate the truss elements now. So I generated direction vectors using star-end points and then rotate the planes using Adjust Plane object.

Fourth. Using Path Mapper object I ordered the list of items as neccesary to generate rectangles and extrude through the rails lines.

It is difficult to explain, but I hope you have understood.