-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,884 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,75 @@ | ||
# mesh-fairing | ||
# **Mesh Fairing** | ||
|
||
 | ||
|
||
This Blender addon provides an alternative smoothing operation. Conventional smoothing has a tendency to cause pinching, bumps, and other undesirable artifacts; however, mesh fairing results in a smooth-as-possible mesh patch. | ||
|
||
# **Installation** | ||
|
||
 | ||
|
||
1. Download the zip archive. | ||
|
||
 | ||
|
||
2. Install the downloaded file. | ||
|
||
3. Enable the addon. | ||
|
||
4. Install SciPy Python module. | ||
|
||
Blender ships with NumPy, but it is *highly* recommended that users install SciPy. Mesh fairing with the latter is much faster and less prone to crashing. If you encounter any issues during the automated installation process, consider attempting manual installation: https://blender.stackexchange.com/questions/56011/how-to-use-pip-with-blenders-bundled-python/56013#56013 | ||
|
||
# **Location** | ||
|
||
Mesh fairing is available in both *Sculpt* and *Edit* modes of the *3D Viewport* panel. | ||
|
||
 | ||
|
||
# **Tool Options** | ||
|
||
Mesh fairing displaces affected vertices to produce a smooth-as-possible mesh patch with respect to a specified continuity constraint. | ||
|
||
* **Continuity:** Determines how inner vertices blend with surrounding faces to produce a smooth-as-possible mesh patch | ||
|
||
* **Position:** Change in vertex position is minimized. | ||
|
||
* **Tangency:** Change in vertex tangency is minimized. | ||
|
||
* **Curvature:** Change in vertex curvature is minimized. | ||
|
||
Mode-specific options also exist to affect the outcome of mesh fairing. | ||
|
||
### **Sculpt Mode** ### | ||
|
||
* **Invert Mask:** If this option is enabled, mesh fairing is applied to masked vertices; otherwise, only unmasked vertices are affected. | ||
|
||
### **Edit Mode** ### | ||
|
||
* **Triangulate:** Triangulates affected region to produce higher quality results | ||
|
||
# **Usage Examples** | ||
|
||
Here are a few examples that demonstrate the usefulness of mesh fairing: | ||
|
||
1. Blend between sections of geometry. | ||
|
||
 | ||
|
||
2. Remove surface features. | ||
|
||
 | ||
|
||
3. Create interesting shape keys. | ||
|
||
 | ||
|
||
# **Credits** | ||
|
||
* **Addon Author:** Brett Fedack | ||
|
||
* **David Model:** 3D scan of Michelangelo's David provided by [Scan the World](https://www.myminifactory.com/object/3d-print-head-of-michelangelo-s-david-52645) initiative | ||
|
||
* **Monkey Model:** Suzanne is Blender's mascot who we've all come to know and love. | ||
|
||
* **Other:** Special thanks to Jane Tournois whose mesh fairing implementation for [CGAL](https://github.com/CGAL/cgal/blob/master/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/fair_impl.h) proved highly instructive in designing this addon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# ##### BEGIN GPL LICENSE BLOCK ##### | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
# ##### END GPL LICENSE BLOCK ##### | ||
|
||
bl_info = { | ||
'name' : 'Mesh Fairing', | ||
'description' : 'Continuity based smoothing tool', | ||
'author' : 'Brett Fedack', | ||
'location': ( | ||
'Sculpt mode: Sculpt menu, Edit mode: Vertex menu' | ||
), | ||
'version' : (1, 0), | ||
'blender' : (2, 80, 0), | ||
'category' : 'Mesh' | ||
} | ||
|
||
import logging | ||
|
||
if 'bpy' not in locals(): | ||
import bpy | ||
from . import operators | ||
from . import preferences | ||
from . import ui | ||
else: | ||
import imp | ||
imp.reload(operators) | ||
imp.reload(preferences) | ||
imp.reload(ui) | ||
|
||
classes = (operators.MESH_OT_fair_vertices, | ||
operators.MESH_OT_fair_vertices_internal, | ||
operators.SCULPT_OT_fair_vertices, | ||
operators.SCULPT_OT_fair_vertices_internal, | ||
operators.SCRIPT_OT_install_module, | ||
preferences.MeshFairingPreferences) | ||
|
||
|
||
def register(): | ||
|
||
# Configure the logging service. | ||
logging_format = ( | ||
'[%(levelname)s] ' + | ||
'(%(asctime)s) ' + | ||
'{0}.%(module)s.%(funcName)s():L%(lineno)s'.format(__package__) + | ||
' - %(message)s' | ||
) | ||
logging.basicConfig( | ||
level = logging.DEBUG, | ||
format = logging_format, | ||
datefmt = '%Y/%m/%d %H:%M:%S' | ||
) | ||
|
||
# Initialize the linear algebra solver. | ||
linalg.init() | ||
|
||
# Register this Blender addon. | ||
for cls in classes: | ||
bpy.utils.register_class(cls) | ||
|
||
# Add mesh fairing operators to existing menus. | ||
bpy.types.VIEW3D_MT_edit_mesh_vertices.append(ui.draw_vertex_menu) | ||
bpy.types.VIEW3D_MT_sculpt.append(ui.draw_sculpt_menu) | ||
|
||
|
||
def unregister(): | ||
|
||
# Remove mesh fairing operators from existing menus. | ||
bpy.types.VIEW3D_MT_edit_mesh_vertices.remove(ui.draw_vertex_menu) | ||
bpy.types.VIEW3D_MT_sculpt.remove(ui.draw_sculpt_menu) | ||
|
||
# Unregister this Blender addon. | ||
for cls in reversed(classes): | ||
bpy.utils.unregister_class(cls) |
Oops, something went wrong.