#geometry #axis

axgeom

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

59 stable releases

1.12.1 Apr 28, 2022
1.9.7 Dec 31, 2021
1.9.3 Dec 29, 2020
1.7.7 Nov 23, 2020
0.1.0 Dec 1, 2017

#1 in #axis

Download history 108/week @ 2022-07-31 93/week @ 2022-08-07 84/week @ 2022-08-14 192/week @ 2022-08-21 68/week @ 2022-08-28 189/week @ 2022-09-04 127/week @ 2022-09-11 163/week @ 2022-09-18 79/week @ 2022-09-25 147/week @ 2022-10-02 82/week @ 2022-10-09 50/week @ 2022-10-16 77/week @ 2022-10-23 176/week @ 2022-10-30 199/week @ 2022-11-06 131/week @ 2022-11-13

585 downloads per month
Used in 13 crates (10 directly)

MIT license

38KB
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 performance in algorithms where you need to get values for a particular axis often.

Dependencies

~0.4–1MB
~24K SLoC