diff --git a/src/Mod/Part/App/PartFeature.cpp b/src/Mod/Part/App/PartFeature.cpp index fbaa479fe7..5ec7a459fa 100644 --- a/src/Mod/Part/App/PartFeature.cpp +++ b/src/Mod/Part/App/PartFeature.cpp @@ -1776,11 +1776,19 @@ bool Feature::getCameraAlignmentDirection(Base::Vector3d& directionZ, Base::Vect // Edge direction const size_t edgeCount = topoShape.countSubShapes(TopAbs_EDGE); - if (edgeCount == 1 && topoShape.isLinearEdge()) { - if (const std::unique_ptr geometry = Geometry::fromShape(topoShape.getSubShape(TopAbs_EDGE, 1), true)) { - const std::unique_ptr geomLine(static_cast(geometry.get())->toLine()); - if (geomLine) { - directionZ = geomLine->getDir().Normalize(); + if (edgeCount == 1) { + if (topoShape.isLinearEdge()) { + if (const std::unique_ptr geometry = Geometry::fromShape(topoShape.getSubShape(TopAbs_EDGE, 1), true)) { + const std::unique_ptr geomLine(static_cast(geometry.get())->toLine()); + if (geomLine) { + directionZ = geomLine->getDir().Normalize(); + return true; + } + } + } else { + // Planar curves + if (gp_Pln plane; topoShape.findPlane(plane)) { + directionZ = Base::Vector3d(plane.Axis().Direction().X(), plane.Axis().Direction().Y(), plane.Axis().Direction().Z()).Normalize(); return true; } }