Concave/Convex polyline points

Hi all,

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.

I’m new to grasshopper, so I’m not sure how to achieve this.

Any suggestions?

Could you post your edited gh file with the curves internalized? :slightly_smiling_face:

Cluster? Or standard GH component? Without posting your code, it’s hard to know but sometimes Sift or Pick’n’Choose work better than Stream Filter.

1 Like

Hi all,

The .gh file was downloadable from the referenced link, but I’ve attached a sample .gh and .3dm file here for convenience.

Concave-Convex Polylines.3dm (176.1 KB)
Concave-Convex Polylines.gh (19.3 KB)

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.

1 Like

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:

  1. 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.
  2. 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.
  3. 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?

Single loop example:

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.

Multiple Loops:

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.

Updated Files:
Concave-Convex Polylines.3dm (185.7 KB)
Concave-Convex Polylines.gh (21.5 KB)

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)

1 Like

Hi Ryan,

Thanks for that. It is an improvement, but it still doesn’t work correctly.

The two radius inputs are intended to be for Concave and Convex corners. I haven’t looked into it, but it seems to arbitrarily apply a radius.

On some corners, it has strange artifacts like the image below.
image

Finally - it fails if there is only 1 profile.

I haven’t looked into it in detail yet, I’ll spend more time on it later tonight.

1 Like

Well, I’m getting a little bit closer.

I’ve eliminated the weird artifacts, and now one curve works, but the other doesn’t.

It also still fails if there is only one profile.

Updated Files:
Concave-Convex Polylines Maybe.gh (23.0 KB)
Concave-Convex Polylines.3dm (158.0 KB)

1 Like

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.


Concave-Convex Polylines perhaps.gh (24.8 KB)

2 Likes

That looksl like the one! Thanks for that.

2 Likes

Beat me to it again. Sweet job! @Toni_Osterlund :slightly_smiling_face:

1 Like