Merge pull request #25536 from AjinkyaDahale/patch-8
Sketcher: Only draw finite conics
This commit is contained in:
@@ -204,7 +204,7 @@ std::vector<Base::Vector2d> CurveConverter::toVector2D(const Part::Geometry* geo
|
||||
vector2d.emplace_back(point.x, point.y);
|
||||
};
|
||||
|
||||
auto isconic = geometry->isDerivedFrom<Part::GeomConic>();
|
||||
auto isperiodicconic = geometry->is<Part::GeomCircle>() || geometry->is<Part::GeomEllipse>();
|
||||
auto isbounded = geometry->isDerivedFrom<Part::GeomBoundedCurve>();
|
||||
|
||||
if (geometry->is<Part::GeomLineSegment>()) { // add a line
|
||||
@@ -213,7 +213,7 @@ std::vector<Base::Vector2d> CurveConverter::toVector2D(const Part::Geometry* geo
|
||||
emplaceasvector2d(geo->getStartPoint());
|
||||
emplaceasvector2d(geo->getEndPoint());
|
||||
}
|
||||
else if (isconic || isbounded) {
|
||||
else if (isperiodicconic || isbounded) {
|
||||
|
||||
auto geo = static_cast<const Part::GeomConic*>(geometry);
|
||||
|
||||
@@ -225,7 +225,7 @@ std::vector<Base::Vector2d> CurveConverter::toVector2D(const Part::Geometry* geo
|
||||
}
|
||||
|
||||
// either close the curve for untrimmed conic or set the last point for bounded curves
|
||||
emplaceasvector2d(isconic ? geo->value(0) : geo->value(geo->getLastParameter()));
|
||||
emplaceasvector2d(isperiodicconic ? geo->value(0) : geo->value(geo->getLastParameter()));
|
||||
}
|
||||
|
||||
return vector2d;
|
||||
|
||||
Reference in New Issue
Block a user