Principles behind patch? I would like to make a mesh that uses parts of those ideas

Hi guys, I need to make a mesh patch that is acting more like a nurbs patch:

Any ideas on how to start?

If you want a regular mesh (like a grid of points) I would interpret it as an optimization problem, you start with an initial regular mesh and move the vertices minimizing the difference with the shape and between the neighbors (the laplacian). This is done by looping a logic that slightly minimizes that error until no significant improvement is achieved. You can keep the mesh regular and the trim it with the contour or adapt the naked edges to the contour.

But if your input geometry is going to be like those polycurves with four segments, I would opt to build the mesh from that, instead of looking for a generic method with so many corner cases.

1 Like

For a surface meeting 4 curves, one that’s simple to implement is a Coons patch.

You just add the positions from the 2 linear interpolations from one side to the other, and subtract the bilinear interpolation


Here’s a script I made a while back
coonspatch.gh (7.6 KB)

8 Likes

Or in Rhino use the EdgeSrf command which generates a Coons Patch from edge curves, and which takes care of reparameterizing, elevating degree, and inserting knots as needed.
Added EdgeSrf creates an “exact” Coons Patch using the input curve and does not approximate the input curves.

Does native Grasshopper lack a function corresponding to EdgeSrf?

My understanding of @Holo’s question was that it is about understanding the principles in order to use in scripting something further based on this, or control some specific aspect more than possible with the standard command, but yes EdgeSrf exists in Grasshopper.

Hi guys, sorry for tossing a question out and not being on the ball to answer right at once.
Thanks for the input, this is great and a good start. My example of 4 curves was just the simplest example I could think of, but patch is handling 3, 5, 10 what ever complex boundary, + internal curves and points, so I am looking for an understanding of how patch works in calculating the spans.
Ideally I would make a coarse but “smooth” mesh surface that is bound to the edges and that could also handle internal break lines to generate a terrain for landscape architecture.

The tool I have now uses mesh patch and handles breaklines, points and holes, and extrudes the result to a given thickness. This works fine, but it has the problem that it makes the plateaus and the kinks as in the image above that mesh patch is infamous of.

I will study the coonspatch.gh file and see if I can use some of that approach and if you have some ideas on how patch works then please share :slight_smile:

Hey @davidcockey,

The functionality behind Rhino’s EdgeSrf command is available in RhinoCommon via the Brep.CreateEdgeSurface static function. Grasshopper’s EdgeSrf component uses this.

– Dale

OK, so I am getting some results through my research, and I found calculating the mesh vertices difficult as I also want breaklines in the mesh down the road.
So what I’ve got so far is a nice result by populating a lot of points within the boundry curve and then smooth these mesh vertices afterwards:


This gives a better result than what I hoped for, and I should be able to code the rest.
And here is the automated result so far:

2 Likes

Mini status update:
Border, breaklines and holes added and working fine:

What is this for out of curiosity?

I was also experimenting a while ago with a tool for filling in mesh holes smoothly and with prescribed tangents at the boundary, which for positively curved shapes gives quite a different result to just smoothing alone with only boundary positions fixed. I didn’t have any clear use case in mind though.

3 Likes

NICE, that looks great Daniel!

I use it for landscape architecture:

6 Likes

What was your final solution? Looks pretty handy, like ‘meshpolyline’ but taking into account some perimeter tangency/tension, but where would that additional constraint come from a simple perimeter polyline?

The final solution was to add points within the shape, but not too close to any edges or within holes. Then smooth those points multiple times.

The principles for smoothing is for each poin not on the edge, a help line or a hole to be the average of the surrounding points, so that is what causes the shape. But the smoothing has to be done in multiple steps for a good result and with too many points it can be time consuming.

1 Like