Create 4-point polycurves from list of 6 points

I have an irregular curtain wall in Revit. It has angled edges. I am pulling the non-rectangular edge panels into Dynamo, tracing them and using the corner points to place adaptive components. When I create the polycurves from the panels, I get a list that has some with 4 points, and some with 6 points (highlighted in the image). I want to take all of the 6-point ones and turn them into 4-point ones. They are all 4-point polygons, just ended up with some extra points along some edges. Any suggestions on how to remove the extraneous points?

Thank you.

1 Like

Spring nodes has a node called “CurveLoop.Simplify” that might help. Tho you’ll need to make a small revision to make it work with Dynamo 1.0. I haven’t had a chance to update the package to 1.0 yet.

The problem is that the node uses a script and unlike the OOTB nodes, script does not get migrated automatically… Here’s what you’ll need to change inside:

sp1=pn1.Curves().StartPoint;
ep1=pn1.Curves().EndPoint;
dr1=List.DropItems(Vector.ByTwoPoints(ep1,sp1),-1);
dr2=List.DropItems(Vector.ByTwoPoints(sp1,ep1),1);
msk=dr1.IsParallel(dr2);
pn2=List.FilterByBoolMask(List.RestOfItems(sp1),msk)["out"];
pn3=Flatten({sp1[0],pn2});
1 Like

Another way …
This is what I first thought of.
Not the most efficient, but will do the job.

Thanks for the replies. I will try these suggestions later today and report back. Much appreciated.

I downloaded Spring Nodes and made the change indicated. However, I am ending up with 5 points on two of my shapes. The other two came in with 4 points. So I am thinking maybe there is a precision issue? These shapes come from curtain panels in Revit. So maybe they are off just a little?

Hi Vikram:

I tried this graph and at first was having trouble, but when I added a List.Map it worked. Now the trouble is, I am getting five points instead of 4. Maybe the same issue I noted above with the Spring Nodes option? A visual scan of the points seems to be four-sided, but maybe along the diagonal lines, the precision makes it result in a five-sided shape? Just guessing of course.

@Paul_Aubin Instead of a list of panels, to see if it works, try it on one panel.

Sadly that does not seem to help. I still get five points

Thanks

Hi Paul,
Is it possible to drop here 6 points panel family and dyn file so that we can have closer look at it. Thanks :slight_smile:

Certainly. Thank you for taking a look!
Sample Facade_C.rvt (1.7 MB)
Edge Panels_C.dyn (21.7 KB)

Hi Paul,

My script did not cover all corner cases. I’ve revised the node. Give it a try:

CurveLoop.Simplify.dyf (4.6 KB)

1 Like

@Paul_Aubin Paste the code provided below in a code block and connect the list of 6 sided polycurves.

sp1=pn1.Curves().StartPoint;
ep1=pn1.Curves().EndPoint;
ep2=List.ShiftIndices(ep1<1>,-1);
ln1=Line.ByStartPointEndPoint(sp1,ep2);
in1=ep1.DoesIntersect(ln1);
List.FilterByBoolMask(ep1,in1)["out"];
4 Likes

Hi Dimitar:
Works great now! Thanks!

Hi Vikram:
This also works great! Thanks.

Both proposed solutions gave the desired result. Thank you both. Here is a composite image showing both graphs and the result in Revit. Thanks again.

2 Likes

Oh, and those are just “stand-in” panels. I still have to build a proper adaptive panel for the edges. Just wanted to get the Dynamo part working first. Thanks again.

@Paul_Aubin
I follow this forum from your Dynamo course in Linkedin, for the irregular curtain wall panel.
Thanks for your effort to share your knowledge on BIM to the world.
I study all courses you teach on Linkedin. That make me progress in my professional career.
You are my great teacher.
Respect.

1 Like

Hello @kahn.cad. Thank you for those comments. Much appreciated.

1 Like