#geometry #axis

axgeom

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

46 stable releases

new 1.7.7 Nov 23, 2020
1.6.6 Jul 21, 2020
1.6.2 Feb 21, 2020
1.5.0 Dec 30, 2019
0.1.0 Dec 1, 2017

#28 in Math

Download history 94/week @ 2020-08-09 92/week @ 2020-08-16 58/week @ 2020-08-23 19/week @ 2020-08-30 173/week @ 2020-09-06 19/week @ 2020-09-13 15/week @ 2020-09-20 20/week @ 2020-09-27 22/week @ 2020-10-04 18/week @ 2020-10-11 59/week @ 2020-10-18 26/week @ 2020-10-25 60/week @ 2020-11-01 155/week @ 2020-11-08 38/week @ 2020-11-15 115/week @ 2020-11-22

230 downloads per month
Used in 8 crates (7 directly)

MIT/Apache

40KB
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

~0.7–1.3MB
~31K SLoC