extern crate kiss3d; extern crate nalgebra as na; use kiss3d::light::Light; use kiss3d::window::Window; use petgraph::visit::EdgeRef; use petgraph::visit::IntoEdgeReferences; use polyhedra::platonic_solids::make_icosahedron; use polyhedra::VertexGraph; fn main() { let mut window = Window::new("Kiss3d: Icosahedron"); window.set_light(Light::StickToCamera); let ico = make_icosahedron(); let graph: VertexGraph = ico.into(); while window.render() { for edge in graph.edge_references() { let source = edge.source(); let target = edge.target(); let source_pos = graph.node_weight(source).unwrap(); let target_pos = graph.node_weight(target).unwrap(); window.draw_line(source_pos, target_pos, &na::Point3::new(1.0, 1.0, 1.0)); } } }