Compare commits

...

5 Commits

6 changed files with 28 additions and 19 deletions

View File

@ -512,7 +512,7 @@ impl Plane {
id,
artifact_id: id.into(),
origin: Point3d::new(0.0, 0.0, 0.0, UnitLen::Mm),
x_axis: Point3d::new(-1.0, 0.0, 0.0, UnitLen::Mm),
x_axis: Point3d::new(1.0, 0.0, 0.0, UnitLen::Mm),
y_axis: Point3d::new(0.0, 0.0, 1.0, UnitLen::Mm),
z_axis: Point3d::new(0.0, 1.0, 0.0, UnitLen::Mm),
value: PlaneType::XZ,

View File

@ -1260,21 +1260,30 @@ async fn make_sketch_plane_from_orientation(
let hide = Some(true);
match data {
PlaneData::XY | PlaneData::NegXY | PlaneData::XZ | PlaneData::NegXZ | PlaneData::YZ | PlaneData::NegYZ => {
/*
NOTE(dr): The x_axis defined below isn't consistent with default plane definitions. PlaneData::Neg* variants
only negate the z axis, x and y axes are the same as PlaneData::*.
Defining the x_axis in this way causes `startOnSketch(-XZ)` and `startOnSketch(offsetPlane(-XZ, offset = 0))`
to produce different results.
*/
// TODO: ignoring the default planes here since we already created them, breaks the
// front end for the feature tree which is stupid and we should fix it.
let x_axis = match data {
PlaneData::NegXY => Point3d::new(-1.0, 0.0, 0.0, UnitLen::Mm),
PlaneData::NegXZ => Point3d::new(-1.0, 0.0, 0.0, UnitLen::Mm),
PlaneData::NegYZ => Point3d::new(0.0, -1.0, 0.0, UnitLen::Mm),
_ => plane.x_axis,
};
// let x_axis = match data {
// PlaneData::NegXY => Point3d::new(-1.0, 0.0, 0.0, UnitLen::Mm),
// PlaneData::NegXZ => Point3d::new(-1.0, 0.0, 0.0, UnitLen::Mm),
// PlaneData::NegYZ => Point3d::new(0.0, -1.0, 0.0, UnitLen::Mm),
// _ => plane.x_axis,
// };
args.batch_modeling_cmd(
plane.id,
ModelingCmd::from(mcmd::MakePlane {
clobber,
origin: plane.origin.into(),
size,
x_axis: x_axis.into(),
// x_axis: x_axis.into(),
x_axis: plane.x_axis.into(),
y_axis: plane.y_axis.into(),
hide,
}),

View File

@ -306,7 +306,7 @@ description: Variables in memory after executing artifact_graph_example_code_no_
}
},
"xAxis": {
"x": -1.0,
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {

View File

@ -771,7 +771,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
}
},
"xAxis": {
"x": -1.0,
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
@ -2783,7 +2783,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
}
},
"xAxis": {
"x": -1.0,
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
@ -2932,7 +2932,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
}
},
"xAxis": {
"x": -1.0,
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
@ -3081,7 +3081,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
}
},
"xAxis": {
"x": -1.0,
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
@ -3179,7 +3179,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
}
},
"xAxis": {
"x": -1.0,
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
@ -3353,7 +3353,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
}
},
"xAxis": {
"x": -1.0,
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
@ -3912,7 +3912,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
}
},
"xAxis": {
"x": -1.0,
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {
@ -4288,7 +4288,7 @@ description: Variables in memory after executing crazy_multi_profile.kcl
}
},
"xAxis": {
"x": -1.0,
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {

View File

@ -181,7 +181,7 @@ description: Variables in memory after executing i-beam.kcl
}
},
"xAxis": {
"x": -1.0,
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {

View File

@ -108,7 +108,7 @@ description: Variables in memory after executing neg_xz_plane.kcl
}
},
"xAxis": {
"x": -1.0,
"x": 1.0,
"y": 0.0,
"z": 0.0,
"units": {