home *** CD-ROM | disk | FTP | other *** search
- #python
-
-
- def Work(Document):
-
- mesh = k3dmesh(Document);
- pos1 = 0, 0, 0
- point1 = mesh.create_point(pos1)
- pos2 = 0, 1, 0
- point2 = mesh.create_point(pos2)
- pos3 = 1, 1, 0
- point3 = mesh.create_point(pos3)
- pos4 = 1, 0, 0
- point4 = mesh.create_point(pos4)
-
- polyhedron = mesh.create_polyhedron()
- face = polyhedron.create_face(point1)
- polyhedron.add_point_to_face(face, point2)
- polyhedron.add_point_to_face(face, point3)
- polyhedron.add_point_to_face(face, point4)
-
- # Create an object and an instance for it
- mesh_object = mesh.create_mesh_object()
- mesh_instance = mesh.create_mesh_instance(mesh_object)
-
-
- # Main
-
- # Find a valid document
- if not MyDocument:
- print "No document found\n"
- exit
-
- Work(MyDocument)
-
-
-