I have a collection of closed curves. They were created by applying _CurveBoolean to a grid of curves in Rhino. They look like this:
Every curve in this collection appears, visually, to have three or four crisp corners, but when I bring them into grasshopper and explode them, many of them explode into more than three or four segments, like this:
I realize that this is probably because of how I created the curves (they’re from a wireframe, projected to c-plane, and then turned into cells with _curveboolean).
But I want to create edge surfaces from them, to project other stuff on to, with the goal effectively being a paneling grid, but curved. The Edge Surface component requires four or fewer input curves. I would like to find a way of automatically splitting my curves at their corners to achieve this.
I tried Simplify Curve. No luck. There does not appear to be a Merge Edges component, and it might not work anyway. So is there a way to detect the corners and split at them? or is there another way to delete the unwanted vertices, yielding my desired number of segments after passing them through Explode Curve?
I have made a few attempts at this. The best one so far doesn’t work perfectly, and is also probably way too complicated. It’s definitely processor intensive. Here it is, (some components are only hear for error checking):Split at crisp corners halp.gh (15.3 MB)
This should be simpler to achieve, right? I’m a newb and I’m self-taught, so I’m betting this is about a basic knowledge gap. Fill me in?
They are planar curves so it’s easy. If needed, you can then get the edges of the Boundary surfaces.
Split_at_crisp_corners_2019Nov13a.gh (447.3 KB)
That isn’t working. Patch, followed by getting the edges, takes out some of the segmentation that I don’t want. Boundary Surface doesn’t take out any of it. If I do boundary surface, then Brep Edges or Deconstruct Brep, the result is the same number of segments that the closed curves began with.
Is there a way to detect pointy corners of closed curves and then split the closed curves at those points?
Again, the reason I want to get surfaces with 3 or 4 edges is so I can map curves on to them. For example, if I place a circular curve on a square planar surface, I can map it inside any four-edged surface. If I also place a circular curve on a triangular planar surface, I can map it to any three-edged surface. If I sort correctly, any grid with a combination of 3 and 4 sided surfaces can have curves mapped to it.
Here is an example of the result I’m after, created with manual editing of the input grid closed curves, which I would like to avoid:
Try with Discontinuity, then Shatter curves at t-parameters. You may have some undesired points, but certainly less then now.
Just tried it. At the tangency setting it still gives me the same points that I got with my over-complicated use of Patch. This seems weird, because the continuity doesn’t look bad.
Under _CurvatureGraph, I definitely see the gaps in continuity, though. It’s just odd that it’s totally invisible without checking that way.
Is there away to do this by measuring angles between curves, or is that impossible because they aren’t lines?
Split at crisp corners halp_RE.gh (15.3 MB)
Might be tried with mapping ellipses instead of circles…
I did the image before using eliipses, but it also works with a circle rebuilt to have more control points.
This method you used is different from mine, though. Mine uses a Parakeet map curve to surface component (maybe it’s redundant to a native one?)
I’ll play with this.
Is there a way to test angles between curved segments or is that geometric nonsense?
Of 740 boundary surfaces, only twelve of them return five “edges” in this code.
Yup. I get the same result from curve > patch > brep edges > explode, or by using discontinuity > shatter
I’m trying to get to zero, and it seems like the key is in getting points to appear only on the “pointy” corners. I just don’t know what to try to start trying to make that happen.
I hear what you’re looking for, just been distracted by the congressional hearings… So here’s one more little gimmick to consider for making holes instead of Map Srf.
This version does that. It culls ‘t’ values to ignore tangent angles less than the “tolerance angle” slider (blue group). I had to raise that angle to 13.5 degrees before Bnd returned “3 To 4” instead of “3 To 5” curve segments per cell.
Not sure it makes any difference using the Nurbs curve “hole”. I have a Map Srf group off screen that works well most of the time but in too many cases, fails to keep the circle from surface edges.
Thank you! Eager to try it out!
By the way in the definition I used to do the example image I posted, I mapped the circle all the way to the edges of the source surface, but I created the source surface after using the offset curve component on the original curves. That allows me to control the spacing accurately.