Exception in the algorithm Geom2dGcc_Circ2dTanOnRadGeo raised because the number of solutions exceeded the size of reserved array for solutions. A check has been added to forbid adding solutions outside of allocated place.
The similar protection has been done in other algorithms of this package.
else {
if (Abs(Radius-R1) < Tol) {
if (OnCirc.Distance(center1) < Tol) {
- cirsol(NbrSol) = C1;
+ NbrSol = 1;
+ cirsol(NbrSol) = C1;
// ==============
qualifier1(NbrSol) = Qualified1.Qualifier();
- NbrSol = 1;
TheSame1(NbrSol) = 1;
pntcen3(NbrSol) = center1;
parcen3(NbrSol)=ElCLib::Parameter(OnCirc,pntcen3(NbrSol));
else {
if (Abs(Radius-R1) < Tol) {
if (OnCirc.Distance(center1) < Tol) {
- cirsol(NbrSol) = C1;
+ NbrSol = 1;
+ cirsol(NbrSol) = C1;
// ==============
qualifier1(NbrSol) = Qualified1.Qualifier();
- NbrSol = 1;
TheSame1(NbrSol) = 1;
pntcen3(NbrSol) = center1;
parcen3(NbrSol)=ElCLib::Parameter(OnCirc,pntcen3(NbrSol));
#include <Standard_OutOfRange.hxx>
#include <StdFail_NotDone.hxx>
+static const Standard_Integer aNbSolMAX = 8;
+
Geom2dGcc_Circ2d2TanOnGeo::
Geom2dGcc_Circ2d2TanOnGeo (const GccEnt_QualifiedCirc& Qualified1 ,
const GccEnt_QualifiedCirc& Qualified2 ,
const Geom2dAdaptor_Curve& OnCurv ,
const Standard_Real Tolerance ):
- cirsol(1,8) ,
- qualifier1(1,8),
- qualifier2(1,8),
- TheSame1(1,8) ,
- TheSame2(1,8) ,
- pnttg1sol(1,8) ,
- pnttg2sol(1,8) ,
- pntcen(1,8) ,
- par1sol(1,8) ,
- par2sol(1,8) ,
- pararg1(1,8) ,
- pararg2(1,8) ,
- parcen3(1,8)
+ cirsol(1, aNbSolMAX) ,
+ qualifier1(1, aNbSolMAX),
+ qualifier2(1, aNbSolMAX),
+ TheSame1(1, aNbSolMAX) ,
+ TheSame2(1, aNbSolMAX) ,
+ pnttg1sol(1, aNbSolMAX) ,
+ pnttg2sol(1, aNbSolMAX) ,
+ pntcen(1, aNbSolMAX) ,
+ par1sol(1, aNbSolMAX) ,
+ par2sol(1, aNbSolMAX) ,
+ pararg1(1, aNbSolMAX) ,
+ pararg2(1, aNbSolMAX) ,
+ parcen3(1, aNbSolMAX)
{
WellDone = Standard_False;
Standard_Real thefirst = -100000.;
}
}
if (nnsol > 0) {
- for (Standard_Integer k = 1 ; k <= nnsol ; k++) {
+ for (Standard_Integer k = 1 ; k <= nnsol && NbrSol < aNbSolMAX; k++) {
NbrSol++;
cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius(k));
// ==========================================================
const GccEnt_QualifiedLin& Qualified2 ,
const Geom2dAdaptor_Curve& OnCurv ,
const Standard_Real Tolerance ):
-cirsol(1,8) ,
-qualifier1(1,8),
-qualifier2(1,8),
-TheSame1(1,8) ,
-TheSame2(1,8) ,
-pnttg1sol(1,8) ,
-pnttg2sol(1,8) ,
-pntcen(1,8) ,
-par1sol(1,8) ,
-par2sol(1,8) ,
-pararg1(1,8) ,
-pararg2(1,8) ,
-parcen3(1,8)
+cirsol(1, aNbSolMAX) ,
+qualifier1(1, aNbSolMAX),
+qualifier2(1, aNbSolMAX),
+TheSame1(1, aNbSolMAX) ,
+TheSame2(1, aNbSolMAX) ,
+pnttg1sol(1, aNbSolMAX) ,
+pnttg2sol(1, aNbSolMAX) ,
+pntcen(1, aNbSolMAX) ,
+par1sol(1, aNbSolMAX) ,
+par2sol(1, aNbSolMAX) ,
+pararg1(1, aNbSolMAX) ,
+pararg2(1, aNbSolMAX) ,
+parcen3(1, aNbSolMAX)
{
WellDone = Standard_False;
}
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
- for (Standard_Integer j = 1 ; j <= Intp.NbPoints() ; j++) {
+ for (Standard_Integer j = 1 ; j <= Intp.NbPoints() && NbrSol < aNbSolMAX; j++) {
gp_Pnt2d Center(Intp.Point(j).Value());
Standard_Real dist1 = Center.Distance(center1);
// Standard_Integer nbsol = 1;
const GccEnt_QualifiedLin& Qualified2 ,
const Geom2dAdaptor_Curve& OnCurv ,
const Standard_Real Tolerance ):
-cirsol(1,8) ,
-qualifier1(1,8),
-qualifier2(1,8),
-TheSame1(1,8) ,
-TheSame2(1,8) ,
-pnttg1sol(1,8) ,
-pnttg2sol(1,8) ,
-pntcen(1,8) ,
-par1sol(1,8) ,
-par2sol(1,8) ,
-pararg1(1,8) ,
-pararg2(1,8) ,
-parcen3(1,8)
+cirsol(1, aNbSolMAX) ,
+qualifier1(1, aNbSolMAX),
+qualifier2(1, aNbSolMAX),
+TheSame1(1, aNbSolMAX) ,
+TheSame2(1, aNbSolMAX) ,
+pnttg1sol(1, aNbSolMAX) ,
+pnttg2sol(1, aNbSolMAX) ,
+pntcen(1, aNbSolMAX) ,
+par1sol(1, aNbSolMAX) ,
+par2sol(1, aNbSolMAX) ,
+pararg1(1, aNbSolMAX) ,
+pararg2(1, aNbSolMAX) ,
+parcen3(1, aNbSolMAX)
{
WellDone = Standard_False;
Intp.Perform(Bis.ThisSolution(i),D1,C2,D2,Tol1,Tol2);
if (Intp.IsDone()) {
if ((!Intp.IsEmpty())) {
- for (Standard_Integer j = 1 ; j <= Intp.NbPoints() ; j++) {
+ for (Standard_Integer j = 1 ; j <= Intp.NbPoints() && NbrSol < aNbSolMAX; j++) {
gp_Pnt2d Center(Intp.Point(j).Value());
Standard_Real dist1 = L1.Distance(Center);
Standard_Real dist2 = L2.Distance(Center);
const gp_Pnt2d& Point2 ,
const Geom2dAdaptor_Curve& OnCurv ,
const Standard_Real Tolerance ):
-cirsol(1,8) ,
-qualifier1(1,8),
-qualifier2(1,8),
-TheSame1(1,8) ,
-TheSame2(1,8) ,
-pnttg1sol(1,8) ,
-pnttg2sol(1,8) ,
-pntcen(1,8) ,
-par1sol(1,8) ,
-par2sol(1,8) ,
-pararg1(1,8) ,
-pararg2(1,8) ,
-parcen3(1,8)
+cirsol(1, aNbSolMAX) ,
+qualifier1(1, aNbSolMAX),
+qualifier2(1, aNbSolMAX),
+TheSame1(1, aNbSolMAX) ,
+TheSame2(1, aNbSolMAX) ,
+pnttg1sol(1, aNbSolMAX) ,
+pnttg2sol(1, aNbSolMAX) ,
+pntcen(1, aNbSolMAX) ,
+par1sol(1, aNbSolMAX) ,
+par2sol(1, aNbSolMAX) ,
+pararg1(1, aNbSolMAX) ,
+pararg2(1, aNbSolMAX) ,
+parcen3(1, aNbSolMAX)
{
WellDone = Standard_False;
}
if (Intp.IsDone()) {
if ((!Intp.IsEmpty())) {
- for (Standard_Integer j = 1 ; j <= Intp.NbPoints() ; j++) {
+ for (Standard_Integer j = 1 ; j <= Intp.NbPoints() && NbrSol < aNbSolMAX; j++) {
gp_Pnt2d Center(Intp.Point(j).Value());
Radius = Center.Distance(Point2);
Standard_Real dist1 = center1.Distance(Center);
const gp_Pnt2d& Point2 ,
const Geom2dAdaptor_Curve& OnCurv ,
const Standard_Real Tolerance ):
-cirsol(1,8) ,
-qualifier1(1,8),
-qualifier2(1,8),
-TheSame1(1,8) ,
-TheSame2(1,8) ,
-pnttg1sol(1,8) ,
-pnttg2sol(1,8) ,
-pntcen(1,8) ,
-par1sol(1,8) ,
-par2sol(1,8) ,
-pararg1(1,8) ,
-pararg2(1,8) ,
-parcen3(1,8)
+cirsol(1, aNbSolMAX) ,
+qualifier1(1, aNbSolMAX),
+qualifier2(1, aNbSolMAX),
+TheSame1(1, aNbSolMAX) ,
+TheSame2(1, aNbSolMAX) ,
+pnttg1sol(1, aNbSolMAX) ,
+pnttg2sol(1, aNbSolMAX) ,
+pntcen(1, aNbSolMAX) ,
+par1sol(1, aNbSolMAX) ,
+par2sol(1, aNbSolMAX) ,
+pararg1(1, aNbSolMAX) ,
+pararg2(1, aNbSolMAX) ,
+parcen3(1, aNbSolMAX)
{
WellDone = Standard_False;
}
if (Intp.IsDone()) {
if ((!Intp.IsEmpty())) {
- for (Standard_Integer j = 1 ; j <= Intp.NbPoints() ; j++) {
+ for (Standard_Integer j = 1 ; j <= Intp.NbPoints() && NbrSol < aNbSolMAX; j++) {
gp_Pnt2d Center(Intp.Point(j).Value());
Standard_Real Radius = L1.Distance(Center);
// Standard_Integer nbsol = 1;
const gp_Pnt2d& Point2 ,
const Geom2dAdaptor_Curve& OnCurv ,
const Standard_Real Tolerance ):
-cirsol(1,8) ,
-qualifier1(1,8),
-qualifier2(1,8),
-TheSame1(1,8) ,
-TheSame2(1,8) ,
-pnttg1sol(1,8) ,
-pnttg2sol(1,8) ,
-pntcen(1,8) ,
-par1sol(1,8) ,
-par2sol(1,8) ,
-pararg1(1,8) ,
-pararg2(1,8) ,
-parcen3(1,8)
+cirsol(1, aNbSolMAX) ,
+qualifier1(1, aNbSolMAX),
+qualifier2(1, aNbSolMAX),
+TheSame1(1, aNbSolMAX) ,
+TheSame2(1, aNbSolMAX) ,
+pnttg1sol(1, aNbSolMAX) ,
+pnttg2sol(1, aNbSolMAX) ,
+pntcen(1, aNbSolMAX) ,
+par1sol(1, aNbSolMAX) ,
+par2sol(1, aNbSolMAX) ,
+pararg1(1, aNbSolMAX) ,
+pararg2(1, aNbSolMAX) ,
+parcen3(1, aNbSolMAX)
{
WellDone = Standard_False;
Intp.Perform(Bis.ThisSolution(),D1,Cu2,D2,Tol1,Tol2);
if (Intp.IsDone()) {
if ((!Intp.IsEmpty())) {
- for (Standard_Integer j = 1 ; j <= Intp.NbPoints() ; j++) {
+ for (Standard_Integer j = 1 ; j <= Intp.NbPoints() && NbrSol < aNbSolMAX; j++) {
gp_Pnt2d Center(Intp.Point(j).Value());
Standard_Real Radius = Point2.Distance(Center);
NbrSol++;
const Handle(Geom2d_Point)& Point ,
const Standard_Real Radius ,
const Standard_Real Tolerance ):
- cirsol(1,8) ,
- qualifier1(1,8),
- qualifier2(1,8),
- TheSame1(1,8) ,
- TheSame2(1,8) ,
- pnttg1sol(1,8),
- pnttg2sol(1,8),
- par1sol(1,8) ,
- par2sol(1,8) ,
- pararg1(1,8) ,
- pararg2(1,8)
+ cirsol(1,aNbSolMAX) ,
+ qualifier1(1,aNbSolMAX),
+ qualifier2(1,aNbSolMAX),
+ TheSame1(1,aNbSolMAX) ,
+ TheSame2(1,aNbSolMAX) ,
+ pnttg1sol(1,aNbSolMAX),
+ pnttg2sol(1,aNbSolMAX),
+ par1sol(1,aNbSolMAX) ,
+ par2sol(1,aNbSolMAX) ,
+ pararg1(1,aNbSolMAX) ,
+ pararg2(1,aNbSolMAX)
{
if (Radius < 0.) { throw Standard_NegativeValue(); }
else {
gp_Pnt2d Point(L1.Location().XY()+cote1(jcote1)*Dir.XY());
gp_Lin2d Line(Point,L1.Direction()); // ligne avec deport.
IntRes2d_Domain D1;
- for (Standard_Integer jcote2 = 1 ; jcote2 <= nbrcote2 ; jcote2++) {
+ for (Standard_Integer jcote2 = 1; jcote2 <= nbrcote2 && NbrSol < aNbSolMAX; jcote2++) {
Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(Cu2);
Adaptor2d_OffsetCurve C2(HCu2,cote2(jcote2));
firstparam = Max(C2.FirstParameter(),thefirst);
Geom2dInt_TheIntConicCurveOfGInter Intp(Line,D1,C2,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
- for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
+ for (Standard_Integer i = 1; i <= Intp.NbPoints() && NbrSol < aNbSolMAX; i++) {
NbrSol++;
gp_Pnt2d Center(Intp.Point(i).Value());
cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius);
}
Standard_Real R1 = C1.Radius();
Geom2dInt_TheIntConicCurveOfGInter Intp;
- for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) {
+ for (Standard_Integer jcote1 = 1; jcote1 <= nbrcote1 && NbrSol < aNbSolMAX; jcote1++) {
gp_Circ2d Circ(C1.XAxis(),R1+cote1(jcote1));
IntRes2d_Domain D1(ElCLib::Value(0.,Circ), 0.,Tol,
ElCLib::Value(2.*M_PI,Circ),2.*M_PI,Tol);
Intp.Perform(Circ,D1,C2,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
- for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
+ for (Standard_Integer i = 1; i <= Intp.NbPoints() && NbrSol < aNbSolMAX; i++) {
NbrSol++;
gp_Pnt2d Center(Intp.Point(i).Value());
cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius);
ElCLib::Value(M_PI+M_PI,Circ),M_PI+M_PI,Tol);
D1.SetEquivalentParameters(0.,M_PI+M_PI);
Geom2dInt_TheIntConicCurveOfGInter Intp;
- for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) {
+ for (Standard_Integer jcote1 = 1; jcote1 <= nbrcote1 && NbrSol < aNbSolMAX; jcote1++) {
Handle(Geom2dAdaptor_HCurve) HCu1 = new Geom2dAdaptor_HCurve(Cu1);
Adaptor2d_OffsetCurve Cu2(HCu1,cote1(jcote1));
firstparam = Max(Cu2.FirstParameter(),thefirst);
Intp.Perform(Circ,D1,Cu2,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
- for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
+ for (Standard_Integer i = 1; i <= Intp.NbPoints() && NbrSol < aNbSolMAX; i++) {
NbrSol++;
gp_Pnt2d Center(Intp.Point(i).Value());
cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius);
IntRes2d_Domain D2C1(C1.Value(firstparam),firstparam,Tol,
C1.Value(lastparam),lastparam,Tol);
#endif
- for (Standard_Integer jcote2 = 1 ; jcote2 <= nbrcote2 ; jcote2++) {
+ for (Standard_Integer jcote2 = 1; jcote2 <= nbrcote2 && NbrSol < aNbSolMAX; jcote2++) {
Handle(Geom2dAdaptor_HCurve) HCu2 = new Geom2dAdaptor_HCurve(Cu2);
Adaptor2d_OffsetCurve C2(HCu2,cote2(jcote2));
#ifdef OCCT_DEBUG
if (!Intp.IsEmpty()) {
const Standard_Real aSQApproxTol = Precision::Approximation() *
Precision::Approximation();
- for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++)
+ for (Standard_Integer i = 1; i <= Intp.NbPoints() && NbrSol < aNbSolMAX; i++)
{
Standard_Real aU0 = Intp.Point(i).ParamOnFirst();
Standard_Real aV0 = Intp.Point(i).ParamOnSecond();
const Standard_Real Tolerance ,
const Standard_Real Param1 ,
const Standard_Real Param2 ):
- cirsol(1,16) ,
- qualifier1(1,16),
- qualifier2(1,16),
- qualifier3(1,16),
- TheSame1(1,16) ,
- TheSame2(1,16) ,
- TheSame3(1,16) ,
- pnttg1sol(1,16),
- pnttg2sol(1,16),
- pnttg3sol(1,16),
- par1sol(1,16) ,
- par2sol(1,16) ,
- par3sol(1,16) ,
- pararg1(1,16) ,
- pararg2(1,16) ,
- pararg3(1,16)
+ cirsol(1,20) ,
+ qualifier1(1,20),
+ qualifier2(1,20),
+ qualifier3(1,20),
+ TheSame1(1,20) ,
+ TheSame2(1,20) ,
+ TheSame3(1,20) ,
+ pnttg1sol(1,20),
+ pnttg2sol(1,20),
+ pnttg3sol(1,20),
+ par1sol(1,20) ,
+ par2sol(1,20) ,
+ par3sol(1,20) ,
+ pararg1(1,20) ,
+ pararg2(1,20) ,
+ pararg3(1,20)
{
Geom2dAdaptor_Curve C1 = Qualified1.Qualified();
Geom2dAdaptor_Curve C2 = Qualified2.Qualified();
#include <StdFail_NotDone.hxx>
#include <TColStd_Array1OfReal.hxx>
+static const Standard_Integer aNbSolMAX = 8;
+
//=========================================================================
// Cercle tangent : a un cercle Qualified1 (C1). +
// centre : sur une droite OnLine. +
// Initialisation des champs. +
//=========================================================================
-cirsol(1,8) ,
-qualifier1(1,8) ,
-TheSame1(1,8) ,
-pnttg1sol(1,8) ,
-pntcen3(1,8) ,
-par1sol(1,8) ,
-pararg1(1,8) ,
-parcen3(1,8)
+cirsol(1,aNbSolMAX) ,
+qualifier1(1,aNbSolMAX) ,
+TheSame1(1,aNbSolMAX) ,
+pnttg1sol(1,aNbSolMAX) ,
+pntcen3(1,aNbSolMAX) ,
+par1sol(1,aNbSolMAX) ,
+pararg1(1,aNbSolMAX) ,
+parcen3(1,aNbSolMAX)
{
//=========================================================================
Intp.Perform(OnLine,D1,C2,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
- for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
+ for (Standard_Integer i = 1 ; i <= Intp.NbPoints() && NbrSol < aNbSolMAX; i++) {
NbrSol++;
gp_Pnt2d Center(Intp.Point(i).Value());
cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius);
// Initialisation des champs. +
//=========================================================================
-cirsol(1,8) ,
-qualifier1(1,8) ,
-TheSame1(1,8) ,
-pnttg1sol(1,8) ,
-pntcen3(1,8) ,
-par1sol(1,8) ,
-pararg1(1,8) ,
-parcen3(1,8)
+cirsol(1,aNbSolMAX) ,
+qualifier1(1,aNbSolMAX) ,
+TheSame1(1,aNbSolMAX) ,
+pnttg1sol(1,aNbSolMAX) ,
+pntcen3(1,aNbSolMAX) ,
+par1sol(1,aNbSolMAX) ,
+pararg1(1,aNbSolMAX) ,
+parcen3(1,aNbSolMAX)
{
//=========================================================================
Intp.Perform(OnCirc,D1,C2,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
- for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
+ for (Standard_Integer i = 1 ; i <= Intp.NbPoints() && NbrSol < aNbSolMAX; i++) {
NbrSol++;
gp_Pnt2d Center(Intp.Point(i).Value());
cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius);
// Initialisation des champs. +
//=========================================================================
-cirsol(1,8) ,
-qualifier1(1,8) ,
-TheSame1(1,8) ,
-pnttg1sol(1,8) ,
-pntcen3(1,8) ,
-par1sol(1,8) ,
-pararg1(1,8) ,
-parcen3(1,8)
+cirsol(1,aNbSolMAX) ,
+qualifier1(1,aNbSolMAX) ,
+TheSame1(1,aNbSolMAX) ,
+pnttg1sol(1,aNbSolMAX) ,
+pntcen3(1,aNbSolMAX) ,
+par1sol(1,aNbSolMAX) ,
+pararg1(1,aNbSolMAX) ,
+parcen3(1,aNbSolMAX)
{
//=========================================================================
Intp.Perform(Circ,D1,OnCurv,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
- for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
+ for (Standard_Integer i = 1 ; i <= Intp.NbPoints() && NbrSol < aNbSolMAX; i++) {
NbrSol++;
gp_Pnt2d Center(Intp.Point(i).Value());
cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius);
// Initialisation des champs. +
//=========================================================================
-cirsol(1,8) ,
-qualifier1(1,8) ,
-TheSame1(1,8) ,
-pnttg1sol(1,8) ,
-pntcen3(1,8) ,
-par1sol(1,8) ,
-pararg1(1,8) ,
-parcen3(1,8)
+cirsol(1,aNbSolMAX) ,
+qualifier1(1,aNbSolMAX) ,
+TheSame1(1,aNbSolMAX) ,
+pnttg1sol(1,aNbSolMAX) ,
+pntcen3(1,aNbSolMAX) ,
+par1sol(1,aNbSolMAX) ,
+pararg1(1,aNbSolMAX) ,
+parcen3(1,aNbSolMAX)
{
//=========================================================================
Intp.Perform(Line,D1,OnCurv,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
- for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
+ for (Standard_Integer i = 1 ; i <= Intp.NbPoints() && NbrSol < aNbSolMAX; i++) {
NbrSol++;
gp_Pnt2d Center(Intp.Point(i).Value());
cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius);
// Initialisation des champs. +
//=========================================================================
-cirsol(1,8) ,
-qualifier1(1,8) ,
-TheSame1(1,8) ,
-pnttg1sol(1,8) ,
-pntcen3(1,8) ,
-par1sol(1,8) ,
-pararg1(1,8) ,
-parcen3(1,8)
+cirsol(1,aNbSolMAX) ,
+qualifier1(1,aNbSolMAX) ,
+TheSame1(1,aNbSolMAX) ,
+pnttg1sol(1,aNbSolMAX) ,
+pntcen3(1,aNbSolMAX) ,
+par1sol(1,aNbSolMAX) ,
+pararg1(1,aNbSolMAX) ,
+parcen3(1,aNbSolMAX)
{
//=========================================================================
Intp.Perform(C1,D1,C2,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
- for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
+ for (Standard_Integer i = 1 ; i <= Intp.NbPoints() && NbrSol < aNbSolMAX; i++) {
NbrSol++;
gp_Pnt2d Center(Intp.Point(i).Value());
cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius);
// Initialisation des champs. +
//=========================================================================
-cirsol(1,8) ,
-qualifier1(1,8) ,
-TheSame1(1,8) ,
-pnttg1sol(1,8) ,
-pntcen3(1,8) ,
-par1sol(1,8) ,
-pararg1(1,8) ,
-parcen3(1,8)
+cirsol(1,aNbSolMAX) ,
+qualifier1(1,aNbSolMAX) ,
+TheSame1(1,aNbSolMAX) ,
+pnttg1sol(1,aNbSolMAX) ,
+pntcen3(1,aNbSolMAX) ,
+par1sol(1,aNbSolMAX) ,
+pararg1(1,aNbSolMAX) ,
+parcen3(1,aNbSolMAX)
{
//=========================================================================
Geom2dInt_TheIntConicCurveOfGInter Intp(Circ,D1,OnCurv,D2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
- for (Standard_Integer i = 1 ; i <= Intp.NbPoints() ; i++) {
+ for (Standard_Integer i = 1 ; i <= Intp.NbPoints() && NbrSol < aNbSolMAX; i++) {
NbrSol++;
gp_Pnt2d Center(Intp.Point(i).Value());
cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Center,dirx),Radius);
--- /dev/null
+puts "======================="
+puts "0031140: Draw command cirtang raises ex-ception on the parallel curves"
+puts "======================="
+
+restore [locate_data_file bug31140_edge1.brep] e1
+restore [locate_data_file bug31140_edge2.brep] e2
+mk2dcurve c1 e1
+mk2dcurve c2 e2
+cirtang res -c c1 -c c2 -r .1