Sketcher New Feature: Ellipse support
- Ellipse introduction button via (center,majaxis extreme, a point in edge), ellipse is always CCW so that Z axis goes in the positive direction of the sketch - Backwards compatibility with files of previous versions of ellipse not defining a phi angle - Art by Jim (all the icons you see and the XPMs shown on creation of an ellipse) - Element Widget support for ellipses - Box selection for ellipses - Point on Ellipse constraint based on the gardener's method based on Ulrich's function proposal (radcan simplified, i.e. with simplify_radical sage function) - Tangent: Ellipse to Line based on DeepSOIC's geometric formulation (radcan simplified) Sketcher New Feature: Internal Alignment Constraint - The element to which internal alignment is applied has to be selected last. - All other elements are added in the order of priority, taking into account existing elements - Art by Jim (beautiful icons). Sketcher New Feature: Tool to show/hide/restore the internal geometry of an element - New functionality for show/hide internal geometry: toggles between hiding all unused internal geometry elements and showing all internal geometry. The restore function is implicit to the showing all internal geometry Sketcher New Feature: Arc of Ellipse support - Part::Geometry + Python implementation - ArcOfEllipse creation method - Art by Jim (all the icons you see and the XPMs shown on creation of arc of ellipse elements) - Sketcher Element widget for ArcOfEllipse. Bug fix: Select elements associated to constraints works now for foci internal alignment constraints
This commit is contained in:
@@ -257,6 +257,10 @@ Base::Vector3d SketchObject::getPoint(int GeoId, PointPos PosId) const
|
||||
const Part::GeomCircle *circle = dynamic_cast<const Part::GeomCircle*>(geo);
|
||||
if (PosId == mid)
|
||||
return circle->getCenter();
|
||||
} else if (geo->getTypeId() == Part::GeomEllipse::getClassTypeId()) {
|
||||
const Part::GeomEllipse *ellipse = dynamic_cast<const Part::GeomEllipse*>(geo);
|
||||
if (PosId == mid)
|
||||
return ellipse->getCenter();
|
||||
} else if (geo->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) {
|
||||
const Part::GeomArcOfCircle *aoc = dynamic_cast<const Part::GeomArcOfCircle*>(geo);
|
||||
if (PosId == start)
|
||||
@@ -265,6 +269,14 @@ Base::Vector3d SketchObject::getPoint(int GeoId, PointPos PosId) const
|
||||
return aoc->getEndPoint();
|
||||
else if (PosId == mid)
|
||||
return aoc->getCenter();
|
||||
} else if (geo->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId()) {
|
||||
const Part::GeomArcOfEllipse *aoc = dynamic_cast<const Part::GeomArcOfEllipse*>(geo);
|
||||
if (PosId == start)
|
||||
return aoc->getStartPoint();
|
||||
else if (PosId == end)
|
||||
return aoc->getEndPoint();
|
||||
else if (PosId == mid)
|
||||
return aoc->getCenter();
|
||||
}
|
||||
|
||||
return Base::Vector3d();
|
||||
@@ -944,7 +956,9 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} else if (geo->getTypeId() == Part::GeomEllipse::getClassTypeId()) {
|
||||
// TODO: Ellipse Trim support
|
||||
return 0;
|
||||
} else if (geo->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) {
|
||||
const Part::GeomArcOfCircle *aoc = dynamic_cast<const Part::GeomArcOfCircle*>(geo);
|
||||
Base::Vector3d center = aoc->getCenter();
|
||||
@@ -1490,6 +1504,9 @@ void SketchObject::rebuildVertexIndex(void)
|
||||
} else if ((*it)->getTypeId() == Part::GeomCircle::getClassTypeId()) {
|
||||
VertexId2GeoId.push_back(i);
|
||||
VertexId2PosId.push_back(mid);
|
||||
} else if ((*it)->getTypeId() == Part::GeomEllipse::getClassTypeId()) {
|
||||
VertexId2GeoId.push_back(i);
|
||||
VertexId2PosId.push_back(mid);
|
||||
} else if ((*it)->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) {
|
||||
VertexId2GeoId.push_back(i);
|
||||
VertexId2PosId.push_back(start);
|
||||
@@ -1497,6 +1514,13 @@ void SketchObject::rebuildVertexIndex(void)
|
||||
VertexId2PosId.push_back(end);
|
||||
VertexId2GeoId.push_back(i);
|
||||
VertexId2PosId.push_back(mid);
|
||||
} else if ((*it)->getTypeId() == Part::GeomArcOfEllipse::getClassTypeId()) {
|
||||
VertexId2GeoId.push_back(i);
|
||||
VertexId2PosId.push_back(start);
|
||||
VertexId2GeoId.push_back(i);
|
||||
VertexId2PosId.push_back(end);
|
||||
VertexId2GeoId.push_back(i);
|
||||
VertexId2PosId.push_back(mid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user