Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eadf committed Nov 18, 2023
1 parent 6aaaf4f commit ecc4158
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
16 changes: 5 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "centerline"
version = "0.9.0"
version = "0.10.0"
authors = ["eadf"]
edition = "2021"
description = "Simple library for finding centerlines of 2D closed geometry"
Expand All @@ -20,12 +20,8 @@ glam = ["vector-traits/glam"] # this is only needed for the gui, tests and bench
cgmath = ["vector-traits/cgmath"] # this is only needed for some tests

[dependencies]
#vector-traits = { version = "0.3.0", features = ["glam"] }
#vector-traits = {path = "../vector-traits"}
vector-traits = {git = "https://github.com/eadf/vector-traits.git"}
#linestring = "0.11.0"
#linestring = {path="../linestring.rs"}
linestring = {git = "https://github.com/eadf/linestring.rs.git"}
vector-traits = { version = "0.3.2", features = ["glam"] }
linestring = "0.12.0"
boostvoronoi = { version = "0.11.0" }
ahash = "0.8.6"
vob = "3.0.3"
Expand All @@ -46,11 +42,9 @@ name = "cli"
path = "example/cli.rs"

[dev-dependencies]
#vector-traits = { version = "0.3.0", features = ["glam", "cgmath"] }
#vector-traits = { path = "../vector-traits", features = ["glam", "cgmath"] }
vector-traits = {git = "https://github.com/eadf/vector-traits.git", features = ["glam", "cgmath"]}
vector-traits = { version = "0.3.2", features = ["glam", "cgmath"] }

fltk = "1.4.15"
fltk = "1.4.18"
itertools = "0.12.0"
criterion = "0.5.1"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![crates.io](https://img.shields.io/crates/v/centerline.svg)](https://crates.io/crates/centerline)
[![Documentation](https://docs.rs/centerline/badge.svg)](https://docs.rs/centerline)
[![Workflow](https://github.com/eadf/centerline.rs/workflows/Rust/badge.svg)](https://github.com/eadf/centerline.rs/workflows/Rust/badge.svg)
[![dependency status](https://deps.rs/crate/centerline/0.9.0/status.svg)](https://deps.rs/crate/centerline/0.9.0)
[![dependency status](https://deps.rs/crate/centerline/0.10.0/status.svg)](https://deps.rs/crate/centerline/0.10.0)
![license](https://img.shields.io/crates/l/centerline)

This simple library tries to find center-lines, aka the median-axis, of closed 2D geometries.
Expand Down
1 change: 1 addition & 0 deletions example/centerline_gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ where
Ok(())
}

#[cfg(feature = "obj-rs")]
/// Add data to the input lines.
fn add_data_from_file<I: InputType + Send, T: GenericVector3>(
shared_data: Rc<RefCell<SharedData<I, T>>>,
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ impl HasMatrix4 for Vec3A {
center: Vec3A,
plane: Plane,
) -> Self::Matrix4Type {
let scale_transform = glam::Mat4::from_scale(Vec3::new(scale, scale, scale));
let scale_transform = glam::Mat4::from_scale(Vec3::splat(scale));

let center = scale_transform.transform_point3(center.into());
let center = scale_transform.transform_point3a(center);
let center_transform =
glam::Mat4::from_translation(Vec3::new(-center.x, -center.y, -center.z));
glam::Mat4::from_translation((-center).into());

let plane_transform = match plane {
Plane::XY => glam::Mat4::IDENTITY,
Expand Down Expand Up @@ -595,7 +595,7 @@ pub fn divide_into_shapes<T: GenericVector3>(
next = *current_vertex.connected_vertices.iter().find(|x| **x != prev).ok_or_else(||{
println!("current_vertex.connected_vertices {:?}", current_vertex.connected_vertices);
CenterlineError::InvalidData(
"Could not find next vertex. All lines must form connected loops".to_string(),
"Could not find next vertex. All lines must form connected loops (loops connected to other loops are not supported,yet)".to_string(),
)},
)?;
} else {
Expand All @@ -609,7 +609,7 @@ pub fn divide_into_shapes<T: GenericVector3>(
loops += 1;
if loops > rvi.len() + 1 {
return Err(CenterlineError::InvalidData(
"It seems like one (or more) of the line strings does not form a connected loop."
"It seems like one (or more) of the line strings does not form a connected loop.(loops connected to other loops are not supported,yet)"
.to_string(),
));
}
Expand Down

0 comments on commit ecc4158

Please sign in to comment.