Joining lines and arcs to polycurve

#1

Hi all,

I have a question: How can I join line and arcs to a polycurve?

I’m trying to create rebar by calculating the start and endpoint of the lines.
The lines are connected via an arc and then joined as a polycurve.
So far I can only join 2 lines and a curve to a polycurve (see line lightup blue in picture). when I want to add the next arc and line it gives me an error.
In an other post I found out it has something to do with the fact that the startpoint of the arc does not match the endpoint of the polyline. Is that correct? (The error is telling me that it is producing more then one wire)
And how can I check that and how can I correct it?

With kind regards,
Mike

0 Likes

#2

Even if the start and end points of the curves and arcs are sequential, the node is still only expecting a single curve as the first input.

With some list management this should be an easy fix.

You can the Polycurve.ByJoinedCurves node instead if all the curves do join, as this ignores ‘start / end’ point inconsistencies.

2 Likes

#3

I was just looking through older dynamo files of mine and found out I already made this work.
So I copyed what I did before… but it didn’t work! Sadly.
So I tweak it here and there and got rid of the error but stil got 10 polylines instead of 2 polylines that are made up of 5 lines each.

But let me try your deconstruct aproche. I’ll post the result hopefully soon!

0 Likes

#4

0 Likes

#5

Just looked at a design script alternative (DS +1 ), based on what i can see of your script / background.
This may help… but if not, should be a good reference for others.

//design script only

//control points
a=Autodesk.Point.ByCoordinates(0,0);
b=Autodesk.Point.ByCoordinates(0,0,1000);
c=Autodesk.Point.ByCoordinates(0,100);
d=Autodesk.Point.ByCoordinates(0,100,1000);
e=Line.PointAtParameter(a1,1);
f=Line.PointAtParameter(a2,0);

//lines and arcs
l1=Line.ByStartPointEndPoint(a,b);
l2=Line.ByStartPointDirectionLength(e,Vector.YAxis(),300);
l3=Line.ByStartPointDirectionLength(f,Vector.YAxis(),300);

//lists of lines and arcs
linelist={l1,a1,a2,l2,l3};
linelist2=DSCore.List.Flatten(linelist,10);

//joining lines and arcs for rotation
pc1=PolyCurve.ByJoinedCurves(linelist2);
cp=Autodesk.Point.ByCoordinates(0,10000,0);
v1=Vector.ZAxis();
ang1=0…360…2;
Geometry.Rotate(pc1,cp,v1,ang1);

//offseting item for secondary ring rotation
pc2=pc1.Translate(Vector.YAxis(),3000);
ang2=0…360…5;
Geometry.Rotate(pc2,cp,v1,ang2);

0 Likes

#6

Archilab’s group curves node may be worth a look here…

The polycurve by joined curves node fails as soon as it finds a curve which doesn’t connect with another…

0 Likes

#7

Or even design script grouping by @Vikram_Subbaiah

Grouping of Curves with Design Script

1 Like

#8

FRIKKING H*L!!!
I found my problem! My approach was correct. It was the startingpoint of the top line that wasn’t the same as the endpoint of the arc. My calculation was off.
@Ewan_Opie: in your great example you make use of horizontal en vertical lines.
But in my case the top line is sloped and so I first must calculate the startpoint of the top line in oder to create the topline. then I can create the arc between the vertical and the topline.
And there was my problem.
For the vector of the topline I used the calculated slope (100,4 degrees between vertical and slope) but for the startingpoint of the topline I used a set value of 110 degrees (Angle between vertical and slope).
Now I used the calculated angle to for the startingpoint and it works like a charm!

But thanks for your input! Could come in handy for future problems!

With kind regards,