better square
This commit is contained in:
parent
13c8628590
commit
308697fe6a
1 changed files with 34 additions and 27 deletions
|
@ -137,33 +137,40 @@ impl StreamSource{
|
|||
pub fn get_shape(&self, current_lines: LaserPoints) -> LaserPoints {
|
||||
match self {
|
||||
Self::CurrentLines => current_lines,
|
||||
Self::Rectangle => LaserPoints { points: vec!(
|
||||
laser::Point{
|
||||
position:[0xFFF as f32, 0xFFF as f32],
|
||||
Self::Rectangle => {
|
||||
let mut points = Vec::new();
|
||||
let steps: usize = 10;
|
||||
for i in (0..=steps).rev()a {
|
||||
points.push(laser::Point{
|
||||
position:[0xFFF as f32, (0xFFF * i / steps) as f32],
|
||||
color: [1.,1.,1.],
|
||||
weight: 0,
|
||||
},
|
||||
laser::Point{
|
||||
position:[0xFFF as f32, 0.0],
|
||||
});
|
||||
}
|
||||
for i in (0..=steps).rev() {
|
||||
points.push(laser::Point{
|
||||
position:[(0xFFF * i / steps) as f32, 0.0],
|
||||
color: [1.,1.,1.],
|
||||
weight: 0,
|
||||
},
|
||||
laser::Point{
|
||||
position:[0.0, 0.0],
|
||||
});
|
||||
}
|
||||
for i in 0..=steps {
|
||||
points.push(laser::Point{
|
||||
position:[0.0 , (0xFFF * i / steps) as f32],
|
||||
color: [1.,1.,1.],
|
||||
weight: 0,
|
||||
},
|
||||
laser::Point{
|
||||
position:[0.0, 0xFFF as f32],
|
||||
});
|
||||
}
|
||||
for i in 0..=steps {
|
||||
points.push(laser::Point{
|
||||
position:[(0xFFF * i / steps) as f32 , 0xFFF as f32],
|
||||
color: [1.,1.,1.],
|
||||
weight: 0,
|
||||
});
|
||||
}
|
||||
// dbg!("{:?}", &points);
|
||||
LaserPoints { points, space: CoordinateSpace::Laser }
|
||||
},
|
||||
laser::Point{
|
||||
position:[0xFFF as f32, 0xFFF as f32],
|
||||
color: [1.,1.,1.],
|
||||
weight: 0,
|
||||
},
|
||||
), space: CoordinateSpace::Laser },
|
||||
Self::Grid => {
|
||||
let mut points = Vec::new();
|
||||
for i in (0..=0xFFF).step_by(0xFFF / 5) {
|
||||
|
|
Loading…
Reference in a new issue