Split duct by points

Hello everyone, please help me with an issue about splitting ducts. As shown in the screenshot, I want to split each duct by 2 points respectively but the result is not what I expected (only the duct at index [0][4] was split into 2 parts). I’m terrible at level of lists and maybe that’s the reason. So please take a look and help me with your advice. Thanks a lot.

First thing, if those extra list levels aren’t necessary you should get rid of them. It’s going to complicate things and potentially cause issues with your list comprehension.

As for your original question, a duct needs to exist at the split point at the time of the split in order to successfully split the existing duct. These splits happen consecutively, so the order is important. You need to make sure your points are ordered in a way that the leftover (original) duct can still be split after each point.

In the example below you can see how order changes things. The top duct is drawn left to right, so when it’s split at point 1 the original element is now that length and can’t be split at point 2. The bottom duct is drawn right to left, so when it’s split at point 1 it still has the length needed to be split at point 2.

1 Like

hi @Nick_Boyts . Thank you for the explanation, I have fixed it and it worked well.

1 Like