Skip to content

EclipseShadow55/Smoothing-and-Subdivision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

Subdivision and Smoothing

This library contains a class SubdivisionSmoothing that provides methods for performing subdivision and smoothing operations on 3D meshes. The class includes methods for Simple Subdivsion, Laplacian Smoothing, and a custom Subdivision Method that takes into account vertex position and edge sharpness. It also includes some helpful methods for making a subdivision or smoothing method yourself.

Installation

To use this library, you need to have Python installed.

  1. Create and navigate to your project directory.
  2. Create a virtual environment (optional but recommended):
    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the package using pip: For normal installation:
    pip install subdivision-smoothing
    For development installation:
    pip install subdivision-smoothing[dev]
  4. For development, clone the subdivision_smoothing\debug dir from the repository. You can use the debug.py script to visualize the intermediate steps of the algorithms.

Usage

Here's a basic example of how to use the SubdivisionSmoothing class:

from subdivision_smoothing import SubdivisionSmoothing
import trimesh

# Load a mesh
mesh = trimesh.load_mesh('path_to_your_mesh.obj')
# Use a sudivision method on the mesh
subdivided_mesh = SubdivisionSmoothing.simple_subdivide(mesh, iterations=2)
# Save or visualize the subdivided mesh
subdivided_mesh.export('subdivided_mesh.obj')

Issues

The following are known issues with the most recent version of the package

  • edge_erosion_subdivision is only stable for 1 iteration for some meshes. The cause is how the meshing library handles degenerate faces, so I am working a solution that doesn't create any degenerate faces
  • simple_smooth raises an error when processing certain meshes. The cause is unknown.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages