Ejemplo n.º 1
0
def testssi(s1, s2, eps):
    tm = irit.time(1)
    inter = irit.ssinter(s1, s2, 1, eps, 0)
    tm = irit.time(0)
    irit.color(inter, irit.GREEN)
    irit.view(irit.list(s1, s2, inter), irit.ON)
    irit.printf(
        "no alignment: length of intersection curve %d, time = %f sec.\n",
        irit.list(irit.SizeOf(irit.nth(irit.nth(inter, 1), 1)), tm))
    tm = irit.time(1)
    inter = irit.ssinter(s1, s2, 1, eps, 1)
    tm = irit.time(0)
    irit.color(inter, irit.GREEN)
    irit.view(irit.list(s1, s2, inter), irit.ON)
    irit.printf(
        "z alignment:  length of intersection curve %d, time = %f sec.\n",
        irit.list(irit.SizeOf(irit.nth(irit.nth(inter, 1), 1)), tm))
    tm = irit.time(1)
    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))
Ejemplo n.º 2
0
#This is an IRIT script and as such requires both math and irit import:
#
import math
import irit
#

#
#  This solid was taken from: Geometric Modeling,
#  by Michael E. Mortenson page 441, figure 10.9
#
#                                Created by Gershon Elber,       Apr 90
#

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