Skip to content

Provides some classes and methods for quick mesh generation and writing to .obj files. Allows for wireframe rendering. Written in plain python

License

Notifications You must be signed in to change notification settings

fwidmaier/mesh_handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mesh_handler

Provides some classes and methods for quick mesh generation and writing to .obj files. Allows mesh generation from a given parametrisation of a surface/manifold.

Since the second version it also supports the rendering of (simple) wireframes.

drawing drawing drawing

Wireframe rendering

One may launch the interactive viewer through

python3 wireframe.py out/torus.obj

or by

from mesh.obj import OBJFile
from viewer import Viewer

app = Viewer()
torus = OBJFile.read("out/torus.obj", axis="xyz")
app.scene.addObject(torus)
app.show()

Example code

from mesh.obj import OBJFile
from render.scene import *

scene = Scene(500, 500)  # specifying the width and height of the scene (in px)
apple = OBJFile.read("out/apple.obj", axis="xyz")
scene.addObject(apple)

scene.render()
scene.im.show()

The code above will generate the following image:

Mesh generation

Some rendered examples of the generated .obj files (some of them can be found in out):

A Klein bottle - immersed in R^3 (rendered with Blender): Klein_ A Moebius strip: moeb A catenoid: catenoid A trefoil knot: kleeblatschleife2 An apple: apple

About

Provides some classes and methods for quick mesh generation and writing to .obj files. Allows for wireframe rendering. Written in plain python

Topics

Resources

License

Stars

Watchers

Forks

Languages