How to use the zencad.display function in zencad

To help you get started, we’ve selected a few zencad examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mirmik / zencad / test / face_prim / fillet_ngon.py View on Github external
#!/usr/bin/env python3
#coding: utf-8

import zencad

m = zencad.ngon(r = 10, n = 6).fillet(4)
zencad.display(m)

zencad.show()
github mirmik / zencad / test / caching / torus.py View on Github external
#!/usr/bin/env python3
#coding: utf-8

import zencad
m = zencad.torus(r1 = 10, r2 = 3)

zencad.display(m)
zencad.show()
github mirmik / zencad / test / HIDE / include / include.py View on Github external
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()
github mirmik / zencad / test / prim2d / square.py View on Github external
#!/usr/bin/env python3
#coding: utf-8

import zencad

m = zencad.square(a = 10, center = True)
zencad.display(m)

zencad.show()
github mirmik / zencad / test / prim1d / segment.py View on Github external
#!/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()
github mirmik / zencad / test / prim2d / rectangle.py View on Github external
#!/usr/bin/env python3
#coding: utf-8

import zencad

m = zencad.rectangle(a = 10, b = 6, center = True)
zencad.display(m)

zencad.show()
github mirmik / zencad / zencad / examples / Integration / skimage-mechanicus / mech.py View on Github external
f = w1.fill() - w0.fill()

    mechanicus = gons + f
    mechanicus = mechanicus.extrude(20).up(20)

    base = zencad.circle(r=500).extrude(20)

    return mechanicus, base, zcountours


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()
github mirmik / zencad / zencad / examples / Integration / skimage-mechanicus / mech.py View on Github external
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()