diff --git a/src/main.rs b/src/main.rs index 547c1e3..486339a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -78,14 +78,23 @@ fn prism(origin: Point, _radius: f32) -> Result { ), ]; + let faces = [ + Face::new(points.to_vec(), vec![1, 2, 3]), + Face::new(points.to_vec(), vec![0, 2, 3]), + Face::new(points.to_vec(), vec![0, 1, 3]), + Face::new(points.to_vec(), vec![0, 2, 1]), + ]; + Ok(format!( r#"{0} -f -3 -2 -1 -f -4 -2 -1 -f -4 -3 -1 -f -4 -2 -3 +{1} "#, - vertex_string(points.to_vec()) + vertex_string(points.to_vec()), + faces + .into_iter() + .map(|f| f.to_obj_string()) + .collect::>() + .join("\n") )) }