diff --git a/modeling-cmds/openapi/api.json b/modeling-cmds/openapi/api.json index 67c40729..12d5defa 100644 --- a/modeling-cmds/openapi/api.json +++ b/modeling-cmds/openapi/api.json @@ -7373,6 +7373,46 @@ "type" ] }, + { + "description": "A general exact curve segment. Start at the current path \"pen\" and end at the final control point. In the first pass this is used for non-rational open-uniform spline curves.", + "type": "object", + "properties": { + "degree": { + "description": "Degree of the curve.", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "points": { + "description": "Ordered control points for the curve. The final 3D point becomes the new path \"pen\" position.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Point4d" + } + }, + "rational": { + "description": "Whether to use the homogeneous `w` component as a rational weight.", + "type": "boolean" + }, + "relative": { + "description": "Whether or not this curve is a relative offset", + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "curve" + ] + } + }, + "required": [ + "degree", + "points", + "rational", + "relative", + "type" + ] + }, { "description": "Adds a tangent arc from current pen position with the given radius and angle.", "type": "object", @@ -7733,20 +7773,16 @@ "type": "object", "properties": { "w": { - "type": "number", - "format": "float" + "$ref": "#/components/schemas/LengthUnit" }, "x": { - "type": "number", - "format": "float" + "$ref": "#/components/schemas/LengthUnit" }, "y": { - "type": "number", - "format": "float" + "$ref": "#/components/schemas/LengthUnit" }, "z": { - "type": "number", - "format": "float" + "$ref": "#/components/schemas/LengthUnit" } }, "required": [ diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index 374171d3..d0d010a0 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -1600,7 +1600,7 @@ define_modeling_cmd_enum! { /// The default color to use for highlight #[serde(default)] pub highlight_color: Option, - /// The default color to use for selection + /// The default color to use for selection #[serde(default)] pub selection_color: Option, } diff --git a/modeling-cmds/src/shared.rs b/modeling-cmds/src/shared.rs index a8efb471..0fc31332 100644 --- a/modeling-cmds/src/shared.rs +++ b/modeling-cmds/src/shared.rs @@ -620,7 +620,7 @@ pub enum CameraDragInteractionType { /// A segment of a path. /// Paths are composed of many segments. -#[derive(Debug, Clone, Copy, Serialize, Deserialize, JsonSchema, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema, PartialEq)] #[serde(rename_all = "snake_case", tag = "type")] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] @@ -662,6 +662,20 @@ pub enum PathSegment { ///Whether or not this bezier is a relative offset relative: bool, }, + /// A general exact curve segment. + /// Start at the current path "pen" and end at the final control point. + /// In the first pass this is used for non-rational open-uniform spline curves. + Curve { + /// Degree of the curve. + degree: u32, + /// Whether to use the homogeneous `w` component as a rational weight. + rational: bool, + /// Ordered control points for the curve. + /// The final 3D point becomes the new path "pen" position. + points: Vec>, + ///Whether or not this curve is a relative offset + relative: bool, + }, /// Adds a tangent arc from current pen position with the given radius and angle. TangentialArc { /// Radius of the arc.