I’m trying to adapt a Grasshopper cluster that I found to suit my needs.
The cluster comes from here:
and it relates to getting ‘concave’ and ‘convex’ points of a curve, and applying different fillets accordingly.
In my case, I want to apply sheetmetal bend reliefs to concave corners.
When I try to use the cluster, I get an error from the first two ‘Stream Filter’ components saying that 'Filter component can only operate on a single Filter index value". It seems that the original application was designed to allow a single input curve only, whereas in my case, the input will be multiple input curves, and I want one (or none) output for each input.
you could simply delete all the stream filter/gate,since they are just to select between closed and open curve,at the other hand there could be operation only on closed in your case.
consider there is two Fillet component and one of them operate in multi-input while the other one operate only at single-input.
In my case, the curves will always be closed. I tried to delete the stream filter, but that had other issues down stream that I couldn’t figure out.
Issues:
Fillets aren’t applied to all corners as expected. Some corners are filleted, some aren’t.
I found that if I ‘graft’ the input to the ‘pick’n’choose’ this eliminated ‘null’ values, this had a minor effect on the output, but didn’t solve the problem.
The ‘Curve Closest Point’ doesn’t return values for all corner points - this seems to correspond to the corners that do/don’t have fillets applied. I think this problem is key. Refer to the last image.
Curves are exploded, then rejoined - the loops are ignored because after fillets are applied, the list of curves is flattened, loosing association with the original loops. This may not be relevant once I fix the ‘Curve Closest Point’ problem above.
In the case of a single loop, the stream filter output (for the first two stream filters) was (always?) 0 - See first image. I’m not sure what they were meant to do. Output 1 if the loop was open?
I tried using a couple of other methods to replace the ‘Stream Filter’ but each test gave me an error.
I think in some cases, it they were trying to use the boolean input as an index reference… not sure.
I found that ‘Grafting’ the input to the pick’n’choose component seemed to give the correct result (in this case), but I’m not sure if this is the right approach. Note that grafting the input to the ‘stream filter’ had no effect. Refer image below.
Here’s what the ‘Curve Closest Point’ component is doing - you can see the green points in the Rhino window are the points that its returning, whereas I expect it to return a point for each corner of the curve profiles.
So maybe this will work for now? I think I have it figured. There were some flatten trees in there that I switched to Trim trees. And I switched the stream gate with dispatch. Looking closer all that stream gate component was doing was moving the curve from one gate to the other based on whether the curve was initially closed. Concave-Convex Polylines Maybe.gh (23.3 KB) Concave-Convex Polylines Maybe.3dm (173.1 KB)
Hi @Gerrard_Hickson
check if this works for you. I did some tree pruning inside the cluster, just to make sure the adresses stay coherent in multiple situations. Did not touch the algorithm itself.
Works on single curves, list of curves, and grafted curves.