lint default planes and add a suggestion (#6587)

lint default planes and other plane cleanup

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-04-29 19:11:02 -07:00
committed by GitHub
parent bf63b21d74
commit 9c29756a38
123 changed files with 14097 additions and 13997 deletions

View File

@ -15,8 +15,8 @@ use crate::{
execution::{
kcl_value::FunctionSource,
types::{NumericType, PrimitiveType, RuntimeType, UnitAngle, UnitLen, UnitType},
ExecState, ExecutorContext, ExtrudeSurface, Helix, KclObjectFields, KclValue, Metadata, Sketch, SketchSurface,
Solid, TagIdentifier,
ExecState, ExecutorContext, ExtrudeSurface, Helix, KclObjectFields, KclValue, Metadata, PlaneInfo, Sketch,
SketchSurface, Solid, TagIdentifier,
},
parsing::ast::types::TagNode,
source_range::SourceRange,
@ -984,11 +984,11 @@ impl<'a> FromKclValue<'a> for super::sketch::PlaneData {
fn from_kcl_val(arg: &'a KclValue) -> Option<Self> {
// Case 0: actual plane
if let KclValue::Plane { value } = arg {
return Some(Self::Plane {
origin: value.origin,
x_axis: value.x_axis,
y_axis: value.y_axis,
});
return Some(Self::Plane(PlaneInfo {
origin: value.info.origin,
x_axis: value.info.x_axis,
y_axis: value.info.y_axis,
}));
}
// Case 1: predefined plane
if let Some(s) = arg.as_str() {
@ -1008,7 +1008,7 @@ impl<'a> FromKclValue<'a> for super::sketch::PlaneData {
let origin = plane.get("origin").and_then(FromKclValue::from_kcl_val)?;
let x_axis = plane.get("xAxis").and_then(FromKclValue::from_kcl_val)?;
let y_axis = plane.get("yAxis").and_then(FromKclValue::from_kcl_val)?;
Some(Self::Plane { origin, x_axis, y_axis })
Some(Self::Plane(PlaneInfo { origin, x_axis, y_axis }))
}
}