opencascade 0.3.0

A high level Rust wrapper to build 3D models in code, using the OpenCascade CAD kernel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use cxx::UniquePtr;
use opencascade_sys as ffi;

#[must_use]
pub(crate) fn make_pipe_shell_with_law_function(
    profile: &ffi::topo_ds::TopoDS_Wire,
    spine: &ffi::topo_ds::TopoDS_Wire,
    law_function: &ffi::law::Handle_Law_Function,
) -> UniquePtr<ffi::b_rep_offset_api::BRepOffsetAPI_MakePipeShell> {
    let mut make_pipe_shell = ffi::b_rep_offset_api::BRepOffsetAPI_MakePipeShell_new(spine);
    make_pipe_shell.pin_mut().SetMode(false);
    let profile_shape = ffi::topo_ds::cast_wire_to_shape(profile);
    let with_contact = false;
    let with_correction = true;
    make_pipe_shell.pin_mut().SetLaw(profile_shape, law_function, with_contact, with_correction);
    make_pipe_shell
}