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

Serena/circular pattern types #58

Merged
merged 6 commits into from
Jan 19, 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
2 changes: 2 additions & 0 deletions modeling-cmds/src/def_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ pub enum ModelingCmd {
EntityGetDistance(EntityGetDistance),
/// Duplicate the given entity, evenly spaced along the chosen axis.
EntityLinearPattern(EntityLinearPattern),
/// Duplicate the given entity, evenly spaced around the specified axis, spanning the arc.
EntityCircularPattern(EntityCircularPattern),
/// When you select some entity with the current tool, what should happen to the entity?
SetSelectionType(SetSelectionType),
/// What kind of entities can be selected?
Expand Down
16 changes: 16 additions & 0 deletions modeling-cmds/src/each_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,22 @@ pub struct EntityLinearPattern {
/// Spacing between repetitions.
pub spacing: f64,
}
/// Create a circular pattern using this entity (currently only valid for 3D solids).
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
pub struct EntityCircularPattern {
/// ID of the entity being copied.
pub entity_id: Uuid,
/// Axis around which to make the copies
pub axis: Point3d<f64>,
/// Point around which to make the copies
pub center: Point3d<f64>,
/// Number of repetitions to make.
pub num_repetitions: u32,
/// Arc angle (in degrees) to place repetitions along.
pub arc_degrees: f64,
/// Whether or not to rotate the objects as they are copied.
pub rotate_duplicates: bool,
}

/// Enter edit mode
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
Expand Down
1 change: 1 addition & 0 deletions modeling-cmds/src/impl_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ impl_variant_output!(EntityGetChildUuid);
impl_variant_output!(EntityGetAllChildUuids);
impl_variant_output!(EntityGetDistance);
impl_variant_output!(EntityLinearPattern);
impl_variant_output!(EntityCircularPattern);
impl_variant_empty!(EditModeEnter);
impl_variant_output!(SelectWithPoint);
impl_variant_empty!(SelectAdd);
Expand Down
1 change: 1 addition & 0 deletions modeling-cmds/src/ok_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ build_enum! {
GetEntityType,
EntityGetDistance,
EntityLinearPattern,
EntityCircularPattern,
Solid3dGetAllEdgeFaces,
Solid3dGetAllOppositeEdges,
Solid3dGetOppositeEdge,
Expand Down
9 changes: 9 additions & 0 deletions modeling-cmds/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ pub struct EntityLinearPattern {
pub entity_ids: Vec<Uuid>,
}

/// The response from the `EntityCircularPattern` command.
#[derive(Debug, Serialize, Deserialize, JsonSchema, ExecutionPlanValue)]
pub struct EntityCircularPattern {
/// The UUIDs of the entities that were created.
pub entity_ids: Vec<Uuid>,
}


impl ModelingCmdOutput for Export {}
impl ModelingCmdOutput for SelectWithPoint {}
impl ModelingCmdOutput for HighlightSetEntity {}
Expand All @@ -273,6 +281,7 @@ impl ModelingCmdOutput for EntityGetParentId {}
impl ModelingCmdOutput for EntityGetAllChildUuids {}
impl ModelingCmdOutput for EntityGetDistance {}
impl ModelingCmdOutput for EntityLinearPattern {}
impl ModelingCmdOutput for EntityCircularPattern {}
impl ModelingCmdOutput for SelectGet {}
impl ModelingCmdOutput for GetEntityType {}
impl ModelingCmdOutput for Solid3dGetAllEdgeFaces {}
Expand Down
Loading