Giter VIP home page Giter VIP logo

halfedge_mesh's Introduction

Halfedge Mesh

This is a small python library that will read OFF mesh format files into a halfedge data structure. A halfedge data structure has two edges for a given edge in a mesh.

Usage

Here I run through some basic manipulations of a mesh.

import halfedge_mesh

# .off are supported
mesh = halfedge_mesh.HalfedgeMesh("my_meshes.off")

# Returns a list of Vertex type (in order of file)--similarly for halfedges,
# and facets
mesh.vertices

# The number of facets in the mesh
len(mesh.facets)

# Get the 10th halfedge
mesh.halfedges[10]

# Get the halfedge that starts at vertex 25 and ends at vertex 50
# will not work with a random mesh
# mesh.get_halfedge(25, 50)

# Iterate over the vertices of the mesh
for i in mesh.vertices:
    print(i.get_vertex())

Please refer to the documentation for more functionality.

Test

Option 1

Simply run

python setup.py test

If you would like to see the coverage of the unit tests run

python setup.py test --addopts --cov=halfedge_mesh

Note: this will not work with python 2.6 due to argparse dependency.

Option 2

In order to run the tests in this project you must have py.test. To install py.test you can either

pip install -U pytest # or
easy_install -U pytest

then you can simply run py.test in the home project directory. Make sure halfedge_mesh is importable, for example by typing once:

pip install -e .   # install package using setup.py in editable mode

Help

Email me, Carlos Rojas at [email protected]

Contribution Guidelines

Please follow the PEP 8 style guide for python and the writing good commit guideline

Here are some helpful articles git commits, and clean git history.

License

Halfedge Mesh is released under the MIT License.

halfedge_mesh's People

Contributors

alextsui05 avatar jmtrivial avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.