Skip to content

out-of-cheese-error/pyln

Repository files navigation

pyln

Dependencies Status Code style: black Security: bandit Pre-commit Semantic Versions License

a (WIP) Python 3D line art engine

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)
)

Rotate and render as a GIF:

csg

Examples

Images rendered from the scripts in the examples folder:

cube

cubes

function

outline

skyscrapers

skyscrapers_striped

suzanne

voxelize

sliced

Credits

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.

About

3D line art engine (Python port of fogleman/ln)

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published