Rhino WIP Feature: Patch re-implemented

Can the new patch command be used in Grasshopper?

Yes, look for the “continuous patch” component.

Thanks for the hint. It works but is there also a way to change the orientation of the surface?

The patch on the left is done with the Rhino command and a starting surface. It would be nice to have a direction input instead of starting surface.

patch_continuous_missing_direction_input.gh (20.3 KB)

It looks like some of the options that are in the command need to be added to the GH component. The component will be updated early next year.

Thanks @menno, I’m looking forward to a more complete implementation in Grasshopper

I wonder how the new “Patch” tool of Rhino 9 handles this case with G2 curvature continuity, either with the top blue or the top green ellipse. Here is a test 3dm file from Rhino 7 where I built a patch with G1 tangency.

Patch test 1.3dm (558.4 KB)

I used the “Shaded 14” display mode for this test due to its highlight. It can be downloaded from this link:

Patch test 1 9.3dm (3.4 MB)

Hmmm, I expected a smoother and more relaxed result from the G2 option… Looks quite distorted and inconsistent.

Patch test 1_MDvR.3dm (1.5 MB)

This is my attempt with the green curve as an internal constraint. To me it looks more smooth than the above. These settings were used:

Update: the stiffness setting is different - I used 0 (zero) where @martinsiegrist used 100.

This is indeed a much smoother result. Is the “Stiffness” option sort of a falloff that dictates a certain distance (offset) from the target surface’s edge to be taken into consideration for the G2 continuity matching? A lower value means longer distance from the edge?

The new Patch uses a technique called variational surface modelling, where the shape of the surface is assigned an energy based on bending (2nd derivative) and the change in bending (3rd derivative). The stiffness parameter affects the relative importance between the two, where zero stiffness puts the energy fully on rate of change, while 100 puts the energy fully on bending. Values in between blend the two contributions. The total energy is minimised during the surface creation.

In most cases, zero stiffness gives a nice, smooth result. There are cases, however, where stiffness needs to be increased to be able to get a decent surface. My advice is to start out with zero stiffness and increase it if needed.

I add another test model that may help the developers polish the “Patch” tool even more. It would be interesting to see how the tool will behave when:

  1. Surfaces #1 and #2 must be replaced by a couple of patches patches (surface #3 remains as target surface).
  2. Surfaces #1, #2 and #3 all must be replaced by a single patch.

Complex shape test.3dm (2.2 MB)

So, the smaller surfaces (1) and (2) are relatively easy. With default settings you can get up to G2 continuity, with the exception of the lower bend in both surfaces that are G1.

The bigger patch (3) is more difficult, and needs some tuning. Ultimately, I got a good result by keeping the top edge at G1, and the other three edges at G2 - there is no G2 consistency at the corners. Then, the stiffness can affect the shape of the patch somewhat, but the best result is achieved with 0% stiffness (attached).

What I did here was to first do (1) and (2), while keeping (3) as input. Then I did (3) with the patch results for (1) and (2) and the existing edges in the model.

Complex shape test_MDvR.3dm (1.7 MB)

Thank you for that trial. Looks like the new “Patch” tool can handle such cases almost flawlessly (except for the G1 tangency where the bottom pipes are located).

I noticed that the large patch surface is a bit concave where number #3 is located. Is it possible to include the green vertical smooth blend curve and test the patch again to see if this will improve the overall shape? I also fixed the lack of G2 transition of the middle blend surface.
Complex shape test 2.3dm (1.4 MB)

It is certainly possible to add internal constraint curves. It would be useful if you could provide the starting patches (1) and (2) optimized for the second trial. If I use the ones from the first trial, they are not aligned with the bottom bend of patch (3) anymore, and Patch then cannot make a surface.

Attached is the result with the internal constraint curve where a single patch is used to cover the whole thing, using G1 for all edges (G2 did not work at all). This is not as good as the approach with 3 patches, especially in the region where the handles are attached where upon joining you get naked edges.

Complex shape test 2_MDvR.3dm (1.8 MB)

I purposely didn’t included the surfaces marked with #1 and #2, in order to make the challenge closer to a real case. However, the updated file below consists an additional blend surface that should be good enough to provide a reference for the patch surface marked with #1. Note that I made the latter with Rhino 7’s “Patch” tool, so it’s unusable and must be deleted and replaced with a better “Patch” from Rhino 9 WIP. I also included 3 blend curves with the “Edge” option to provide extra guides for the patch surface.

I also saved the camera position as a Named view, in order to make the comparisons consistent.

Complex shape test 2.3dm (1.9 MB)

I made this version with a curve in the middle acting as an internal constraint (as a control point), because otherwise the surface tended to collapse inward in the central areas.


Complex shape test_bravi.3dm (4.2 MB)

option 2
Complex shape test_bravi 2.3dm (5.9 MB)

On the same model, visually the result is better without “Refine” enabled.

Wow, what last 1% took so much longer. I often see this in various programs, including in Windows Explorer. They are fairly quick to reach 99% completion, yet the last percent takes ages. Not sure why that happens…

I’ve noticed that Refine significantly slows down the Patch command. In some cases it even fails, whereas when I disable Refine, the patch is created much faster and the isocurves are also easier to control and adjust.

Global Edge Continuity Rhino 9 WIP test