How to use the zencad.color 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 / expers / treedy.py View on Github external
L = 100
rot = kinematic.rotator(name="RBODY",ax=(0,0,1))
body = zencad.assemble.unit(name="N", shape=sphere(20))
a = zencad.assemble.unit(name="A")
b = zencad.assemble.unit(name="B")
aa = zencad.assemble.unit(name="AA")
bb = zencad.assemble.unit(name="BB")
aaa = zencad.assemble.unit(name="AAA")
bbb = zencad.assemble.unit(name="BBB")
aaaa = zencad.assemble.unit(name="AAAA")
bbbb = zencad.assemble.unit(name="BBBB")
aaaaa = zencad.assemble.unit(name="AAAAA")
bbbbb = zencad.assemble.unit(name="BBBBB")

a.add_shape((cylinder(h=L, r=5)+sphere(10).up(L)), color=zencad.color.blue)
b.add_shape((cylinder(h=L, r=5)+sphere(10).up(L)))
aa.add_shape((cylinder(h=L, r=5)+sphere(10).up(L)), color=zencad.color.blue)
bb.add_shape((cylinder(h=L, r=5)+sphere(10).up(L)))
aaa.add_shape((cylinder(h=L, r=5)+sphere(10).up(L)), color=zencad.color.blue)
bbb.add_shape((cylinder(h=L, r=5)+sphere(10).up(L)))
aaaa.add_shape((cylinder(h=L, r=5)+sphere(10).up(L)), color=zencad.color.blue)
bbbb.add_shape((cylinder(h=L, r=5)+sphere(10).up(L)))
aaaaa.add_shape((cylinder(h=L, r=5)+sphere(10).up(L)), color=zencad.color.blue)
bbbbb.add_shape((cylinder(h=L, r=5)+sphere(10).up(L)))
inertia.attach_inertia(rot.output, mass=0.1, Ix=0.1, Iy=0.1, Iz=0.1, radius=pyservoce.vector3(0,0,L))
inertia.attach_inertia(body, mass=0.1, Ix=0.1, Iy=0.1, Iz=0.1, radius=pyservoce.vector3(0,0,L))
inertia.attach_inertia(a, mass=0.1, Ix=0.1, Iy=0.1, Iz=0.1, radius=pyservoce.vector3(0,0,L))
inertia.attach_inertia(b, mass=0.1, Ix=0.1, Iy=0.1, Iz=0.1, radius=pyservoce.vector3(0,0,L))
inertia.attach_inertia(aa, mass=0.1, Ix=0.1, Iy=0.1, Iz=0.1, radius=pyservoce.vector3(0,0,L))
inertia.attach_inertia(bb, mass=0.1, Ix=0.1, Iy=0.1, Iz=0.1, radius=pyservoce.vector3(0,0,L))
inertia.attach_inertia(aaa, mass=0.1, Ix=0.1, Iy=0.1, Iz=0.1, radius=pyservoce.vector3(0,0,L))
github mirmik / zencad / zencad / __init__.py View on Github external
return pyservoce.triangulation(shp, defl)


zencad.color = pyservoce.color

zencad.color.white =     zencad.color(1,1,1)
zencad.color.black =     zencad.color(0,0,0)
zencad.color.red =       zencad.color(1,0,0)
zencad.color.green =     zencad.color(0,1,0)
zencad.color.blue =      zencad.color(0,0,1)
zencad.color.yellow =    zencad.color(1,1,0)
zencad.color.magenta =   zencad.color(1,0,1)
zencad.color.cian =      zencad.color(0,1,1)
zencad.color.mech =      zencad.color(0.6, 0.6, 0.8)
zencad.color.transmech = zencad.color(0.6, 0.6, 0.8, 0.8)
zencad.color.orange =    zencad.color(1, 0xa5/255, 0)

default_color = zencad.settings.Settings.get_default_color()


pyservoce.Shape.move = pyservoce.Shape.translate
pyservoce.Shape.moveX = pyservoce.Shape.right
pyservoce.Shape.moveY = pyservoce.Shape.forw
pyservoce.Shape.moveZ = pyservoce.Shape.up

zencad.move = zencad.translate
zencad.moveX = zencad.right
zencad.moveY = zencad.forw
zencad.moveZ = zencad.up

def to_vector(arg):
    return zencad.util.vector3(arg)
github mirmik / zencad / zencad / __init__.py View on Github external
def triangulate(shp, defl):
    return pyservoce.triangulation(shp, defl)


zencad.color = pyservoce.color

zencad.color.white =     zencad.color(1,1,1)
zencad.color.black =     zencad.color(0,0,0)
zencad.color.red =       zencad.color(1,0,0)
zencad.color.green =     zencad.color(0,1,0)
zencad.color.blue =      zencad.color(0,0,1)
zencad.color.yellow =    zencad.color(1,1,0)
zencad.color.magenta =   zencad.color(1,0,1)
zencad.color.cian =      zencad.color(0,1,1)
zencad.color.mech =      zencad.color(0.6, 0.6, 0.8)
zencad.color.transmech = zencad.color(0.6, 0.6, 0.8, 0.8)
zencad.color.orange =    zencad.color(1, 0xa5/255, 0)

default_color = zencad.settings.Settings.get_default_color()


pyservoce.Shape.move = pyservoce.Shape.translate
pyservoce.Shape.moveX = pyservoce.Shape.right
pyservoce.Shape.moveY = pyservoce.Shape.forw
pyservoce.Shape.moveZ = pyservoce.Shape.up

zencad.move = zencad.translate
zencad.moveX = zencad.right
zencad.moveY = zencad.forw
zencad.moveZ = zencad.up

def to_vector(arg):
github mirmik / zencad / zencad / __init__.py View on Github external
@lazy
def triangulate(shp, defl):
    return pyservoce.triangulation(shp, defl)


zencad.color = pyservoce.color

zencad.color.white =     zencad.color(1,1,1)
zencad.color.black =     zencad.color(0,0,0)
zencad.color.red =       zencad.color(1,0,0)
zencad.color.green =     zencad.color(0,1,0)
zencad.color.blue =      zencad.color(0,0,1)
zencad.color.yellow =    zencad.color(1,1,0)
zencad.color.magenta =   zencad.color(1,0,1)
zencad.color.cian =      zencad.color(0,1,1)
zencad.color.mech =      zencad.color(0.6, 0.6, 0.8)
zencad.color.transmech = zencad.color(0.6, 0.6, 0.8, 0.8)
zencad.color.orange =    zencad.color(1, 0xa5/255, 0)

default_color = zencad.settings.Settings.get_default_color()


pyservoce.Shape.move = pyservoce.Shape.translate
pyservoce.Shape.moveX = pyservoce.Shape.right
pyservoce.Shape.moveY = pyservoce.Shape.forw
pyservoce.Shape.moveZ = pyservoce.Shape.up

zencad.move = zencad.translate
zencad.moveX = zencad.right
zencad.moveY = zencad.forw
github mirmik / zencad / zencad / __init__.py View on Github external
@lazy
def triangulate(shp, defl):
    return pyservoce.triangulation(shp, defl)


zencad.color = pyservoce.color

zencad.color.white =     zencad.color(1,1,1)
zencad.color.black =     zencad.color(0,0,0)
zencad.color.red =       zencad.color(1,0,0)
zencad.color.green =     zencad.color(0,1,0)
zencad.color.blue =      zencad.color(0,0,1)
zencad.color.yellow =    zencad.color(1,1,0)
zencad.color.magenta =   zencad.color(1,0,1)
zencad.color.cian =      zencad.color(0,1,1)
zencad.color.mech =      zencad.color(0.6, 0.6, 0.8)
zencad.color.transmech = zencad.color(0.6, 0.6, 0.8, 0.8)
zencad.color.orange =    zencad.color(1, 0xa5/255, 0)

default_color = zencad.settings.Settings.get_default_color()


pyservoce.Shape.move = pyservoce.Shape.translate
pyservoce.Shape.moveX = pyservoce.Shape.right
pyservoce.Shape.moveY = pyservoce.Shape.forw
pyservoce.Shape.moveZ = pyservoce.Shape.up

zencad.move = zencad.translate
zencad.moveX = zencad.right
zencad.moveY = zencad.forw
zencad.moveZ = zencad.up
github mirmik / zencad / zencad / __init__.py View on Github external
@lazy
def triangulate(shp, defl):
    return pyservoce.triangulation(shp, defl)


zencad.color = pyservoce.color

zencad.color.white =     zencad.color(1,1,1)
zencad.color.black =     zencad.color(0,0,0)
zencad.color.red =       zencad.color(1,0,0)
zencad.color.green =     zencad.color(0,1,0)
zencad.color.blue =      zencad.color(0,0,1)
zencad.color.yellow =    zencad.color(1,1,0)
zencad.color.magenta =   zencad.color(1,0,1)
zencad.color.cian =      zencad.color(0,1,1)
zencad.color.mech =      zencad.color(0.6, 0.6, 0.8)
zencad.color.transmech = zencad.color(0.6, 0.6, 0.8, 0.8)
zencad.color.orange =    zencad.color(1, 0xa5/255, 0)

default_color = zencad.settings.Settings.get_default_color()


pyservoce.Shape.move = pyservoce.Shape.translate
pyservoce.Shape.moveX = pyservoce.Shape.right
pyservoce.Shape.moveY = pyservoce.Shape.forw
pyservoce.Shape.moveZ = pyservoce.Shape.up

zencad.move = zencad.translate
zencad.moveX = zencad.right
zencad.moveY = zencad.forw
zencad.moveZ = zencad.up
github mirmik / zencad / zencad / __init__.py View on Github external
return pyservoce.unify(shp)


@lazy
def triangulate(shp, defl):
    return pyservoce.triangulation(shp, defl)


zencad.color = pyservoce.color

zencad.color.white =     zencad.color(1,1,1)
zencad.color.black =     zencad.color(0,0,0)
zencad.color.red =       zencad.color(1,0,0)
zencad.color.green =     zencad.color(0,1,0)
zencad.color.blue =      zencad.color(0,0,1)
zencad.color.yellow =    zencad.color(1,1,0)
zencad.color.magenta =   zencad.color(1,0,1)
zencad.color.cian =      zencad.color(0,1,1)
zencad.color.mech =      zencad.color(0.6, 0.6, 0.8)
zencad.color.transmech = zencad.color(0.6, 0.6, 0.8, 0.8)
zencad.color.orange =    zencad.color(1, 0xa5/255, 0)

default_color = zencad.settings.Settings.get_default_color()


pyservoce.Shape.move = pyservoce.Shape.translate
pyservoce.Shape.moveX = pyservoce.Shape.right
pyservoce.Shape.moveY = pyservoce.Shape.forw
pyservoce.Shape.moveZ = pyservoce.Shape.up

zencad.move = zencad.translate
zencad.moveX = zencad.right
github mirmik / zencad / zencad / __init__.py View on Github external
def unify(shp):
    return pyservoce.unify(shp)


@lazy
def triangulate(shp, defl):
    return pyservoce.triangulation(shp, defl)


zencad.color = pyservoce.color

zencad.color.white =     zencad.color(1,1,1)
zencad.color.black =     zencad.color(0,0,0)
zencad.color.red =       zencad.color(1,0,0)
zencad.color.green =     zencad.color(0,1,0)
zencad.color.blue =      zencad.color(0,0,1)
zencad.color.yellow =    zencad.color(1,1,0)
zencad.color.magenta =   zencad.color(1,0,1)
zencad.color.cian =      zencad.color(0,1,1)
zencad.color.mech =      zencad.color(0.6, 0.6, 0.8)
zencad.color.transmech = zencad.color(0.6, 0.6, 0.8, 0.8)
zencad.color.orange =    zencad.color(1, 0xa5/255, 0)

default_color = zencad.settings.Settings.get_default_color()


pyservoce.Shape.move = pyservoce.Shape.translate
pyservoce.Shape.moveX = pyservoce.Shape.right
pyservoce.Shape.moveY = pyservoce.Shape.forw
pyservoce.Shape.moveZ = pyservoce.Shape.up

zencad.move = zencad.translate
github mirmik / zencad / zencad / __init__.py View on Github external
@lazy.lazy(cls=shape_generator)
def unify(shp):
    return pyservoce.unify(shp)


@lazy
def triangulate(shp, defl):
    return pyservoce.triangulation(shp, defl)


zencad.color = pyservoce.color

zencad.color.white =     zencad.color(1,1,1)
zencad.color.black =     zencad.color(0,0,0)
zencad.color.red =       zencad.color(1,0,0)
zencad.color.green =     zencad.color(0,1,0)
zencad.color.blue =      zencad.color(0,0,1)
zencad.color.yellow =    zencad.color(1,1,0)
zencad.color.magenta =   zencad.color(1,0,1)
zencad.color.cian =      zencad.color(0,1,1)
zencad.color.mech =      zencad.color(0.6, 0.6, 0.8)
zencad.color.transmech = zencad.color(0.6, 0.6, 0.8, 0.8)
zencad.color.orange =    zencad.color(1, 0xa5/255, 0)

default_color = zencad.settings.Settings.get_default_color()


pyservoce.Shape.move = pyservoce.Shape.translate
pyservoce.Shape.moveX = pyservoce.Shape.right
pyservoce.Shape.moveY = pyservoce.Shape.forw
pyservoce.Shape.moveZ = pyservoce.Shape.up
github mirmik / zencad / zencad / __init__.py View on Github external
@lazy.lazy(cls=shape_generator)
def unify(shp):
    return pyservoce.unify(shp)


@lazy
def triangulate(shp, defl):
    return pyservoce.triangulation(shp, defl)


zencad.color = pyservoce.color

zencad.color.white =     zencad.color(1,1,1)
zencad.color.black =     zencad.color(0,0,0)
zencad.color.red =       zencad.color(1,0,0)
zencad.color.green =     zencad.color(0,1,0)
zencad.color.blue =      zencad.color(0,0,1)
zencad.color.yellow =    zencad.color(1,1,0)
zencad.color.magenta =   zencad.color(1,0,1)
zencad.color.cian =      zencad.color(0,1,1)
zencad.color.mech =      zencad.color(0.6, 0.6, 0.8)
zencad.color.transmech = zencad.color(0.6, 0.6, 0.8, 0.8)
zencad.color.orange =    zencad.color(1, 0xa5/255, 0)

default_color = zencad.settings.Settings.get_default_color()


pyservoce.Shape.move = pyservoce.Shape.translate
pyservoce.Shape.moveX = pyservoce.Shape.right
pyservoce.Shape.moveY = pyservoce.Shape.forw
pyservoce.Shape.moveZ = pyservoce.Shape.up