-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to export sphere to stp file #33
Comments
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 ?
The text was updated successfully, but these errors were encountered: