Simplify and clean up mesh geometry by automatically merging adjacent coplanar faces into single n-gons. This custom Rhino script is designed to optimise mesh quality and readability, particularly useful when working with triangulated or imported geometries.
The Merge Coplanar Mesh Faces command allows you to:
- Select multiple mesh objects in the viewport.
- Combine them into a single mesh and fully weld them.
- Automatically detect and merge adjacent coplanar faces into clean n-gons based on a user-defined angle tolerance.
This process is especially helpful for reducing face complexity after import, retopologising geometry, or preparing meshes for clean presentation or fabrication.
Note: Requires Rhino 7 or later (due to
AddPlanarNgons()support).
Rhino’s native tools do not provide an easy way to merge coplanar faces into n-gons. Triangulated or fragmented meshes can be difficult to work with, both visually and structurally. This script:
- Reduces mesh face count and improves legibility.
- Simplifies post-processing workflows.
- Helps with 3D printing and export to external software (e.g., Unreal, Blender, or Revit).
Method 1:
- Type
_RunPythonScriptin the command line. - Browse to the saved location of the script file and run it.
-
Right-click an empty area of a toolbar and select New Button.
-
In the Button Editor:
-
Left Button Command:
! _-RunPythonScript "FullPathToYourScript\merge_coplanar_mesh_faces.py"Replace
FullPathToYourScriptwith the actual script file path. -
Tooltip: For example,
Merge coplanar mesh faces into n-gons. -
Icon (Optional): Assign a custom icon if desired.
-
-
Open Tools > Options, then go to the Aliases tab.
-
Create a New Alias:
-
Alias: e.g.,
meshmerge -
Command Macro:
_-RunPythonScript "FullPathToYourScript\merge_coplanar_mesh_faces.py"
-
-
Select one or more mesh objects when prompted.
-
Enter an angle tolerance in degrees. Adjacent faces within this angle will be considered coplanar.
-
The script will:
- Combine all selected meshes.
- Fully weld them at 180°.
- Merge coplanar faces using
AddPlanarNgons. - Replace the original meshes with a new optimised version.
- Cleaning up triangulated meshes from STL or OBJ imports.
- Preparing meshes for CNC or laser cutting.
- Reducing geometry complexity for viewport performance or mesh UV mapping.