Exclude Diagonal Line in the pattern in grasshopper

Hi, i was following this tutorial online building the cambridge central mosque tree structure column. I came across the cull pattern. In his tutorial, there is no longest diagonal line in his. I couldn’t find what happens to my grasshopper so i’d like to ask if there is a method to exclude the diagonal line. If so which parameter. Would it be using the panel and setting diagnoal coordinates? Thanks in advance :slight_smile:

Nobody can help if there is no GH file.

1 Like

Second what Quan Li says but one thing to check without seeing your file… Control points of a square yield 5 points instead of the expected 4.

It’s possible wherever in your script you draw those initial lines from point to point you either need to uncheck “wrap” on your point list (to exclude the extra line being drawn with the last point of list to the first point) OR cull duplicate points.

TLDR, I’m guessing you have 1 too many points in the logic before you’re drawing your lines

sry I didn’t know that i could upload gh file. I thought i could only share ss.
Mosque.gh (37.9 KB)

1 Like

I’ll give it a look. How do you cull duplicate points if i may ask? Given the coordinates of the points, how do you achieve that.

You can use the Cull Duplicates component and set it to “Leave one” it will cull overlapping points and leave 1 there. But it’s really handy because it gives you an index output as well so if you had a list of lines you could feed the middle point of the lines to cull duplicates and then use the index output to cull the list of lines itself if that makes sense. Because the middle point indices would match the indices of the lines they came from.

I’ll take a look at your GH definition when I’m back at my computer again. Thanks for uploading

Alright I figured it out. You were using the “Sort By Curve” component from TTToolbox but you need to use the “Sort Curves Along Crv” component from TT Toolbox instead.

Did you just need to reread that? Exactly, they are named the exact same thing but yield slightly different results.

In your script you use the version from TTToolbox, the tutorial and the correct version you need is from TT Toolbox.

I’m not sure which one is older vs. newer… but here’s the location of the one you need.

TTToolbox (Incorrect sorting):

TT Toolbox (Correct sorting):

And here is the result you are after:

20230527_Mosque_Response_01a.gh (22.5 KB)

If you open up the attached GH file it may prompt you to download the correct plugin version you need, you can try that.

Hi Michael, thank you so so much for your response. It is really a subtle difference and idk how you manage to find it!

You’re welcome! I like to turn on selected preview only, then walk through the logic step by step to see where the script isn’t working as expected and then troubleshoot at that location.

Also, for whatever reason I have both of those components as well and it’s tripped me up before as the blue icon version almost never works as I expect it to haha.

Anyways, happy to help!

1 Like