const Handle(GccInt_Bisec)& abisector,
const gp_Vec2d& afirstvector ,
const gp_Vec2d& asecondvector,
+ const gp_Vec2d& VecRef,
const Standard_Real adirection,
Standard_Real& aparameter,
Standard_Boolean& asense,
// Modified by Sergey KHROMOV - Thu Oct 31 14:16:54 2002
}
}
+ //jgv: for OCC26185
+ if (VecRef.SquareMagnitude() != 0)
+ {
+ gp_Dir2d DirRef = VecRef;
+ if (tangdir * DirRef < 0.)
+ asense = Standard_False;
+ }
+ ///////////////////
// Modified by Sergey KHROMOV - Tue Oct 22 16:35:51 2002 End
}
}
Handle(Geom2d_Curve) CurveE;
Handle(GccInt_Bisec) TheSol;
- gp_Vec2d tan1 = afirstcurve->DN(afirstcurve->LastParameter (),1);
- gp_Vec2d tan2 = asecondcurve->DN(asecondcurve->FirstParameter(),1);
+ //jgv: for OCC26296
+ gp_Vec2d LineBisVec(0.,0.);
+ gp_Vec2d tan1, tan2;
+ gp_Pnt2d Pnt1, Pnt2;
+ afirstcurve->D1(afirstcurve->LastParameter(), Pnt1, tan1);
+ asecondcurve->D1(asecondcurve->FirstParameter(), Pnt2, tan2);
+ if (!oncurve)
+ {
+ LineBisVec = gp_Vec2d(Pnt1, Pnt2);
+ LineBisVec.Rotate(M_PI/2.);
+ }
+ ///////////////////
+
tan1.Reverse();
if (type1 == STANDARD_TYPE(Geom2d_TrimmedCurve))
// adirection,parameter,sense,ok);
if (oncurve)
distanceptsol = Distance(apoint,solution,
- tan2,tan1,
+ tan2,tan1,LineBisVec,
adirection,parameter,sense,ok);
else
distanceptsol = Distance(apoint,solution,
- afirstvector,asecondvector,
+ afirstvector,asecondvector,LineBisVec,
adirection,parameter,sense,ok);
// Modified by skv - Tue Feb 15 17:51:29 2005 Integration End
Handle(Geom2d_Curve) bisectorcurve = new Geom2d_Line(line);
sense = Standard_True;
if (oncurve) {
distanceptsol = Distance(apoint,solution,
- tan1,tan2,
+ tan1,tan2,LineBisVec,
adirection,parameter,sense,ok);
}
else {ok = Standard_True;}
// adirection,parameter,sense,ok);
if (oncurve)
distanceptsol = Distance(apoint,solution,
- tan2,tan1,
+ tan2,tan1,LineBisVec,
adirection,parameter,sense,ok);
else
distanceptsol = Distance(apoint,solution,
- afirstvector,asecondvector,
+ afirstvector,asecondvector,LineBisVec,
adirection,parameter,sense,ok);
// Modified by skv - Tue Feb 15 17:51:29 2005 Integration End
if (distanceptsol <= distancemini) {
Handle(GccInt_Bisec) solution = Bisector.ThisSolution(i);
Degenerate(solution,tolerance);
sense = Standard_True;
- distanceptsol = Distance(apoint,solution,tan1,tan2,
+ distanceptsol = Distance(apoint,solution,tan1,tan2,LineBisVec,
adirection,parameter,sense,ok);
if (ok || !oncurve) {
sense = Standard_False;
// adirection,parameter,sense,ok);
if (oncurve)
distanceptsol = Distance(apoint,solution,
- tan2,tan1,
+ tan2,tan1,LineBisVec,
adirection,parameter,sense,ok);
else
distanceptsol = Distance(apoint,solution,
- afirstvector,asecondvector,
+ afirstvector,asecondvector,LineBisVec,
adirection,parameter,sense,ok);
// Modified by skv - Tue Feb 15 17:51:29 2005 Integration End
if (distanceptsol <= distancemini) {
}
else if (type == GccInt_Par) {
bisectorcurve = new Geom2d_Parabola(TheSol->Parabola());
- Standard_Real FocalLength = ((Handle(Geom2d_Parabola)&)bisectorcurve)->Focal();
+ gp_Pnt2d apex = bisectorcurve->Value(0.);
+ gp_Pnt2d firstpnt = bisectorcurve->Value(firstparameter);
+ Standard_Real ChordLen = apex.Distance(firstpnt);
+ const Standard_Real TolPar = 1.e-5;
Standard_Real secondparameter = Precision::Infinite();
if (!thesense)
{
if (ajointype == GeomAbs_Intersection &&
- 4.*FocalLength < firstparameter) //first parameter is too far from peak of parabola
+ TolPar < firstparameter &&
+ ChordLen >= circle1.Radius()) //first parameter is too far from peak of parabola
secondparameter = 0.;
thebisector = new Geom2d_TrimmedCurve(bisectorcurve,
firstparameter,
else
{
if (ajointype == GeomAbs_Intersection &&
- firstparameter < -4.*FocalLength) //first parameter is too far from peak of parabola
+ firstparameter < -TolPar &&
+ ChordLen >= circle1.Radius()) //first parameter is too far from peak of parabola
secondparameter = 0.;
thebisector = new Geom2d_TrimmedCurve(bisectorcurve,
firstparameter,
// adirection,parameter,sense,ok);
if (oncurve)
distanceptsol = Distance(apoint,solution,
- tan2,tan1,
+ tan2,tan1,LineBisVec,
adirection,parameter,sense,ok);
else
distanceptsol = Distance(apoint,solution,
- afirstvector,asecondvector,
+ afirstvector,asecondvector,LineBisVec,
adirection,parameter,sense,ok);
// Modified by skv - Tue Feb 15 17:51:29 2005 Integration End
// if (distanceptsol <= distancemini) {
// adirection,parameter,sense,ok);
if (oncurve)
distanceptsol = Distance(apoint,solution,
- tan2,tan1,
+ tan2,tan1,LineBisVec,
adirection,parameter,sense,ok);
else
distanceptsol = Distance(apoint,solution,
- afirstvector,asecondvector,
+ afirstvector,asecondvector,LineBisVec,
adirection,parameter,sense,ok, Standard_True);
// Modified by skv - Tue Feb 15 17:51:29 2005 Integration End
if (ok || !oncurve) {
Standard_Boolean ok;
Standard_Boolean thesense = Standard_False,sense;
Standard_Real distanceptsol,parameter,firstparameter =0.,secondparameter;
+ gp_Vec2d VecRef(0.,0.);
Handle(Geom2d_Curve) curve;
Handle(GccInt_Bisec) TheSol;
Degenerate(solution,tolerance);
sense = Standard_False;
distanceptsol = Distance(apoint,solution,
- afirstvector,asecondvector,
+ afirstvector,asecondvector,VecRef,
adirection,parameter,sense,ok);
if (distanceptsol <= distancemini) {
}
sense = Standard_False;
distanceptsol = Distance(apoint,solution,
- afirstvector,asecondvector,
+ afirstvector,asecondvector,VecRef,
adirection,parameter,sense,ok);
if (ok || !oncurve) {
{
Standard_Boolean sense,ok;
Standard_Real parameter;
+ gp_Vec2d VecRef(0.,0.);
GccAna_Pnt2dBisec bisector(afirstpoint->Pnt2d(),asecondpoint->Pnt2d());
gp_Lin2d line = bisector.ThisSolution();
sense = Standard_False;
Distance(apoint,solution,
- afirstvector,asecondvector,
- adirection,parameter,sense,ok);
+ afirstvector,asecondvector,VecRef,
+ adirection,parameter,sense,ok);
if (ok || !oncurve) {
Handle(Geom2d_Curve) bisectorcurve = new Geom2d_Line(line);
if (!sense)