コード例 #1
0
                                    irit.ctlpt( irit.E2, 0.1, (-0.1 ) ), \
                                    irit.ctlpt( irit.E2, (-0.1 ), (-0.1 ) ), \
                                    irit.ctlpt( irit.E2, (-0.1 ), 0.2 ), \
                                    irit.ctlpt( irit.E2, 0.2, 0.2 ), \
                                    irit.ctlpt( irit.E2, 0.2, (-0.2 ) ), \
                                    irit.ctlpt( irit.E2, (-0.2 ), (-0.2 ) ), \
                                    irit.ctlpt( irit.E2, (-0.2 ), 0.3 ), \
                                    irit.ctlpt( irit.E2, 0, 0.3 ) ), irit.list( irit.KV_OPEN ) )
crv1a = crv1 * irit.trans( ( (-0.4 ), 0, 0 ) )
crv1b = irit.cbezier( irit.list( irit.ctlpt( irit.E2, 0.3, (-0.3 ) ), \
                                 irit.ctlpt( irit.E2, 0.4, 0 ), \
                                 irit.ctlpt( irit.E2, 0.3, 0.3 ) ) )
irit.free( crv1 )
irit.color( crv1a, irit.GREEN )
irit.color( crv1b, irit.GREEN )
irit.ffcompat( crv1a, crv1b )
irit.view( irit.list( crv1a, crv1b ), irit.ON )

i = 0
while ( i <= 1 ):
    crv = irit.cmorph( crv1a, crv1b, 0, i )
    irit.color( crv, irit.YELLOW )
    irit.view( irit.list( crv1a, crv1b, crv ), irit.ON )
    i = i + 0.01

crvs = irit.cmorph( crv1a, crv1b, 1, 0.01 )
irit.snoc( crv1b, crvs )
i = 1
while ( i <= irit.SizeOf( crvs ) ):
    c = irit.nth( crvs, i )
    irit.color( c, irit.YELLOW )
コード例 #2
0
while (a <= 0):
    pt = (a, 0, 0)
    c1 = irit.cbezier( irit.list( irit.ctlpt( irit.E3, 0, (-0.2 ), (-1 ) ), \
                                   irit.ctlpt( irit.E3, 0, (-3.2 ), 0 ), \
                                   irit.ctlpt( irit.E3, 0, (-0.2 ), 1 ) ) )
    bisectsrf = irit.cbisector3d(irit.list(c1, pt), 0)
    display(c1, pt, bisectsrf)
    a = a + 0.005 * speed

# ############################################################################
#
#  A cubic
#

circ = irit.pcircle((0, 0, 0), 1) * irit.rz(90) * irit.ry((-90))
irit.ffcompat(c1, circ)

pt = (0, 0, 0)

a = 0
while (a <= 1):
    c1x = irit.cmorph(c1, circ, 0, a)
    bisectsrf = irit.cbisector3d(irit.list(c1x, pt), 0)
    display(c1x, pt, bisectsrf)
    a = a + 0.01 * speed

a = 0
while (a <= 0.9):
    pt = (0, a, 0)
    bisectsrf = irit.cbisector3d(irit.list(circ, pt), 0)
    display(circ, pt, bisectsrf)
コード例 #3
0
0.144928, 0.15942, 0.173913, 0.188406, 0.202899, 0.217391,\
0.231884, 0.246377, 0.26087, 0.275362, 0.289855, 0.304348,\
0.318841, 0.333333, 0.347826, 0.362319, 0.376812, 0.391304,\
0.405797, 0.42029, 0.434783, 0.449275, 0.463768, 0.478261,\
0.492754, 0.507246, 0.521739, 0.536232, 0.550725, 0.565217,\
0.57971, 0.594203, 0.608696, 0.623188, 0.637681, 0.652174,\
0.666667, 0.681159, 0.695652, 0.710145, 0.724638, 0.73913,\
0.753623, 0.768116, 0.782609, 0.797101, 0.811594, 0.826087,\
0.84058, 0.855072, 0.869565, 0.884058, 0.898551, 0.913043,\
0.927536, 0.942029, 0.956522, 0.971014, 0.985507, 1,\
1, 1 ) )

echosrc = irit.iritstate( "echosource", echosrc )
irit.free( echosrc )

irit.ffcompat( locally, globally )

irit.color( locally, irit.RED )
irit.color( globally, irit.GREEN )

irit.view( irit.list( locally, globally ), irit.ON )
bg_obj = irit.list( locally, globally )
i = 0
while ( i <= 300 * speed ):
    c = irit.cmorph( locally, globally, 0, i/(300.0 * speed) )
    irit.color( c, irit.YELLOW )
    irit.view( irit.list(c, bg_obj), irit.ON)
    i = i + 1
irit.save( "glocal1", irit.list( locally, globally, irit.cmorph( locally, globally, 0, 0.5 ) ) )

globally2 = irit.ffmatch( locally, globally, 20, 100, 2, 0, (-2 ) )
コード例 #4
0
    c2 = irit.cbezier( irit.list( \
                                   irit.ctlpt( irit.E3, (-1 ), 0.1, 0 ), \
                                   irit.ctlpt( irit.E3, 0, 2.1, 0 ), \
                                   irit.ctlpt( irit.E3, 1, 0.1, 0 ) ) )
    bisectsrf = irit.cbisector3d(irit.list(c1, c2), 1)
    display(c1, c2, bisectsrf)
    a = a + 0.02 * speed

# ############################################################################
#
#  A line and a circle
#

circ = irit.creparam(irit.pcircle((0, 0, 0), 1), 0, 1) * irit.rz(
    (-90)) * irit.ry(180)
irit.ffcompat(c2, circ)

a = 0
while (a <= 1):
    c1 = irit.cbezier( irit.list( irit.ctlpt( irit.E3, 0, 0, (-1 ) ), \
                                   irit.ctlpt( irit.E3, 0, 0, 1 ) ) )
    c2x = irit.cmorph(c2, circ, 0, a)
    bisectsrf = irit.cbisector3d(irit.list(c1, c2x), 1)
    display(c1, c2x, bisectsrf)
    a = a + 0.01 * speed

# ############################################################################
#
#  A line and a circle (again)
#
コード例 #5
0
ファイル: smorph.py プロジェクト: AlessandroScrem/irit-sm_V11
                                      irit.ctlpt( irit.E3, 0.12, 0, 0.65 ), \
                                      irit.ctlpt( irit.E3, 0.09, 0, 0.65 ), \
                                      irit.ctlpt( irit.E3, 0.07, 0, 0.64 ), \
                                      irit.ctlpt( irit.E3, 0.1, 0, (-0.05 ) ), \
                                      irit.ctlpt( irit.E3, 0.21, 0, (-0.1 ) ), \
                                      irit.ctlpt( irit.E3, 0.21, 0, (-0.64 ) ), \
                                      irit.ctlpt( irit.E3, 0.18, 0, (-0.67 ) ), \
                                      irit.ctlpt( irit.E3, 0, 0, (-0.66 ) ) ), irit.list( irit.KV_OPEN ) )
srf2 = irit.surfrev(bcross)
irit.free(bcross)
irit.color(srf2, irit.GREEN)

#
#  Must make them compatible before doing some morphing.
#
irit.ffcompat(srf1, srf2)

#
#  Since we would like the animation to look as good as possible we need
#  to precompute as much as possible before invoking view to erase old
#  drawing and display new one. That is why we precompute isolines.
#

i = 0
while (i <= 1):
    irit.view(irit.smorph(srf1, srf2, i), irit.ON)
    i = i + step

#
#  Now dump 12 steps in this morphing sequence as 12 distinct files.
#
コード例 #6
0
circ = irit.pcircle((0, 0, 0), 1)

#
#  Example 1.
#

crv1 = irit.cbezier( irit.list( irit.ctlpt( irit.E2, (-0.5 ), 0 ), \
                                irit.ctlpt( irit.E2, (-0.5 ), 1.7 ), \
                                irit.ctlpt( irit.E2, 0.5, 1.7 ), \
                                irit.ctlpt( irit.E2, 0.5, 0 ) ) )
irit.color(crv1, irit.RED)
irit.attrib(crv1, "width", irit.GenRealObject(0.01))

arc1 = irit.cregion(circ, 0, 2)
irit.ffcompat(crv1, arc1)
irit.color(arc1, irit.GREEN)
irit.attrib(arc1, "width", irit.GenRealObject(0.01))

irit.interact(irit.list(crv1, arc1))

arc1match = irit.ffmatch( crv1, arc1, 50, 200, 2, 0,\
2 )

offsets1nomatch = irit.nil()
i = (-5)
while (i <= 5):
    irit.snoc(irit.symbsum(crv1, arc1 * irit.sc(i / 10.0)), offsets1nomatch)
    i = i + 1
irit.color(offsets1nomatch, irit.YELLOW)
all1a = irit.list(arc1, crv1, offsets1nomatch) * irit.sc(0.7) * irit.tx(
コード例 #7
0
iter_gl = irit.nil()
morph_step = 0.02

wgl_prisa2d_frame = srflistframecrvs(wgl_prisa2d, 0.02)
irit.color(wgl_prisa2d_frame, irit.RED)
wgl_prisa3d_frame = srflistframecrvs(wgl_prisa3d, 0.02)
irit.color(wgl_prisa3d_frame, irit.GREEN)

irit.view(irit.list(wgl_prisa2d_frame, wgl_prisa3d_frame), irit.ON)
bg_obj = irit.list(wgl_prisa2d_frame, wgl_prisa3d_frame)
irit.save("wglass.itd", irit.list(wgl_prisa2d_frame, wgl_prisa3d_frame))
i = 1
while (i <= irit.SizeOf(wgl_prisa3d)):
    min_gl = irit.nth(wgl_prisa2d, 1 + irit.SizeOf(wgl_prisa3d) - i)
    max_gl = irit.nth(wgl_prisa3d, i)
    irit.ffcompat(min_gl, max_gl)
    t = float(0)
    while (t <= 1):
        iter_gl = irit.smorph(min_gl, max_gl, t)
        irit.color(iter_gl, irit.CYAN)
        irit.view(irit.list(iter_gl, bg_obj), irit.ON)
        irit.save("wglass" + str(i) + "." + str(t / morph_step) + ".itd",
                  iter_gl)
        t = t + morph_step
    irit.snoc(max_gl, built_gl)
    irit.color(built_gl, irit.YELLOW)
    irit.view(irit.list(wgl_prisa2d_frame, wgl_prisa3d_frame, built_gl),
              irit.ON)
    bg_obj = irit.list(wgl_prisa2d_frame, wgl_prisa3d_frame, built_gl)
    irit.save("wglass" + str(i) + ".itd", built_gl)
    i = i + 1
コード例 #8
0
                                     irit.ctlpt( irit.E3, 1.3, 0, 0 ), \
                                     irit.ctlpt( irit.E3, 1.4, 0, 0 ), \
                                     irit.ctlpt( irit.E3, 1.5, 0, 0 ) ), irit.list( irit.KV_OPEN ) ) * irit.tx( (-0.75 ) )
irit.color( wave1, irit.RED )
irit.color( wave2, irit.GREEN )

irit.view( irit.list( wave1, wave2 ), irit.ON )
i = 0
while ( i <= 300 * speed ):
    c = irit.cmorph( wave1, wave2, 0, i/300.0 * speed )
    irit.color( c, irit.YELLOW )
    irit.view( irit.list( wave1, wave2, c ), irit.ON )
    i = i + 1

wave2a = irit.ffmatch( wave1, wave2, 20, 100, 2, 0, 2 )
irit.ffcompat( wave1, wave2a )
irit.save( "cmorph21", irit.list( wave1, wave2, wave2a ) )

i = 0
while ( i <= 100 * speed ):
    c = irit.cmorph( wave1, wave2a, 0, i/100.0 * speed )
    irit.color( c, irit.YELLOW )
    irit.view( irit.list( wave1, wave2, c ), irit.ON )
    i = i + 1
irit.free( wave1 )
irit.free( wave2 )
irit.free( wave2a )

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

wave1 = irit.cbspline( 3, irit.list( irit.ctlpt( irit.E3, 0, 0, 0 ), \
コード例 #9
0
def morphpage(srf1, srf2, step):
    irit.ffcompat(srf1, srf2)
    i = 0
    while (i <= 1):
        irit.snoc(irit.smorph(srf1, srf2, i), srfmorphlist)
        i = i + step