Typo: tangental should be tangential (#842)
* Typo: tangental should be tangential * Run executor tests in serial * Fix typo in image file names
This commit is contained in:
@ -1080,11 +1080,11 @@ async fn inner_arc(data: ArcData, sketch_group: Box<SketchGroup>, args: Args) ->
|
||||
Ok(new_sketch_group)
|
||||
}
|
||||
|
||||
/// Data to draw a tangental arc.
|
||||
/// Data to draw a tangential arc.
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, ts_rs::TS)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase", untagged)]
|
||||
pub enum TangentalArcData {
|
||||
pub enum TangentialArcData {
|
||||
RadiusAndOffset {
|
||||
/// Radius of the arc.
|
||||
/// Not to be confused with Raiders of the Lost Ark.
|
||||
@ -1103,20 +1103,20 @@ pub enum TangentalArcData {
|
||||
Point([f64; 2]),
|
||||
}
|
||||
|
||||
/// Draw a tangental arc.
|
||||
pub async fn tangental_arc(args: Args) -> Result<MemoryItem, KclError> {
|
||||
let (data, sketch_group): (TangentalArcData, Box<SketchGroup>) = args.get_data_and_sketch_group()?;
|
||||
/// Draw a tangential arc.
|
||||
pub async fn tangential_arc(args: Args) -> Result<MemoryItem, KclError> {
|
||||
let (data, sketch_group): (TangentialArcData, Box<SketchGroup>) = args.get_data_and_sketch_group()?;
|
||||
|
||||
let new_sketch_group = inner_tangental_arc(data, sketch_group, args).await?;
|
||||
let new_sketch_group = inner_tangential_arc(data, sketch_group, args).await?;
|
||||
Ok(MemoryItem::SketchGroup(new_sketch_group))
|
||||
}
|
||||
|
||||
/// Draw an arc.
|
||||
#[stdlib {
|
||||
name = "tangentalArc",
|
||||
name = "tangentialArc",
|
||||
}]
|
||||
async fn inner_tangental_arc(
|
||||
data: TangentalArcData,
|
||||
async fn inner_tangential_arc(
|
||||
data: TangentialArcData,
|
||||
sketch_group: Box<SketchGroup>,
|
||||
args: Args,
|
||||
) -> Result<Box<SketchGroup>, KclError> {
|
||||
@ -1125,7 +1125,7 @@ async fn inner_tangental_arc(
|
||||
let id = uuid::Uuid::new_v4();
|
||||
|
||||
let to = match &data {
|
||||
TangentalArcData::RadiusAndOffset { radius, offset } => {
|
||||
TangentialArcData::RadiusAndOffset { radius, offset } => {
|
||||
// Calculate the end point from the angle and radius.
|
||||
let end_angle = Angle::from_degrees(*offset);
|
||||
let start_angle = Angle::from_degrees(0.0);
|
||||
@ -1147,7 +1147,7 @@ async fn inner_tangental_arc(
|
||||
.await?;
|
||||
to.into()
|
||||
}
|
||||
TangentalArcData::PointWithTag { to, .. } => {
|
||||
TangentialArcData::PointWithTag { to, .. } => {
|
||||
args.send_modeling_cmd(
|
||||
id,
|
||||
ModelingCmd::ExtendPath {
|
||||
@ -1166,7 +1166,7 @@ async fn inner_tangental_arc(
|
||||
|
||||
*to
|
||||
}
|
||||
TangentalArcData::Point(to) => {
|
||||
TangentialArcData::Point(to) => {
|
||||
args.send_modeling_cmd(
|
||||
id,
|
||||
ModelingCmd::ExtendPath {
|
||||
@ -1207,11 +1207,11 @@ async fn inner_tangental_arc(
|
||||
Ok(new_sketch_group)
|
||||
}
|
||||
|
||||
/// Data to draw a tangental arc to a specific point.
|
||||
/// Data to draw a tangential arc to a specific point.
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, ts_rs::TS)]
|
||||
#[ts(export)]
|
||||
#[serde(rename_all = "camelCase", untagged)]
|
||||
pub enum TangentalArcToData {
|
||||
pub enum TangentialArcToData {
|
||||
/// A point with a tag.
|
||||
PointWithTag {
|
||||
/// Where the arc should end. Must lie in the same plane as the current path pen position. Must not be colinear with current path pen position.
|
||||
@ -1223,27 +1223,27 @@ pub enum TangentalArcToData {
|
||||
Point([f64; 2]),
|
||||
}
|
||||
|
||||
/// Draw a tangental arc to a specific point.
|
||||
pub async fn tangental_arc_to(args: Args) -> Result<MemoryItem, KclError> {
|
||||
let (data, sketch_group): (TangentalArcToData, Box<SketchGroup>) = args.get_data_and_sketch_group()?;
|
||||
/// Draw a tangential arc to a specific point.
|
||||
pub async fn tangential_arc_to(args: Args) -> Result<MemoryItem, KclError> {
|
||||
let (data, sketch_group): (TangentialArcToData, Box<SketchGroup>) = args.get_data_and_sketch_group()?;
|
||||
|
||||
let new_sketch_group = inner_tangental_arc_to(data, sketch_group, args).await?;
|
||||
let new_sketch_group = inner_tangential_arc_to(data, sketch_group, args).await?;
|
||||
Ok(MemoryItem::SketchGroup(new_sketch_group))
|
||||
}
|
||||
|
||||
/// Draw an arc.
|
||||
#[stdlib {
|
||||
name = "tangentalArcTo",
|
||||
name = "tangentialArcTo",
|
||||
}]
|
||||
async fn inner_tangental_arc_to(
|
||||
data: TangentalArcToData,
|
||||
async fn inner_tangential_arc_to(
|
||||
data: TangentialArcToData,
|
||||
sketch_group: Box<SketchGroup>,
|
||||
args: Args,
|
||||
) -> Result<Box<SketchGroup>, KclError> {
|
||||
let from: Point2d = sketch_group.get_coords_from_paths()?;
|
||||
let to = match &data {
|
||||
TangentalArcToData::PointWithTag { to, .. } => to,
|
||||
TangentalArcToData::Point(to) => to,
|
||||
TangentialArcToData::PointWithTag { to, .. } => to,
|
||||
TangentialArcToData::Point(to) => to,
|
||||
};
|
||||
|
||||
let delta = [to[0] - from.x, to[1] - from.y];
|
||||
@ -1270,7 +1270,7 @@ async fn inner_tangental_arc_to(
|
||||
base: BasePath {
|
||||
from: from.into(),
|
||||
to: *to,
|
||||
name: if let TangentalArcToData::PointWithTag { tag, .. } = data {
|
||||
name: if let TangentialArcToData::PointWithTag { tag, .. } = data {
|
||||
tag.to_string()
|
||||
} else {
|
||||
"".to_string()
|
||||
|
Reference in New Issue
Block a user