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.
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()
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:
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):
A Moebius strip:
A catenoid:
A trefoil knot:
An apple: