Example #1
0
def antanim(scl):
    save_res = irit.GetResolution()
    bodyall = antbody()
    body = irit.nth(bodyall, 1)
    eyes = irit.nth(bodyall, 2)
    llegs = irit.list(
        antlleganim(1) * irit.sc(1.1) * irit.sx(1.3) * irit.ry(
            (-45)) * irit.trans((0.1, 0, 1.02)),
        antlleganim((-1)) * irit.sc(1.3) * irit.ry(10) * irit.trans(
            (0.1, 0.05, 1)),
        antlleganim(1) * irit.sc(1.2) * irit.sx(1.4) * irit.ry(40) *
        irit.trans((0.1, 0.02, 0.95)))
    rlegs = irit.list(
        antrleganim(
            (-1)) * irit.sc(1.1) * irit.sx(1.3) * irit.ry(45) * irit.trans(
                ((-0.1), 0, 1.02)),
        antrleganim(1) * irit.sc(1.3) * irit.ry((-10)) * irit.trans(
            ((-0.1), 0.05, 1)),
        antrleganim((-1)) * irit.sc(1.2) * irit.sx(1.4) * irit.ry(
            (-40)) * irit.trans(((-0.1), 0.02, 0.95)))
    irit.SetResolution(20)
    antennas = irit.list(
        antantenna() * irit.ry((-110)) * irit.trans(((-0.02), 0.2, 1.6)),
        antantenna() * irit.ry((-70)) * irit.trans((0.02, 0.2, 1.6)))
    irit.attrprop(antennas, "u_resolution", irit.GenRealObject(0.2))
    body = (body + irit.gpolygon(antennas, 1))
    irit.attrib(body, "rgb", irit.GenStrObject("255,50,50"))
    irit.SetResolution(save_res)
    retval = irit.list(
        body, llegs, rlegs,
        eyes) * irit.sz(1.3) * irit.sc(1) * irit.ty(0.28785) * irit.rx(90)
    mov_y = irit.creparam( irit.ctlpt( irit.E1, 0 ) + \
                            irit.ctlpt( irit.E1, (-1 ) ), 0, 1.2 )
    irit.attrib(retval, "animation", mov_y)
    return retval
Example #2
0
def ant(scl):
    save_res = irit.GetResolution()
    bodyall = antbody()
    body = irit.nth(bodyall, 1)
    eyes = irit.nth(bodyall, 2)
    leg = antleg()
    llegs = irit.list(
        leg * irit.sc(1.1) * irit.sx(1.3) * irit.ry((-45)) * irit.trans(
            (0.1, 0, 1.02)),
        leg * irit.sc(1.3) * irit.ry(10) * irit.trans((0.1, 0.05, 1)),
        leg * irit.sc(1.2) * irit.sx(1.4) * irit.ry(40) * irit.trans(
            (0.1, 0.02, 0.95)))
    irit.SetResolution(20)
    irit.attrprop(llegs, "u_resolution", irit.GenRealObject(0.2))
    antennas = irit.list(
        antantenna() * irit.ry((-110)) * irit.trans(((-0.02), 0.2, 1.6)),
        antantenna() * irit.ry((-70)) * irit.trans((0.02, 0.2, 1.6)))
    irit.attrprop(antennas, "u_resolution", irit.GenRealObject(0.2))
    body = (body + irit.gpolygon(llegs, 1) + irit.gpolygon(llegs, 1) * irit.sx(
        (-1)) + irit.gpolygon(antennas, 1))
    irit.attrib(body, "rgb", irit.GenStrObject("255,50,50"))
    irit.SetResolution(save_res)
    retval = irit.list(
        body,
        eyes) * irit.sz(1.3) * irit.sc(1) * irit.ty(0.28785) * irit.rx(90)
    return retval
Example #3
0
import math
import irit
#

#
#  A test of intersection of three orthogonal cylinders.
#
#                                Gershon Elber, April 94.
#

save_mat = irit.GetViewMatrix()
save_res = irit.GetResolution()

length = 0.7
radius = 0.2
irit.SetResolution(40)

c1 = irit.cylin(((-length) / 2, 0, 0), (length, 0, 0), radius, 3)
c2 = irit.cylin((0, (-length) / 2, 0), (0, length, 0), radius, 3)
c3 = irit.cylin((0, 0, (-length) / 2), (0, 0, length), radius, 3)

irit.attrib(c1, "width", irit.GenRealObject(0.0001))
irit.attrib(c2, "width", irit.GenRealObject(0.0001))
irit.attrib(c3, "width", irit.GenRealObject(0.0001))

c12 = c1 * c2
c123 = c12 * c3
irit.attrib(c123, "width", irit.GenRealObject(0.005))
irit.color(c123, irit.RED)
irit.adwidth(c123, 3)
Example #4
0
#

#
#  This solid was taken from: Geometric Modeling,
#  by Michael E. Mortenson page 468, figure 10.34
#
#                                Created by Gershon Elber,       Feb 89
#
#    High resolution version. Do not try this on an IBM PC.
#

t = irit.time(1)

save_res = irit.GetResolution()

irit.SetResolution(32)
t1 = irit.cylin(((-1.1), 0, 0), (2.2, 0, 0), 0.2, 3)
t2 = irit.cylin(((-0.8), 0, 0), (0.05, 0, 0), 0.3, 3)
t3 = irit.cylin((0.8, 0, 0), ((-0.05), 0, 0), 0.3, 3)

s1 = (t1 + t2 + t3)
irit.free(t1)
irit.free(t2)
irit.free(t3)
s1 = irit.convex(s1)
irit.view(s1, irit.ON)

s2 = s1 * irit.roty(90)
s3 = s1 * irit.rotz(90)
irit.view(irit.list(s2, s3), irit.OFF)
Example #5
0
#This is an IRIT script and as such requires both math and irit import:
#
import math
import irit
#

#
#  Intersection of cone and a cylinder:
#  Try this one with resolution equal 20 - slower, but much nicer!
#
#                        Created by Gershon Elber,       Jan. 89
#

view_mat1 = irit.GetViewMatrix() * irit.sc(0.2)
save_res = irit.GetResolution()
irit.SetResolution(8)

# ############################################################################

cone1 = irit.con2((0, 0, (-1)), (0, 0, 4), 2, 1, 3)
cylin1 = irit.cylin((0, 3, 0), (0, (-6), 2), 0.7, 3)

a = (cone1 + cylin1)
irit.free(cylin1)
irit.free(cone1)
irit.interact(irit.list(view_mat1, a))

#
#  Currently variables can not be introduced in a loop (except the iteration
#  variable), so we prepare all variables in advance.
#
Example #6
0
irit.free(crv2)

steps = 8
pt_lst = irit.nil()
i = 0
while (i <= steps - 1):
    pt = irit.ceval(
        cbsp,
        irit.FetchRealObject(irit.nth(irit.pdomain(cbsp), 2)) * i /
        (steps - 1))
    irit.snoc(pt, pt_lst)
    i = i + 1
cpl = irit.poly(pt_lst, irit.TRUE)
irit.color(cpl, irit.GREEN)

irit.SetResolution(0.02)
cbsp2 = cbsp
cpl2 = irit.gpolyline(cbsp2, 2)
irit.color(cpl2, irit.YELLOW)
irit.SetResolution(20)

irit.interact(irit.list(cbsp, cpl2, cpl))
irit.save("gpolyln1", irit.list(cbsp, cpl2, cpl))

# ############################################################################

cbsp = irit.cbspline( 3, irit.list( irit.ctlpt( irit.E2, 0, (-1 ) ), \
                                    irit.ctlpt( irit.E2, 0.3, 1 ), \
                                    irit.ctlpt( irit.E2, 0.7, (-1 ) ), \
                                    irit.ctlpt( irit.E2, 1, 1 ) ), irit.list( irit.KV_OPEN ) )
irit.color(cbsp, irit.RED)
Example #7
0
t = irit.time(1)

save_mat = irit.GetViewMatrix()
irit.SetViewMatrix(irit.GetViewMatrix() * irit.scale((0.5, 0.5, 0.5)))
save_res = irit.GetResolution()

#
#  Try it with coplanar false for fun.
#
#  irit.iritstate( "coplanar", false );
#

psort = irit.iritstate("polysort", irit.GenRealObject(0))

t1 = irit.box(((-2), (-0.35), 0), 4, 0.7, 0.4)
irit.SetResolution(40)
t2 = irit.cylin((0, 0, 0), (0, 0, 0.4), 1.4, 3)
s1 = t1 * t2
irit.free(t1)
irit.free(t2)
irit.view(irit.list(irit.GetViewMatrix(), s1), irit.ON)

irit.SetResolution(20)
t3 = irit.cylin((0, 0, 0), (0, 0, 0.4), 0.9, 3)
s2 = (s1 + t3)
irit.free(t3)
irit.free(s1)
irit.view(s2, irit.ON)

irit.SetResolution(40)
t4 = irit.cylin((1.45, (-0.5), 1), (0, 1, 0), 0.8, 3)
Example #8
0
#This is an IRIT script and as such requires both math and irit import:
#
import math
import irit
#


# 
#  A model of the B58 Bomber.
# 
# 
#                        Gershon Elber, October 1991.
# 

if ( irit.GetMachine() == irit.MSDOS ):
    irit.SetResolution(8)
else:
    irit.SetResolution(10)

save_mat = irit.GetViewMatrix()
irit.SetViewMatrix(irit.GetViewMatrix() * irit.trans( ( 5, 2, 0 ) ) * irit.scale( ( 0.15, 0.15, 0.15 ) ) )

# 
#  Set up for colored or wood texture version. set do_texture to 1 for
#  wood version, otherwise color version. Note locally (in irit) it will
#  always be displayed in colors.
# 
do_texture = 0


Example #9
0
irit.free(c)
irit.free(p)
irit.free(cntrs)

#
#  Simple self intersecting surface.
#
c1 = irit.cbspline( 3, irit.list( irit.ctlpt( irit.E3, 0, (-1 ), 0 ), \
                                  irit.ctlpt( irit.E3, 0, 1, 0.2 ), \
                                  irit.ctlpt( irit.E3, 1, 0, 0.4 ), \
                                  irit.ctlpt( irit.E3, (-1 ), 0, 0.6 ) ), irit.list( irit.KV_OPEN ) )
s1 = irit.ruledsrf(c1, c1 * irit.tz(1) * irit.rz(10))
irit.color(s1, irit.GREEN)

irit.SetResolution(30)

#
#  Computing self intersection by a Boolean operation with itself - Parametric.
#
dummy = irit.iritstate("intercrv", irit.GenRealObject(1))
uvbool = irit.iritstate("uvboolean", irit.GenRealObject(1))
s1inter = (s1 + s1)
irit.color(s1inter, irit.RED)
irit.attrib(s1inter, "dwidth", irit.GenRealObject(3))

paramdomain = irit.poly(irit.list((0, 0, 0), (0, 1, 0), (2, 1, 0), (2, 0, 0)),
                        irit.FALSE)
irit.color(paramdomain, irit.GREEN)

irit.SetViewMatrix(irit.tx((-1)) * irit.sc(0.6))
Example #10
0
#
#  Two quadratic curves
#
c1 = irit.cbezier( irit.list( irit.ctlpt( irit.E2, (-0.5 ), 0.1 ), \
                              irit.ctlpt( irit.E2, 0, 0.3 ), \
                              irit.ctlpt( irit.E2, 0.5, 0.7 ) ) )
c2 = irit.coerce(c1 * irit.sy((-1)), irit.E2)
irit.color(c1, irit.YELLOW)
irit.color(c2, irit.YELLOW)
irit.adwidth(c1, 3)
irit.adwidth(c2, 3)

bisectsrf = irit.cbisector3d(irit.list(c1, c2), 4)
irit.color(bisectsrf, irit.RED)

irit.SetResolution(25)
bisectcrv = irit.contour(bisectsrf, irit.plane(0, 0, 1, epsilon))
irit.color(bisectcrv, irit.GREEN)
irit.adwidth(bisectcrv, 3)

irit.interact(irit.list(c1, c2, bisectcrv, bisectsrf))

# ############################################################################
#
#  Two quadratic curves
#
c1 = irit.cbezier( irit.list( irit.ctlpt( irit.E2, (-0.5 ), 0.5 ), \
                              irit.ctlpt( irit.E2, 0, 0.3 ), \
                              irit.ctlpt( irit.E2, 0.5, 0.7 ) ) )
c2 = irit.coerce(c1 * irit.sy((-1)), irit.E2)
irit.color(c1, irit.YELLOW)
Example #11
0
#

#
#  Some routines to test bezier curves/surfaces.
#

#
#  Set display to on to view some results, off to view nothing.
#
display = 1
save_res = irit.GetResolution()

dlevel = irit.iritstate("dumplevel", irit.GenIntObject(255))

if (irit.GetMachine() == irit.MSDOS):
    irit.SetResolution(5)
else:
    irit.SetResolution(10)

s45 = math.sin(math.pi / 4)
cbzr = irit.list( irit.ctlpt( irit.P2, 1, 1, 0 ), \
                  irit.ctlpt( irit.P2, s45, s45, s45 ), \
                  irit.ctlpt( irit.P2, 1, 0, 1 ) )

sbzr = irit.list( irit.list( irit.ctlpt( irit.E3, 0.1, 0, 1 ), \
                             irit.ctlpt( irit.E3, 0.3, 1, 0 ), \
                             irit.ctlpt( irit.E3, 0, 2, 1 ) ), irit.list( \
                             irit.ctlpt( irit.E3, 1.1, 0, 0 ), \
                             irit.ctlpt( irit.E3, 1.3, 1.5, 2 ), \
                             irit.ctlpt( irit.E3, 1, 2.1, 0 ) ), irit.list( \
                             irit.ctlpt( irit.E3, 2.1, 0, 2 ), \
Example #12
0
tv1s1 = irit.strivar(tv1, irit.COL, 0.77)
irit.color(tv1s1, irit.RED)
tv1s2 = irit.strivar(tv1, irit.ROW, 0.375)
irit.color(tv1s2, irit.GREEN)
tv1s3 = irit.strivar(tv1, irit.DEPTH, 0.31)
irit.color(tv1s3, irit.CYAN)

tv2s1 = irit.strivar(tv2, irit.COL, 0.4)
irit.color(tv2s1, irit.RED)
tv2s2 = irit.strivar(tv2, irit.ROW, 0.5)
irit.color(tv2s2, irit.GREEN)
tv2s3 = irit.strivar(tv2, irit.DEPTH, 0.6)
irit.color(tv2s3, irit.CYAN)

save_res = irit.GetResolution()
irit.SetResolution(2)
tv2poly = irit.gpolyline(tv2, 0)
irit.SetResolution(save_res)
irit.interact(irit.list(tv2poly, tv2s1, tv2s2, tv2s3))

irit.save(
    "trivar5",
    irit.list(tv2poly, tv2s1, tv2s2, tv2s3, irit.teval(tv1, 0.77, 0.375, 0.31),
              irit.teval(tv2, 0.4, 0.5, 0.6), irit.seval(tv1s1, 0.375, 0.31),
              irit.seval(tv1s2, 0.77, 0.31), irit.seval(tv1s3, 0.77, 0.375),
              irit.seval(tv2s1, 0.5, 0.6), irit.seval(tv2s2, 0.4, 0.6),
              irit.seval(tv2s3, 0.4, 0.5)))

irit.free(tv1s1)
irit.free(tv1s2)
irit.free(tv1s3)
Example #13
0
cross = irit.cbspline( 3, irit.list( irit.ctlpt( irit.E3, (-1 ), 0, 0 ), \
                                     irit.ctlpt( irit.E3, (-1.1 ), 0.2, 0 ), \
                                     irit.ctlpt( irit.E3, (-1.1 ), 0.6, 0 ), \
                                     irit.ctlpt( irit.E3, (-0.7 ), 1.1, 0 ), \
                                     irit.ctlpt( irit.E3, (-0.5 ), 1.3, 0 ), \
                                     irit.ctlpt( irit.E3, 0.5, 1.3, 0 ), \
                                     irit.ctlpt( irit.E3, 0.7, 1.1, 0 ), \
                                     irit.ctlpt( irit.E3, 1.1, 0.6, 0 ), \
                                     irit.ctlpt( irit.E3, 1.1, 0.2, 0 ), \
                                     irit.ctlpt( irit.E3, 1, 0, 0 ) ), irit.list( irit.KV_PERIODIC ) ) * irit.rz( (-90 ) ) * irit.sc( 0.3 )
direc = irit.cbspline( 3, irit.list( irit.ctlpt( irit.E3, (-1.2 ), 0, 0 ), \
                                     irit.ctlpt( irit.E3, 0, 0.24, 0 ), \
                                     irit.ctlpt( irit.E3, 1.2, 0, 0 ) ), irit.list( irit.KV_OPEN ) )

irit.SetResolution(res)
srf1 = irit.gpolygon((-irit.sweepsrf(irit.coerce(cross, irit.KV_OPEN), direc,
                                     irit.GenIntObject(0))), 1)
irit.free(cross)
irit.free(direc)

irit.SetResolution(res * 5)
cyl1 = irit.cylin((0, 0, (-1)), (0, 0, 2), 1.15, 3)

srf2 = srf1 * cyl1
irit.free(cyl1)

irit.SetResolution(res * 5)
cyl2 = irit.cylin((0, 0.2, (-1)), (0, 0, 2), 0.6, 3)

srf3 = srf1 * cyl2 * irit.sz(4) * irit.sx(0.9) * irit.ty((-0.15))
Example #14
0
srftext1 = irit.ruledsrf( irit.ctlpt( irit.E2, 0, 0 ) + \
                          irit.ctlpt( irit.E2, 0, 1 ), \
                          irit.ctlpt( irit.E2, 1, 0 ) + \
                          irit.ctlpt( irit.E2, 1, 1 ) )
srftext1 = irit.sraise(irit.sraise(srftext1, irit.ROW, 3), irit.COL, 3)
srftext1 = irit.srefine(srftext1, irit.ROW, 0, irit.list(0.25, 0.5, 0.75))
srftext1 = irit.srefine(srftext1, irit.COL, 0, irit.list(0.25, 0.5, 0.75))
srftext1 = irit.coerce(srftext1, irit.E3)

#  Make a spike out of the four interior points.
srftext1 = irit.seditpt(srftext1, irit.ctlpt(irit.E3, 0.5, 0.5, 1), 2, 2)
srftext1 = irit.seditpt(srftext1, irit.ctlpt(irit.E3, 0.5, 0.5, 1), 2, 3)
srftext1 = irit.seditpt(srftext1, irit.ctlpt(irit.E3, 0.5, 0.5, 1), 3, 2)
srftext1 = irit.seditpt(srftext1, irit.ctlpt(irit.E3, 0.5, 0.5, 1), 3, 3)

irit.SetResolution(6)

srf1 = irit.sddmmap(srf, irit.gpolygon((-srftext1) * irit.sz(0.1), 1), 4, 8, 1)
irit.interact(srf1)

srf1 = irit.sddmmap(srf, irit.gpolygon((-srftext1) * irit.sz(0.2), 1), 8, 12,
                    1)
irit.interact(srf1)
irit.save("disp1map", srf1)

irit.free(srftext1)
irit.free(srf1)

# #############################################################################
#
#  Scale like texture
Example #15
0
t = irit.time(1)

save_mat = irit.GetViewMatrix()
irit.SetViewMatrix(irit.GetViewMatrix() * irit.scale((0.5, 0.5, 0.5)))
save_res = irit.GetResolution()

#
#  Try it with coplanar false for fun.
#
#  irit.iritstate( "coplanar", false );
#

psort = irit.iritstate("polysort", irit.GenRealObject(0))

t1 = irit.box(((-2), (-0.35), 0), 4, 0.7, 0.4)
irit.SetResolution(80)
t2 = irit.cylin((0, 0, 0), (0, 0, 0.4), 1.4, 3)
s1 = t1 * t2
irit.free(t1)
irit.free(t2)
irit.view(irit.list(irit.GetViewMatrix(), s1), irit.ON)

irit.SetResolution(40)
t3 = irit.cylin((0, 0, 0), (0, 0, 0.4), 0.9, 3)
s2 = (s1 + t3)
irit.free(t3)
irit.free(s1)
irit.view(s2, irit.ON)

irit.SetResolution(80)
t4 = irit.cylin((1.45, (-0.5), 1), (0, 1, 0), 0.8, 3)
Example #16
0
def antbody():
    save_res = irit.GetResolution()
    c = irit.pcircle((0, 0, 0), 1)
    body = (-irit.sfromcrvs(
        irit.list(
            c * irit.sc(1e-006) * irit.ty((-0.1)) * irit.tz(0.19),
            c * irit.sy(0.8) * irit.sc(0.07) * irit.ty((-0.1)) * irit.tz(0.19),
            c * irit.sy(0.8) * irit.sc(0.11) * irit.ty((-0.1)) * irit.tz(0.21),
            c * irit.sy(0.8) * irit.sc(0.14) * irit.ty((-0.1)) * irit.tz(0.23),
            c * irit.sy(0.8) * irit.sc(0.14) * irit.ty((-0.1)) * irit.tz(0.26),
            c * irit.sy(0.8) * irit.sc(0.11) * irit.ty((-0.1)) * irit.tz(0.28),
            c * irit.sy(0.8) * irit.sc(0.11) * irit.ty((-0.1)) * irit.tz(0.29),
            c * irit.sy(0.8) * irit.sc(0.24) * irit.ty(
                (-0.05)) * irit.tz(0.31),
            c * irit.sy(0.8) * irit.sc(0.27) * irit.ty(
                (-0.05)) * irit.tz(0.41),
            c * irit.sy(0.8) * irit.sc(0.19) * irit.ty(
                (-0.05)) * irit.tz(0.44),
            c * irit.sy(0.8) * irit.sc(0.19) * irit.ty(
                (-0.05)) * irit.tz(0.45),
            c * irit.sy(0.8) * irit.sc(0.3) * irit.ty(
                (-0.035)) * irit.tz(0.47),
            c * irit.sy(0.8) * irit.sc(0.32) * irit.ty(
                (-0.035)) * irit.tz(0.59),
            c * irit.sy(0.8) * irit.sc(0.24) * irit.ty(
                (-0.035)) * irit.tz(0.62),
            c * irit.sy(0.8) * irit.sc(0.24) * irit.ty(
                (-0.035)) * irit.tz(0.63),
            c * irit.sy(0.8) * irit.sc(0.3) * irit.ty((-0.03)) * irit.tz(0.65),
            c * irit.sy(0.8) * irit.sc(0.28) * irit.ty(
                (-0.03)) * irit.tz(0.76),
            c * irit.sy(0.8) * irit.sc(0.07) * irit.ty((-0.1)) * irit.tz(0.85),
            c * irit.sy(0.8) * irit.sc(0.07) * irit.ty((-0.1)) * irit.tz(0.87),
            c * irit.sy(0.8) * irit.sc(0.18) * irit.ty((-0.1)) * irit.tz(0.93),
            c * irit.sy(0.8) * irit.sc(0.18) * irit.ty((-0.1)) * irit.tz(1.03),
            c * irit.sy(0.8) * irit.sc(0.07) * irit.ty((-0.1)) * irit.tz(1.1),
            c * irit.sy(0.8) * irit.sc(0.07) * irit.ty((-0.1)) * irit.tz(1.12),
            c * irit.sy(0.8) * irit.sc(0.18) * irit.ty(
                (-0.06)) * irit.tz(1.18),
            c * irit.sy(0.8) * irit.sc(0.18) * irit.ty(
                (-0.03)) * irit.tz(1.32),
            c * irit.sy(0.8) * irit.sc(0.07) * irit.ty((-0)) * irit.tz(1.41),
            c * irit.sy(0.8) * irit.sc(0.07) * irit.ty((-0)) * irit.tz(1.43),
            c * irit.sy(0.8) * irit.sc(0.22) * irit.ty(0.05) * irit.tz(1.5),
            c * irit.sy(0.8) * irit.sc(0.2) * irit.ty((-0)) * irit.tz(1.66),
            c * irit.sy(0.8) * irit.sc(0.05) * irit.ty(
                (-0.22)) * irit.tz(1.85),
            c * irit.sy(0.8) * irit.sc(1e-006) * irit.ty(
                (-0.22)) * irit.tz(1.86)), 3, irit.KV_OPEN))
    irit.SetResolution(15)
    eye1 = irit.sphere((0, 0, 0), 0.08) * irit.rx(20) * irit.ry(
        (-20)) * irit.trans((0.15, 0.05, 1.59))
    eye2 = eye1 * irit.sx((-1))
    irit.SetResolution(20)
    bodycut = body / eye1 ^ eye2
    irit.attrib(bodycut, "rgb", irit.GenStrObject("255,50,50"))
    eye1cut = eye1 / body
    irit.attrib(eye1cut, "reflection", irit.GenStrObject("0.85"))
    irit.attrib(eye1cut, "rgb", irit.GenStrObject("15,15,15"))
    eye2cut = eye2 / body
    irit.attrib(eye2cut, "reflection", irit.GenStrObject("0.85"))
    irit.attrib(eye2cut, "rgb", irit.GenStrObject("15,15,15"))
    irit.SetResolution(save_res)
    retval = irit.list(bodycut, irit.list(eye1cut, eye2cut))
    return retval
Example #17
0
v11 = (0.7, 0, 0.2)
v12 = (0.6, 0, 0.2)

plgcross = irit.poly( irit.list( v1, v2, v3, v4, v5, v6,\

v7, v8, v9, v10, v11, v12 ),\
0 )

pllcross = irit.poly( irit.list( v1, v2, v3, v4, v5, v6,\

v7, v8, v9, v10, v11, v12,\
v1 ), 1 )
irit.color(pllcross, irit.GREEN)
irit.adwidth(pllcross, 5)

irit.SetResolution(16)

t1 = irit.surfrev2(plgcross, 33, 180)
irit.interact(irit.list(pllcross, irit.GetAxes(), t1))

t2 = irit.surfrevaxs(plgcross, (1, 0, 1))
irit.interact(irit.list(pllcross, irit.GetAxes(), t2))

t3 = irit.surfrevaxs(plgcross, (1, 1, 1))
irit.interact(irit.list(pllcross, irit.GetAxes(), t3))

t4 = irit.surfrevax2(plgcross, 90, 360, (1, 0, 1))
irit.interact(irit.list(pllcross, irit.GetAxes(), t4))

#  T9 = surfRevAxs( PlgCross, vector( 0, 1, 0 ) );
Example #18
0
import irit
#

#
#  Yet another simple 3D mechanical object. This one whas taken from
#  PC MAGAZINE volume 8 number 2, January 31, 1989, page 34. This was example
#  that was implemented under AutoCAD ver 10, and it looked nice so I tried
#  it... It took me about an hour to complete.
#
#                                Created by Gershon Elber,       Mar 89
#

save_mat = irit.GetViewMatrix()
save_res = irit.GetResolution()

irit.SetResolution(48)
irit.SetViewMatrix(irit.GetViewMatrix() * irit.trans((0.4, (-0.1), 0)))

#
#  Create the big cylinder ( no hole yet )
#
c1 = irit.cylin((0, 0, 0), (0, 0, 0.7), 0.2, 3)

#
#  And the small one ( including the torus & sphere cut
#
c2 = irit.cylin((1, 0, 0.05), (0, 0, 0.4), 0.15, 3)
irit.SetResolution(32)
t1 = irit.circpoly((0, 1, 0), (0.151, 0, 0.25), 0.03)
irit.SetResolution(48)
t2 = irit.surfrev(t1) * irit.trans((1, 0, 0))