fix: Correct coordinate system for sketch plane geometry and rendering

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-02-18 11:50:24 -07:00
parent 0798cd2a6c
commit a7ad78e103
2 changed files with 12 additions and 12 deletions

View File

@@ -65,14 +65,14 @@ void SketchFeature::buildShape()
gp_Pnt other_corner1, other_corner2;
if (m_plane == SketchPlane::XY) {
other_corner1.SetCoord(c1.X(), c2.Y(), c1.Z());
other_corner2.SetCoord(c2.X(), c1.Y(), c1.Z());
other_corner1.SetCoord(c2.X(), c1.Y(), c1.Z());
other_corner2.SetCoord(c1.X(), c1.Y(), c2.Z());
} else if (m_plane == SketchPlane::XZ) {
other_corner1.SetCoord(c1.X(), c1.Y(), c2.Z());
other_corner2.SetCoord(c2.X(), c1.Y(), c1.Z());
} else { // YZ
other_corner1.SetCoord(c1.X(), c1.Y(), c2.Z());
other_corner1.SetCoord(c2.X(), c1.Y(), c1.Z());
other_corner2.SetCoord(c1.X(), c2.Y(), c1.Z());
} else { // YZ
other_corner1.SetCoord(c1.X(), c2.Y(), c1.Z());
other_corner2.SetCoord(c1.X(), c1.Y(), c2.Z());
}
BRepBuilderAPI_MakeEdge me1(c1, other_corner1);
@@ -93,8 +93,8 @@ void SketchFeature::buildShape()
double radius = circle->radius();
gp_Dir normal;
switch (m_plane) {
case SketchPlane::XY: normal = gp::DZ(); break;
case SketchPlane::XZ: normal = gp::DY(); break;
case SketchPlane::XY: normal = gp::DY(); break;
case SketchPlane::XZ: normal = gp::DZ(); break;
case SketchPlane::YZ: normal = gp::DX(); break;
}
gp_Ax2 axis(center, normal);