Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#!/usr/bin/env python3
#coding: utf-8
import zencad
zencad.display(zencad.point(2,4,5))
zencad.display(zencad.point(20,40,50))
zencad.show()
#!/usr/bin/env python3
import zencad
model = zencad.box(30,20,10)
if __name__ == "__main__":
zencad.display(model)
zencad.show()
(5,2),
(6,3),
])
tang = zencad.vectors([
(1,0),
(0,0),
(1,0),
(1,1),
(1,1),
(1,1),
])
zencad.display(zencad.interpolate(pnts = pnts))
for p in pnts: zencad.display(p)
zencad.show()
import zencad
model = zencad.execfile("box.py")["model"]
#scn = zencad.scene()
#scn.add(model)
#
#cam = zencad.camera(0,0,0,0,0,0)
#
#view = zencad.view(scn, cam)
#view.render()
#
#view.screenshot("path.png")
zencad.display(model)
zencad.show()
#!/usr/bin/env python3
#coding: utf-8
import zencad
import zencad.future_cache
import evalcache
evalcache.enable()
m = zencad.future_cache.box(20, 80, 10)
zencad.display(m.eval())
zencad.show()
#!/usr/bin/env python3
#coding: utf-8
import zencad
m = zencad.rectangle(a = 10, b = 6, center = True)
zencad.display(m)
zencad.show()
#!/usr/bin/env python3
#coding: utf-8
import zencad
m = zencad.sphere(10)
zencad.display(m)
zencad.show()
#!/usr/bin/env python3
#coding: utf-8
import zencad
m = zencad.torus(r1 = 10, r2 = 3)
zencad.display(m)
zencad.show()
#!/usr/bin/env python3
#coding: utf-8
import sys
sys.path.insert(0, "../..")
import zencad
m = zencad.segment((0,0,0), (10,20,30))
zencad.display(m)
zencad.show()
if __name__ == "__main__":
mechanicus, base, zcountours = build()
for z in zcountours:
if z.is_closed():
zencad.display(
z.left(760 / 2).back(768 / 2).forw(760 + 200), zencad.color(0, 1, 0)
)
else:
zencad.display(
z.left(760 / 2).back(768 / 2).forw(760 + 200), zencad.color(1, 0, 0)
)
zencad.display(mechanicus, zencad.color(1, 1, 1))
zencad.display(base, zencad.color(0.2, 0.2, 0.2))
zencad.show()