Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeoLab

GeoLab is a pure Python library for geometric computing based on NumPy arrays and SciPy sparse matrices. GeoLab provides a halfedge data structure for manifold and orientable meshes with arbitrary polygonal faces. Moreover, GeoLab provides plotting functions and a GUI environment based on MayaVi and TraitsUI for the development of custom 3D interactive applications.

GeoLab data structures are specifically designed for vectorized computing with NumPy and SciPy and for fast visualization with MayaVi.

GeoLab code is open source.

Installation

GeoLab requires NumPy, SciPy, Matplotlib, and MayaVi to run.

Windows + Anaconda

An environment with all dependencies can be created as:

 conda create -n <env_name> -c anaconda mayavi scipy
 conda activate <env_name>
 pip install geolab

MacOS

TODO

License

MIT

Getting started

In Python, import GeoLab as

 import geolab as geo

Open a mesh

To open an obj file, type

 v, f = geo.read_mesh('file_name.obj')

Here v is an array containing the coordinate of vertices and f the list of faces. The halfedges can be built as

 h = geo.halfedges(f)

Navigate halfedges

To get, for instance, the origin of halfedges, type

 origin = geo.navigate_halfedges(h, 'o')

The origin of the next halfedge can be get as

 next_origin = geo.navigate_halfedges(h, 'n-o')

while the face of the previous of the twin of the next halfedge as

 next_twin_previous_face = geo.navigate_halfedges(h, 'n-t-p-f')

and so on...

Plot a mesh

A plotter can be initialized as

 plotter = geo.plotter()

To add the faces of a mesh to the plot type

 plotter.plot_faces(v, f)

and for edges type

 plotter.plot_edges(v, h)

Finally, to show the plot type

 plotter.show()

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages