Meshing With Rhino

> WATCH THE VIDEO

Rhino is a NURBS modeler produced by Robert McNeel & Associates. A demo of Rhino can be downloaded from their website, http://rhino3d.com. Although Rhino has meshing capability, McNeel does not promote Rhino as a meshing utility. As a result, there is little information about meshing in the Rhino website, manual, or online help. In this document we will illustrate several techniques for creating a mesh using Rhino.

We will start with a Quick "How To Mesh With Rhino" summary. To illustrate these steps in more detail we will proceed through three examples, each emphasizing a different aspect of working in Rhino:

  • Importing an IGES Surface Geometry examines file importing and exporting, analyzing the objects, surface smoothing, joining parts into a single object, exploding a mesh into parts, and vertices welding.
  • Importing an Existing Mesh examines exploding an object into its constituent parts, and creating surfaces from a mesh.
  • Re-creating an Object Inside Rhino explores some of the commands that aid the creation of NURBS objects including cursor snapping, Boolean operations, and object scaling.

Although all examples illustrate the use of the meshing controls, the third example examines the effects of the controls in the most detail. We describe the effect of each of the Detailed Mesh controls in another document, Detailed Controls.

In terms of available documentation, we find ourselves referring often to Chapters 5 (Rhino Commands), 16 (Rhino Geometry) and 18 (Surfaces) in the Rhino User's Guide for general information on using and creating surfaces inside Rhino. The User's Guide allots one page to meshing (the last page of Chapter 16).

Quick "How To Mesh With Rhino"

  • Importing an Existing Mesh: Rhino can read in polygon meshes using one of several file formats: AutoCAD DXF (both 3DFace and Polyface entities), STL, RAW (any quad polygons in the file will be converted to triangles), 3DS, and others (See Import and Export Formats under the Help Index.) Being a NURBS modeler, Rhino can do little with existing meshes.
  • Importing a Surface Geometry: Rhino can read surface geometries using one of two formats: IGES and AutoCAD DXF. Rhino recommends the use of the IGES format for transferring surface geometries into Rhino from Catia, Mechanical Desktop, Microstation, Pro/E, SRDC I-DEAS, SolidWorks, Unigraphics, and others (See Related Topics under the Help Index topic IGES File Exchange.)
  • Preparing the Surfaces for Meshing: To ensure a "watertight" mesh (in which adjacent polygons share common vertices), you must join all surfaces together. There are two methods: Edit->Join and Solid->Union/Difference. The second method is a Boolean operation.To eliminate unwanted surface transitions and imperfections use the Transform->Smooth command.
  • Meshing the Surface: Select the surface. Use the menu command Tools->Polygon Mesh->From NURBS object. A Create Polygon Mesh from NURBS object window will pop up; hit Detailed Controls. In the (Detailed Controls) Mesh from NURBS window, set Max aspect ratio = 1. Hit Preview. If you don't like what you see (Rhino will probably create more polygons than you want), type in a very small value for Min Edge Length and hit Preview. Increase Min Edge Length gradually, hitting Preview after every change, until the mesh no longer has undesirable detail in it. If your surfaces have small details in them, Rhino will not be able to gloss over the detail when meshing. If you end up with some overly big polygons, use the Max Edge Length to decrease the size of your largest polygons.
  • Preparing the Mesh for Export: If you want to break the mesh into parts, use the Tools->Polygon Tools->Explode command. This operation may result in more parts than you desire. You can combine the pieces into the parts that you desire either in Rhino or WinTherm. We recommend doing as much as you can within Rhino. The Tools->Polygon Mesh->Join command joins adjacent mesh parts.
  • Exporting the Mesh: Once you're happy with the mesh, hit OK in the Mesh From NURBS window. Select the mesh, and then use the menu command File->Export Selected. Rhino can export a polygon mesh in various formats (AutoCAD DXF, STL, RAW, 3DS, Wavefront OBJ, VRML, etc). We recommend using Wavefront OBJ or AutoCAD DXF for import into WinTherm. When exporting an OBJ file, select Polygon Mesh and Polylines in the option window. When exporting an AutoCAD DXF file, use the options Write Surfaces as Meshes and Write Meshes as 3DFaces. You can also use the File->Save As->Wavefront OBJ command; however, we do not recommend using this option since you must then mesh during the file save operation which denies you opportunity to prepare the mesh for export.

Importing an IGES Surface Geometry

Importing an IGES Surface Geometry

In the first example, we will import a surface geometry in IGES format that was created in Pro/E. The object consists of two orthogonal cylinders. Since the geometry was created inside Pro/E, the model is a solid. This means that the cylinders have a front, back, front and bottom forming an enclosed volume. The smaller cylinder, shown on top in the figure, is composed of two sections with slightly different diameters. The larger cylinder of elliptical cross-section has been trimmed with a plane.

Reduce the geometry to a shell

The first step in the process is to reduce the geometry to a shell. All interior surfaces must be deleted, one by one. In Rhino, this process consists of selecting an interior surface with a mouse click and hitting the delete key. Rotating the geometry in the Perspective window makes the task of selecting the interior surfaces easy. When you click on the object and there are two surfaces beneath your mouse (e.g., an exterior and interior shell). You will be notified by Rhino and allowed to toggle between them before making your selection.

The easiest way to check for smoothness is by meshing the object. At this point it is wise to check the smoothness of the geometry. Objects that you import from other CAD programs may have unnecessary detail where surfaces meet. The easiest way to check for smoothness is by meshing the object. Use Edit->Select->All->Surfaces, then Tools->Polygon Mesh. Use the Simple Controls, leave the slider at its default mid-point and mesh the geometry.

There appears to be no gross irregularities in the object, but since Rhino has a handy tool for smoothing out surface irregularities, it generally is a good idea to smooth. The utility is called Transform->Smooth. You will need to test several smoothing factors; we used a factor of 0.001 for this object.

To ensure that you end up with a watertight mesh (i.e., adjacent facets and parts meet at common vertices), you need to combine all surfaces into one. The Edit->Join command will allow you to join adjacent surfaces. The command will fail if the surfaces do not meet. If you correctly selected the exterior (e.g., larger) surfaces, then the parts should join as one.

This is a good time to do some checking. Analyze->Direction displays surface normals. As you move the cursor across the object, the normal to the surface at that point is indicated by an arrow attached to the cursor. Typing in the command FlipNormal will reverse the displayed surface normals. Analyze->Edge Tools->Show Naked Edges will highlight all surface edges that are not joined to an adjacent edge. You expect some naked edges, such as along the edges of the cylinder top and bottom. Other naked edges indicate that the surfaces do not fully intersect and hence may not form a watertight mesh along those edges. To fix unwanted naked edges, explode the surfaces apart, and then attempt to adjust them (translate, scale, Solid(Boolean)->Union/Difference, recreate the surfaces, etc.) so that the edges do fully intersect and overlap.

You are ready to mesh.You are ready to mesh. Select the surface (there should be a single surface after the joining operation). From the menu bar, select Tools->Polygon Mesh->From NURBS Object. Use the Detailed Controls. Set Max Aspect Ratio = 1 and use the Min Side Length to control the number of polygons. You can reset the Max Angle to an appropriate value; we find the default of 20 degrees to be an acceptable value for most cases. Note: you must always select a Max Angle and Max Aspect Ratio. For this example, we set the Min Side Length to 0.5. The resulting mesh, while not perfect, is definitely usable.

Mouse pick the mesh and type in the command SelNakedMeshEdgePt. As before, only the outermost edges should be displayed. In this instance, the edges along transition in the smaller cylinder had naked edges. Sometimes these naked edges can be resolved by using the Weld command (type Weld or Tools->Mesh->Weld) with an appropriate angle. We used 100 degrees because we wanted to join the transition lip with the cylinder, and these parts meet orthogonally. The weld command will attempt to merge the vertices of adjacent polygons that have normals are less than the input angle. The weld command is not always successful, and parts that are welded together cannot later be exploded apart. Perhaps a better, and definitely more robust, method to deal with naked edges is to crunch the vertices after you export the mesh out of Rhino. Crunch all vertices that are within some user-specified distance tolerance.

If you export the mesh at this point, there will be only one part. To break the mesh back into parts, use the Tools->Polygon Mesh->Explode command. This operation will often create more parts than you want. To combine the mesh pieces into meaningful parts, you can combine the pieces using Tools->Polygon Mesh->Join. An exploded mesh can also be joined inside WinTherm. We recommend doing whatever can easily be done within Rhino before exporting the mesh, and then finishing the job using WinTherm's Assign/Unassign tools.

To export the mesh out of Rhino, mouse pick the meshes or Edit->Select->All->Meshes, and then File->Export Selected->Wavefront OBJ. When the OBJ export window opens, select Polygon Mesh. The other selection in the OBJ export window is for trim definitions; there should be no trims in the mesh. (We usually select Polyline just to be safe.) If you try to export before you mesh, or if you do a File->Save As->Wavefront OBJ, yo uwill be prompted to mesh during the File Save/Export operation. In general, you will not want to do this. You will usually want to export a previously meshed object because you want your mesh to be exploded and joined into meaningful parts. Consequently, we advise against using the File->Save As route.

Importing an Existing Mesh

The resulting mesh has many long and skinny triangles.We created and meshed a box and cylinder inside AutoCAD, and exported via a DXF file. (Note: if the DXF file uses PolyFace entities, it cannot be imported directly into WinTherm; use Rhino to convert it to a DXF file that uses 3DFaces.) The resulting mesh, pictured at left, is deficient in that there are many long and skinny triangles. When meshing a cylinder, AutoCAD will always create triangles that span from top to bottom. The resolution control in AutoCAD adjusts only the number of top-to-bottom triangles created. The mesh consists of a single part. One helpful feature in Rhino is the Info tab under Edit->Object Properties. For this geometry, it shows that you have a single layer containing a mesh with 35 vertices and 66 polygons.

To convert the mesh into a polysurface, select the mesh and type in the command MeshToNurb.Most Rhino operations will not work on imported meshes. For instance, the Tools->Polygon Mesh->Explode command does nothing.

Rhino's tools act principally upon NURBS surfaces. To convert the mesh into a polysurface, select the mesh and type in the command MeshToNurb. You can then mesh the polysurface (We find it easier to first delete the original mesh, but this step is purely for appearance purposes.) Setting Aspect Ratio = 1 and Min Edge Length = 0.5 results in the mesh pictured below. It is not a good thermal mesh. Although the polygons are smaller and many have a near unity aspect ratio, there are still many long and skinny triangles. The polysurface that Rhino created was based on the polygons of the AutoCAD mesh. All that Rhino has been able to achieve is subdivision of those original polygons.

We attempted to smooth the AutoCAD surfaces prior to meshing. Since Rhino will not smooth a polysurface, we used Edit->Explode to break the surface into individual surfaces which resulted in one surface for each AutoCAD polygon. Transform->Smooth seemed to have little effect since it smoothed each planar surface (each a former polygon) individually. Before meshing the smoothed surfaces, you must join the surfaces back into a single polysurface (to ensure that adjacent facets and parts share vertices). You must mouse pick the surfaces one by one and reassemble the object (using Edit->Join).

You can use the smooth command on a mesh. High values of the smoothing factor smoothed the shape into a blob; whereas low values did little. There is another option for dealing with an imported mesh; this option will be explained in the next section.

Re-creating an Object Inside Rhino

We imported the AutoCAD DXF mesh into Rhino and created a box and cylinder the same size as the original AutoCAD object. This exercise demonstrates the modeling power of Rhino.

Since Rhino can do little with meshes, select the mesh and type in the MeshToNurb command. Rhino can now snap the cursor to the end points of the polygonal surfaces. By snapping to the vertices, you can create an exact NURBS representation of the original mesh object.

To create the box, activate Osnap (located at the bottom of the screen) and select End. As you drag the cursor over the object, you will notice that the central point jumps off the cursor to the nearest end point of a surface. Create a Box From 3 Corners by clicking on three corners of the box. You have now created a box exactly the same dimensions of the original AutoCAD box (assuming that it was a rectangular box).

The cylinder involves a bit more work. We will be snapping to the center of the top and bottom circles forming the cylinder. First we must create the circles. There are only triangular strips on the cylinder top and bottom; the imported geometry does not have any circles. Use Circle From 3 Points. In a side view, move the cursor along the bottom of the cylinder and watch the top view as the cursor point snaps to the points. Pick three points on the bottom, and then on the top, to create two circles. Deactivate End in Osnap and activate Center. Start creating a solid cylinder. Move the cursor to the circumference of the bottom circle. (You have to move the cursor to the circumference, not the center, to snap to the center of a circle.) Once you have the center selected, deactivate Center and activate End in Osnap. Snap to a point on the outer circumference of the bottom circle (used by the Solid Cylinder command to set the radius), thus creating the cylinder base. Deactivate End and activate Center, and then select the center point of the top circle. You have now created an exact duplicate of the original box and cylinder—exact to within how closely the end points of the AutoCAD facets corresponded to the original box and cylinder.

The next step is to Boolean union the newly created box and cylinder to form a single object. Rhino's Boolean addition (Solid->Union) is the tool to use. Rhino's Boolean tools are quirky. Often the Difference operation achieves what you would expect Union to do. In this case, the Boolean union fails. Rhino will not tell you why it fails, but if you nudge the cylinder either by translating or scaling, Rhino can union the result. The catch appears to be the bottom where the center of the cylinder coincides with a corner of the box. Translating the cylinder has two drawbacks: it is no longer the exact geometry and, more importantly, it adds unnecessary detail to the object. When meshing the resulting union, Rhino will generate many polygons to capture the slight offset you have imposed on the junction between the box and cylinder.

A better approach is to copy the cylinder and perform a 1-D scale (Transform->Scale->Scale 1-D) on the cylinder. Scale the copy of the cylinder slightly in the vertical direction. (Activate Ortho along the bottom of the screen—this will restrict your mouse operations, such as translation, to be along the axes directions.) Union the scaled cylinder and the box. Using the original cylinder, create planes at the original top and bottom. Expand and translate the planes so that they can be used to trim the scaled cylinder/box combination. Instead of the trim function, we recommend using the Edit->Split. Like Trim, the Split command will trim the surface; but there are two differences between Trim and Split. Trim splits the object into two pieces and deletes one of them. The Trim function will fail if Rhino feels the need to break the object into more than two pieces. Split has no restriction on the number of pieces created—hence, it is far more robust. Which piece of the object that the Trim function deletes depends on the direction of the normals and often Trim will delete the "wrong" piece. Since Split does not delete any piece, the user has complete control over which pieces are deleted.

After using Edit->Split, delete the original cylinder, cutting planes, and the pieces of the scaled cylinder.After using Edit->Split, delete the original cylinder, cutting planes, and the pieces of the scaled cylinder above and below the cutting planes. This leaves an object that looks exactly like what we want. The object, however, has no top or bottom because we've cut them off. Rhino's Solid->Cap Planar Holes will, with a single mouse click, cap both ends, thus creating an exact copy of the original geometry. The resulting geometry can be readily meshed.

This cylinder part of the mesh looks very good. The facets on the box are a bit scattered, a bit large, and some have an excessive aspect ratio. We will use this geometry to explore the effects of the various Detailed Controls available when you mesh with Rhino.

Reducing the Max Side Length to 1 results in the mesh at left.We generated the above mesh, which contains 230 vertices and 250 facets, by using the following settings:

Max Angle 20
Max Aspect Ratio 1
Min Side Length 0.6
Max Side Length 2

When you adjust the settings, you will discover that there are combination thresholds. For instance, increasing the Max Angle results in no change in the mesh until you reach 45. Under other combinations of settings, increasing the Max Angle from 20 to 21 would result in a change. This makes determination of the best settings a bit of an art.

Given the above mesh, we would like to increase the resolution on the box. Since the box facets have the largest facet edge lengths, the most logical move would be to decrease the Max Side Length. Reducing the Max Side Length to 1 results in the mesh at left.

The top of the cylinder no longer looks circular and is composed of a triangular fan with small, very skinny triangles along the side.This mesh is slightly larger than the previous one, with 242 vertices and 273 polygons. The additional polygons are well used, subdividing the box mesh into equilateral quads and triangles. This mesh is suitable for thermal analysis.

Compared to full-fledged meshing programs, the meshing controls that Rhino has are simple and rudimentary. Although the controls can be adjusted to yield good results, you may have to go through several, if not many, iterations to achieve the desired result. There is often no guide as to which parameters should be adjusted. To illustrate this point, we perturbed the above mesh by increasing the Min Side Length to 0.8 (Max Angle 20, Max Aspect Ratio 1, Min Side Length 0.8, Max Side Length 1). This tiny adjustment resulted in a slightly smaller mesh (206 vertices and 236 polygons) that does not model the cylinder well. The top of the cylinder no longer looks circular and is composed of a triangular fan with small, very skinny triangles along the side.

This example suggests a possible guideline: Keep the Max Side Length slightly larger than double the Min Side Length. Keeping the Max Angle at the default value of 20 seems to yield good results. The Max Aspect Ratio should usually be set equal to 1.


Learn More About Meshing

1998 Archive: Review of Codes to Create Polygon Meshes

There are many codes that will create a polygon mesh. Most of these will not create a mesh suitable for thermal analysis. The following is a review of some of these tools. We do not endorse any specific code; rather, we supply this information as a guide.

Creating Efficient Meshes from Rhino® Surfaces

by James Truax, ThermoAnalytics, Inc. Version 1.0 I. Creating Surfaces From Curve Network – (NetworkSrf ® Surface – From Curve Network) Usage This is the newest surface creating command Rhino has implemented.  It is available in the latest beta version at www.rhino3d.com.  This command uses two series of curves to create a single surface.  These sets of curves run along and perpendicular to the surface.

Meshing With Rhino

> WATCH THE VIDEO Rhino is a NURBS modeler produced by Robert McNeel & Associates. A demo of Rhino can be downloaded from their website, http://rhino3d.com. Although Rhino has meshing capability, McNeel does not promote Rhino as a meshing utility. As a result, there is little information about meshing in the Rhino website, manual, or online help. In this document we will illustrate several techniques for creating a mesh using Rhino.

Schedule an Engineering Review of Your Project

To discuss your engineering requirements in detail, please use the contact form below or call our main office at (906) 482-9560 for a no-charge initial engineering review of your system.

Download Our Brochures Contact an Engineer