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::geodesic::build_icosahedral_goldberg; use polyhedra::*; fn main() { let mut window = Window::new("Kiss3d: Goldberg Polyhedron"); window.set_light(Light::StickToCamera); let ico = build_icosahedral_goldberg(2); 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)); } } }