Sketcher: Fix errors message when selecting circle seam point. (#25953)
This commit is contained in:
@@ -11438,6 +11438,17 @@ Data::IndexedName SketchObject::checkSubName(const char *subname) const{
|
||||
int posId = static_cast<int>(PointPos::none);
|
||||
if ((iss >> sep >> posId) && sep == 'v') {
|
||||
int idx = getVertexIndexGeoPos(geoId, static_cast<PointPos>(posId));
|
||||
|
||||
// Outside edit-mode circles exposes the seam point but not the center, while in edit-mode we expose the center but not the seam.
|
||||
// getVertexIndexGeoPos searching for a circle start point (g1v1 for example) (which happens outside of edit mode) will fail.
|
||||
// see https://github.com/FreeCAD/FreeCAD/issues/25089
|
||||
// The following fix works because circles have always 1 vertex, whether in or out of edit mode.
|
||||
if (idx < 0 && (static_cast<PointPos>(posId) == PointPos::start || static_cast<PointPos>(posId) == PointPos::end)) {
|
||||
if (geo->is<Part::GeomCircle>() || geo->is<Part::GeomEllipse>()) {
|
||||
idx = getVertexIndexGeoPos(geoId, PointPos::mid);
|
||||
}
|
||||
}
|
||||
|
||||
if (idx < 0) {
|
||||
FC_ERR("invalid subname " << subname);
|
||||
return Data::IndexedName();
|
||||
|
||||
Reference in New Issue
Block a user