Trait colain::Segment[][src]

pub trait Segment<T: Copy> {
    fn start(&self) -> [T; 2];
fn end(&self) -> [T; 2]; }

Reinterpret [T; 4] as two points

use std::fs::File;
use std::io::prelude::*;
use colain::{
	CLI, Segment, Point,
	clitype::*
};

let mut buf: Vec<u8> = Vec::new();
File::open("example.cli").unwrap().read_to_end(&mut buf).unwrap();

let model = CLI::<LongCLI>::new(&buf).unwrap();
let x: f32 = model.iter().next().unwrap() // first layer
		.iter_hatches().next().unwrap() // first set of hatches in layer
		.iter().next().unwrap() // first segment in hatches
		.start() // first point in segment
		.x(); // x value of first point in segment

Required methods

fn start(&self) -> [T; 2][src]

Get the first point

fn end(&self) -> [T; 2][src]

Get the second point

Loading content...

Implementations on Foreign Types

impl<T: Copy> Segment<T> for [T; 4][src]

Loading content...

Implementors

Loading content...