1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#![warn(
missing_docs,
missing_debug_implementations,
trivial_casts,
trivial_numeric_casts,
unsafe_code,
unstable_features,
unused_import_braces,
unused_qualifications
)]
pub mod base {
pub use truck_base::{bounding_box::*, cgmath64::*, geom_traits::*, tolerance::*};
}
pub use base::*;
pub mod geometry {
use super::*;
pub use truck_geometry::KnotVec;
pub type BSplineCurve = truck_geometry::BSplineCurve<Vector4>;
pub type BSplineSurface = truck_geometry::BSplineSurface<Vector4>;
pub type NURBSCurve = truck_geometry::NURBSCurve<Vector4>;
pub type NURBSSurface = truck_geometry::NURBSSurface<Vector4>;
}
pub use geometry::*;
pub mod topology {
use super::*;
pub type Vertex = truck_topology::Vertex<Point3>;
pub type Edge = truck_topology::Edge<Point3, NURBSCurve>;
pub type Wire = truck_topology::Wire<Point3, NURBSCurve>;
pub type Face = truck_topology::Face<Point3, NURBSCurve, NURBSSurface>;
pub type Shell = truck_topology::Shell<Point3, NURBSCurve, NURBSSurface>;
pub type Solid = truck_topology::Solid<Point3, NURBSCurve, NURBSSurface>;
pub type VertexID = truck_topology::VertexID<Point3>;
pub type EdgeID = truck_topology::EdgeID<NURBSCurve>;
pub type FaceID = truck_topology::FaceID<NURBSSurface>;
pub use truck_topology::{errors::Error, shell::ShellCondition, Result};
}
pub use topology::*;
pub mod topo_traits {
pub trait Mapped<P, C, S>: Sized {
fn mapped<FP: Fn(&P) -> P, FC: Fn(&C) -> C, FS: Fn(&S) -> S>(
&self,
point_mapping: &FP,
curve_mapping: &FC,
surface_mapping: &FS,
) -> Self;
fn topological_clone(&self) -> Self
where
P: Clone,
C: Clone,
S: Clone, {
self.mapped(&Clone::clone, &Clone::clone, &Clone::clone)
}
}
pub trait Sweep<P, C, S> {
type Swept;
fn sweep<
FP: Fn(&P) -> P,
FC: Fn(&C) -> C,
FS: Fn(&S) -> S,
CP: Fn(&P, &P) -> C,
CE: Fn(&C, &C) -> S,
>(
&self,
point_mapping: &FP,
curve_mapping: &FC,
surface_mapping: &FS,
connect_points: &CP,
connect_curve: &CE,
) -> Self::Swept;
}
pub trait MultiSweep<P, C, S> {
type Swept;
fn multi_sweep<
FP: Fn(&P) -> P,
FC: Fn(&C) -> C,
FS: Fn(&S) -> S,
CP: Fn(&P, &P) -> C,
CE: Fn(&C, &C) -> S,
>(
&self,
point_mapping: &FP,
curve_mapping: &FC,
surface_mapping: &FS,
connect_points: &CP,
connect_curve: &CE,
division: usize,
) -> Self::Swept;
}
pub trait ClosedSweep<P, C, S>: MultiSweep<P, C, S> {
fn closed_sweep<
FP: Fn(&P) -> P,
FC: Fn(&C) -> C,
FS: Fn(&S) -> S,
CP: Fn(&P, &P) -> C,
CE: Fn(&C, &C) -> S,
>(
&self,
point_mapping: &FP,
curve_mapping: &FC,
surface_mapping: &FS,
connect_points: &CP,
connect_curves: &CE,
division: usize,
) -> Self::Swept;
}
}
pub use topo_traits::*;
pub mod builder;
mod closed_sweep;
mod geom_impls;
mod mapped;
mod multi_sweep;
mod sweep;
mod topo_impls;