Skip to content
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
46 changes: 46 additions & 0 deletions modeling-cmds/openapi/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,25 @@
"direction"
]
},
"BodyType": {
"description": "Body type determining if the operation will create a solid or a surface.",
"oneOf": [
{
"description": "Create a body that has two caps, creating a solid object.",
"type": "string",
"enum": [
"solid"
]
},
{
"description": "Create only the surface of the body without any caps.",
"type": "string",
"enum": [
"surface"
]
}
]
},
"CameraDragInteractionType": {
"description": "The type of camera drag interaction.",
"oneOf": [
Expand Down Expand Up @@ -1829,6 +1848,15 @@
"description": "Command for extruding a solid 2d.",
"type": "object",
"properties": {
"body_type": {
"description": "Should this extrude create a solid body or a surface?",
"default": "solid",
"allOf": [
{
"$ref": "#/components/schemas/BodyType"
}
]
},
"distance": {
"description": "How far off the plane to extrude",
"allOf": [
Expand Down Expand Up @@ -1890,6 +1918,15 @@
"description": "Command for extruding a solid 2d to a reference geometry.",
"type": "object",
"properties": {
"body_type": {
"description": "Should this extrude create a solid body or a surface?",
"default": "solid",
"allOf": [
{
"$ref": "#/components/schemas/BodyType"
}
]
},
"extrude_method": {
"description": "Should the extrusion create a new object or be part of the existing object.",
"default": "merge",
Expand Down Expand Up @@ -1954,6 +1991,15 @@
}
]
},
"body_type": {
"description": "Should this extrude create a solid body or a surface?",
"default": "solid",
"allOf": [
{
"$ref": "#/components/schemas/BodyType"
}
]
},
"center_2d": {
"description": "Center to twist about (relative to 2D sketch)",
"default": {
Expand Down
10 changes: 10 additions & 0 deletions modeling-cmds/src/def_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ define_modeling_cmd_enum! {
length_unit::LengthUnit,
shared::{
Angle,
BodyType,
ComponentTransform,
RelativeTo,
CutType, CutTypeV2,
Expand Down Expand Up @@ -128,6 +129,9 @@ define_modeling_cmd_enum! {
/// Should the extrusion create a new object or be part of the existing object.
#[serde(default)]
pub extrude_method: ExtrudeMethod,
/// Should this extrude create a solid body or a surface?
#[serde(default)]
pub body_type: BodyType,
}

/// Command for extruding a solid 2d to a reference geometry.
Expand All @@ -150,6 +154,9 @@ define_modeling_cmd_enum! {
/// Should the extrusion create a new object or be part of the existing object.
#[serde(default)]
pub extrude_method: ExtrudeMethod,
/// Should this extrude create a solid body or a surface?
#[serde(default)]
pub body_type: BodyType,
}

fn default_twist_extrude_section_interval() -> Angle {
Expand Down Expand Up @@ -182,6 +189,9 @@ define_modeling_cmd_enum! {
pub angle_step_size: Angle,
///The twisted surface loft tolerance
pub tolerance: LengthUnit,
/// Should this extrude create a solid body or a surface?
#[serde(default)]
pub body_type: BodyType,
}

/// Extrude the object along a path.
Expand Down
14 changes: 14 additions & 0 deletions modeling-cmds/src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,19 @@ impl From<EngineErrorCode> for http::StatusCode {
}
}

/// Body type determining if the operation will create a solid or a surface.
#[derive(Default, Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
#[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
pub enum BodyType {
///Create a body that has two caps, creating a solid object.
#[default]
Solid,
///Create only the surface of the body without any caps.
Surface,
}

/// Extrusion method determining if the extrusion will be part of the existing object or an
/// entirely new object.
#[derive(Default, Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize, JsonSchema)]
Expand Down Expand Up @@ -1342,6 +1355,7 @@ impl_extern_type! {
// Scene
SceneSelectionType = "Enums::_SceneSelectionType"
SceneToolType = "Enums::_SceneToolType"
BodyType = "Enums::_BodyType"
EntityType = "Enums::_EntityType"
AnnotationType = "Enums::_AnnotationType"
AnnotationTextAlignmentX = "Enums::_AnnotationTextAlignmentX"
Expand Down
1 change: 1 addition & 0 deletions modeling-session/examples/cube_png.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ async fn main() -> Result<()> {
faces: None,
opposite: Default::default(),
extrude_method: Default::default(),
body_type: Default::default(),
}
.into(),
)
Expand Down
1 change: 1 addition & 0 deletions modeling-session/examples/cube_png_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ async fn main() -> Result<()> {
faces: None,
opposite: Default::default(),
extrude_method: Default::default(),
body_type: Default::default(),
}),
cmd_id: random_id(),
});
Expand Down
1 change: 1 addition & 0 deletions modeling-session/examples/lsystem_png_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ async fn main() -> Result<()> {
faces: None,
opposite: Default::default(),
extrude_method: Default::default(),
body_type: Default::default(),
}),
cmd_id: random_id(),
});
Expand Down
Loading