Scripting Quadrilateral Mesh in Rhino 6 for Mac

I need to create quadrilateral meshes for an aerodynamic panel code. The meshes need to have a specified spacing of the nodes that does not correspond to Rhino’s algorithm that is based on the change in angle between successive points. I need to write out the mesh points along section lines (v isocurves) that progress from one end to the other.

I’ve attempted to create a surface with the desired distribution of points by creating polyline rails and sweeping a polyline section curve, but there were irregularies in the distribution of the isocurves.

My attempts at using Rebuild and specifying a polyline with the desired knot distribution as master curve did not result in parameterizing the curve with the desired distribution. I had to resort to manually creating sections at every station to get the distribution of points I wanted.

I’ve been through the user guide and I can’t find a way to script these actions in Rhino 6 for Mac.

Here’s a sample of the kind of surface I’m trying to fit and the distribution of sections and points along the section.
WingSample.3dm (3.7 MB)

Anyone have a solution for creating these kinds of meshes?

Hello - does the mesh in the attached file (just a small fragment) have the spacing you need?
Wingmesh.3dm (36.4 KB)


(Edit) Oops - at first I thought you were referring to my file.

Yes, the sample you sent appears to have the right spacing, at least along one edge. It’s hard to tell without the whole surface.

Hello - it might be possible to script this - maybe. The corners of the quads that I made are on intersections of isocurves extracted at your marker points. So getting the points is not hard, keeping track of them to shove them into a mesh in the right order might be a challenge, but probably do-able. How are you dividing the edge curves, what are the rules?


I started by computing the values for a unit length line in a spreadsheet and saving it as a text file. I then imported the points and passed a polyline through them. My intent was to use them as master curves in the Rebuid command, but that didn’t work.

I then rotated and scaled a copy of the unit length master curve and extracted the points. Then used them as starting points to manually section the edge curves. For. each. and. every. one. of. the. 100. points. I had to repeat that for the root section curve as well. Clearly this is not something that I’m going to be able to do on a routine basis.

If I could enter the (u,v) value of a point, I could extract the points one at a time from a nurbs surface - provided that it was uniformly built. But I can’t find a way to do that.

With regard to the rules, I’m currently using four different parameterizations. For 0<i<n, where n is the number of segments to divide the line, the parameterizations are:
uniform: u = i/n
cosine: u = (1-cos(i/n * pi))/2
half cosine: u = 1-cos(i/n * pi/2)
half sine: u= sin(i/n * pi/2)
I have also used a cubic polynomial when I needed to match the “speed” of the parameterization at each end to an adjacent curve.

I suppose another approach would be to make a generic grid that has the spacing I want in both directions. Then morph (Drape?) it over the surface and extract the points. I’d need a way to export the points in the right order, however. I couldn’t live with just a randomly ordered collection of points.

Hello - you can do this part in a script (in plain Rhino, one at a time, EvaluateUVPt ) - that part is not hard - what I’d do first is verfiy that extracting an iscurve at each of your edge marker points gets you a grid of curves for which the intersection points are the ones you want over the full surface. If so, then we can figure out how to generate a mesh from those points easily enough. If the rules are clear for dividing up the edge curves to begin with, then I think the whole thing can be scripted.


I figured I could do it in a script, but I’ve been through all the documentation I can find, and nowhere is there a list of what all the commands are and their associated parameters! When I do things manually and pull up the history, it only shows what commands I did with no details.

I tried using EvaluateUVPt, and entering a u,v value did not work. The point it created wasn’t even on the surface!

Could you build the wing form and then create an array of intersecting planes at the proper spacing then use the split command to create the nodes?

That’s basically equivalent to the Section command, which is what I’ve been using to generate the points along the edge curves. It works for generating the section curves, but it doesn’t work for generating the spanwise curves, which do not lie in a single plane.

My problem is that while it’s straightforward to do the sectioning for a largely planar shape like a wing panel, I also need to be able to generate a grid for a very 3D shape like the fairing that joins a large strut and a wing. Nothing lies in a plane for a shape like that.

Hi Tom - can you confirm that extracting isocurves at the division points in your file that are on the two edges on your surface gets you, at the intersections of the isos, the grid of points you want to mesh or export etc? If I know that the set of points you’re after is on intersections of those isocurves all across the surface, I think we can cook something up.


Yes, divisions based on the edge curves are what I want.

In addition to parameterizing the surface itself in a specified way, it’s also important that adjacent surfaces meet in a water-tight manner and share the same divisions. Basing the divisions on edge curves will ensure that adjacent patch grids match.

Hi Tom - I understand that the divisions at the edge curves are the inputs - what I was not sure about is whether, away from the input edges, out across the surface, the desired output are points that correspond to surface isocurve intersections where the isos are based on the edge curve divisions. I think the answer is yes…Anyway it looks like Dale Fugier already got on this and wrote something good…


Yes. Isocurves across the whole surface. The intersections form a quadrilateral mesh.

I searched for Dale Fugier’s posts, and as best I can tell:

  1. CreateQuadMesh did not work with Rhino for Mac, only Windows
  2. CreateQuadMesh is no longer available, having been replaced by QuadRemesh in Rhino 7
  3. The quad meshers seem aimed at creating highly isotropic meshes on very complex surfaces, where I need an aniostropic structured mesh on simpler surfaces.

Edit: I now see that Rhino 7 for Mac WIP is available. I’ll give that a whirl.

OK, I downloaded Rhino 7 WIP for Mac and tried out QuadRemesh. It doesn’t do what I want at all. It does create quad meshes - a step forward - but there is no control over the density of the mesh for smooth surfaces. (Sigh)

I’m making progress. I found a terrific online course that covers just the kind of thing I’m trying to do. I’ve now written a script that allows me to output PMARC formatted patches directly from Rhino, with the same kinds of parameterization I wanted to achieve:
test.pdf (758.7 KB)

However, I am still having problems in some areas. Trimmed surfaces are evil! The UV domain associated with a trimmed surface covers the entire underlying surface, not just the visible portion. My script ends up meshing the untrimmed underlying surface. So untrimmed surfaces only!

I also have to do a lot of handwork on the Rhino model to make it suitable. Some of this is related to the aerodynamic model I’m trying to create, which requires sharp trailing edges. So this gives me the opportunity to create untrimmed surfaces that approximate the trimmed ones. I’m finding that using NetworkSrf from a set of modified isocurves is a good way to create an untrimmed surface matching the original.

Lots of work remaining, but I’m finally making progress.