Part: determine tangent intersection of two 2d curves
This commit is contained in:
@@ -563,6 +563,21 @@ PyObject* GeometryCurvePy::intersect2d(PyObject *args)
|
||||
tuple.setItem(1, Py::Float(pt.Y()));
|
||||
list.append(tuple);
|
||||
}
|
||||
if (intCC.NbSegments() > 0) {
|
||||
// See also Curve2dPy::intersectCC() that uses Geom2dAPI_ExtremaCurveCurve
|
||||
const Geom2dInt_GInter& gInter = intCC.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();
|
||||
gp_Pnt2d pt = fp.Value();
|
||||
Py::Tuple tuple(2);
|
||||
tuple.setItem(0, Py::Float(pt.X()));
|
||||
tuple.setItem(1, Py::Float(pt.Y()));
|
||||
list.append(tuple);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Py::new_reference_to(list);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user