示例#1
0
c1 = irit.cbezier( irit.list( irit.ctlpt( irit.E3, (-1 ), 0, (-1 ) ), \
                              irit.ctlpt( irit.E3, 0, 1, (-1 ) ), \
                              irit.ctlpt( irit.E3, 0.3, 0, (-1 ) ), \
                              irit.ctlpt( irit.E3, 1, 0, (-1 ) ) ) )

c2 = irit.cbezier( irit.list( irit.ctlpt( irit.E3, (-1 ), 0, 1 ), \
                              irit.ctlpt( irit.E3, 0, 1, 1 ), \
                              irit.ctlpt( irit.E3, 0.3, 1, 1 ), \
                              irit.ctlpt( irit.E3, 1, 0, 1 ) ) )

r1 = irit.ruledsrf(c1, c2)

r2 = r1 * irit.rx(90)

c = irit.nth(
    irit.rrinter(irit.cmesh(r1, irit.ROW, 0), irit.cmesh(r1, irit.ROW, 1),
                 irit.cmesh(r2, irit.ROW, 0), irit.cmesh(r2, irit.ROW, 1), 10,
                 0), 1)

irit.color(c, irit.RED)
irit.adwidth(c, 3)

irit.interact(irit.list(r1, r2, c))

zerosetsrf = irit.rrinter(irit.cmesh(r1, irit.ROW, 0),
                          irit.cmesh(r1, irit.ROW, 1),
                          irit.cmesh(r2, irit.ROW, 0),
                          irit.cmesh(r2, irit.ROW, 1), 10, 1)
zerosetsrfe3 = irit.coerce(zerosetsrf, irit.E3) * irit.rotx((-90)) * irit.roty(
    (-90)) * irit.sz(0.1)
zeroset = irit.contour(zerosetsrfe3, irit.plane(0, 0, 1, 1e-005))
示例#2
0
printtest("mfrommv", irit.csurface(s, irit.COL, 0.22),
          irit.coerce(irit.mfrommv(ms, 0, 0.22), irit.CURVE_TYPE))
printtest("mfrommv", irit.csurface(s, irit.ROW, 0.672),
          irit.coerce(irit.mfrommv(ms, 1, 0.672), irit.CURVE_TYPE))
printtest("mfrommv", irit.csurface(s3, irit.ROW, 0.872),
          irit.coerce(irit.mfrommv(ms3, 1, 0.872), irit.CURVE_TYPE))

printtest("mfrommv", irit.strivar(t, irit.COL, 0.16),
          irit.coerce(irit.mfrommv(mt, 0, 0.16), irit.SURFACE_TYPE))
printtest("mfrommv", irit.strivar(t, irit.ROW, 0.96),
          irit.coerce(irit.mfrommv(mt, 1, 0.96), irit.SURFACE_TYPE))
printtest("mfrommv", irit.strivar(t, irit.DEPTH, 0.66),
          irit.coerce(irit.mfrommv(mt, 2, 0.66), irit.SURFACE_TYPE))

printtest("mfrommesh", irit.cmesh(s, irit.ROW, 2),
          irit.coerce(irit.mfrommesh(ms, 1, 2), irit.CURVE_TYPE))
printtest("mfrommesh", irit.cmesh(s, irit.COL, 0),
          irit.coerce(irit.mfrommesh(ms, 0, 0), irit.CURVE_TYPE))
printtest("mfrommesh", irit.cmesh(s3, irit.COL, 0),
          irit.coerce(irit.mfrommesh(ms3, 0, 0), irit.CURVE_TYPE))

printtest("mfrommesh", irit.smesh(t, irit.COL, 1),
          irit.coerce(irit.mfrommesh(mt, 0, 1), irit.SURFACE_TYPE))
printtest("mfrommesh", irit.smesh(t, irit.ROW, 2),
          irit.coerce(irit.mfrommesh(mt, 1, 2), irit.SURFACE_TYPE))
printtest("mfrommesh", irit.smesh(t, irit.DEPTH, 0),
          irit.coerce(irit.mfrommesh(mt, 2, 0), irit.SURFACE_TYPE))

printtest("meshsize", irit.GenRealObject(irit.GetMeshSize(c, 0)),
          irit.GenRealObject(irit.GetMeshSize(mc, 0)))
示例#3
0
while (t <= 0.9):
    cb1 = irit.csurface(sb, irit.ROW, t)
    irit.color(cb1, irit.GREEN)
    irit.snoc(cb1, cb_all)
    t = t + 0.1
if (display == 1):
    irit.interact(cb_all)

#
#  curves extraction from surface mesh. Note curves may be not on the surface.
#
cb_all = irit.list(irit.GetAxes())
irit.snoc(sb, cb_all)
t = 0
while (t <= 2):
    cb1 = irit.cmesh(sb, irit.COL, t)
    irit.color(cb1, irit.GREEN)
    irit.snoc(cb1, cb_all)
    t = t + 1
t = 0
while (t <= 4):
    cb1 = irit.cmesh(sb, irit.ROW, t)
    irit.color(cb1, irit.GREEN)
    irit.snoc(cb1, cb_all)
    t = t + 1

if (display == 1):
    irit.interact(cb_all)
    irit.viewstate("dsrfmesh", 1)
    irit.pause()
    irit.viewstate("dsrfmesh", 0)
示例#4
0
#  A chair base, to be used by most games below.
# 
chairbasecrv = irit.cbspline( 3, irit.list( irit.ctlpt( irit.E3, 0.6, 0, 0 ), \
                                            irit.ctlpt( irit.E3, 0.3, 0, 0.05 ), \
                                            irit.ctlpt( irit.E3, 0, 0, 0 ) ), irit.list( irit.KV_OPEN ) )
chairbasecross = ( irit.arc( ( 0.25, 0.05, 0 ), ( 0.25, 0, 0 ), ( 0.3, 0, 0 ) ) + \
				   irit.arc( ( 0.3, 0, 0 ), ( 0.25, 0, 0 ), ( 0.25, (-0.05 ), 0 ) ) + \
				   irit.cbspline( 3, irit.list( irit.ctlpt( irit.E3, 0.25, (-0.05 ), 0 ), \
										  irit.ctlpt( irit.E3, 0.22, (-0.05 ), 0 ), \
										  irit.ctlpt( irit.E3, 0, 0, 0 ), \
										  irit.ctlpt( irit.E3, (-0.22 ), (-0.05 ), 0 ), \
										  irit.ctlpt( irit.E3, (-0.25 ), (-0.05 ), 0 ) ), irit.list( irit.KV_OPEN ) ) + irit.arc( ( (-0.25 ), (-0.05 ), 0 ), ( (-0.25 ), 0, 0 ), ( (-0.3 ), 0, 0 ) ) + irit.arc( ( (-0.3 ), 0, 0 ), ( (-0.25 ), 0, 0 ), ( (-0.25 ), 0.05, 0 ) ) + \
										  irit.ctlpt( irit.E3, 0.25, 0.05, 0 ) )
chairbasemain = (-irit.sweepsrf( chairbasecross * irit.rotz( 90 ), chairbasecrv, irit.GenRealObject(0) ) )

chaircrv1 = irit.cmesh( chairbasemain, irit.ROW, 0 )
chaircrv1a = chaircrv1 * irit.trans( ( 0.06, 0, (-0.02 ) ) )
chaircrv1b = chaircrv1 * irit.scale( ( 0, 0.83, 0 ) ) * irit.trans( ( 0.66, 0, (-0.02 ) ) )
chairbasecover1 = (-irit.sfromcrvs( irit.list( chaircrv1, chaircrv1a, chaircrv1b ), 3, irit.KV_OPEN ) )
irit.free( chaircrv1 )
irit.free( chaircrv1a )
irit.free( chaircrv1b )
irit.free( chairbasecrv )

chaircrv2 = irit.cmesh( chairbasemain, irit.ROW, 2 )
chaircrv2a = chaircrv2 * irit.trans( ( (-0.06 ), 0, (-0.02 ) ) )
chaircrv2b = chaircrv2 * irit.scale( ( 0, 0.83, 0 ) ) * irit.trans( ( (-0.06 ), 0, (-0.02 ) ) )
chairbasecover2 = irit.sfromcrvs( irit.list( chaircrv2, chaircrv2a, chaircrv2b ), 3, irit.KV_OPEN )
irit.free( chaircrv2 )
irit.free( chaircrv2a )
irit.free( chaircrv2b )