Feature request - Align/register meshes, local smoothing



I am using a lot of data from 3d scanners and I think that there are two features that would make this process a lot easier:

  1. A mesh alignment tool. I often have to align two stl meshes of the same object taken from different orientations to create a more complete model of the object. Currently I have to go back and forth between Rhino and meshlab to achieve an accurate match of the two (or more) meshes.

It would be great if something like this could be integrated into Rhino. Just moving one mesh to match another would be a great first step however as an extension there could be an option to merge the two meshes into a single mesh, possibly smoothing the junction between the two.

  1. A local smoothing function. The smooth function works very well for meshes however it works on the entire mesh. Sometimes I have a local distortion that needs to be smoothed out and I do not want to lose detail in other areas of the mesh. I see this tool being something like a paintbrush that smooths over the selected area

I think that with the explosion of the availability of 3d scanners these features would be valuable additions to Rhino.


(Brian James) #2

Thanks for the feedback on working with meshes. Can you provide a sample file to illustrate the alignment and registering request? I would suggest the Align command used twice for horizontal and then vertical alignment at a guess.

For local smoothing, try turning on control points for the mesh then use SelBrush to select only portions of the mesh in a paint brush style workflow. Then use Smooth as you normally would with the selection of points still active. The command CullControlPolygon is also helpful here to limit the selection of verts behind what you’re actually looking at. This command is a toggle in case you need the opposite behavior.


Thanks for the response. The selection of control points seems to work well although it is a bit labor intensive. An ideal solution for me would be to have the smooth and SelBrushPoints to work together dynamically, smoothing the mesh as the points are selected.

As for the alignment, more often than not the meshes also have a rotational component as well as a displacement that needs correcting. Doing this manually can be difficult as you have to create a best fit by hand. The MeshLab tool minimises the difference between two meshes to create a calculated best fit.

I will work on getting some meshes to you to demonstrate this.


As a quick example:

I have a scan of a face from the front however I am missing some detail around the nose so I took another scan from below to capture this area. Cropping out all but the desired area and aligning the two meshes using meshlab gives a quick and accurate result.

If at some point in the design I wish to add another region, say the side of the head, I have to export the mesh, open it in MeshLab, Insert and align the new area then export it again to then open it up in Rhino…

Whilst it can be manually aligned it is very difficult to get it just right. Something that meshlab can do automatically.

aligned meshes.3dm (2.9 MB)

(Brian James) #5

Thanks for the file. Currently Rhino doesn’t have an auto-alignment command to position your secondary scan as you know. I’m wondering if your other application is connected to the scanner or requires manual marker placement prior to alignment. I believe some other information aside from the mesh itself would be required in a case like this for alignment. I can get very close easily using the Gumball but there are still overlapping polys that I bet aren’t wanted.

I’m happy to file a feature request but will need to know what the reference for alignment is and how to input that into Rhino first. For instance, is the object origin and orientation for the smaller scan suppose to be the same as that of the larger. If so, was there a file format change before importing the second scan into Rhino?


In Meshlab the alignment process requires two steps. Firstly you roughly align the two meshes by picking 4 or more (the more the better) key points on both meshes. In this case I picked the tip of the nose, both side creases (where the nostril meets the face) and the center of the upper lip. Meshlab then aligns the two meshes so that that those key points roughly match. this gives a good approximation.

The second step is automatic and it seems like meshlab computes the best fit between the two meshes, minimising the distance between the two.

Further processing merges the meshes together, removing the overlapping polys etc.

Here is a video demonstrating this process: https://www.youtube.com/watch?v=4g9Hap4rX0k

In my scanner the origin is fixed to the scanner and not the object. Importing both of the scans (they come out as .stl meshes) gives the initial alignment as shown in the first two layers of the file above (Face & Nose). I assume that a rough alignment is required before the fine alignment is calculated. It could be workable to do this rough alignment using the gumball but I think the key point method meshlab uses may be a little more user friendly.

(Brian James) #7

Thanks for explaining more. I filed the feature request as http://mcneel.myjetbrains.com/youtrack/issue/RH-28761

The workflow has many layers to it and is a very specific task when working with meshes. It’s an opportunity for plugin developers for sure.


Any news about this topic? I’d really like to have something like a “best fit” for two similar mesh.
I tried with MeshLab and the operation looks working but when I save the STL and get back to rhino I still have the original version.


Rhino Open Projects has a mesh registration script that does an ok job. For more control and a more accurate result however I now use CloudCompare.

CC is open source though so I am sure someone with the appropriate skills could port the mesh registration features (and all the great options) to Rhino.


Thank you for pointing me at CouldCompare, it worked well. Only negative thig it’s losing mapping coordinates on OBJ.