Part: determine tangent intersection of two 2d curves

This commit is contained in:
wmayer
2020-02-13 12:51:40 +01:00
parent b799996c22
commit 3cbe309330
2 changed files with 30 additions and 0 deletions

View File

@@ -174,6 +174,21 @@ bool Part2DObject::seekTrimPoints(const std::vector<Geometry *> &geomlist,
for (int i=1; i <= Intersector.NbPoints(); i++)
points.push_back(Intersector.Point(i));
if (Intersector.NbSegments() > 0) {
const Geom2dInt_GInter& gInter = Intersector.Intersector();
for (int i=1; i <= gInter.NbSegments(); i++) {
const IntRes2d_IntersectionSegment& segm = gInter.Segment(i);
if (segm.HasFirstPoint()) {
const IntRes2d_IntersectionPoint& fp = segm.FirstPoint();
points.push_back(fp.Value());
}
if (segm.HasLastPoint()) {
const IntRes2d_IntersectionPoint& fp = segm.LastPoint();
points.push_back(fp.Value());
}
}
}
for (auto p : points) {
// get the parameter of the intersection point on the primary curve
Projector.Init(p, primaryCurve);