From 98cef3949fe29b0b113b9f5f1664b5867e049612 Mon Sep 17 00:00:00 2001 From: Mike Farrell Date: Wed, 25 Feb 2026 12:19:11 -0800 Subject: [PATCH 1/7] new APIs --- modeling-cmds/src/def_enum.rs | 28 ++++++++++++++++++++++++++++ modeling-cmds/src/ok_response.rs | 16 ++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index 1b2abe52..f591ca02 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -2384,6 +2384,34 @@ define_modeling_cmd_enum! { pub curve_clockwise: bool, } + /// Create a region with a query point. + /// The region should have an ID taken from the ID of the + /// 'CreateRegionQueryPoint' modeling command. + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] + pub struct CreateRegionQueryPoint { + /// Which sketch object to create the region from. + pub object_id: Uuid, + + /// The query point (in the same coordinates as the sketch itself) + /// if a possible sketch region contains this point, then that region will be created + pub query_point: Point2d, + } + + /// Finds a suitable point inside the region for calling such that CreateRegionQueryPoint will generate an identical region. + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] + #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] + #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] + #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] + #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] + pub struct RegionGetQueryPoint { + /// Which region object to search within + pub object_id: Uuid, + } + /// The user clicked on a point in the window, /// returns the region the user clicked on, if any. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index 4ffbf907..107a308d 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -1215,6 +1215,22 @@ define_ok_modeling_cmd_response_enum! { pub struct CreateRegion { } + /// The response from the 'CreateRegionQueryPoint'. + /// The region should have an ID taken from the ID of the + /// 'CreateRegionQueryPoint' modeling command. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] + pub struct CreateRegionQueryPoint { + } + + /// The response from 'RegionGetQueryPoint' modeling command. + #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] + #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] + pub struct RegionGetQueryPoint { + ///A point that is inside of the queried region, in the same coordinate frame as the sketch itself + pub query_point: Point2d, + } + /// The response from the 'SelectRegionFromPoint'. /// If there are multiple ways to construct this region, this chooses arbitrarily. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] From 025e1f6b9b5f0c18df5648e0c45a1834b6de2c94 Mon Sep 17 00:00:00 2001 From: Mike Farrell Date: Wed, 25 Feb 2026 12:21:30 -0800 Subject: [PATCH 2/7] better name for create region /w qp --- modeling-cmds/src/def_enum.rs | 6 +++--- modeling-cmds/src/ok_response.rs | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index f591ca02..8702e23f 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -2386,13 +2386,13 @@ define_modeling_cmd_enum! { /// Create a region with a query point. /// The region should have an ID taken from the ID of the - /// 'CreateRegionQueryPoint' modeling command. + /// 'CreateRegionFromQueryPoint' modeling command. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] - pub struct CreateRegionQueryPoint { + pub struct CreateRegionFromQueryPoint { /// Which sketch object to create the region from. pub object_id: Uuid, @@ -2401,7 +2401,7 @@ define_modeling_cmd_enum! { pub query_point: Point2d, } - /// Finds a suitable point inside the region for calling such that CreateRegionQueryPoint will generate an identical region. + /// Finds a suitable point inside the region for calling such that CreateRegionFromQueryPoint will generate an identical region. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema, ModelingCmdVariant, Builder)] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index 107a308d..fdb593d3 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -1223,10 +1223,10 @@ define_ok_modeling_cmd_response_enum! { pub struct CreateRegionQueryPoint { } - /// The response from 'RegionGetQueryPoint' modeling command. + /// The response from 'CreateRegionFromQueryPoint' modeling command. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] - pub struct RegionGetQueryPoint { + pub struct CreateRegionFromQueryPoint { ///A point that is inside of the queried region, in the same coordinate frame as the sketch itself pub query_point: Point2d, } @@ -1241,6 +1241,5 @@ define_ok_modeling_cmd_response_enum! { /// this returns None. pub region: Option, } - } } From aef773cfe087e24702b17b78311ec882503efd6f Mon Sep 17 00:00:00 2001 From: Mike Farrell Date: Wed, 25 Feb 2026 12:25:59 -0800 Subject: [PATCH 3/7] typo --- modeling-cmds/src/ok_response.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index fdb593d3..27f04403 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -1215,18 +1215,18 @@ define_ok_modeling_cmd_response_enum! { pub struct CreateRegion { } - /// The response from the 'CreateRegionQueryPoint'. + /// The response from the 'CreateRegionFromQueryPoint'. /// The region should have an ID taken from the ID of the /// 'CreateRegionQueryPoint' modeling command. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] - pub struct CreateRegionQueryPoint { + pub struct CreateRegionFromQueryPoint { } - /// The response from 'CreateRegionFromQueryPoint' modeling command. + /// The response from 'RegionGetQueryPoint' modeling command. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] - pub struct CreateRegionFromQueryPoint { + pub struct RegionGetQueryPoint { ///A point that is inside of the queried region, in the same coordinate frame as the sketch itself pub query_point: Point2d, } From cb69e1888ad95af9e499d4ddded3f7ae1acb20b2 Mon Sep 17 00:00:00 2001 From: Mike Farrell Date: Wed, 25 Feb 2026 12:28:40 -0800 Subject: [PATCH 4/7] Update api.json --- modeling-cmds/openapi/api.json | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/modeling-cmds/openapi/api.json b/modeling-cmds/openapi/api.json index 5cbf2cfa..f6fb4f10 100644 --- a/modeling-cmds/openapi/api.json +++ b/modeling-cmds/openapi/api.json @@ -6556,6 +6556,57 @@ "type" ] }, + { + "description": "Create a region with a query point. The region should have an ID taken from the ID of the 'CreateRegionFromQueryPoint' modeling command.", + "type": "object", + "properties": { + "object_id": { + "description": "Which sketch object to create the region from.", + "type": "string", + "format": "uuid" + }, + "query_point": { + "description": "The query point (in the same coordinates as the sketch itself) if a possible sketch region contains this point, then that region will be created", + "allOf": [ + { + "$ref": "#/components/schemas/Point2d" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "create_region_from_query_point" + ] + } + }, + "required": [ + "object_id", + "query_point", + "type" + ] + }, + { + "description": "Finds a suitable point inside the region for calling such that CreateRegionFromQueryPoint will generate an identical region.", + "type": "object", + "properties": { + "object_id": { + "description": "Which region object to search within", + "type": "string", + "format": "uuid" + }, + "type": { + "type": "string", + "enum": [ + "region_get_query_point" + ] + } + }, + "required": [ + "object_id", + "type" + ] + }, { "description": "The user clicked on a point in the window, returns the region the user clicked on, if any.", "type": "object", From c463f64118f9e37709312f5680a7c5da9cd6aaa0 Mon Sep 17 00:00:00 2001 From: Mike Farrell Date: Wed, 25 Feb 2026 16:14:21 -0800 Subject: [PATCH 5/7] region object id -> entity id --- modeling-cmds/openapi/api.json | 6 +++--- modeling-cmds/src/def_enum.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modeling-cmds/openapi/api.json b/modeling-cmds/openapi/api.json index f6fb4f10..518b7255 100644 --- a/modeling-cmds/openapi/api.json +++ b/modeling-cmds/openapi/api.json @@ -6590,8 +6590,8 @@ "description": "Finds a suitable point inside the region for calling such that CreateRegionFromQueryPoint will generate an identical region.", "type": "object", "properties": { - "object_id": { - "description": "Which region object to search within", + "region_id": { + "description": "Which region to search within", "type": "string", "format": "uuid" }, @@ -6603,7 +6603,7 @@ } }, "required": [ - "object_id", + "region_id", "type" ] }, diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index 8702e23f..5a9ff950 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -2408,8 +2408,8 @@ define_modeling_cmd_enum! { #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct RegionGetQueryPoint { - /// Which region object to search within - pub object_id: Uuid, + /// Which region to search within + pub region_id: Uuid, } /// The user clicked on a point in the window, From 8de722c12ae77665d5920be89a779d469da76e52 Mon Sep 17 00:00:00 2001 From: Mike Farrell Date: Thu, 26 Feb 2026 16:10:47 -0800 Subject: [PATCH 6/7] f64 -> LengthUnit for querypoint --- modeling-cmds/src/def_enum.rs | 2 +- modeling-cmds/src/ok_response.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modeling-cmds/src/def_enum.rs b/modeling-cmds/src/def_enum.rs index 5a9ff950..6506bf51 100644 --- a/modeling-cmds/src/def_enum.rs +++ b/modeling-cmds/src/def_enum.rs @@ -2398,7 +2398,7 @@ define_modeling_cmd_enum! { /// The query point (in the same coordinates as the sketch itself) /// if a possible sketch region contains this point, then that region will be created - pub query_point: Point2d, + pub query_point: Point2d, } /// Finds a suitable point inside the region for calling such that CreateRegionFromQueryPoint will generate an identical region. diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index 27f04403..9f89fdab 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -1228,7 +1228,7 @@ define_ok_modeling_cmd_response_enum! { #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct RegionGetQueryPoint { ///A point that is inside of the queried region, in the same coordinate frame as the sketch itself - pub query_point: Point2d, + pub query_point: Point2d, } /// The response from the 'SelectRegionFromPoint'. From d4a43120bf857dd1e182a98bb0ac7eb771607a16 Mon Sep 17 00:00:00 2001 From: Mike Farrell Date: Wed, 4 Mar 2026 14:04:20 -0800 Subject: [PATCH 7/7] typo fix --- modeling-cmds/src/ok_response.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modeling-cmds/src/ok_response.rs b/modeling-cmds/src/ok_response.rs index 9e812236..541a67a3 100644 --- a/modeling-cmds/src/ok_response.rs +++ b/modeling-cmds/src/ok_response.rs @@ -1217,7 +1217,7 @@ define_ok_modeling_cmd_response_enum! { /// The response from the 'CreateRegionFromQueryPoint'. /// The region should have an ID taken from the ID of the - /// 'CreateRegionQueryPoint' modeling command. + /// 'CreateRegionFromQueryPoint' modeling command. #[derive(Debug, Serialize, Deserialize, Clone, JsonSchema, ModelingCmdOutput)] #[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)] pub struct CreateRegionFromQueryPoint {