diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a22fff5..775082c 100644 Binary files a/.github/workflows/CI.yml and b/.github/workflows/CI.yml differ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9a3de0c..838762a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,8 +1,8 @@ -# How to contribute +### How to contribute All contributions welcome -- Ideas, feature requests 💡 -- bug reports 🪲 +- [Ideas, feature requests](https://github.com/dancergraham/e57-python/issues) 💡 +- [bug reports](https://github.com/dancergraham/e57-python/issues) 🪲 - documentation 📃 - sample files 🌫️ - tests @@ -10,9 +10,7 @@ All contributions welcome - python code 🐍 - tell your friends, share the project online / via social media, ... 🗣️ -## Best practice - -If you know how, you should fork the repo, create a new branch and then submit a pull request. +Fork the repo, create a new branch and then submit a pull request. (If you are new to GitHub, you might start with a basic tutorial and check out a more detailed guide to pull requests.) diff --git a/Cargo.toml b/Cargo.toml index 8714fda..bbb3e7c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "e57-python" -version = "0.1.0-a8" +version = "0.2.0-a1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -9,7 +9,7 @@ name = "e57" crate-type = ["cdylib"] [dependencies] -pyo3 = "0.20.3" -e57 = { version = "0.10.5",features =["crc32c"]} -numpy = "0.20.0" +pyo3 = "0.21.2" +e57 = { version = "0.11.7",features =["crc32c"]} +numpy = "0.21.0" ndarray = "0.15.6" diff --git a/src/lib.rs b/src/lib.rs index b5fd198..d882385 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -52,8 +52,6 @@ unsafe fn read_points(py: Python<'_>, filepath: &str) -> PyResult { let mut color_vec = Vec::with_capacity(pc.records as usize * 3); let mut intensity_vec = Vec::with_capacity(pc.records as usize); let mut nrows = 0; - let intensity_min = pc.intensity_limits.map(|limits| limits.min).unwrap_or(0.0); - let intensity_max = pc.intensity_limits.map(|limits| limits.max).unwrap_or(1.0); for pointcloud in file.pointclouds() { let mut iter = file .pointcloud_simple(&pointcloud) @@ -61,6 +59,7 @@ unsafe fn read_points(py: Python<'_>, filepath: &str) -> PyResult { iter.spherical_to_cartesian(true); iter.cartesian_to_spherical(false); iter.intensity_to_color(true); + iter.normalize_intensity(false); iter.apply_pose(true); for p in iter { @@ -73,8 +72,7 @@ unsafe fn read_points(py: Python<'_>, filepath: &str) -> PyResult { color_vec.extend([color.red, color.green, color.blue]) } if let Some(intensity) = p.intensity { - let rescaled_intensity = (intensity * (intensity_max - intensity_min)) + intensity_min; - intensity_vec.push(rescaled_intensity) + intensity_vec.push(intensity); } } }