mirror of https://codeberg.org/topola/topola.git
deps(specctra-core): use geo-types instead of geo
This commit is contained in:
parent
e76f740563
commit
355faa59c7
|
|
@ -11,6 +11,11 @@ serde_json = "1.0"
|
||||||
spade = "2.12"
|
spade = "2.12"
|
||||||
thiserror = "2.0"
|
thiserror = "2.0"
|
||||||
|
|
||||||
|
[workspace.dependencies.geo-types]
|
||||||
|
version = "0.7"
|
||||||
|
default-features = false
|
||||||
|
features = ["serde"]
|
||||||
|
|
||||||
[workspace.dependencies.geo]
|
[workspace.dependencies.geo]
|
||||||
version = "0.29"
|
version = "0.29"
|
||||||
default-features = false
|
default-features = false
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bimap.workspace = true
|
bimap.workspace = true
|
||||||
geo.workspace = true
|
geo-types.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
specctra_derive.path = "../specctra_derive"
|
specctra_derive.path = "../specctra_derive"
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use core::ops::Sub;
|
use core::ops::Sub;
|
||||||
use geo::geometry::Point;
|
use geo_types::geometry::Point;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
|
||||||
|
|
@ -20,7 +20,7 @@ impl Circle {
|
||||||
///
|
///
|
||||||
/// `phi` is the angle given in radians starting at `(r, 0)`.
|
/// `phi` is the angle given in radians starting at `(r, 0)`.
|
||||||
pub fn position_at_angle(&self, phi: f64) -> Point {
|
pub fn position_at_angle(&self, phi: f64) -> Point {
|
||||||
geo::point! {
|
geo_types::point! {
|
||||||
x: self.pos.0.x + self.r * phi.cos(),
|
x: self.pos.0.x + self.r * phi.cos(),
|
||||||
y: self.pos.0.y + self.r * phi.sin()
|
y: self.pos.0.y + self.r * phi.sin()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -392,17 +392,17 @@ pub struct Point {
|
||||||
pub y: f64,
|
pub y: f64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<geo::Point> for Point {
|
impl From<geo_types::Point> for Point {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn from(z: geo::Point) -> Self {
|
fn from(z: geo_types::Point) -> Self {
|
||||||
Point { x: z.0.x, y: z.0.y }
|
Point { x: z.0.x, y: z.0.y }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<Point> for geo::Point {
|
impl From<Point> for geo_types::Point {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn from(z: Point) -> Self {
|
fn from(z: Point) -> Self {
|
||||||
geo::point! {
|
geo_types::point! {
|
||||||
x: z.x,
|
x: z.x,
|
||||||
y: z.y
|
y: z.y
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue