I encountered a bug in Geom2dGcc_Lin2d2Tan.
I would like to try a really simple example but it crash

gp_Pnt2d ptOrigin(0.0,0.0);
Handle_Geom2d_Curve testCurve = new Geom2d_Line(ptOrigin,gp_Dir2d(1.0,0.0));
Geom2dAdaptor_Curve adaptatedCurve(testCurve);
const GccEnt_Position qualifier = GccEnt_noqualifier;
const Geom2dGcc_QualifiedCurve qualifiedCurve(adaptatedCurve,qualifier);
const Standard_Real tolerance = Precision::Approximation();

Geom2dGcc_Lin2d2Tan mkline(qualifiedCurve,ptOrigin,tolerance);

And the last line crash. What is wrong. I used it bad ?

Thanks in advance.

QbProg's picture

I always found line and tangent circles a bit unstable and buggy (incorrect results). I ended up rewriting the formulas...

Steph's picture

Hi Thomas,

Thanks for the news. It didn't help me :) but i will try to do the same as you.


Thomas Paviot's picture

Hi Steph,

When running your code, I get the following error:

>>> RuntimeError: GccEnt_BadQualifier

Trying using other qualifiers: GccEnt_unqualified, GccEnt_enclosing, GccEnt_enclosed or GccEnt_outside.

Best Regards,


Steph's picture

Thanks Thomas, i will try.