Skip to content
Open
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
86 changes: 85 additions & 1 deletion modeling-cmds/openapi/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1962,6 +1962,11 @@
}
]
},
"keep_seams": {
"description": "When two collinear segments are extruded, what should happen? If true, creates a body with two separate surfaces. If false, creates a body with one surface, spanning both collinear segments.",
"default": false,
"type": "boolean"
},
"merge_coplanar_faces": {
"nullable": true,
"description": "Only used if the extrusion is created from a face and extrude_method = Merge If true, coplanar faces will be merged and seams will be hidden. Otherwise, seams between the extrusion and original body will be shown.",
Expand All @@ -1976,8 +1981,17 @@
}
]
},
"segments": {
"nullable": true,
"description": "If given, extrude each of these segments into a separate body with the given ID.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Misleading description: states "extrude each of these segments into a separate body with the given ID" but the array contains segment IDs to be extruded, not body IDs to assign. The wording "with the given ID" incorrectly suggests these UUIDs are for the resulting bodies. Should clarify:

"description": "If given, only extrude these segments from the sketch. Each segment will be extruded into a separate body."

This same incorrect description appears in all operation types (lines 2061, 2151, 2230, 2340, 2598).

Suggested change
"description": "If given, extrude each of these segments into a separate body with the given ID.",
"description": "If given, only extrude these segments from the sketch. Each segment will be extruded into a separate body.",

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"target": {
"description": "Which sketch to extrude. Must be a closed 2D solid.",
"description": "Which sketch to extrude. Must be a 2D sketch.",
"allOf": [
{
"$ref": "#/components/schemas/ModelingCmdId"
Expand Down Expand Up @@ -2029,6 +2043,11 @@
}
]
},
"keep_seams": {
"description": "When two collinear segments are extruded, what should happen? If true, creates a body with two surfaces. If false, creates a body with one surface, spanning both collinear segments.",
"default": false,
"type": "boolean"
},
"reference": {
"description": "Reference to extrude to. Extrusion occurs along the target's normal until it is as close to the reference as possible.",
"allOf": [
Expand All @@ -2037,6 +2056,15 @@
}
]
},
"segments": {
"nullable": true,
"description": "If given, extrude each of these segments into a separate body with the given ID.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"target": {
"description": "Which sketch to extrude. Must be a closed 2D solid.",
"allOf": [
Expand Down Expand Up @@ -2113,6 +2141,20 @@
}
]
},
"keep_seams": {
"description": "When two collinear segments are extruded, what should happen? If true, creates a body with two surfaces. If false, creates a body with one surface, spanning both collinear segments.",
"default": false,
"type": "boolean"
},
"segments": {
"nullable": true,
"description": "If given, extrude each of these segments into a separate body with the given ID.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"target": {
"description": "Which sketch to extrude. Must be a closed 2D solid.",
"allOf": [
Expand Down Expand Up @@ -2165,6 +2207,11 @@
}
]
},
"keep_seams": {
"description": "When two collinear segments are extruded, what should happen? If true, creates a body with two surfaces. If false, creates a body with one surface, spanning both collinear segments.",
"default": false,
"type": "boolean"
},
"relative_to": {
"description": "What is this sweep relative to?",
"default": "sketch_plane",
Expand All @@ -2178,6 +2225,15 @@
"description": "If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components.",
"type": "boolean"
},
"segments": {
"nullable": true,
"description": "If given, extrude each of these segments into a separate body with the given ID.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"target": {
"description": "Which sketch to sweep. Must be a closed 2D solid.",
"allOf": [
Expand Down Expand Up @@ -2257,6 +2313,11 @@
}
]
},
"keep_seams": {
"description": "When two collinear segments are extruded, what should happen? If true, creates a body with two surfaces. If false, creates a body with one surface, spanning both collinear segments.",
"default": false,
"type": "boolean"
},
"opposite": {
"description": "Should the revolution also revolve in the opposite direction along the given axis? If so, this specifies its angle.",
"default": "None",
Expand All @@ -2274,6 +2335,15 @@
}
]
},
"segments": {
"nullable": true,
"description": "If given, extrude each of these segments into a separate body with the given ID.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"target": {
"description": "Which sketch to revolve. Must be a closed 2D solid.",
"allOf": [
Expand Down Expand Up @@ -2542,6 +2612,11 @@
"type": "string",
"format": "uuid"
},
"keep_seams": {
"description": "When two collinear segments are extruded, what should happen? If true, creates a body with two surfaces. If false, creates a body with one surface, spanning both collinear segments.",
"default": false,
"type": "boolean"
},
"opposite": {
"description": "Should the revolution also revolve in the opposite direction along the given axis? If so, this specifies its angle.",
"default": "None",
Expand All @@ -2551,6 +2626,15 @@
}
]
},
"segments": {
"nullable": true,
"description": "If given, extrude each of these segments into a separate body with the given ID.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"target": {
"description": "Which sketch to revolve. Must be a closed 2D solid.",
"allOf": [
Expand Down
56 changes: 55 additions & 1 deletion modeling-cmds/src/def_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,17 @@ define_modeling_cmd_enum! {
#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
pub struct Extrude {
/// Which sketch to extrude.
/// Must be a closed 2D solid.
/// Must be a 2D sketch.
pub target: ModelingCmdId,
/// If given, extrude each of these segments into a separate body with the given ID.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub segments: Option<Vec<Uuid>>,
/// When two collinear segments are extruded, what should happen?
/// If true, creates a body with two separate surfaces.
/// If false, creates a body with one surface, spanning both collinear segments.
#[serde(default)]
#[builder(default)]
pub keep_seams: bool,
/// How far off the plane to extrude
pub distance: LengthUnit,
/// Which IDs should the new faces have?
Expand Down Expand Up @@ -167,6 +176,15 @@ define_modeling_cmd_enum! {
/// Which sketch to extrude.
/// Must be a closed 2D solid.
pub target: ModelingCmdId,
/// If given, extrude each of these segments into a separate body with the given ID.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub segments: Option<Vec<Uuid>>,
/// When two collinear segments are extruded, what should happen?
/// If true, creates a body with two surfaces.
/// If false, creates a body with one surface, spanning both collinear segments.
#[serde(default)]
#[builder(default)]
pub keep_seams: bool,
/// Reference to extrude to.
/// Extrusion occurs along the target's normal until it is as close to the reference as possible.
pub reference: ExtrudeReference,
Expand Down Expand Up @@ -200,6 +218,15 @@ define_modeling_cmd_enum! {
/// Which sketch to extrude.
/// Must be a closed 2D solid.
pub target: ModelingCmdId,
/// If given, extrude each of these segments into a separate body with the given ID.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub segments: Option<Vec<Uuid>>,
/// When two collinear segments are extruded, what should happen?
/// If true, creates a body with two surfaces.
/// If false, creates a body with one surface, spanning both collinear segments.
#[serde(default)]
#[builder(default)]
pub keep_seams: bool,
/// How far off the plane to extrude
pub distance: LengthUnit,
/// Which IDs should the new faces have?
Expand Down Expand Up @@ -237,6 +264,15 @@ define_modeling_cmd_enum! {
/// Which sketch to sweep.
/// Must be a closed 2D solid.
pub target: ModelingCmdId,
/// If given, extrude each of these segments into a separate body with the given ID.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub segments: Option<Vec<Uuid>>,
/// When two collinear segments are extruded, what should happen?
/// If true, creates a body with two surfaces.
/// If false, creates a body with one surface, spanning both collinear segments.
#[serde(default)]
#[builder(default)]
pub keep_seams: bool,
/// Path along which to sweep.
pub trajectory: ModelingCmdId,
/// If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components.
Expand Down Expand Up @@ -269,6 +305,15 @@ define_modeling_cmd_enum! {
/// Which sketch to revolve.
/// Must be a closed 2D solid.
pub target: ModelingCmdId,
Comment on lines 264 to 307
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Documentation inconsistency: Revolve.target still says "Must be a closed 2D solid" but should be updated to "Must be a 2D sketch" to match the Extrude operation and reflect support for partial surface revolves via the new segments field.

Suggested change
/// Which sketch to sweep.
/// Must be a closed 2D solid.
pub target: ModelingCmdId,
/// If given, extrude each of these segments into a separate body with the given ID.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub segments: Option<Vec<IdPair>>,
/// When two collinear segments are extruded, what should happen?
/// If true, creates a body with two surfaces.
/// If false, creates a body with one surface, spanning both collinear segments.
#[serde(default)]
#[builder(default)]
pub keep_seams: bool,
/// Path along which to sweep.
pub trajectory: ModelingCmdId,
/// If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, sweeps) based on the trajectory path components.
/// Which sketch to revolve.
/// Must be a 2D sketch.
pub target: ModelingCmdId,

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

/// If given, extrude each of these segments into a separate body with the given ID.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub segments: Option<Vec<Uuid>>,
/// When two collinear segments are extruded, what should happen?
/// If true, creates a body with two surfaces.
/// If false, creates a body with one surface, spanning both collinear segments.
#[serde(default)]
#[builder(default)]
pub keep_seams: bool,
/// The origin of the extrusion axis
pub origin: Point3d<LengthUnit>,
/// The axis of the extrusion (taken from the origin)
Expand Down Expand Up @@ -420,6 +465,15 @@ define_modeling_cmd_enum! {
/// Which sketch to revolve.
/// Must be a closed 2D solid.
pub target: ModelingCmdId,
/// If given, extrude each of these segments into a separate body with the given ID.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub segments: Option<Vec<Uuid>>,
/// When two collinear segments are extruded, what should happen?
/// If true, creates a body with two surfaces.
/// If false, creates a body with one surface, spanning both collinear segments.
#[serde(default)]
#[builder(default)]
pub keep_seams: bool,
/// The edge to use as the axis of revolution, must be linear and lie in the plane of the solid
pub edge_id: Uuid,
/// The signed angle of revolution (in degrees, must be <= 360 in either direction)
Expand Down
38 changes: 37 additions & 1 deletion modeling-cmds/src/ok_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ define_ok_modeling_cmd_response_enum! {
base64::Base64Data,
id::ModelingCmdId,
length_unit::LengthUnit,
shared::{CurveType, EntityType, ExportFile, ExtrusionFaceCapType, PathCommand, Point2d, Point3d},
shared::{CurveType, EntityType, ExportFile, ExtrusionFaceCapType, PathCommand, Point2d, Point3d, BodiesCreated, BodiesUpdated},
units,
};

Expand Down Expand Up @@ -57,30 +57,60 @@ define_ok_modeling_cmd_response_enum! {
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
pub struct Extrude {
/// Any new bodies created by the request.
#[serde(default, skip_serializing_if = "BodiesCreated::is_empty")]
pub bodies_created: BodiesCreated,
/// Any existing bodies updated by the request.
#[serde(default, skip_serializing_if = "BodiesUpdated::is_empty")]
pub bodies_updated: BodiesUpdated,
Comment thread
gserena01 marked this conversation as resolved.
}

/// The response from the `ExtrudeToReference` endpoint.
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
pub struct ExtrudeToReference {
/// Any new bodies created by the request.
#[serde(default, skip_serializing_if = "BodiesCreated::is_empty")]
pub bodies_created: BodiesCreated,
/// Any existing bodies updated by the request.
#[serde(default, skip_serializing_if = "BodiesUpdated::is_empty")]
pub bodies_updated: BodiesUpdated,
}

/// The response from the `TwistExtrude` endpoint.
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
pub struct TwistExtrude {
/// Any new bodies created by the request.
#[serde(default, skip_serializing_if = "BodiesCreated::is_empty")]
pub bodies_created: BodiesCreated,
/// Any existing bodies updated by the request.
#[serde(default, skip_serializing_if = "BodiesUpdated::is_empty")]
pub bodies_updated: BodiesUpdated,
}

/// The response from the `Sweep` endpoint.
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
pub struct Sweep {
/// Any new bodies created by the request.
#[serde(default, skip_serializing_if = "BodiesCreated::is_empty")]
pub bodies_created: BodiesCreated,
/// Any existing bodies updated by the request.
#[serde(default, skip_serializing_if = "BodiesUpdated::is_empty")]
pub bodies_updated: BodiesUpdated,
}

/// The response from the `Revolve` endpoint.
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
pub struct Revolve {
/// Any new bodies created by the request.
#[serde(default, skip_serializing_if = "BodiesCreated::is_empty")]
pub bodies_created: BodiesCreated,
/// Any existing bodies updated by the request.
#[serde(default, skip_serializing_if = "BodiesUpdated::is_empty")]
pub bodies_updated: BodiesUpdated,
}

/// The response from the `Solid3dShellFace` endpoint.
Expand Down Expand Up @@ -134,6 +164,12 @@ define_ok_modeling_cmd_response_enum! {
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)]
#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
pub struct RevolveAboutEdge {
/// Any new bodies created by the request.
#[serde(default, skip_serializing_if = "BodiesCreated::is_empty")]
pub bodies_created: BodiesCreated,
/// Any existing bodies updated by the request.
#[serde(default, skip_serializing_if = "BodiesUpdated::is_empty")]
pub bodies_updated: BodiesUpdated,
}

/// The response from the `CameraDragStart` endpoint.
Expand Down
Loading
Loading