Skip to content

Commit

Permalink
docs: run doctests against README
Browse files Browse the repository at this point in the history
  • Loading branch information
cbgbt committed Nov 24, 2024
1 parent 31e39d0 commit 664fcb2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ The following Rust code draws the cube which is included as an example in the
original `ln` repo.

```rust
use raydeon::shapes::RectPrism;
use raydeon::shapes::AxisAlignedCuboid;
use raydeon::{Camera, Scene, WPoint3, WVec3};
use std::sync::Arc;

fn main() {
env_logger::Builder::from_default_env()
.format_timestamp_nanos()
.init();
env_logger::Builder::from_default_env()
.format_timestamp_nanos()
.init();

let scene = Scene::new(vec![Arc::new(RectPrism::new(
fn main() {
let scene = Scene::new(vec![Arc::new(AxisAlignedCuboid::new(
WVec3::new(-1.0, -1.0, -1.0),
WVec3::new(1.0, 1.0, 1.0),
))]);
Expand All @@ -45,7 +45,7 @@ fn main() {
let znear = 0.1;
let zfar = 10.0;

let camera = Camera::look_at(eye, focus, up).perspective(fovy, width, height, znear, zfar);
let camera = Camera::new().look_at(eye, focus, up).perspective(fovy, width, height, znear, zfar);

let paths = scene.attach_camera(camera).render();

Expand Down
1 change: 1 addition & 0 deletions raydeon/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[doc = include_str!("../../README.md")]
pub(crate) mod bvh;
pub mod camera;
pub mod path;
Expand Down

0 comments on commit 664fcb2

Please sign in to comment.