1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0024585: Wrong pcurve of the section curve

PCurve is extended to surface boundary forcefully.
It is made by finding some additional points (if it is possibly).
"bopcurves" DRAW-command returns number of found 3D-curves and (as an option) 2D-curve (see help for more detail information).

Test cases for issue CR24585
This commit is contained in:
nbv
2014-02-12 14:21:54 +04:00
committed by apn
parent 8bb96a9760
commit c2c2f2b62c
11 changed files with 772 additions and 56 deletions

View File

@@ -1371,7 +1371,11 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
if(dminiPointLigne > SeuildPointLigne) {
PW.Perform(StartParams,UminLig1,VminLig1,UminLig2,VminLig2,UmaxLig1,VmaxLig1,UmaxLig2,VmaxLig2);
if(PW.IsDone()) {
if(PW.NbPoints()>2) {
if(PW.NbPoints()>2)
{
//Try to extend the intersection line to boundary, if it is possibly
Standard_Boolean hasBeenAdded = PW.PutToBoundary(Surf1, Surf2);
RejetLigne = Standard_False;
Point3dDebut = PW.Value(1).Value();
const IntSurf_PntOn2S& PointFin = PW.Value(PW.NbPoints());
@@ -1419,8 +1423,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
Standard_Real TolTang = TolTangency;
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
if (RestrictLine){
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang);
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang,hasBeenAdded);
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang,hasBeenAdded);
}
if(wline->NbVertex() == 0) {
@@ -2125,10 +2129,14 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
//
if( iPWNbPoints > 2 )
{
//Try to extend the intersection line to boundary, if it is possibly
Standard_Boolean hasBeenAdded = PW.PutToBoundary(Surf1, Surf2);
const Standard_Integer aMinNbPoints = 40;
if(iPWNbPoints < aMinNbPoints)
{
PW.SeekAdditionalPoints(Surf1, Surf2, aMinNbPoints);
hasBeenAdded =
PW.SeekAdditionalPoints(Surf1, Surf2, aMinNbPoints) || hasBeenAdded;
iPWNbPoints = PW.NbPoints();
}
@@ -2224,8 +2232,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
Standard_Real TolTang = TolTangency;
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang);
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang,hasBeenAdded);
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang,hasBeenAdded);
if(wline->NbVertex() == 0)
{

View File

@@ -34,7 +34,8 @@ is
Domain : TopolTool from Adaptor3d;
OtherSurf : HSurface from Adaptor3d;
OnFirst : Boolean from Standard ;
Tol : Real from Standard)
Tol : Real from Standard;
hasBeenAdded: Boolean from Standard = Standard_False)
raises DomainError from Standard;
--- The exception is raised if the Line from is neither

View File

@@ -445,7 +445,8 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L,
const Handle(Adaptor3d_TopolTool)& Domain,
const Handle(Adaptor3d_HSurface)& OtherSurf,
const Standard_Boolean OnFirst,
const Standard_Real Tol )
const Standard_Real Tol,
const Standard_Boolean hasBeenAdded)
{
// Domain est le domaine de restriction de la surface Surf.
@@ -1229,7 +1230,7 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L,
*/
wlin->SetPeriod(pu1,pv1,pu2,pv2);
wlin->ComputeVertexParameters(Tol);
wlin->ComputeVertexParameters(Tol, hasBeenAdded);
}
else {
#ifdef DEB

View File

@@ -236,7 +236,9 @@ is
is static;
ComputeVertexParameters(me: mutable; Tol: Real from Standard)
ComputeVertexParameters(me: mutable;
Tol: Real from Standard;
hasBeenAdded: Boolean from Standard = Standard_False)
---Purpose: Set the parameters of all the vertex on the line.
-- if a vertex is already in the line,

View File

@@ -238,8 +238,9 @@ inline Standard_Boolean CompareVerticesOnS2(const IntPatch_Point& vtx1, const In
{return CompareVerticesOnSurf (vtx1, vtx2, Standard_False);}
void IntPatch_WLine::ComputeVertexParameters(const Standard_Real RTol) {
void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol,
const Standard_Boolean hasBeenAdded)
{
// MSV Oct 15, 2001: use tolerance of vertex instead of RTol where
// it is possible
@@ -463,9 +464,9 @@ void IntPatch_WLine::ComputeVertexParameters(const Standard_Real RTol) {
Standard_Real dmini = Precision::Confusion();
dmini*=dmini;
for(i=2; i<=nbponline; i++) {
//const IntSurf_PntOn2S& aPntOn2S1=curv->Value(i-1);
//const IntSurf_PntOn2S& aPntOn2S2=curv->Value(i);
Standard_Real d = (curv->Value(i-1).Value()).SquareDistance((curv->Value(i).Value()));
const IntSurf_PntOn2S& aPnt1=curv->Value(i-1);
const IntSurf_PntOn2S& aPnt2=curv->Value(i);
Standard_Real d = (aPnt1.Value()).SquareDistance((aPnt2.Value()));
if(d < dmini) {
curv->RemovePoint(i);
nbponline--;
@@ -473,10 +474,10 @@ void IntPatch_WLine::ComputeVertexParameters(const Standard_Real RTol) {
//-- On recadre les Vertex si besoin
//--
for(j=1; j<=nbvtx; j++) {
indicevertex = svtx.Value(j).ParameterOnLine();
if(indicevertex >= i) {
svtx.ChangeValue(j).SetParameter(indicevertex-1.0);
}
indicevertex = svtx.Value(j).ParameterOnLine();
if(indicevertex >= i) {
svtx.ChangeValue(j).SetParameter(indicevertex-1.0);
}
}
//modified by NIZNHY-PKV Mon Feb 11 09:28:02 2002 f
i--;
@@ -487,7 +488,30 @@ void IntPatch_WLine::ComputeVertexParameters(const Standard_Real RTol) {
for(i=1; i<=nbvtx; i++) {
const gp_Pnt& P = svtx.Value(i).Value();
Standard_Real vTol = svtx.Value(i).Tolerance();
indicevertex = svtx.Value(i).ParameterOnLine();
if(hasBeenAdded)
{
if(nbvtx == 2)
{
if(i == nbvtx)
{
indicevertex = curv->NbPoints();
}
else
{
indicevertex = svtx.Value(i).ParameterOnLine();
}
}
else
{
indicevertex = svtx.Value(i).ParameterOnLine();
}
}
else
{
indicevertex = svtx.Value(i).ParameterOnLine();
}
indicevertexonline = (Standard_Integer)indicevertex;
//--------------------------------------------------
//-- On Compare le vertex avec les points de la ligne