This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Uniformly remeshes vtk surface meshes

Project Description
ACVD Clustering module

This module takes a vtk surface mesh (vtkPolyData) surface and returns a
uniformly meshed surface also as a vtkPolyData. It is based on research by:
S. Valette, and J. M. Chassery in
Approximated Centroidal Voronoi Diagrams for Uniform Polygonal Mesh Coarsening
http://www.creatis.insa-lyon.fr/site/en/acvd

Much of this code was translated from the C++ source code available on the
above website. Cython was used as much of the remeshing process is of an
iterative nature. This is currently a work in progress and any bugs within
this module do not reflect the true nature of ACVD developed by S. Valette.

This code has been tested with Ubuntu 14.10 and Windows 7 64-bit using
Python 2.7. It should be compatable with newer versions of Python, but this
has not been tested (yet).


Installation:
$ pip install PyACVD
# Note: if "Clustering_Cython" cannot be imported after this install,
install for a single user (below)

- or for a single user -
$ pip install PyACVD --user

- or download the source code and execute the following from the download folder: -
$ python setup.py install


Install Tests:
from PyACVD import Tests

# Run Stanford bunny remeshing example/test
Tests.Remesh.Bunny()

# Run non-uniform sphere remeshing example/test
Tests.Remesh.Sphere()


Example Code:
from PyACVD import Clustering

# Load mesh from file. One method would be to load a *.stl file using:

filename = 'file.stl'
stlReader = vtk.vtkSTLReader()
stlReader.SetFileName(filename)
stlReader.Update()
mesh = stlReader.GetOutput()

# Create clustering object
cobj = Clustering.Cluster(target)

# Generate clusters
cobj.GenClusters(10000)

# Generate uniform mesh
cobj.GenMesh()

# Get mesh
remesh = cobj.ReturnNewMesh()


# The clustered original mesh and new mesh can be viewed with:
cobj.PlotClusters() # must run cobj.GenClusters first
cobj.PlotRemesh() # must run cobj.GenMesh first


Restrictions:
vtkPolyData mesh should not contain duplicate points (i.e. adjcent faces
should share identical points). If not already done so, clean the mesh
using "vtk.vtkCleanPolyData()"

The number of resulting points is limited by the available memory of the
host computer. If approaching the upper limit of your available memory,
reduce the "subratio" option when generating the mesh. As it will be
pointed out below, the coarser the mesh, the less accurate the solution.

The input mesh should be composed of one surface. Unexpected behavior
may result from a multiple input meshes, though some testing has shown
that it is stable.

Holes in the input mesh may not be filled by the module and will result in
a non-manifold output.


Options:
See individual modules for available options


Known bugs:
- Cluster sizes are highly dependent on initial cluster placement.
- Clusters one face (or point) large will generate highly non-uniform
meshes.

Please submit any bugs or issues with the code on the github repository below.
Release History

Release History

This version
History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
PyACVD-0.1.tar.gz (8.2 MB) Copy SHA256 Checksum SHA256 Source Sep 19, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting