1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-09 18:50:54 +03:00

0029694: Geom2dGcc_Circ2dTanCenGeo crash

The reason of this issue is in incorrectly interpreted the generic class "TheExtPC" (eliminated after the fix 0024773) as Extrema_ExtPC2d. Correct interpretation must be "Extrema_EPCOfExtPC2d" class.

Now this problem has been fixed in the class Geom2dGcc_Circ2dTanCenGeo.

New testgrid "lowalgos 2dgcc" has been created.
This commit is contained in:
nbv 2018-05-22 12:15:27 +03:00 committed by bugmaster
parent 638ad7f3c5
commit 894dba72a3
16 changed files with 265 additions and 272 deletions

View File

@ -5684,18 +5684,33 @@ projponf f pnt
Syntax: Syntax:
~~~~~ ~~~~~
cirtang cname curve/point/radius curve/point/radius curve/point/radius cirtang result [-t <Tolerance>] -c <curve> -p <point> -r <Radius>...
~~~~~ ~~~~~
Builds all circles satisfying the three constraints which are either a curve (the circle must be tangent to that curve), a point (the circle must pass through that point), or a radius for the circle. Only one constraint can be a radius. The solutions will be stored in variables *name_1*, *name_2*, etc. Builds all circles satisfying the condition:
1. the circle must be tangent to every given curve;
2. the circle must pass through every given point;
3. the radius of the circle must be equal to the requested one.
Only following set of input data is supported: Curve-Curve-Curve, Curve-Curve-Point, Curve-Curve-Radius, Curve-Point-Point, Curve-Point-Radius, Point-Point-Point, Point-Point-Radius. The solutions will be stored in variables *result_1*, *result_2*, etc.
**Example:** **Example:**
~~~~~ ~~~~~
# a point, a line and a radius. 2 solutions # a point, a line and a radius. 2 solutions of type Curve-Point-Radius (C-P-R)
point p 0 0 point p 0 0
line 1 10 0 -1 1 line l 10 0 -1 1
cirtang c p 1 4 cirtang c -p p -c l -r 4
== c_1 c_2 == Solution of type C-P-R is: c_1 c_2
~~~~~
Additionally it is possible to create a circle(s) with given center and tangent to the given curve (Curve-Point type).
**Example:**
~~~~~
point pp 1 1
2dbsplinecurve cc 1 2 0 2 1 2 -10 -5 1 10 -5 1
cirtang r -p pp -c cc
== Solution of type C-P is: r_1 r_2
~~~~~ ~~~~~
@subsubsection occt_draw_6_10_2 lintan @subsubsection occt_draw_6_10_2 lintan

View File

@ -41,12 +41,13 @@ Geom2dGcc_Circ2dTanCenGeo (const Geom2dGcc_QCurve& Qualified1,
//======================================================================== //========================================================================
// Initialisation des champs. + // Initialisation des champs. +
//======================================================================== //========================================================================
WellDone(Standard_False),
cirsol(1,2) , NbrSol(0),
qualifier1(1,2), cirsol(1, 2),
pnttg1sol(1,2) , qualifier1(1, 2),
par1sol(1,2) , pnttg1sol(1, 2),
pararg1(1,2) par1sol(1, 2),
pararg1(1, 2)
{ {
Standard_Real Tol = Abs(Tolerance); Standard_Real Tol = Abs(Tolerance);
TColgp_Array1OfPnt2d pTan(1,2); TColgp_Array1OfPnt2d pTan(1,2);
@ -60,23 +61,19 @@ Geom2dGcc_Circ2dTanCenGeo (const Geom2dGcc_QCurve& Qualified1,
gp_Dir2d dirx(1.0,0.0); gp_Dir2d dirx(1.0,0.0);
Standard_Real thePar; Standard_Real thePar;
Geom2dAdaptor_Curve curve = Qualified1.Qualified(); Geom2dAdaptor_Curve curve = Qualified1.Qualified();
Extrema_ExtPC2d distmin(Pcenter,curve,Geom2dGcc_CurveTool::NbSamples(curve), Extrema_ExtPC2d distmin(Pcenter, curve, Geom2dGcc_CurveTool::FirstParameter(curve),
Geom2dGcc_CurveTool::EpsX(curve,Tol),Tol); Geom2dGcc_CurveTool::LastParameter(curve), Tol);
if (!distmin.IsDone() ) { throw Standard_Failure(); } if (!distmin.IsDone() ) { throw Standard_Failure(); }
Standard_Integer nbext = distmin.NbExt(); Standard_Integer nbext = distmin.NbExt();
if(nbext==0) { throw Standard_Failure(); } if(nbext==0) { throw Standard_Failure(); }
while (i<=nbext) { while (i<=nbext) {
thePar = distmin.Point(i).Parameter(); thePar = distmin.Point(i).Parameter();
if (distmin.SquareDistance(i)<theDist2(1) && if (distmin.SquareDistance(i)<theDist2(1)) {
thePar>=Geom2dGcc_CurveTool::FirstParameter(curve) &&
thePar <= Geom2dGcc_CurveTool::LastParameter(curve)) {
theDist2(1) = distmin.SquareDistance(i); theDist2(1) = distmin.SquareDistance(i);
theParam(1) = thePar; theParam(1) = thePar;
pTan(1) = distmin.Point(i).Value(); pTan(1) = distmin.Point(i).Value();
} }
if (distmin.SquareDistance(i)>theDist2(2) && if (distmin.SquareDistance(i)>theDist2(2)) {
thePar>=Geom2dGcc_CurveTool::FirstParameter(curve) &&
thePar <= Geom2dGcc_CurveTool::LastParameter(curve)) {
theDist2(2) = distmin.SquareDistance(i); theDist2(2) = distmin.SquareDistance(i);
theParam(2) = thePar; theParam(2) = thePar;
pTan(2) = distmin.Point(i).Value(); pTan(2) = distmin.Point(i).Value();

View File

@ -83,8 +83,7 @@ static Standard_Integer solutions(Draw_Interpretor& di,
for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) { for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
Handle(Geom2d_Circle) C = new Geom2d_Circle(ct3.ThisSolution(i)); Handle(Geom2d_Circle) C = new Geom2d_Circle(ct3.ThisSolution(i));
Sprintf(solname,"%s_%d",name,i); Sprintf(solname,"%s_%d",name,i);
char* temp = solname; // pour portage WNT DrawTrSurf::Set(solname, C);
DrawTrSurf::Set(temp,C);
di << solname << " "; di << solname << " ";
} }
return 0; return 0;
@ -107,8 +106,7 @@ static Standard_Integer solutions(Draw_Interpretor& di,
for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) { for (Standard_Integer i = 1 ; i <= ct3.NbSolutions() ; i++) {
Handle(Geom2d_Circle) C = new Geom2d_Circle(ct3.ThisSolution(i)); Handle(Geom2d_Circle) C = new Geom2d_Circle(ct3.ThisSolution(i));
Sprintf(solname,"%s_%d",name,i); Sprintf(solname,"%s_%d",name,i);
char* temp = solname; // pour portage WNT DrawTrSurf::Set(solname, C);
DrawTrSurf::Set(temp,C);
di << solname << " "; di << solname << " ";
} }
return 0; return 0;
@ -120,260 +118,211 @@ static Standard_Integer solutions(Draw_Interpretor& di,
} }
//======================================================================= //=======================================================================
//function : cirtang //function : solutions
//purpose : //purpose :
//======================================================================= //=======================================================================
static Standard_Integer solutions(Draw_Interpretor& theDI,
static Standard_Integer cirtang (Draw_Interpretor& di,Standard_Integer n, const char** a) Geom2dGcc_Circ2dTanCen& theCt2,
const char* theName)
{ {
if (n < 5) return 1; char solname[200];
Handle(Geom2d_Curve) C1 = DrawTrSurf::GetCurve2d(a[2]); Draw_Color col = DrawTrSurf_CurveColor(Draw_Color(Draw_vert));
Handle(Geom2d_Curve) C2 = DrawTrSurf::GetCurve2d(a[3]); DrawTrSurf_CurveColor(col);
Handle(Geom2d_Curve) C3 = DrawTrSurf::GetCurve2d(a[4]);
gp_Pnt2d P1,P2,P3;
Standard_Boolean ip1 = DrawTrSurf::GetPoint2d(a[2],P1);
Standard_Boolean ip2 = DrawTrSurf::GetPoint2d(a[3],P2);
Standard_Boolean ip3 = DrawTrSurf::GetPoint2d(a[4],P3);
Standard_Real tol = Precision::Confusion(); if (theCt2.IsDone())
if (n > 5) tol = Draw::Atof(a[5]); {
for (Standard_Integer i = 1; i <= theCt2.NbSolutions(); i++)
{
if (!C1.IsNull()) { Handle(Geom2d_Circle) C = new Geom2d_Circle(theCt2.ThisSolution(i));
// C-... Sprintf(solname, "%s_%d", theName, i);
if (!C2.IsNull()) { DrawTrSurf::Set(solname, C);
// C-C-... theDI << solname << " ";
if (!C3.IsNull()) {
// C-C-C
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C2),
Geom2dGcc::Unqualified(C3),
tol,0,0,0);
return solutions(di,ct3,a[1]);
}
else if (ip3) {
// C-C-P
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C2),
new Geom2d_CartesianPoint(P3),
tol,0,0);
return solutions(di,ct3,a[1]);
}
else {
// C-C-R
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C2),
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
}
} }
else if (ip2) { return 0;
// C-P-.. }
if (!C3.IsNull()) { else
// C-P-C {
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1), theDI << "Circ2dTanCen Not done";
Geom2dGcc::Unqualified(C3), return 1;
new Geom2d_CartesianPoint(P2), }
tol,0,0); }
return solutions(di,ct3,a[1]);
}
else if (ip3) { //=======================================================================
// C-P-P //function : Cirtang
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C1), //purpose :
new Geom2d_CartesianPoint(P2), //=======================================================================
new Geom2d_CartesianPoint(P3), static Standard_Integer Cirtang(Draw_Interpretor& theDI,
tol,0); Standard_Integer theNArgs,
return solutions(di,ct3,a[1]); const char** theArgVals)
} {
if (theNArgs < 3)
else { {
// C-P-R theDI << "Use: " << theArgVals[0] << "result [-t <Tolerance>] -c <curve> -p <point> -r <Radius>...\n";
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1), return 1;
new Geom2d_CartesianPoint(P2),
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
}
}
else {
// C-R-..
if (!C3.IsNull()) {
// C-R-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
Geom2dGcc::Unqualified(C3),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
}
else if (ip3) {
// C-R-P
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C1),
new Geom2d_CartesianPoint(P3),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
}
else {
// C-R-R
di << "Curve, radius, radius ???\n";
return 1;
}
}
} }
else if (ip1) { Standard_Real aTol = Precision::Confusion();
// P-... Handle(Geom2d_Curve) aC[3];
if (!C2.IsNull()) { gp_Pnt2d aP[3];
// P-C-... Standard_Real aRadius = -1.0;
if (!C3.IsNull()) {
// P-C-C
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C2),
Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P1),
tol,0,0);
return solutions(di,ct3,a[1]);
}
else if (ip3) { Standard_Integer aNbCurves = 0, aNbPnts = 0;
// P-C-P
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C2),
new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P3),
tol,0);
return solutions(di,ct3,a[1]);
}
else { for (Standard_Integer anArgID = 2; anArgID < theNArgs; anArgID++)
// P-C-R {
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2), if (theArgVals[anArgID][0] != '-')
new Geom2d_CartesianPoint(P1), {
Draw::Atof(a[4]),tol); theDI << "Cannot interpret the argument #" << anArgID << " (" << theArgVals[anArgID] << ")\n";
return solutions(di,ct3,a[1]); return 1;
}
} }
else if (ip2) { else if (!strcmp(theArgVals[anArgID], "-c"))
// P-P-.. {
if (!C3.IsNull()) { if (aNbCurves >= 3)
// P-P-C
Geom2dGcc_Circ2d3Tan ct3(Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P2),
tol,0);
return solutions(di,ct3,a[1]);
}
else if (ip3) {
// P-P-P
Geom2dGcc_Circ2d3Tan ct3(new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P2),
new Geom2d_CartesianPoint(P3),
tol);
return solutions(di,ct3,a[1]);
}
else {
// P-P-R
Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P2),
Draw::Atof(a[4]),tol);
return solutions(di,ct3,a[1]);
}
}
else {
// P-R-..
if (!C3.IsNull()) {
// P-R-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P1),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
}
else if (ip3) {
// P-R-P
Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P1),
new Geom2d_CartesianPoint(P3),
Draw::Atof(a[3]),
tol);
return solutions(di,ct3,a[1]);
}
else {
// P-R-R
di << "Point, radius, radius ???\n";
return 1;
}
}
}
else {
// R-...
if (!C2.IsNull()) {
// R-C-...
if (!C3.IsNull()) {
// R-C-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
Geom2dGcc::Unqualified(C3),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
}
else if (ip3) {
// R-C-P
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C2),
new Geom2d_CartesianPoint(P3),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
}
else {
// R-C-R
di << "Radius - Curve - Radius ??\n";
return 1;
}
}
else if (ip2) {
// R-P-..
if (!C3.IsNull()) {
// R-P-C
Geom2dGcc_Circ2d2TanRad ct3(Geom2dGcc::Unqualified(C3),
new Geom2d_CartesianPoint(P2),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
}
else if (ip3)
{ {
// R-P-P theDI << "A lot of curves are given (not greater than 3 ones are expected)\n";
Geom2dGcc_Circ2d2TanRad ct3(new Geom2d_CartesianPoint(P2),
new Geom2d_CartesianPoint(P3),
Draw::Atof(a[2]),
tol);
return solutions(di,ct3,a[1]);
}
else {
// R-P-R
di << "Radius - Point - Radius ??\n";
return 1; return 1;
} }
aC[aNbCurves] = DrawTrSurf::GetCurve2d(theArgVals[++anArgID]);
if (aC[aNbCurves].IsNull())
{
theDI << "Error: " << theArgVals[anArgID] << " is not a curve\n";
return 1;
}
aNbCurves++;
} }
else { else if (!strcmp(theArgVals[anArgID], "-p"))
// R-R-.. {
di << "radius, radius ???\n"; if (aNbPnts >= 3)
{
theDI << "A lot of points are given (not greater than 3 ones are expected)\n";
return 1;
}
if (!DrawTrSurf::GetPoint2d(theArgVals[++anArgID], aP[aNbPnts]))
{
theDI << "Error: " << theArgVals[anArgID] << " is not a point\n";
return 1;
}
aNbPnts++;
}
else if (!strcmp(theArgVals[anArgID], "-r"))
{
aRadius = Draw::Atof(theArgVals[++anArgID]);
}
else if (!strcmp(theArgVals[anArgID], "-t"))
{
aTol = Draw::Atof(theArgVals[++anArgID]);
}
else
{
theDI << "Unknown option " << theArgVals[anArgID] << "\n";
return 1; return 1;
} }
} }
if (aNbCurves == 3)
{
// C-C-C
Geom2dGcc_Circ2d3Tan aCt3(Geom2dGcc::Unqualified(aC[0]),
Geom2dGcc::Unqualified(aC[1]),
Geom2dGcc::Unqualified(aC[2]),
aTol, 0, 0, 0);
theDI << "Solution of type C-C-C is: ";
return solutions(theDI, aCt3, theArgVals[1]);
}
else if (aNbCurves == 2)
{
if (aNbPnts >= 1)
{
// C-C-P
Geom2dGcc_Circ2d3Tan aCt3(Geom2dGcc::Unqualified(aC[0]),
Geom2dGcc::Unqualified(aC[1]),
new Geom2d_CartesianPoint(aP[0]),
aTol, 0, 0);
theDI << "Solution of type C-C-P is: ";
return solutions(theDI, aCt3, theArgVals[1]);
}
else if (aRadius > 0)
{
// C-C-R
Geom2dGcc_Circ2d2TanRad aCt3(Geom2dGcc::Unqualified(aC[0]),
Geom2dGcc::Unqualified(aC[1]),
aRadius, aTol);
theDI << "Solution of type C-C-R is: ";
return solutions(theDI, aCt3, theArgVals[1]);
}
theDI << "Error: Unsupported set of input data!\n";
return 1;
}
else if (aNbCurves == 1)
{
if (aNbPnts == 2)
{
//C-P-P
Geom2dGcc_Circ2d3Tan aCt3(Geom2dGcc::Unqualified(aC[0]),
new Geom2d_CartesianPoint(aP[0]),
new Geom2d_CartesianPoint(aP[1]),
aTol,0);
theDI << "Solution of type C-P-P is: ";
return solutions(theDI, aCt3, theArgVals[1]);
}
else if (aNbPnts == 1)
{
if (aRadius > 0.0)
{
//C-P-R
Geom2dGcc_Circ2d2TanRad aCt3(Geom2dGcc::Unqualified(aC[0]),
new Geom2d_CartesianPoint(aP[0]),
aRadius, aTol);
theDI << "Solution of type C-P-R is: ";
return solutions(theDI, aCt3, theArgVals[1]);
}
else
{
// C-P
Geom2dGcc_Circ2dTanCen aCt2(Geom2dGcc::Unqualified(aC[0]),
new Geom2d_CartesianPoint(aP[0]), aTol);
theDI << "Solution of type C-P is: ";
return solutions(theDI, aCt2, theArgVals[1]);
}
}
theDI << "Error: Unsupported set of input data!\n";
return 1;
}
else if (aNbPnts >= 2)
{
if (aNbPnts == 3)
{
//P-P-P
Geom2dGcc_Circ2d3Tan aCt3(new Geom2d_CartesianPoint(aP[0]),
new Geom2d_CartesianPoint(aP[1]),
new Geom2d_CartesianPoint(aP[2]),
aTol);
theDI << "Solution of type P-P-P is: ";
return solutions(theDI, aCt3, theArgVals[1]);
}
else if (aRadius > 0)
{
//P-P-R
Geom2dGcc_Circ2d2TanRad aCt3(new Geom2d_CartesianPoint(aP[0]),
new Geom2d_CartesianPoint(aP[1]),
aRadius, aTol);
theDI << "Solution of type P-P-R is: ";
return solutions(theDI, aCt3, theArgVals[1]);
}
theDI << "Error: Unsupported set of input data!\n";
return 1;
}
theDI << "Error: Unsupported set of input data!\n";
return 1;
} }
@ -805,9 +754,9 @@ void GeometryTest::ConstraintCommands(Draw_Interpretor& theCommands)
g = "GEOMETRY Constraints"; g = "GEOMETRY Constraints";
theCommands.Add("cirtang", theCommands.Add("cirtang",
"cirtang cname curve/point/radius curve/point/radius curve/point/radius", "cirtang cname [-t <Tolerance>] -c <curve> -p <point> -r <Radius>...",
__FILE__, __FILE__,
cirtang,g); Cirtang, g);
theCommands.Add("lintan", theCommands.Add("lintan",
"lintan lname curve1 curve2 [angle]", "lintan lname curve1 curve2 [angle]",

View File

@ -7,6 +7,6 @@ set len_ch 2513
point p 1600 300 point p 1600 300
line l 0 500 2000 500 line l 0 500 2000 500
cirtang c p l 400 cirtang c -p p -c l -r 400
checklength c_1 -l 2513.2741228718346 checklength c_1 -l 2513.2741228718346
checklength c_2 -l 2513.2741228718346 checklength c_2 -l 2513.2741228718346

View File

@ -5,4 +5,4 @@ puts "======================="
point p 1600 300 point p 1600 300
line l 0 500 2000 500 line l 0 500 2000 500
cirtang c1 p l 200 cirtang c1 -p p -c l -r 200

View File

@ -5,4 +5,4 @@ puts "======================="
point p2 1400 1400 point p2 1400 1400
line l2 3000 1700 1000 1550 line l2 3000 1700 1000 1550
cirtang c3 p2 l2 300 cirtang c3 -p p2 -c l2 -r 300

View File

@ -5,4 +5,4 @@ puts "======================="
point p2 1400 1400 point p2 1400 1400
line l2 3000 1700 1000 1550 line l2 3000 1700 1000 1550
cirtang result p2 l2 150 cirtang result -p p2 -c l2 -r 150

View File

@ -10,7 +10,7 @@ puts ""
circle c1 0 0 100 circle c1 0 0 100
circle c2 500 -400 300 circle c2 500 -400 300
circle c3 300 200 200 circle c3 300 200 200
cirtang result c1 c2 c3 cirtang result -c c1 -c c2 -c c3
checklength result_1 -l 3568.9587306060739 checklength result_1 -l 3568.9587306060739
checklength result_2 -l 9964.7111736227271 checklength result_2 -l 9964.7111736227271
checklength result_3 -l 2082.9371204466097 checklength result_3 -l 2082.9371204466097

View File

@ -10,5 +10,5 @@ puts ""
circle c1 2900 800 500 circle c1 2900 800 500
circle c2 2900 900 400 circle c2 2900 900 400
circle c3 2900 1000 300 circle c3 2900 1000 300
catch {cirtang result c1 c2 c3} catch {cirtang result -c c1 -c c2 -c c3}

View File

@ -10,7 +10,7 @@ puts ""
circle c1 500 1800 500 circle c1 500 1800 500
circle c2 500 1900 400 circle c2 500 1900 400
circle c3 700 1900 200 circle c3 700 1900 200
cirtang result c1 c2 c3 cirtang result -c c1 -c c2 -c c3
checklength result_1 -l 2513.2741228703289 checklength result_1 -l 2513.2741228703289
checklength result_2 -l 837.75804095727631 checklength result_2 -l 837.75804095727631

View File

@ -10,7 +10,7 @@ puts ""
circle c3 500 3000 250 circle c3 500 3000 250
circle c2 375 3000 125 circle c2 375 3000 125
circle c1 625 3000 125 circle c1 625 3000 125
cirtang result c1 c2 c3 cirtang result -c c1 -c c2 -c c3
checklength result_1 -l 1570.7963267948965 checklength result_1 -l 1570.7963267948965
checklength result_2 -l 785.39816339744868 checklength result_2 -l 785.39816339744868

View File

@ -13,7 +13,7 @@ set knots { { 0 4 } { 8.6971225126475 1 } { 16.903955884905 1 } { 28.00871675581
eval 2dbsplinecurve curve_2 3 [ llength $knots ] [ join $knots ] [ join $poles ] eval 2dbsplinecurve curve_2 3 [ llength $knots ] [ join $knots ] [ join $poles ]
if [catch {cirtang result curve_1 curve_2 2} catch_result] { if [catch {cirtang result -c curve_1 -c curve_2 -r 2} catch_result] {
puts "Faulty BUC60941: function cirtang works wrongly" puts "Faulty BUC60941: function cirtang works wrongly"
} else { } else {
puts "BUC60941 OK: function cirtang works properly" puts "BUC60941 OK: function cirtang works properly"

View File

@ -18,7 +18,10 @@ to2d 2d_curve_1 3d_curve_1
to2d 2d_curve_2 3d_curve_2 to2d 2d_curve_2 3d_curve_2
to2d 2d_curve_3 3d_curve_3 to2d 2d_curve_3 3d_curve_3
set circles_Nb [llength [cirtang cir 2d_curve_1 2d_curve_2 2d_curve_3] ] foreach a [directory cir*] { unset $a }
cirtang cir -c 2d_curve_1 -c 2d_curve_2 -c 2d_curve_3
set circles_Nb [llength [directory cir*] ]
if { ${circles_Nb} != 8 } { if { ${circles_Nb} != 8 } {
puts "Error: GccAna_Circ2d3Tan does not find a circle" puts "Error: GccAna_Circ2d3Tan does not find a circle"

View File

@ -0,0 +1,18 @@
puts "========"
puts "0029694: Geom2dGcc_Circ2dTanCenGeo crash"
puts "========"
puts ""
point pp 1 1
2dbsplinecurve cc 1 2 0 2 1 2 -10 -5 1 10 -5 1
if { ![regexp {Solution of type C-P is} [cirtang result -p pp -c cc] ] } {
puts "Error: Cannot find any solution"
}
regexp "Center\\s*:\\s*(\[-0-9.+eE\]+)\\s*,\\s*(\[-0-9.+eE\]+)\\s*" [dump result_1] full pcx pcy
checkreal CenterX $pcx 1.0 1.0e-7 0
checkreal CenterX $pcy 1.0 1.0e-7 0
checkdump result_1 -name Radius -ref 6

View File

@ -0,0 +1,10 @@
point p 0 0
line l 10 0 -1 1
cirtang c -p p -c l -r 4
smallview -2D-
don c_1 c_2
2dfit
disp l p
checkview -screenshot -2d -path ${imagedir}/${test_image}.png

View File

@ -1,4 +1,5 @@
001 2dinter 001 2dinter
002 bnd 002 bnd
003 extcs 003 extcs
004 extcc 004 extcc
005 2dgcc