Open happydpc opened 2 years ago
Sorry for the late reply, STEP must always be spit out with the topology included, not just the geometry. I have made a sample code, but there seems to be an internal bug going on, so please wait a little longer.
Good job on this work, Thanks.
I am very sorry for the delay. One can output the sphere step by the following code and it displays properly in FreeCAD for example.
use std::f64::consts::PI;
use truck_modeling::*;
use truck_stepio::out;
fn main() {
let vertex = builder::vertex(Point3::new(0.0, 0.0, 1.0));
let wire = builder::rsweep(&vertex, Point3::origin(), Vector3::unit_y(), Rad(PI));
let shell = builder::rsweep(&wire, Point3::origin(), Vector3::unit_z(), Rad(PI * 2.0));
let step_string =
out::CompleteStepDisplay::new(out::StepModel::new(&shell.compress()), Default::default())
.to_string();
std::fs::write("output.stp", &step_string).unwrap();
}
However, in truck it is a bit abuse and does not close spherical as topological data. We would like to fix this, but we need to take care of a problem at the same time before we can officially support it.
According to the code, there are two ways to create a sphere:
but they all don't impl the ModelShape trait, how to export sphere to step file ?