Some concerns ain’t easily separated
This commit is contained in:
parent
898c37647c
commit
8302a8c074
|
|
@ -28,7 +28,16 @@ pub fn main() {
|
||||||
let canvas = create_drawing_window("Refraction");
|
let canvas = create_drawing_window("Refraction");
|
||||||
canvas.draw(|gc| {
|
canvas.draw(|gc| {
|
||||||
gc.canvas_height(1000.0);
|
gc.canvas_height(1000.0);
|
||||||
|
gc.line_width(0.5);
|
||||||
|
|
||||||
|
// gc.canvas_height(100.0);
|
||||||
|
// gc.center_region(-100.0, -200.0, 100.0, 0.0);
|
||||||
|
// gc.line_width(0.1);
|
||||||
|
|
||||||
space.draw_background(gc);
|
space.draw_background(gc);
|
||||||
|
|
||||||
|
// gc.stroke_color(Color::Rgba(0.5, 1.0, 0.0, 1.0));
|
||||||
|
// space.draw_fan(gc, vec2(0.0, -0.5 * space.external_halflength), vec2(1.0, 1.0), 1.0);
|
||||||
space.draw_rays(gc, &space);
|
space.draw_rays(gc, &space);
|
||||||
|
|
||||||
let space = Rc::new(space);
|
let space = Rc::new(space);
|
||||||
|
|
@ -38,6 +47,8 @@ pub fn main() {
|
||||||
Box::new(Inside { space: space.clone() }),
|
Box::new(Inside { space: space.clone() }),
|
||||||
];
|
];
|
||||||
space.draw_rays(gc, parts.as_slice());
|
space.draw_rays(gc, parts.as_slice());
|
||||||
|
// gc.stroke_color(Color::Rgba(1.0, 0.0, 1.0, 1.0));
|
||||||
|
// parts.draw_fan(gc, vec2(0.0, space.u(-0.5 * space.external_halflength)), vec2(1.0, 1.0), 1.0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -162,7 +173,6 @@ impl Interesting for Coil {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn draw_rays(&self, gc: &mut Vec<Draw>, tracer: &(impl Rayable + ?Sized)) {
|
fn draw_rays(&self, gc: &mut Vec<Draw>, tracer: &(impl Rayable + ?Sized)) {
|
||||||
gc.line_width(0.5);
|
|
||||||
gc.stroke_color(Color::Rgba(1.0, 0.5, 0.0, 1.0));
|
gc.stroke_color(Color::Rgba(1.0, 0.5, 0.0, 1.0));
|
||||||
tracer.draw_fan(gc, vec2(-500.0, 0.0), vec2(1.0, 0.0), 1.0);
|
tracer.draw_fan(gc, vec2(-500.0, 0.0), vec2(1.0, 0.0), 1.0);
|
||||||
gc.stroke_color(Color::Rgba(0.0, 0.5, 1.0, 1.0));
|
gc.stroke_color(Color::Rgba(0.0, 0.5, 1.0, 1.0));
|
||||||
|
|
@ -181,9 +191,10 @@ impl Interesting for Rect {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn draw_rays(&self, gc: &mut Vec<Draw>, tracer: &(impl Rayable + ?Sized)) {
|
fn draw_rays(&self, gc: &mut Vec<Draw>, tracer: &(impl Rayable + ?Sized)) {
|
||||||
gc.line_width(0.5);
|
|
||||||
gc.stroke_color(Color::Rgba(1.0, 0.5, 0.0, 1.0));
|
gc.stroke_color(Color::Rgba(1.0, 0.5, 0.0, 1.0));
|
||||||
tracer.draw_fan(gc, vec2(-500.0, 0.0), vec2(1.0, 0.0), 1.0);
|
tracer.draw_fan(gc, vec2(-500.0, 0.0), vec2(1.0, 0.0), 1.0);
|
||||||
|
gc.stroke_color(Color::Rgba(0.5, 1.0, 0.0, 1.0));
|
||||||
|
tracer.draw_fan(gc, vec2(0.0, -0.5 * self.external_halflength), vec2(1.0, 1.0), 1.0);
|
||||||
gc.stroke_color(Color::Rgba(0.0, 0.5, 1.0, 1.0));
|
gc.stroke_color(Color::Rgba(0.0, 0.5, 1.0, 1.0));
|
||||||
tracer.draw_fan(gc, vec2(0.0, -0.5 * self.external_halflength), vec2(1.0, 1.0), 1.0);
|
tracer.draw_fan(gc, vec2(0.0, -0.5 * self.external_halflength), vec2(1.0, 1.0), 1.0);
|
||||||
gc.stroke_color(Color::Rgba(0.2, 0.7, 0.0, 1.0));
|
gc.stroke_color(Color::Rgba(0.2, 0.7, 0.0, 1.0));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user