Merge pull request #1894 from hannobraun/docs

Make some fixes  and update to documentation
This commit is contained in:
Hanno Braun 2023-06-19 16:41:32 +02:00 committed by GitHub
commit 3b25f43ec1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 5 deletions

View File

@ -79,7 +79,7 @@ impl<const D: usize> Line<D> {
/// Access the direction of the line /// Access the direction of the line
/// ///
/// The length of this vector defines the unit of the line's curve /// 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`. /// vector points, from `origin`.
pub fn direction(&self) -> Vector<D> { pub fn direction(&self) -> Vector<D> {
self.direction self.direction

View File

@ -121,7 +121,7 @@ pub fn display(model: Model, invert_zoom: bool) -> Result<(), Error> {
pub enum Error { pub enum Error {
/// Error initializing window /// Error initializing window
#[error("Error initializing window")] #[error("Error initializing window")]
WindowInit(#[from] window::Error), WindowInit(#[from] window::WindowError),
/// Error initializing graphics /// Error initializing graphics
#[error("Error initializing graphics")] #[error("Error initializing graphics")]

View File

@ -13,4 +13,7 @@
mod display; mod display;
mod window; mod window;
pub use self::display::{display, Error}; pub use self::{
display::{display, Error},
window::WindowError,
};

View File

@ -6,7 +6,7 @@ pub struct Window(winit::window::Window);
impl Window { impl Window {
/// Create an instance of `Window` from the given `EventLoop` /// 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() let window = WindowBuilder::new()
.with_title("Fornjot") .with_title("Fornjot")
.with_maximized(true) .with_maximized(true)
@ -57,4 +57,4 @@ impl Screen for Window {
/// Error initializing window /// Error initializing window
#[derive(Debug, thiserror::Error)] #[derive(Debug, thiserror::Error)]
#[error("Error initializing window")] #[error("Error initializing window")]
pub struct Error(#[from] pub winit::error::OsError); pub struct WindowError(#[from] pub winit::error::OsError);

View File

@ -4,6 +4,16 @@ use fj_core::algorithms::approx::{InvalidTolerance, Tolerance};
use fj_math::Scalar; use fj_math::Scalar;
/// Standardized CLI for Fornjot models /// 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)] #[derive(clap::Parser)]
pub struct Args { pub struct Args {
/// Export model to this path /// Export model to this path