예제 #1
0
def cntrpolys( pls, zmin, dz, zmax ):
    retval = irit.nil(  )
    intrcrv = irit.iritstate( "intercrv", irit.GenIntObject(1 ))
    z = zmin
    while ( z <= zmax ):
        p = irit.circpoly( ( 0, 0, 1 ), ( 0, 0, z ), 6 )
        irit.snoc( pls * p, retval )
        z = z + dz
    intrcrv = irit.iritstate( "intercrv", intrcrv )
    irit.color( retval, irit.YELLOW )
    return retval
예제 #2
0
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.
#
cntrs = irit.nil()
intrcrv = irit.iritstate("intercrv", irit.GenIntObject(1))
i = (-0.9)
while (i <= 2.9):
    p = irit.circpoly((0, 0, 1), (0, 0, i), 6)
    c = a * p
    irit.viewobj(c)
    irit.snoc(c, cntrs)
    i = i + 0.1

intrcrv = irit.iritstate("intercrv", intrcrv)

irit.viewremove("c")
irit.viewobj(cntrs)
irit.pause()

irit.save("contour1", cntrs)

# ############################################################################
예제 #3
0
irit.free(b2)
irit.interact(irit.list(irit.GetViewMatrix(), m1))

c1 = irit.sphere((0, 0, 0.2), 0.18)
c1 = putrgbonvertices(c1, irit.GenStrObject("0,255,255"))
irit.view(c1, irit.OFF)

m2 = (m1 - c1)

irit.free(m1)
irit.free(c1)
irit.view(m2, irit.ON)

c2 = irit.circle((0.55, 0, 0), 0.12)
c2 = irit.extrude(c2, ((-0.2), 0, 0.2), 0)
c2 = c2 * irit.circpoly((0, 0, 1), (0.55, 0, 0.05), 0.25)
c3 = irit.circle(((-0.55), 0, 0), 0.12)
c3 = irit.extrude(c3, (0.2, 0, 0.2), 0)
c3 = c3 * irit.circpoly((0, 0, 1), ((-0.55), 0, 0.05), 0.25)
c2 = putrgbonvertices(c2, irit.GenStrObject("255,0,255"))
c3 = putrgbonvertices(c3, irit.GenStrObject("255,128,128"))
irit.view(irit.list(c2, c3), irit.OFF)

m3 = (m2 - c2 - c3)
irit.free(m2)
irit.free(c2)
irit.free(c3)
final = irit.convex(m3)
irit.free(m3)

irit.printf("total time = %f\n", irit.list(irit.time(0)))
예제 #4
0
ptc = (0, 0, 0)
pt1 = (math.cos(0), math.sin(0), 0)
pt2 = (math.cos(d), math.sin(d), 0)
pt3 = (math.cos(d * 2), math.sin(d * 2), 0)
pt4 = (math.cos(d * 3), math.sin(d * 3), 0)
pt5 = (math.cos(d * 4), math.sin(d * 4), 0)

star = irit.list(irit.poly(irit.list(ptc, pt1, pt2), irit.FALSE),
                 irit.poly(irit.list(ptc, pt2, pt3), irit.FALSE),
                 irit.poly(irit.list(ptc, pt3, pt4), irit.FALSE),
                 irit.poly(irit.list(ptc, pt4, pt5), irit.FALSE),
                 irit.poly(irit.list(ptc, pt5, pt1), irit.FALSE)) * irit.rz(90)
irit.color(star, irit.WHITE)

irit.SetResolution(80)
circ = irit.circpoly((0, 0, 1), (0, 0, 0), 1) * irit.tz((-0.01))
irit.color(circ, irit.BLUE)
irit.attrib(circ, "rgb", irit.GenStrObject("0,0,8"))
irit.SetResolution(20)

logo1 = irit.list(circ, star)

irit.interact(logo1)

irit.save("logo1", logo1)

irit.free(logo1)

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

eps = 0.12
예제 #5
0

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

#
#  And the small one ( including the torus & sphere cut
#
c2 = irit.cylin((1, 0, 0.05), (0, 0, 0.4), 0.15, 3)
irit.attrib(c2, "id", irit.GenRealObject(2))
irit.SetResolution(8)

t1 = irit.circpoly((0, 1, 0), (0.151, 0, 0.25), 0.03)
irit.SetResolution(16)
t2 = irit.surfrev(t1) * irit.trans((1, 0, 0))
irit.free(t1)
irit.attrib(t2, "id", irit.GenRealObject(3))

b1 = (c2 - t2)
irit.free(c2)
irit.free(t2)
irit.SetResolution(12)
s1 = irit.sphere((1, 0, 0), 0.135)
irit.attrib(s1, "id", irit.GenRealObject(4))

b2 = (b1 - s1)
irit.free(b1)
irit.free(s1)