Skip to content
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

Make some fixes and update to documentation #1894

Merged
merged 4 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/fj-math/src/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<const D: usize> Line<D> {
/// Access the direction of the line
///
/// The length of this vector defines the unit of the line's curve
/// coordinate system. The coordinate `1.` is always were the direction
/// coordinate system. The coordinate `1.` is always where the direction
/// vector points, from `origin`.
pub fn direction(&self) -> Vector<D> {
self.direction
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-window/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub fn display(model: Model, invert_zoom: bool) -> Result<(), Error> {
pub enum Error {
/// Error initializing window
#[error("Error initializing window")]
WindowInit(#[from] window::Error),
WindowInit(#[from] window::WindowError),

/// Error initializing graphics
#[error("Error initializing graphics")]
Expand Down
5 changes: 4 additions & 1 deletion crates/fj-window/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@
mod display;
mod window;

pub use self::display::{display, Error};
pub use self::{
display::{display, Error},
window::WindowError,
};
4 changes: 2 additions & 2 deletions crates/fj-window/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub struct Window(winit::window::Window);

impl Window {
/// Create an instance of `Window` from the given `EventLoop`
pub fn new<T>(event_loop: &EventLoop<T>) -> Result<Self, Error> {
pub fn new<T>(event_loop: &EventLoop<T>) -> Result<Self, WindowError> {
let window = WindowBuilder::new()
.with_title("Fornjot")
.with_maximized(true)
Expand Down Expand Up @@ -57,4 +57,4 @@ impl Screen for Window {
/// Error initializing window
#[derive(Debug, thiserror::Error)]
#[error("Error initializing window")]
pub struct Error(#[from] pub winit::error::OsError);
pub struct WindowError(#[from] pub winit::error::OsError);
10 changes: 10 additions & 0 deletions crates/fj/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ use fj_core::algorithms::approx::{InvalidTolerance, Tolerance};
use fj_math::Scalar;

/// Standardized CLI for Fornjot models
///
/// This is completely optional, as models are just Rust code and don't need any
/// kind of CLI interface. It is useful, however, to provide a standardized
/// interface for viewing and exporting models, and is used for Fornjot's
/// example models and the testing infrastructure they are part of.
///
/// You might not want to use this struct directly. [`handle_model`] Provides a
/// more high-level and convenient interface.
///
/// [`handle_model`]: crate::handle_model()
#[derive(clap::Parser)]
pub struct Args {
/// Export model to this path
Expand Down