#geometry #axis

axgeom

Library that provides ability to extract 1d ranges out of 2d objects

33 stable releases

✓ Uses Rust 2018 edition

new 1.6.2 Feb 21, 2020
1.5.0 Dec 30, 2019
1.2.6 Nov 30, 2019
1.0.7 Jul 25, 2019
0.1.0 Dec 1, 2017

#26 in Math

Download history 23/week @ 2019-11-07 34/week @ 2019-11-14 36/week @ 2019-11-21 224/week @ 2019-11-28 85/week @ 2019-12-05 157/week @ 2019-12-12 30/week @ 2019-12-19 52/week @ 2019-12-26 34/week @ 2020-01-02 119/week @ 2020-01-09 40/week @ 2020-01-16 39/week @ 2020-01-23 7/week @ 2020-01-30 16/week @ 2020-02-06 56/week @ 2020-02-13

308 downloads per month
Used in 7 crates (6 directly)

MIT/Apache

39KB
1K SLoC

axgeom

A library that provides a way to easily extract 1d ranges from a 2d container based off of the x or y axis statically through type parameters. This is useful if you have a function that operates on an axis that recursively calls itself but at the same time alternates its axis.

Example

extern crate axgeom;

#[test]
fn test(){
	use axgeom::AxisTrait;

	let a=axgeom::XAXISS;
	let b=a.next();
	let c=b.next();

	assert_eq!(generic(a),1);
	assert_eq!(generic(b),0);
	assert_eq!(generic(c),1);

	fn generic<T:AxisTrait>(a:T)->usize{
		//known at compile time
		if a.is_xaxis(){
			1
		}else{
			0
		}
	}
}

lib.rs:

A library that provides a way to easily extract 1d ranges from a 2d container based off of the x or y axis statically through

type parameters. This can help with performnace in algorithms where you need to get values for a particular axis often.

Dependencies

~315KB