File tree Expand file tree Collapse file tree 5 files changed +30
-9
lines changed
opencascade/src/primitives Expand file tree Collapse file tree 5 files changed +30
-9
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ fn main() {
5151
5252 let rust_bridges = [
5353 "src/b_rep_g_prop.rs" ,
54+ "src/b_rep_tools.rs" ,
5455 "src/g_prop.rs" ,
5556 "src/lib.rs" ,
5657 "src/shape_analysis.rs" ,
Original file line number Diff line number Diff line change 1+ use cxx:: UniquePtr ;
2+ pub use inner:: * ;
3+
4+ #[ cxx:: bridge]
5+ mod inner {
6+ unsafe extern "C++" {
7+ include ! ( "opencascade-sys/include/wrapper.hxx" ) ;
8+
9+ type TopoDS_Face = crate :: ffi:: TopoDS_Face ;
10+ type TopoDS_Wire = crate :: ffi:: TopoDS_Wire ;
11+
12+ type BRepTools ;
13+
14+ fn outer_wire ( face : & TopoDS_Face ) -> UniquePtr < TopoDS_Wire > ;
15+ }
16+ }
17+
18+ impl BRepTools {
19+ pub fn outer_wire ( face : & TopoDS_Face ) -> UniquePtr < TopoDS_Wire > {
20+ outer_wire ( face)
21+ }
22+ }
Original file line number Diff line number Diff line change 11pub mod b_rep_g_prop;
2+ pub mod b_rep_tools;
23pub mod g_prop;
34pub mod shape_analysis;
45pub mod shape_upgrade;
@@ -1325,9 +1326,6 @@ pub mod ffi {
13251326 approximator : & GCPnts_TangentialDeflection ,
13261327 index : i32 ,
13271328 ) -> UniquePtr < gp_Pnt > ;
1328-
1329- // BRepTools
1330- pub fn outer_wire ( face : & TopoDS_Face ) -> UniquePtr < TopoDS_Wire > ;
13311329 }
13321330}
13331331
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use cxx::UniquePtr;
1111use glam:: { dvec3, DVec3 } ;
1212use opencascade_sys:: {
1313 b_rep_g_prop:: { self , BRepGProp , BRepGProp_SurfaceProperties } ,
14- ffi,
14+ b_rep_tools , ffi,
1515 g_prop:: GProps ,
1616} ;
1717
@@ -229,7 +229,7 @@ impl Face {
229229 let law_function = law_function_from_graph ( radius_values) ;
230230 let law_handle = ffi:: Law_Function_to_handle ( law_function) ;
231231
232- let profile_wire = ffi :: outer_wire ( & self . inner ) ;
232+ let profile_wire = b_rep_tools :: outer_wire ( & self . inner ) ;
233233 let mut make_pipe_shell =
234234 make_pipe_shell_with_law_function ( & profile_wire, & path. inner , & law_handle) ;
235235
@@ -357,7 +357,7 @@ impl Face {
357357
358358 #[ must_use]
359359 pub fn outer_wire ( & self ) -> Wire {
360- let inner = ffi :: outer_wire ( & self . inner ) ;
360+ let inner = b_rep_tools :: outer_wire ( & self . inner ) ;
361361
362362 Wire { inner }
363363 }
Original file line number Diff line number Diff line change 1- use opencascade_sys:: shape_analysis:: connect_edges_to_wires;
1+ use opencascade_sys:: { b_rep_tools , shape_analysis:: connect_edges_to_wires} ;
22use std:: iter:: once;
33
44use crate :: {
@@ -164,7 +164,7 @@ impl Wire {
164164 pub fn fillet ( & self , radius : f64 ) -> Wire {
165165 // Create a face from this wire
166166 let face = Face :: from_wire ( self ) . fillet ( radius) ;
167- let inner = ffi :: outer_wire ( & face. inner ) ;
167+ let inner = b_rep_tools :: outer_wire ( & face. inner ) ;
168168
169169 Self { inner }
170170 }
@@ -173,7 +173,7 @@ impl Wire {
173173 #[ must_use]
174174 pub fn chamfer ( & self , distance_1 : f64 ) -> Wire {
175175 let face = Face :: from_wire ( self ) . chamfer ( distance_1) ;
176- let inner = ffi :: outer_wire ( & face. inner ) ;
176+ let inner = b_rep_tools :: outer_wire ( & face. inner ) ;
177177
178178 Self { inner }
179179 }
You can’t perform that action at this time.
0 commit comments