pymeshfix.PyTMesh#
- class pymeshfix.PyTMesh#
Cython class to interface with C++ Basic_TMesh object
MeshFix V2.0 - by Marco Attene If MeshFix is used for research purposes, please cite the following paper:
M. Attene. A lightweight approach to repairing digitized polygon meshes. The Visual Computer, 2010. (c) Springer.
Examples
Create an instance of TMesh
>>> from pymeshfix import _meshfix >>> tin = _meshfix.PyTMesh()
Load a file
>>> tin.LoadFile(infile)
Load from arrays
>>> tin.load_array(v, f)
Attempt to join nearby components
>>> tin.join_closest_components()
Fill holes
>>> tin.fill_small_boundaries() >>> print('There are {:d} boundaries'.format(tin.boundaries())
Clean and remove self intersections
>>> tin.clean(max_iters=10, inner_loops=3)
Check mesh for holes again
>>> print('There are {:d} boundaries'.format(tin.boundaries())
Output mesh
>>> tin.save_file(outfile)
return numpy arrays
>>> vclean, fclean = tin.return_arrays()
Methods
Get the number of boundary loops of the triangle mesh
Remove self-intersections and degenerate faces.
Fill small boundaries.
Attempt to join nearby open components.
Load points from numpy vertices and faces arrays.
Loads mesh from file
Remove smallest components
Return vertex and face arrays of the mesh.
Save cleaned mesh to file
Selects all intersecting triangles.
Attributes
Number of points in the mesh