def wall = MKPOL:<<<0,0>,<8,0>,<0,6>,<8,6>,<4,8>>,<<1,2,3,4,5>>,<<1>>>; def door = CUBOID:<2,4>; def window = CUBOID:<1,2>; DEF House2D = @1:(STRUCT:< wall, T:1:2:door, T:<1,2>:<5,2>:window >); House2D; DEF myT=T:<1,2>:<0.5,2>:pol; DEF myT=S:<1,2>:<0.5,2>:pol; DEF myT=R:<1,2>:(PI/6):pol; DEF OUT=STRUCT:; out; DEF Mirror2(d::IsInt)(o::IsPol) = (STRUCT~[S:d:-1,ID]):o; DEF Triplet(o::IsPol) = (STRUCT~ [ID,T:1:x,T:1:(2*x)]):o WHERE x = SIZE:1:o END; def out=Triplet:House2d; out; def out=Mirror2:1:House2d; out; DEF OUT=Triplet:(Mirror:1:House2d); out; DEF OUT=Mirror:1:(Triplet:House2d); out; DEF car = (T:2:0.5 ~ STRUCT): WHERE body = MKPOL:, verts = <<0,0>,<3,0>,<7,0>,<6,2>,<4,2>,<3,1>,<1,1>>, cells = <<1,2,6,7>,<2,3,4,5,6>>, pols = <<1,2>>, wheel = S:<1,2>:<0.5,0.5>:(Circle:1:<18,1>) END; car; DEF coda (n::IsInt) = (STRUCT~##:n):< car, T:1:(1.2 * (SIZE:1:car)) >; DEF OUT=coda:6; DEF Queue (n::IsInt)(p::IsPol)= (STRUCT~##:n):< p, T:1:(1.2 * SIZE:1:p) >; DEF OUT=Queue:6:car; DEF Queue (n::IsInt)= (STRUCT~##:n)~[ ID, T:1~(K:1.2 * SIZE:1) ]; DEF OUT=Queue:6:car; DEF codaRuotata (n::IsInt)(gradi::IsReal) = STRUCT:< basis, (R:<1,2>:alpha ~ coda):n > WHERE basis = MKPOL:<<<0,0>,,>,<<1,2,3>>,<<1>>>, u = (SIZE:1 ~ coda):n * COS:alpha, v = (SIZE:1 ~ coda):n * SIN:alpha, alpha = gradi * PI/180 END; DEF OUT=codaRuotata:4:30; MatHom:<<1,5>, <0,1>>; DEF car=cuboid:<1,2>; DEF OUT=STRUCT:; DEF OUT2=OPTIMIZE:OUT; % oMat fungono solo con optimioze!!! % DEF Hy (b::IsReal) = (Mat ~ MatHom):<<1.0,b>,<0.0,1.0>>; DEF out=(optimize ~ STRUCT):; DEF story = (optimize ~ STRUCT): < Hy:1:car, T:1:12:car, (T:1:24 ~ Hy:-1):car >; story; % H disincronizato Kernel <-> PLasM DEF story = STRUCT: < H:2:<1,0>:car, T:1:12:car, (T:1:24 ~ H:2:<-1,0>):car >; story;% DEF story3D = R:<2,3>:(PI/2):(Story * QUOTE:<3.5>); DEF Transf2D (a,b,c,d::IsReal) = (MAT ~ MatHom):<,>; DEF OUT=(optimize ~ STRUCT ~ CAT ~ AA:[@1, ID]~ [ID, Transf2D:<2,0.5,0.5,3>]): (CUBOID:<1,1>); DEF InclinedTriple(deg::IsReal)(Object::IsPol) = STRUCT: < Object, transf:Object, (transf ~ transf):Object > WHERE transf = T:<1,2>:, x = SIZE:1:Object END; DEF OUT=STRUCT:<@1:(codaRuotata:5:8) , (InclinedTriple:8:(Mirror:1:House2D))>; out; DEF IsSqrMat2 = AND ~ [IsMat, EQ ~ [LEN, LEN ~ s1]]; DEF MatHom2 (m::IsSqrMat2) = AL:< AL:<1,#:(LEN:m):0>, (AA:AL ~ DISTL):<0,m> >; MatHom2:<<1,2,3>,<4,5,6>,<7,8,9>> ;