This is a complete Python port of fogleman/ln (with some help from ln.py) using NumPy, Numba, and Pillow.
Constructive Solid Geometry (CSG) is quite intuitive:
import pyln
sphere = pyln.Sphere()
cube = pyln.Cube([-0.8, -0.8, -0.8], [0.8, 0.8, 0.8])
cylinder = pyln.Cylinder(0.4, -2.0, 2.0)
shape = (
(sphere & cube)
- cylinder
- cylinder.rotate_x(90)
- cylinder.rotate_y(90)
)
Images rendered from the scripts in the examples folder:
Original Go implementation: https://github.com/fogleman/ln
Another Python implementation that's partially complete: https://github.com/ksons/ln.py
This project was generated with python-package-template
.