GithubHelp home page GithubHelp logo

pranav-jain / diffgeoops Goto Github PK

View Code? Open in Web Editor NEW
17.0 1.0 3.0 11.15 MB

This repository contains the python implementation of the paper titled "Discrete Differential-Geometry Operators for Triangulated 2-Manifolds" by Meyer et. al. VisMath 2002 http://multires.caltech.edu/pubs/diffGeoOps.pdf

License: MIT License

Python 100.00%
mayavi manifolds mesh mesh-networks 3d triangulated-surfaces differential-geometry curvature gaussian principal-curvatures

diffgeoops's Introduction

DiffGeoOps

The project aims to find the principal, mean and gaussian curvatures on triangular meshes using the famous cotangent formula. The implementation is motivated from the following paper.

http://multires.caltech.edu/pubs/diffGeoOps.pdf

Requirements

The code uses the following libraries

  • numpy
  • csv
  • mayavi (for plotting)

Make sure to install them before running the code.

Caution: Currently, the code supports meshes in .txt and .off format only.

Usage

The file curvature.py finds all the curvatures (principal, mean and gaussian) given a triangular mesh and stores the curvature values at each vertex of the triangular mesh in a csv file named output.csv.

If the mesh is in .off format, run

$ python curvature.py <path to off file>

If the mesh is in .txt format, run

$ python curvature.py <path to vertices.txt file> <path to triangles.txt file>

Caution: The first argument is the file containing vertices and the second argument is the file contatining triangles.

Plotting

The file plot.py shows the plots of the meshes with color scheme according to the value of curvatures. The file plot.py reads from the output.csv created by curvature.py. Make sure that the csv file is the same directory as plot.py.

If the mesh is in .off format, run

$ python plot.py <path to off file>

If the mesh is in .txt format, run

$ python plot.py <path to vertices.txt file> <path to triangles.txt file>

Caution: The first argument is the file containing vertices and the second argument is the file contatining triangles.

Outputs

The Gaussian Curvature plots of some of the meshes is shown below. Gaussian Curvature on Sphere Gaussian Curvature on Torus

License

Copyright (c) 2019 Pranav Jain

For license information, see LICENSE or http://mit-license.org


For bugs in the code, please write to: pranav16255 [at] iiitd [dot] ac [dot] in

diffgeoops's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.