irit.list(s1, psi1b) * irit.tx((-3)), irit.list(s2, psi2a) * irit.tx((-1)), irit.list(s2, psi2b) * irit.tx(1), irit.list(s3, psi3a) * irit.tx(3), irit.list(s3, psi3b) * irit.tx(5))) # ################################ s4 = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, (-0.051 ), (-0.035 ), (-0.042 ) ), \ irit.ctlpt( irit.E3, (-0.017 ), 0.209, (-0.009 ) ), \ irit.ctlpt( irit.E3, 0.143, 0.132, (-0.1 ) ), \ irit.ctlpt( irit.E3, 0.141, (-0.342 ), 0.157 ) ), irit.list( \ irit.ctlpt( irit.E3, (-0.009 ), (-0.13 ), (-0.082 ) ), \ irit.ctlpt( irit.E3, 0.098, (-0.025 ), (-0.042 ) ), \ irit.ctlpt( irit.E3, 0.114, 0.011, 0.327 ), \ irit.ctlpt( irit.E3, 0.47, 0.042, 0.133 ) ), irit.list( \ irit.ctlpt( irit.E3, 0.056, (-0.197 ), (-0.109 ) ), \ irit.ctlpt( irit.E3, 0.047, (-0.177 ), 0.247 ), \ irit.ctlpt( irit.E3, 0.168, (-0.204 ), 0.388 ), \ irit.ctlpt( irit.E3, 0.253, (-0.062 ), 0.474 ) ), irit.list( \ irit.ctlpt( irit.E3, 0.146, (-0.22 ), (-0.158 ) ), \ irit.ctlpt( irit.E3, 0.291, (-0.285 ), 0.025 ), \ irit.ctlpt( irit.E3, 0.389, (-0.308 ), 0.201 ), \ irit.ctlpt( irit.E3, 0.429, (-0.162 ), 0.224 ) ) ) ) irit.color(s4, irit.RED) si4 = irit.selfinter(s4, 0.01, (-1e-010), 90, 1) psi4a = makepolylines(si4) irit.color(psi4a, irit.GREEN) irit.adwidth(psi4a, 2) irit.interact(irit.list(irit.GetAxes(), s4, psi4a))
irit.ctlpt( irit.E3, 1, 1, 0.2 ) ) * irit.tz( 0.35 ) d = irit.duality(s) irit.color(d, irit.YELLOW) view_mat1 = irit.GetViewMatrix() * irit.sc(0.3) * irit.ty(0.5) irit.interact(irit.list(s, d, irit.GetAxes(), view_mat1)) # # A saddle surface # s = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, 0, 0, 0 ), \ irit.ctlpt( irit.E3, 0.05, 0.2, 0.1 ), \ irit.ctlpt( irit.E3, 0.1, 0.05, 0.2 ) ), irit.list( \ irit.ctlpt( irit.E2, 0.1, (-0.2 ) ), \ irit.ctlpt( irit.E3, 0.15, 0.05, 0.1 ), \ irit.ctlpt( irit.E3, 0.2, (-0.1 ), 0.2 ) ), irit.list( \ irit.ctlpt( irit.E1, 0.2 ), \ irit.ctlpt( irit.E3, 0.25, 0.2, 0.1 ), \ irit.ctlpt( irit.E3, 0.3, 0.05, 0.2 ) ) ) ) * irit.sc( 8 ) * irit.tx( (-1 ) ) * irit.ty( 1 ) * irit.tz( (-0.65 ) ) d = irit.duality(s) irit.color(d, irit.YELLOW) view_mat1 = irit.GetViewMatrix() * irit.sc(0.3) * irit.ty( (-0.2)) * irit.tx(0.4) irit.interact(irit.list(s, d, irit.GetAxes(), view_mat1)) # # A closed surface # c = irit.pcircle((0, 0, 0), 1)
i = i + 1 irit.color(intere3, irit.YELLOW) retval = irit.list(raygeom, intere3) return retval # ------------------------------------------------ # SADDLE # ------------------------------------------------ saddle = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, 0, 0, 0 ), \ irit.ctlpt( irit.E3, 0.05, 0.2, 0.1 ), \ irit.ctlpt( irit.E3, 0.1, 0.05, 0.2 ) ), irit.list( \ irit.ctlpt( irit.E3, 0.1, (-0.2 ), 0 ), \ irit.ctlpt( irit.E3, 0.15, 0.05, 0.1 ), \ irit.ctlpt( irit.E3, 0.2, (-0.1 ), 0.2 ) ), irit.list( \ irit.ctlpt( irit.E3, 0.2, 0, 0 ), \ irit.ctlpt( irit.E3, 0.25, 0.2, 0.1 ), \ irit.ctlpt( irit.E3, 0.3, 0.05, 0.2 ) ) ) ) * irit.sc( 4 ) irit.attrib(saddle, "rgb", irit.GenStrObject("55, 255, 255")) all1 = irit.list(saddle, irit.GetAxes(), evalsrfrayinter((0, (-0.5), 0), (1, 1, 1), saddle)) irit.interact(all1) all2 = irit.list(saddle, irit.GetAxes(), evalsrfrayinter(((-0.5), 0.1, 0.2), (2, 0.2, 0.2), saddle)) irit.interact(all2)
x = x + hstep irit.color(meancntrs, irit.YELLOW) minimal = irit.contour(h, irit.plane(1, 0, 0, 0.0001), srf) if (irit.ThisObject(minimal) == irit.POLY_TYPE): irit.color(minimal, irit.GREEN) irit.adwidth(minimal, 2) retval = irit.list(meancntrs, minimal) else: retval = meancntrs return retval bump = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, 0, 0, 0 ), \ irit.ctlpt( irit.E3, 1, 0, 0 ), \ irit.ctlpt( irit.E3, 2, 0, 0 ) ), irit.list( \ irit.ctlpt( irit.E3, 0, 1, 0 ), \ irit.ctlpt( irit.E3, 1, 1, 3 ), \ irit.ctlpt( irit.E3, 2, 1, 0 ) ), irit.list( \ irit.ctlpt( irit.E3, 0, 2, 0 ), \ irit.ctlpt( irit.E3, 1, 2, 0 ), \ irit.ctlpt( irit.E3, 2, 2, 0 ) ) ) ) irit.color(bump, irit.WHITE) irit.SetResolution(20) param = irit.sparabolc(bump, 1) irit.color(param, irit.MAGENTA) irit.interact(irit.list(bump, param)) irit.save("sparab1", irit.list(bump, param)) irit.interact( irit.list(evalgaussiancrvs(bump, 0, (-8.5), 6.5, 2),
crv1m = irit.creparam(irit.cmoebius(crv1, 5), 0, 1) all = irit.list(crveqlparamsegmarkers(crv1c), crveqlparamsegmarkers(crv1m) * irit.tz(0.1)) if (display == 1): irit.interact(all) irit.save("cc3comps", all) # ################################ srf = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, 0, 0, 0 ), \ irit.ctlpt( irit.E3, 0, 0.5, 1 ), \ irit.ctlpt( irit.E3, 0, 1, 0 ) ), irit.list( \ irit.ctlpt( irit.E3, 0.5, 0, 1 ), \ irit.ctlpt( irit.E3, 0.5, 0.5, 0 ), \ irit.ctlpt( irit.E3, 0.5, 1, 1 ) ), irit.list( \ irit.ctlpt( irit.E3, 1, 0, 1 ), \ irit.ctlpt( irit.E3, 1, 0.5, 0 ), \ irit.ctlpt( irit.E3, 1, 1, 1 ) ) ) ) irit.color(srf, irit.MAGENTA) crv = irit.circle((0.5, 0.5, 0), 0.4) irit.color(crv, irit.YELLOW) ccrv = irit.compose(srf, crv) irit.color(ccrv, irit.CYAN) if (display == 1): irit.interact(irit.list(srf, crv, ccrv))
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 ), \ irit.ctlpt( irit.E3, 2.3, 1, 0 ), \ irit.ctlpt( irit.E3, 2, 2, 2 ) ), irit.list( \ irit.ctlpt( irit.E3, 3.1, 0, 0 ), \ irit.ctlpt( irit.E3, 3.3, 1.5, 2 ), \ irit.ctlpt( irit.E3, 3, 2.1, 0 ) ), irit.list( \ irit.ctlpt( irit.E3, 4.1, 0, 1 ), \ irit.ctlpt( irit.E3, 4.3, 1, 0 ), \ irit.ctlpt( irit.E3, 4, 2, 1 ) ) ) cb = irit.cbezier(cbzr) * irit.scale((0.7, 1.4, 1)) irit.color(cb, irit.RED) sb = irit.sbezier(sbzr) irit.color(sb, irit.RED) irit.save( "bezier1", irit.list(irit.fforder(cb), irit.ffmsize(cb), irit.ffctlpts(cb), irit.fforder(sb), irit.ffmsize(sb), irit.ffctlpts(sb))) if (display == 1): irit.interact(irit.list(irit.GetAxes(), cb, sb)) irit.viewstate("dsrfmesh", 1) irit.pause() irit.viewstate("dsrfmesh", 0) irit.pause()
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 ), \ irit.ctlpt( irit.E3, 2.3, 1, 0 ), \ irit.ctlpt( irit.E3, 2, 2, 2 ) ), irit.list( \ irit.ctlpt( irit.E3, 3.1, 0, 0 ), \ irit.ctlpt( irit.E3, 3.3, 1.5, 2 ), \ irit.ctlpt( irit.E3, 3, 2.1, 0 ) ), irit.list( \ irit.ctlpt( irit.E3, 4.1, 0, 1 ), \ irit.ctlpt( irit.E3, 4.3, 1, 0 ), \ irit.ctlpt( irit.E3, 4, 2, 1 ) ) ) sb1 = irit.sbezier(spts) sb2 = irit.sbspline( 3, 3, spts, irit.list(irit.list(irit.KV_OPEN), irit.list(irit.KV_OPEN))) irit.free(spts) # # Constructor using TrimSrf # tcrv1 = irit.cbspline( 2, irit.list( irit.ctlpt( irit.E2, 0.3, 0.3 ), \ irit.ctlpt( irit.E2, 0.7, 0.3 ), \ irit.ctlpt( irit.E2, 0.7, 0.7 ), \ irit.ctlpt( irit.E2, 0.3, 0.7 ), \ irit.ctlpt( irit.E2, 0.3, 0.3 ) ), irit.list( irit.KV_OPEN ) ) tcrv2 = irit.circle((0.5, 0.5, 0), 0.25) tcrv3 = irit.cbspline( 3, irit.list( irit.ctlpt( irit.E2, 0.3, 0.3 ), \
testccdistfunc(crv1b, crv2b, irit.list(0.5)))) irit.free(crv1a) irit.free(crv2a) irit.free(crv1b) irit.free(crv2b) # ############################################################################ sad1 = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, 0, 0, 0 ), \ irit.ctlpt( irit.E3, 0.05, 0.2, 0.1 ), \ irit.ctlpt( irit.E3, 0.1, 0.05, 0.2 ) ), irit.list( \ irit.ctlpt( irit.E2, 0.1, (-0.2 ) ), \ irit.ctlpt( irit.E3, 0.15, 0.05, 0.1 ), \ irit.ctlpt( irit.E3, 0.2, (-0.1 ), 0.2 ) ), irit.list( \ irit.ctlpt( irit.E1, 0.2 ), \ irit.ctlpt( irit.E3, 0.25, 0.2, 0.1 ), \ irit.ctlpt( irit.E3, 0.3, 0.05, 0.2 ) ) ) ) sad2 = irit.offset(sad1, irit.GenRealObject((0.2)), 1, 0) irit.save( "dist2ff6", irit.list(testssdistfunc(sad1, sad2, irit.nil()), testssdistfunc(sad1, sad2, irit.list(0.25, 0.5, 0.75)))) irit.free(sad1) irit.free(sad2) # ############################################################################
i = 1 while (i <= irit.SizeOf(uvxyzpts)): uvxyzpt = irit.nth(uvxyzpts, i) irit.snoc( irit.ctlpt(irit.E3, irit.coord(uvxyzpt, 3), irit.coord(uvxyzpt, 4), irit.coord(uvxyzpt, 5)), retval) i = i + 1 return retval # ############################################################################ # Surface - Surface bisectors. # ############################################################################ s1 = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, 0, 0, 0 ), \ irit.ctlpt( irit.E3, 2, 0, 0 ) ), irit.list( \ irit.ctlpt( irit.E3, 0, 2, 0 ), \ irit.ctlpt( irit.E3, 2, 2, 0 ) ) ) ) * irit.tx( (-1 ) ) * irit.ty( (-1 ) ) irit.color(s1, irit.RED) s2 = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, 0, 0, 2 ), \ irit.ctlpt( irit.E3, 1, 0, 1 ), \ irit.ctlpt( irit.E3, 2, 0, 2 ) ), irit.list( \ irit.ctlpt( irit.E3, 0, 1, 1 ), \ irit.ctlpt( irit.E3, 1, 1, 0 ), \ irit.ctlpt( irit.E3, 2, 1, 1 ) ), irit.list( \ irit.ctlpt( irit.E3, 0, 2, 2 ), \ irit.ctlpt( irit.E3, 1, 2, 1 ), \ irit.ctlpt( irit.E3, 2, 2, 2 ) ) ) ) * irit.tx( (-1 ) ) * irit.ty( (-1 ) ) irit.color(s2, irit.MAGENTA) ms1 = irit.coerce(s1, irit.MULTIVAR_TYPE)
tv2 = irit.extrude(s1, (0, 1, 0.5), 0) tv3 = irit.extrude(s2, (0, 0.2, (-0.4)), 0) irit.interact(irit.list(tv2, tv3, s1, s2)) irit.save("trivar11", irit.list(tv1, tv2, tv3)) irit.free(s1) irit.free(s2) # # Constructs a trivariate from a list of surfaces. # s1 = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, (-0.5 ), (-0.5 ), 0 ), \ irit.ctlpt( irit.E3, (-0.5 ), 0.5, 0 ) ), irit.list( \ irit.ctlpt( irit.E3, 0.5, (-0.5 ), 0 ), \ irit.ctlpt( irit.E3, 0.5, 0.5, 0 ) ) ) ) * irit.sc( 0.3 ) srfs = irit.list(s1 * irit.sc(2), s1 * irit.sx(1.4) * irit.ry(45) * irit.tz(1), s1 * irit.ry(90) * irit.trans((1, 0, 1.1)), s1 * irit.sx(1.4) * irit.ry(135) * irit.trans((2, 0, 1)), s1 * irit.sc(2) * irit.ry(180) * irit.trans((2, 0, 0))) irit.color(srfs, irit.RED) irit.free(s1) ts1 = irit.tfromsrfs(srfs, 3, irit.KV_FLOAT) irit.color(ts1, irit.GREEN) ts2 = irit.tfromsrfs(srfs, 5, irit.KV_OPEN) irit.color(ts2, irit.YELLOW)
mc = irit.mbezier( irit.list( 4 ), irit.list( irit.ctlpt( irit.E3, (-1 ), 0.5, 2 ), \ irit.ctlpt( irit.E3, 0, 0, 2 ), \ irit.ctlpt( irit.E3, 1, (-1 ), 2 ), \ irit.ctlpt( irit.E3, 1, 1, 2 ) ) ) mc2 = irit.mpower( irit.list( 4 ), irit.list( irit.ctlpt( irit.E3, (-1 ), 0.5, 2 ), \ irit.ctlpt( irit.E3, 3, (-1.5 ), 0 ), \ irit.ctlpt( irit.E3, 0, (-1.5 ), 0 ), \ irit.ctlpt( irit.E3, (-1 ), 3.5, 0 ) ) ) s = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, 0, 0, 0 ), \ irit.ctlpt( irit.E3, 0.25, 1, 1 ), \ irit.ctlpt( irit.E3, 0.5, 0.25, 2 ) ), irit.list( \ irit.ctlpt( irit.E3, 0.5, (-1 ), 3 ), \ irit.ctlpt( irit.E3, 0.75, 0.25, 4 ), \ irit.ctlpt( irit.E3, 1, (-0.5 ), 5 ) ), irit.list( \ irit.ctlpt( irit.E3, 1, 0, 6 ), \ irit.ctlpt( irit.E3, 1.25, 1, 7 ), \ irit.ctlpt( irit.E3, 1.3, 0.25, 8 ) ) ) ) irit.attrib(s, "color", irit.GenRealObject(7)) irit.attrib(s, "rgb", irit.GenStrObject("244,164,96")) s3 = irit.sbspline( 3, 3, irit.list( irit.list( irit.ctlpt( irit.E3, 0, 0, 0 ), \ irit.ctlpt( irit.E3, 0.25, 1, 1 ), \ irit.ctlpt( irit.E3, 0.5, 0.25, 2 ) ), irit.list( \ irit.ctlpt( irit.E3, 0.5, (-1 ), 3 ), \ irit.ctlpt( irit.E3, 0.75, 0.25, 4 ), \ irit.ctlpt( irit.E3, 1, (-0.5 ), 5 ) ), irit.list( \ irit.ctlpt( irit.E3, 1, 0, 6 ), \ irit.ctlpt( irit.E3, 1.25, 1, 7 ), \
n = irit.SizeOf(irit.nth(retval, 1)) / 2.0 else: n = 0 irit.printf("found %d intersection connected components.\n", irit.list(n)) return retval # # 1. Simple close loop intersection. Both srfs are bi-quadratic polynomials. # s1 = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, 0.1, 0, 1 ), \ irit.ctlpt( irit.E3, 0.3, 1, 0.5 ), \ irit.ctlpt( irit.E3, 0, 2, 1 ) ), irit.list( \ irit.ctlpt( irit.E3, 1.1, 0, 0.5 ), \ irit.ctlpt( irit.E3, 1.3, 1, 0 ), \ irit.ctlpt( irit.E3, 1, 2, 0.5 ) ), irit.list( \ irit.ctlpt( irit.E3, 2.1, 0, 1.1 ), \ irit.ctlpt( irit.E3, 2.3, 1, 0.4 ), \ irit.ctlpt( irit.E3, 2, 2, 1.2 ) ) ) ) s2 = s1 * irit.scale((1, 1, (-1))) * irit.tz(1.2) irit.color(s1, irit.RED) irit.color(s2, irit.GREEN) i = testinter(s1, s2) all = irit.list(s1, s2, i) irit.interact(all) irit.save("ssi1", all)
# # Some example of using the hermite function. # # Gershon Elber, April 1995 # save_mat = irit.GetViewMatrix() irit.SetViewMatrix(irit.GetViewMatrix() * irit.sc(0.4)) irit.viewobj(irit.GetViewMatrix()) srf1 = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, 0.1, 0, 0 ), \ irit.ctlpt( irit.E3, 0.3, 1, 0 ), \ irit.ctlpt( irit.E3, 0, 2, 0 ) ), irit.list( \ irit.ctlpt( irit.E3, 1.1, 0, 0 ), \ irit.ctlpt( irit.E3, 1.3, 1, 0 ), \ irit.ctlpt( irit.E3, 1, 2, 0 ) ), irit.list( \ irit.ctlpt( irit.E3, 2.1, 0, 0 ), \ irit.ctlpt( irit.E3, 2.3, 1, 0 ), \ irit.ctlpt( irit.E3, 2, 2, 0 ) ), irit.list( \ irit.ctlpt( irit.E3, 3.1, 0, 0 ), \ irit.ctlpt( irit.E3, 3.3, 1, 0 ), \ irit.ctlpt( irit.E3, 3, 2, 0 ) ) ) ) tcrv1 = irit.cbspline( 3, irit.list( irit.ctlpt( irit.E2, 0.5, 0.25 ), \ irit.ctlpt( irit.E2, 0.8, 0.25 ), \ irit.ctlpt( irit.E2, 0.8, 0.75 ), \ irit.ctlpt( irit.E2, 0.6, 0.75 ), \ irit.ctlpt( irit.E2, 0.6, 0.9 ), \ irit.ctlpt( irit.E2, 0.4, 0.9 ), \ irit.ctlpt( irit.E2, 0.4, 0.75 ), \ irit.ctlpt( irit.E2, 0.2, 0.75 ), \ irit.ctlpt( irit.E2, 0.2, 0.25 ), \
inter = irit.ssinter(s1, s2, 1, eps, 2) tm = irit.time(0) irit.color(inter, irit.GREEN) irit.view(irit.list(s1, s2, inter), irit.ON) irit.printf( "rz alignment: length of intersection curve %d, time = %f sec.\n", irit.list(irit.SizeOf(irit.nth(irit.nth(inter, 1), 1)), tm)) # ############################################################################ s1 = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, 0, 0, 0 ), \ irit.ctlpt( irit.E3, 0.05, 0.2, 0.1 ), \ irit.ctlpt( irit.E3, 0.1, 0.05, 0.2 ) ), irit.list( \ irit.ctlpt( irit.E3, 0.1, (-0.2 ), 0 ), \ irit.ctlpt( irit.E3, 0.15, 0.05, 0.1 ), \ irit.ctlpt( irit.E3, 0.2, (-0.1 ), 0.2 ) ), irit.list( \ irit.ctlpt( irit.E3, 0.2, 0, 0 ), \ irit.ctlpt( irit.E3, 0.25, 0.2, 0.1 ), \ irit.ctlpt( irit.E3, 0.3, 0.05, 0.2 ) ) ) ) * irit.sc( 4 ) * irit.sy( 0.3 ) irit.color(s1, irit.RED) s2 = s1 * irit.rx(4) * irit.rz(2) irit.color(s2, irit.BLUE) testssi(s1, s2, 0.1) testssi(s1, s2, 0.03) s1 = s1 * irit.sy(0.1) s2 = s2 * irit.sy(0.1) irit.color(s1, irit.RED)
a = a + (-0.01) irit.pause() # ############################################################################ # # A biquartic surface # pt = irit.point(0, 0, 0) irit.color(pt, irit.CYAN) srf = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, (-1 ), (-1 ), 0 ), \ irit.ctlpt( irit.E3, 0, (-1 ), 0.3 ), \ irit.ctlpt( irit.E3, 1, (-1 ), 0 ) ), irit.list( \ irit.ctlpt( irit.E3, (-1 ), 0, 0.3 ), \ irit.ctlpt( irit.E3, 0, 0, 0.6 ), \ irit.ctlpt( irit.E3, 1, 0, 0.3 ) ), irit.list( \ irit.ctlpt( irit.E3, (-1 ), 1, 0 ), \ irit.ctlpt( irit.E3, 0, 1, 0.3 ), \ irit.ctlpt( irit.E3, 1, 1, 0 ) ) ) ) irit.attrib(srf, "color", irit.GenRealObject(14)) # # Modifying the surface. # irit.viewobj(view_mat3d) a = (-0.5) while (a <= 1.5): newsrf = irit.seditpt(srf, irit.ctlpt(irit.E3, 0, 0, a), 1, 1) orth = irit.orthotomc(newsrf, irit.Fetch3TupleObject(pt), 2) irit.color(orth, irit.GREEN)
irit.ctlpt( irit.E3, 0, 0, 2 ), \ irit.ctlpt( irit.E3, 1, (-1 ), 2 ), \ irit.ctlpt( irit.E3, 1, 1, 2 ) ) ) irit.attrib(c1, "width", irit.GenRealObject(0.02)) irit.attrib(c1, "color", irit.GenRealObject(14)) c2 = irit.pcircle((1, 2, 3), 1.25) c2 = irit.creparam(c2, 0, 1) irit.attrib(c2, "width", irit.GenRealObject(0.02)) irit.attrib(c2, "color", irit.GenRealObject(15)) s1 = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, 0, 0, 0 ), \ irit.ctlpt( irit.E3, 0.25, 1, 0.5 ), \ irit.ctlpt( irit.E3, 0.5, 0.25, 1 ) ), irit.list( \ irit.ctlpt( irit.E3, 0.5, (-1 ), 0 ), \ irit.ctlpt( irit.E3, 0.75, 0.25, 0.5 ), \ irit.ctlpt( irit.E3, 1, (-0.5 ), 1 ) ), irit.list( \ irit.ctlpt( irit.E3, 1, 0, 0 ), \ irit.ctlpt( irit.E3, 1.25, 1, 0.5 ), \ irit.ctlpt( irit.E3, 1.3, 0.25, 1 ) ) ) ) irit.attrib(s1, "color", irit.GenRealObject(7)) irit.attrib(s1, "rgb", irit.GenStrObject("244,164,96")) s2 = irit.spheresrf(1.25) # s2 = sregion( sregion( sphereSrf( 1.25 ), row, 0, 2 ), col, 0, 4 ); s2 = irit.sreparam( irit.sreparam( s2, irit.ROW, 0, 1 ), irit.COL, 0,\ 1 ) irit.attrib(s2, "color", irit.GenRealObject(7)) irit.attrib(s2, "rgb", irit.GenStrObject("164,244,96")) t1 = irit.tbezier( irit.list( irit.list( irit.list( irit.ctlpt( irit.E3, (-0.69 ), 0.31, (-0.6 ) ), \
# # This file existance is justified to demonstrate loops on free form trans.: # save_mat = irit.GetViewMatrix() irit.SetViewMatrix( irit.GetViewMatrix() * irit.scale( ( 0.7, 0.7, 0.7 ) ) ) cbzr = irit.cbezier( irit.list( irit.ctlpt( irit.P3, 1, 0, 0, 0 ), \ irit.ctlpt( irit.P3, 0.707, 0.707, 0, 0 ), \ irit.ctlpt( irit.P3, 1, 1, 1, 0 ) ) ) sbzr = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, 0, 0, 0.5 ), \ irit.ctlpt( irit.E3, 0, 0.5, (-1 ) ), \ irit.ctlpt( irit.E3, 0, 1, 0.5 ) ), irit.list( \ irit.ctlpt( irit.E3, 0.5, 0, (-0.5 ) ), \ irit.ctlpt( irit.E3, 0.5, 0.5, 1 ), \ irit.ctlpt( irit.E3, 0.5, 1, (-0.5 ) ) ), irit.list( \ irit.ctlpt( irit.E3, 1, 0, 0.5 ), \ irit.ctlpt( irit.E3, 1, 0.5, (-1 ) ), \ irit.ctlpt( irit.E3, 1, 1, 0.5 ) ) ) ) rot10x = irit.rotx( 10 ) rot10y = irit.roty( 10 ) rot10z = irit.rotz( 10 ) irit.interact( irit.list( irit.GetAxes(), cbzr, sbzr ) ) # # Rotate around the X Axes(): #
irit.save( "ffptdst4", irit.list( e2pts, c2 ) ) # # Some examples for surfaces. # irit.SetViewMatrix( save_mat) irit.viewobj( irit.GetViewMatrix() ) s1 = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, (-0.5 ), (-1 ), 0 ), \ irit.ctlpt( irit.E3, 0.4, 0, 0.1 ), \ irit.ctlpt( irit.E3, (-0.5 ), 1, 0 ) ), irit.list( \ irit.ctlpt( irit.E3, 0, (-0.7 ), 0.1 ), \ irit.ctlpt( irit.E3, 0, 0, 0 ), \ irit.ctlpt( irit.E3, 0, 0.7, (-0.2 ) ) ), irit.list( \ irit.ctlpt( irit.E3, 0.5, (-1 ), 0.1 ), \ irit.ctlpt( irit.E3, (-0.4 ), 0, 0 ), \ irit.ctlpt( irit.E3, 0.5, 1, (-0.2 ) ) ) ) ) irit.color( s1, irit.MAGENTA ) pts = irit.ffptdist( s1, 0, 1000 ) e3pts = irit.nil( ) i = 1 while ( i <= irit.SizeOf( pts ) ): prmpt = irit.nth( pts, i ) pt = irit.seval( s1, irit.FetchRealObject(irit.coord( prmpt, 0 )), irit.FetchRealObject(irit.coord( prmpt, 1 ) )) irit.snoc( pt, e3pts ) i = i + 1 irit.interact( irit.list( e3pts, s1 ) )
return retval save_res = irit.GetResolution() irit.SetResolution(40) # ############################################################################ s1 = irit.sbezier( irit.list( irit.list( irit.ctlpt( irit.E3, (-1 ), (-1 ), 0 ), \ irit.ctlpt( irit.E3, (-0.635 ), (-0.743 ), 2.04 ), \ irit.ctlpt( irit.E3, 0.333, (-1 ), (-0.8 ) ), \ irit.ctlpt( irit.E3, 1.83, (-1.1 ), 0.675 ) ), irit.list( \ irit.ctlpt( irit.E3, (-1 ), (-0.333 ), 2.8 ), \ irit.ctlpt( irit.E3, (-0.333 ), (-0.333 ), (-4 ) ), \ irit.ctlpt( irit.E3, 0.333, (-0.333 ), 4 ), \ irit.ctlpt( irit.E3, 0.846, (-0.305 ), (-4.72 ) ) ), irit.list( \ irit.ctlpt( irit.E3, (-1 ), 0.333, 1.92 ), \ irit.ctlpt( irit.E3, (-0.333 ), 0.333, 2.4 ), \ irit.ctlpt( irit.E3, 0.333, 0.333, 3.2 ), \ irit.ctlpt( irit.E3, 1, 0.333, 1.6 ) ), irit.list( \ irit.ctlpt( irit.E3, (-1.14 ), 1.21, (-1.49 ) ), \ irit.ctlpt( irit.E3, (-0.333 ), 1, 2.8 ), \ irit.ctlpt( irit.E3, 0.333, 1, 2 ), \ irit.ctlpt( irit.E3, 0.741, 1.47, (-0.622 ) ) ) ) ) irit.attrib(s1, "transp", irit.GenRealObject(0.5)) parab = irit.sparabolc(s1, 1) irit.color(parab, irit.GREEN) f1 = irit.sflecnodal(s1, 0.05, (-1e-006), 0.1, 3, 0) pt1e3 = evalflecnodalpts(s1, f1) irit.color(pt1e3, irit.YELLOW)