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
21 changes: 21 additions & 0 deletions modeling-cmds/openapi/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -7798,6 +7798,27 @@
"type"
]
},
{
"description": "Finds a suitable set of arguments that can be passed to CreateRegion to resolve this very region.",
"type": "object",
"properties": {
"region_id": {
"description": "Which region to resolve",
"type": "string",
"format": "uuid"
},
"type": {
"type": "string",
"enum": [
"region_get_resolvable_intersection_info"
]
}
},
"required": [
"region_id",
"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",
Expand Down
11 changes: 11 additions & 0 deletions modeling-cmds/src/def_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2635,6 +2635,17 @@ define_modeling_cmd_enum! {
pub version: RegionVersion,
}

/// Finds a suitable set of arguments that can be passed to CreateRegion to resolve this very 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 RegionGetResolvableIntersectionInfo {
/// Which region to resolve
pub region_id: Uuid,
}

/// Create a region with a query point.
/// The region should have an ID taken from the ID of the
/// 'CreateRegionFromQueryPoint' modeling command.
Expand Down
16 changes: 16 additions & 0 deletions modeling-cmds/src/ok_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,22 @@ define_ok_modeling_cmd_response_enum! {
pub region_mapping: HashMap<Uuid, Uuid>,
}

/// The response from the 'RegionGetResolvableIntersectionInfo'.
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema, ModelingCmdOutput)]
#[cfg_attr(not(feature = "unstable_exhaustive"), non_exhaustive)]
pub struct RegionGetResolvableIntersectionInfo {
/// The UUID of the walking curve that borders the queried region
pub segment: Uuid,
/// The UUID of the curve that intersects the walking curve that also borders the queried region
pub intersection_segment: Uuid,
/// Disambiguator providing the index of the intersection. Can be non-zero if the two curves intersect multiple times
pub intersection_index: u32,
/// The total number of intersections between the two curves.
pub intersection_count: u32,
/// True if the region lies within the clockwise interior of the two intersections (inside a "right" turn from the segment to the intersection segment)
pub curve_clockwise: bool,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Here is the respective KCL call that will consume these values https://zoo.dev/docs/kcl-std/functions/std-sketch-region

When I compute the boolean false means CCW and true means CW. I am using it as an encoding.

KCL refers to this as Direction

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no worries, we should be good engine-side here

}

/// The response from the 'CreateRegionFromQueryPoint'.
/// The region should have an ID taken from the ID of the
/// 'CreateRegionFromQueryPoint' modeling command.
Expand Down