Add more detail to close() docs (#7300)

* Add more detail to close() docs

* Run gen
This commit is contained in:
Adam Sunderland
2025-05-30 16:05:32 -04:00
committed by GitHub
parent 1c07e8af5b
commit 0624e42822
3 changed files with 8 additions and 4 deletions

View File

@ -14,7 +14,7 @@ close(
): Sketch ): Sketch
``` ```
If you want to perform some 3-dimensional operation on a sketch, like extrude or sweep, you must `close` it first. `close` must be called even if the end point of the last segment is coincident with the sketch starting point.
### Arguments ### Arguments

View File

@ -53607,7 +53607,7 @@
{ {
"name": "close", "name": "close",
"summary": "Construct a line segment from the current origin back to the profile's origin, ensuring the resulting 2-dimensional sketch is not open-ended.", "summary": "Construct a line segment from the current origin back to the profile's origin, ensuring the resulting 2-dimensional sketch is not open-ended.",
"description": "", "description": "If you want to perform some 3-dimensional operation on a sketch, like extrude or sweep, you must `close` it first. `close` must be called even if the end point of the last segment is coincident with the sketch starting point.",
"tags": [ "tags": [
"sketch" "sketch"
], ],

View File

@ -12,6 +12,7 @@ use parse_display::{Display, FromStr};
use schemars::JsonSchema; use schemars::JsonSchema;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use super::shapes::get_radius;
#[cfg(feature = "artifact-graph")] #[cfg(feature = "artifact-graph")]
use crate::execution::{Artifact, ArtifactId, CodeRef, StartSketchOnFace, StartSketchOnPlane}; use crate::execution::{Artifact, ArtifactId, CodeRef, StartSketchOnFace, StartSketchOnPlane};
use crate::{ use crate::{
@ -32,8 +33,6 @@ use crate::{
}, },
}; };
use super::shapes::get_radius;
/// A tag for a face. /// A tag for a face.
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
#[ts(export)] #[ts(export)]
@ -1544,6 +1543,11 @@ pub async fn close(exec_state: &mut ExecState, args: Args) -> Result<KclValue, K
/// Construct a line segment from the current origin back to the profile's /// Construct a line segment from the current origin back to the profile's
/// origin, ensuring the resulting 2-dimensional sketch is not open-ended. /// origin, ensuring the resulting 2-dimensional sketch is not open-ended.
/// ///
/// If you want to perform some 3-dimensional operation on a sketch, like
/// extrude or sweep, you must `close` it first. `close` must be called even
/// if the end point of the last segment is coincident with the sketch
/// starting point.
///
/// ```no_run /// ```no_run
/// startSketchOn(XZ) /// startSketchOn(XZ)
/// |> startProfile(at = [0, 0]) /// |> startProfile(at = [0, 0])