Files
pylib/examples/geometry_hexahedra.py

31 lines
715 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Example geometry of hexahedra.
:Date: 2019-12-24
.. module:: geometry_hexahedra
:platform: *nix, Windows
:synopsis: Example geometry of hexahedra.
.. moduleauthor:: Daniel Weschke <daniel.weschke@directbox.de>
"""
from pylib.geometry import World, Hexahedron
from pylib.geometry_plot_pylab import cad_wireframe
def geometry():
w = World()
for i in range(3):
for j in range(3):
for k in range(3):
w.add(Hexahedron().scale(0.8).translate(-2+2*i, -2+2*j, -2+2*k))
return w
if __name__ == "__main__":
w = geometry()
#print(w.bounding_box())
#print(*w)
#print(w.wireframes_xyz())
cad_wireframe(w)