| from openscad import *
|
| from pytexture import *
|
| house=cube([4,11,6]) | square([4,11]).roof().up(6)
|
| floor=cube([20,20,0.1])+ [-9,-4,0]
|
| faces = house.faces()
|
| right = find_face(faces,[1,0,0])
|
| left = find_face(faces,[-1,0,0])
|
| back = find_face(faces,[0,1,0])
|
| front = find_face(faces,[0,-1,0])
|
| roof1 = find_face(faces,[0.707,0,0.707])
|
| roof2 = find_face(faces,[-0.707,0,0.707])
|
| roof3 = find_face(faces,[0,0.707,0.707])
|
| roof4 = find_face(faces,[0,-0.707,0.707])
|
| floortop = find_face(floor.faces(),[0,0,1])
|
| brick= load_texture("brick.png",3,0.5,True)
|
| rooftile= load_texture("rooftile.png",1.5,0.3)
|
| grass = load_texture("grass.png",1.5,0.8)
|
| add_texture(right,brick)
|
| add_texture(left,brick)
|
| add_texture(front,brick,90)
|
| add_texture(back,brick,90)
|
| add_texture(roof1,rooftile)
|
| add_texture(roof2,rooftile)
|
| add_texture(roof3,rooftile)
|
| add_texture(roof4,rooftile)
|
| add_texture(floortop,grass)
|