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

Mike/lofting enums #461

Merged
merged 6 commits into from
Aug 26, 2024
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
24 changes: 23 additions & 1 deletion modeling-cmds/src/def_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
pub tolerance: LengthUnit,
}

/// Command for revolving a solid 2d.
/// Command for shelling a solid3d face
#[derive(
Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariantEmpty,
)]
Expand Down Expand Up @@ -136,6 +136,28 @@
pub tolerance: LengthUnit,
}

/// Command for lofting sections to create a solid
#[derive(
Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,

Check warning on line 141 in modeling-cmds/src/def_enum.rs

View check run for this annotation

Codecov / codecov/patch

modeling-cmds/src/def_enum.rs#L141

Added line #L141 was not covered by tests
)]
pub struct Loft {
/// The closed section curves to create a lofted solid from.
/// Currently, these must be Solid2Ds
pub section_ids: Vec<Uuid>,
/// Degree of the interpolation. Must be greater than zero.
/// For example, use 2 for quadratic, or 3 for cubic interpolation in the V direction.
pub v_degree: std::num::NonZeroU32,
/// Attempt to approximate rational curves (such as arcs) using a bezier.
/// This will remove banding around interpolations between arcs and non-arcs. It may produce errors in other scenarios
/// Over time, this field won't be necessary.
pub bez_approximate_rational: bool,
/// This can be set to override the automatically determined topological base curve, which is usually the first section encountered.
pub base_curve_index: Option<u32>,
/// Tolerance
pub tolerance: LengthUnit,
}


/// Closes a path, converting it to a 2D solid.
#[derive(
Debug, Clone, Serialize, Deserialize, JsonSchema, ModelingCmdVariant,
Expand Down
7 changes: 7 additions & 0 deletions modeling-cmds/src/ok_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@
pub entity_ids: Vec<Uuid>,
}

/// The response from the `Loft` command.
#[derive(Debug, Serialize, Deserialize, JsonSchema, ModelingCmdOutput)]

Check warning on line 79 in modeling-cmds/src/ok_response.rs

View check run for this annotation

Codecov / codecov/patch

modeling-cmds/src/ok_response.rs#L79

Added line #L79 was not covered by tests
pub struct Loft {
///The UUID of the newly created solid loft.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a solid3d right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but the reader should be able to infer that a solid loft is a solid 3d. there's no such thing as a solid lofted 2D in our engine

pub solid_id: Uuid,
}

/// The response from the `ClosePath` command.
#[derive(Debug, Serialize, Deserialize, JsonSchema, ModelingCmdOutput)]
pub struct ClosePath {
Expand Down
Loading