Skip to content

Commit fa583fc

Browse files
committed
pin real at f64 during transition, adjust names to better match nalgebra
1 parent f561a1b commit fa583fc

28 files changed

+129
-116
lines changed

src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::float_types::Real;
1+
type Real = f64;
22
use nalgebra::Point3;
33

44
/// All the possible validation issues we might encounter,

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Here, we do not use any shared data, so we'll bind the generic S to ().
55

66
#[cfg(feature = "sdf")]
7-
use csgrs::float_types::Real;
7+
type Real = f64;
88

99
use csgrs::mesh::plane::Plane;
1010
use csgrs::traits::CSG;

src/math_ndsp.rs

Lines changed: 89 additions & 89 deletions
Large diffs are not rendered by default.

src/mesh/bsp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::float_types::EPSILON;
66
#[cfg(not(feature = "parallel"))]
77
use crate::mesh::vertex::Vertex;
88

9-
use crate::float_types::Real;
9+
type Real = f64;
1010
use crate::mesh::plane::{BACK, COPLANAR, FRONT, Plane, SPANNING};
1111
use crate::mesh::polygon::Polygon;
1212
use std::fmt::Debug;

src/mesh/connectivity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::float_types::Real;
1+
type Real = f64;
22
use crate::mesh::Mesh;
33
use hashbrown::HashMap;
44
use nalgebra::Point3;

src/mesh/convex_hull.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#![cfg_attr(doc, doc = doc_image_embed::embed_image!("Pre-ConvexHull demo image", "docs/convex_hull_before_nobackground.png"))]
1010
#![cfg_attr(doc, doc = doc_image_embed::embed_image!("ConvexHull demo image", "docs/convex_hull_nobackground.png"))]
1111

12-
use crate::float_types::Real;
12+
type Real = f64;
1313
use crate::mesh::Mesh;
1414
use crate::mesh::polygon::Polygon;
1515
use crate::mesh::vertex::Vertex;

src/mesh/flatten_slice.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Provides functions for flattening a `Mesh` against the Z=0 `Plane`
22
//! or slicing a `Mesh` with an arbitrary `Plane` into a `Sketch`
33
4-
use crate::math_ndsp::consts::{EPSILON, Real};
4+
use crate::math_ndsp::consts::{EPSILON};
55
use crate::mesh::Mesh;
66
use crate::mesh::bsp::Node;
77
use crate::mesh::plane::Plane;
@@ -15,6 +15,7 @@ use hashbrown::HashMap;
1515
use nalgebra::Point3;
1616
use std::fmt::Debug;
1717
use std::sync::OnceLock;
18+
type Real = f64;
1819

1920
impl<S: Clone + Debug + Send + Sync> Mesh<S> {
2021
/// Flattens any 3D polygons by projecting them onto the XY plane (z=0),

src/mesh/manifold.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::float_types::Real;
1+
type Real = f64;
22
use crate::mesh::Mesh;
33
use nalgebra::Point3;
44
use std::collections::HashMap;

src/mesh/metaballs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
//! Provides a `MetaBall` struct and functions for creating a `Mesh` from [MetaBalls](https://en.wikipedia.org/wiki/Metaballs)
22
3-
use crate::math_ndsp::consts::{EPSILON, Real};
3+
use crate::math_ndsp::consts::{EPSILON};
44
use crate::mesh::Mesh;
55
use crate::mesh::polygon::Polygon;
66
use crate::mesh::vertex::Vertex;
77
use crate::traits::CSG;
88
use fast_surface_nets::{SurfaceNetsBuffer, surface_nets};
99
use nalgebra::{Point3, Vector3};
1010
use std::fmt::Debug;
11+
type Real = f64;
1112

1213
#[derive(Debug, Clone)]
1314
pub struct MetaBall {

src/mesh/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::math_ndsp::consts::{
1010
ColliderBuilder, ColliderSet, Ray, RigidBodyBuilder, RigidBodyHandle, RigidBodySet,
1111
SharedShape, TriMesh, Triangle,
1212
},
13-
{EPSILON, Real},
13+
{EPSILON},
1414
};
1515
use crate::mesh::{bsp::Node, plane::Plane, polygon::Polygon, vertex::Vertex};
1616
use crate::sketch::Sketch;
@@ -20,6 +20,7 @@ use nalgebra::{
2020
Isometry3, Matrix4, Point3, Quaternion, Unit, Vector3, partial_max, partial_min,
2121
};
2222
use std::{cmp::PartialEq, fmt::Debug, num::NonZeroU32, sync::OnceLock};
23+
type Real = f64;
2324

2425
#[cfg(feature = "parallel")]
2526
use rayon::{iter::IntoParallelRefIterator, prelude::*};

0 commit comments

Comments
 (0)