Rhino 8 feature req: nurbs2mesh control

Would it be possible to have guidelines or parameters that would control how the NURBS to MESH conversion works?

Regarding converting NURBS to a MESH, it seems as though the current method is optimised to be the most efficient (mathematically? / polygon count?) but not necessarily for usage. Imagine if you will, in the picture below, your object is the roughly tapering cylinder of a corn cob and the kernels represent the rectangles of the MESH.

Cob #2 is the usual result of a mesh2nurb conversion which is nice and efficient. But, the layout of the triangles/ rectangles doesn’t play well with game assets, especially when trying to create LOD’s. In particular, tight curves get incredibly weirdly faceted at low poly counts (such as a bicycle hub flange). As well, if you want to manipulate the shape after the conversion, the geometry can become an unsightly mess.

Cobs #1, 3 and 4 are nice and clean and organised with the rectangles making nice perpendicular and parallel lines. This helps in creating LOD’s in an efficient manner as well as keeping the geometry organised for easier post-conversion manipulation without distorting the shape. I’m no expert in game engine rendering but it’s my understanding that the engines, or most, are optimised to work with angles/ planes in this type of configuration as well (I hope I’m not making that up).

So, would it be possible to have a means to restrict the nurbs2mesh conversion so that the resulting MESH lines are parallel and perpendicular to, say, the curves used to create the surface (ie they are parallel and perpendicular to an original SWEEP curve, or a new curve could be drawn to act as a guide for the conversion)? Perhaps a Cplane, surface, or intersecting lines could be used to create an axis that the conversion would then restrict the polygon shapes to.

Cheers

Depending on your object, Quadremesh can be the tool for that. Do you have an example object you can share with the current mesh you are trying to alter and a desired result (a sketch of the latter is sufficient)

Hi Gijs,

Thanks for replying and sorry for my late follow-up.
I’ve had a look at Quadremsh and it’s interesting. To a degree it helps, but it also does some, what I would call “wasteful” changes. As well, while ReduceMesh can significantly reduce the triangle count, Quadremesh seem to have a limit as to how low it’ll go, and it looks like the density of triangles might be a factor as it seem to be keeping an even density across my example object.

Hub - Rhino Forum - re Mesh.3dm (4.2 MB)

In this file I’ve got my NURBS object starting point (it’s a simplified bicycle hub). (I’m choosing to do this as I’m a lot faster with Rhino/ NURBS than I am with Mesh, also I’ve spent hundreds of hours modelling a much more complex object in NURBS and the thought of starting nearly from scratch to re-do it as Mesh does my head in). Adjacent to the NURBS I’ve got the Mesh game engine target I created from scratch after not being able to get the conversion results.

Then, in a series of decorative/ garish colours I’ve got some conversion results all grouped in patterns.

In the top view from left to right (in the darkest colours - blue, green, and pink) I’ve taken the NURBS object and converted it to Mesh (Mesh command) using the Simple Mode. Blue = more polygons, Green = med (50%) polygons, Pink = fewer polygons.

Then going down the Y-axis to the lighter shade, run a ReduceMesh on the converted Mesh. Continuing further down the Y-axis to the lightest shade, I’ve I’ve run a Quadremsh on the same converted Mesh. In the layers panel you can see the polygon count for each conversion as compared to the specifically created Mesh (792 triangles). The Pink objects are the closest to the target.

In order to test LOD options, I then duplicated the Pink Mesh twice and ran the same ReduceMesh and Quadremesh but with targets equal to 50% and 25% of the original Mesh (792 & 396 triangles). These can be seen in the Orange and Brown objects.

While the ReduceMesh does a good job of reducing the mesh count all the way down to the specific targets, it does this by creating what looks like a haphazard pattern of triangles. While this might be the most efficient way to reduce the triangle count, you can see that by the time it gets to LODa & LODb, the shape is pretty mangled. But rather critically, the “non-linear” (ie effectively 90 degree U & V’s*) arrangement of the polygons would make any shape tweaking (if needed) virtually impossible without completely destroying the shape.

  • I know U & V is probably/ definitely being misused here but I’m thinking of the lines defining the polygons that can be seen. (My lack of good recall on the proper terms is my penalty for having been off Rhino for a few months) Isocurves?

While the Quadremsh does a great job of maintaining the U & V relationship which would be great for any later tweaking, because it seems to be keeping an even density of polygons across the object broad flat areas seem to get for more triangles than are needed whereas smaller detail areas get oversimplified lose their shape. As an example, compare the purpose built Mesh to the LODb (light Brown) Quadremesh - the body of the hub on the Quadremesh has far more triangles than needed (for a relatively broad/ flat area) but it’s lost the detail on the curves of the flanges. So, it seems that in some cases there’s an “inefficient” application of the quads if the object has significant differences in curvature, with the Quadremsh effectively averaging the combined curvatures rather than adapting to the relative size.

Is it possible, or would it be possible to modify one or all three of these of those commands in order to convert to Mesh while maintaining the U V relationship as it appears in Quadremsh, but keeping the ability to get significantly lower triangle counts as can be achieved with ReduceMesh, all the while, while being able to specify the density of the quads? I’m picturing the ability to add guidelines that would restrict or alter the generation of the polygons much like is found in one of the surface matching or filleting commands (I think).

As an example, suppose I took the profile curve that I used to create this hub (Layer: Profile Curves) and used the straight lines on the Y-axis that could then be used as “Quad Guide” or “density definers” (Layer: Quad Guide) such that, in this example, if I wanted 11 isocurves(?) they would be distributed just as the green lines are (Layer: Density example) with one isocurve(?) on each guide and one inbetween each pair for the total of 11 isocurves(?) And perhaps these could be axis independent with something like a Revolve, in this case, having an even distribution, with an option to modify (in case you wanted to split the object and have different results), or just being able to specify/ delineate a different pattern for the quads. Or something like that.

Hope this makes sense. Cheers.

@Gijs Any wise ponderings come to mind on this? No hurry, just curious.

Cheers

@kentalbot1 sorry I did not come back to this. In fact I had downloaded and studied that file already. I also tried the new mesher that you can download on Food4Rhino (PangolinMesh) but found it could not get to the result you want either. I think there will be no fast way to do this.

No worries Gijs. Yeah I didn’t think it’d be easy. I’ll have a look at Pangolin anyway, just in case it’s useful.

Would there be any chance of getting something like this added into the development requests? I’m assuming R9 now that I’ve heard rumours that 8 is out.

thanks for having a look though