Help with building logic for creating curves

Hi all,

I am in the process of creating a graph that can generate a side view of a rebar shape, by offsetting detail lines. Below an example:

I can get to the point where i offset and place detail lines for a straight line, But i need to close it at the ends to so i can turn it into a masking region boundary later on.

I am not sure how to allow for these situations where its just a straight line, or chained lines with or without a bend…
We have a positive and negative offset, so first i’d need to trim and extend these to eachother by group (negative/positive being two groups) That gives us a rough shape, then we need to filled arc all corners, and finally close the loop with a perpendicular line from first point in first group, to first point in second group, and from last point in first group to last point in second group

so given al scenarios, i need this:

Just for context:

Basically what im aming for here is allowing users to draw a line that indicates the shape of a piece of rebar, and making dynamo turn that into an actual side view of that piece of rebar, as a masking region.

im able to get to this point:

I am able to close the loop at start and finish. Im also partly able to add fillet arcs.

The issue is the lines need to be trimmed after the arc, and my method of grouping by negative and positive offset doesnt work since the offset is not dependant on drawing direction of the line. Which means that when you encounter a corner of more than 90 degrees, the negative offset should(according to me…) be on the top side, not the bottom. Im not sure how to address this part.

im only applying the arc to the positive group now, which gives the following results:


The behaviour seems unpreditable to me…

This is what its supposed to look like:

One thing i just thought of, the interior line always has a arc of R=32, and the outer line of 48, so i also somehow need to account for the angle at which the lines are drawn…

You’ll be way better off using PolyCurve.ByThickeningCurveNormal and chamfering your hard angles before offsetting.

Here’s a quick example of what I did.

2 Likes

That’s perfect!
Thank you very much :slight_smile: