PyACVD


NamePyACVD JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/akaszynski/PyACVD
SummaryUniformly remeshes vtk surface meshes
upload_time
maintainerNone
docs_urlNone
authorAlex Kaszynski
requires_pythonNone
licenseCECILL-B
keywords vtk uniform meshing remeshing acvd
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            PyACVD
======

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 `ACVD <https://github.com/valette/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.


Installation
------------

Installation is straightforward using pip::

    $ pip install PyACVD
    
You can also visit `GitHub <https://github.com/akaszynski/PyACVD>`_ to download the latest source and install it running the following from the source directory::

    $ pip install .

You will need a working copy of VTK.  This can be obtained by either building for the source or installing it using a Python distrubution like `Anaconda <https://www.continuum.io/downloads>`_.  The other dependencies are ``numpy`` and ``cython``.

Tests
-----

You can test if your installation works by running the following tests included in the package.

.. code:: python

   from PyACVD import Tests

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

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


Example
-------

This example loads a surface mesh, generates 10000 clusters, and creates a uniform mesh.

.. code:: python

    from PyACVD import Clustering
    
    # Load mesh from file.
    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


Python Algorthim Restrictions
-----------------------------

The `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.


Known bugs
----------

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

Raw data

            {
    "_id": null,
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "cheesecake_code_kwalitee_id": null,
    "keywords": "vtk uniform meshing remeshing,acvd",
    "author": "Alex Kaszynski",
    "home_page": "https://github.com/akaszynski/PyACVD",
    "github_user": "akaszynski",
    "download_url": "UNKNOWN",
    "platform": "UNKNOWN",
    "version": "0.1.1",
    "cheesecake_documentation_id": null,
    "description": "PyACVD\r\n======\r\n\r\nThis module takes a vtk surface mesh (vtkPolyData) surface and returns a\r\nuniformly meshed surface also as a vtkPolyData.  It is based on research by:\r\nS. Valette, and J. M. Chassery in `ACVD <https://github.com/valette/ACVD>`_.\r\n\r\nMuch of this code was translated from the C++ source code available on the\r\nabove website.  Cython was used as much of the remeshing process is of an\r\niterative nature.  This is currently a work in progress and any bugs within\r\nthis module do not reflect the true nature of ACVD developed by S. Valette.\r\n\r\n\r\nInstallation\r\n------------\r\n\r\nInstallation is straightforward using pip::\r\n\r\n    $ pip install PyACVD\r\n    \r\nYou can also visit `GitHub <https://github.com/akaszynski/PyACVD>`_ to download the latest source and install it running the following from the source directory::\r\n\r\n    $ pip install .\r\n\r\nYou will need a working copy of VTK.  This can be obtained by either building for the source or installing it using a Python distrubution like `Anaconda <https://www.continuum.io/downloads>`_.  The other dependencies are ``numpy`` and ``cython``.\r\n\r\nTests\r\n-----\r\n\r\nYou can test if your installation works by running the following tests included in the package.\r\n\r\n.. code:: python\r\n\r\n   from PyACVD import Tests\r\n\r\n   # Run Stanford bunny remeshing example\r\n   Tests.Remesh.Bunny()\r\n\r\n   # Run non-uniform sphere remeshing example\r\n   Tests.Remesh.Sphere()\r\n\r\n\r\nExample\r\n-------\r\n\r\nThis example loads a surface mesh, generates 10000 clusters, and creates a uniform mesh.\r\n\r\n.. code:: python\r\n\r\n    from PyACVD import Clustering\r\n    \r\n    # Load mesh from file.\r\n    filename = 'file.stl'\r\n    stlReader = vtk.vtkSTLReader() \r\n    stlReader.SetFileName(filename) \r\n    stlReader.Update()\r\n    mesh = stlReader.GetOutput()\r\n    \r\n    # Create clustering object\r\n    cobj = Clustering.Cluster(target)\r\n\r\n    # Generate clusters\r\n    cobj.GenClusters(10000)\r\n    \r\n    # Generate uniform mesh\r\n    cobj.GenMesh()\r\n\r\n    # Get mesh\r\n    remesh = cobj.ReturnNewMesh()\r\n    \r\n    \r\n    # The clustered original mesh and new mesh can be viewed with:\r\n    cobj.PlotClusters()   # must run cobj.GenClusters first\r\n    cobj.PlotRemesh()     # must run cobj.GenMesh first\r\n\r\n\r\nPython Algorthim Restrictions\r\n-----------------------------\r\n\r\nThe `vtkPolyData` mesh should not contain duplicate points (i.e. adjcent faces\r\nshould share identical points).  If not already done so, clean the mesh\r\nusing `vtk.vtkCleanPolyData`\r\n    \r\nThe number of resulting points is limited by the available memory of the\r\nhost computer.  If approaching the upper limit of your available memory,\r\nreduce the \"subratio\" option when generating the mesh.  As it will be\r\npointed out below, the coarser the mesh, the less accurate the solution.\r\n    \r\nThe input mesh should be composed of one surface.  Unexpected behavior\r\nmay result from a multiple input meshes, though some testing has shown\r\nthat it is stable.\r\n    \r\nHoles in the input mesh may not be filled by the module and will result in\r\na non-manifold output.\r\n\r\n\r\nKnown bugs\r\n----------\r\n\r\n- Cluster sizes are highly dependent on initial cluster placement.\r\n- Clusters one face (or point) large will generate highly non-uniform meshes.",
    "lcname": "pyacvd",
    "name": "PyACVD",
    "github": true,
    "bugtrack_url": null,
    "license": "CECILL-B",
    "travis_ci": false,
    "github_project": "PyACVD",
    "summary": "Uniformly remeshes vtk surface meshes",
    "split_keywords": [
        "vtk uniform meshing remeshing",
        "acvd"
    ],
    "author_email": "akascap@gmail.com",
    "urls": [],
    "cheesecake_installability_id": null,
    "coveralls": true
}
        
Elapsed time: 0.07965s