mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-13 14:27:08 +03:00
Compare commits
3 Commits
V7_5_2
...
CR752-SALO
Author | SHA1 | Date | |
---|---|---|---|
|
29382b6da7 | ||
|
7d1f8442a2 | ||
|
537521203b |
@@ -178,7 +178,8 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
|
||||
#ifdef CHRONO
|
||||
Chronrsnld.Stop();
|
||||
#endif
|
||||
|
||||
Standard_Boolean isOnDegeneratedBorder = Standard_False;
|
||||
|
||||
if (Cadre) { // update of limits.
|
||||
BornInf(1) = Um;BornSup(1) = UM;BornInf(2) = Vm;BornSup(2) = VM;
|
||||
}
|
||||
@@ -262,6 +263,7 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
|
||||
/ (uv[aCoordIdx - 1] - uvprev[aCoordIdx - 1]) );
|
||||
Standard_Integer aFixIdx = aCoordIdx == 1? 2 : 1; // Fixing index;
|
||||
Uvap(aFixIdx) = uv[aFixIdx - 1] + (uv[aFixIdx - 1] - uvprev[aFixIdx - 1]) * aScaleCoeff;
|
||||
isOnDegeneratedBorder = Standard_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -307,6 +309,8 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
|
||||
if (N <= 0) { // jag 941017
|
||||
MakeWalkingPoint(2,Uvap(1),Uvap(2),Func,Psol);
|
||||
Tgtend = Func.IsTangent(); // jag 940616
|
||||
if (isOnDegeneratedBorder)
|
||||
Tgtend = Standard_True;
|
||||
N = -N;
|
||||
}
|
||||
Arrive = (wd2[I].etat == 12); // the line is open
|
||||
@@ -315,6 +319,9 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
|
||||
aStatus = TestDeflection(Func, Arrive,Uvap,StatusPrecedent,
|
||||
NbDivision,PasC,StepSign);
|
||||
|
||||
if (isOnDegeneratedBorder && Tgtend)
|
||||
aStatus = IntWalk_ArretSurPoint;
|
||||
|
||||
StatusPrecedent = aStatus;
|
||||
if (aStatus == IntWalk_PasTropGrand) {// division of the step
|
||||
Arrive = Standard_False;
|
||||
|
@@ -53,8 +53,10 @@
|
||||
#include <IntPatch_ImpImpIntersection.hxx>
|
||||
#include <ShapeAnalysis_Edge.hxx>
|
||||
#include <ShapeAnalysis_WireOrder.hxx>
|
||||
#include <ShapeAnalysis_Surface.hxx>
|
||||
#include <ShapeBuild_Edge.hxx>
|
||||
#include <ShapeBuild_ReShape.hxx>
|
||||
#include <ShapeConstruct_ProjectCurveOnSurface.hxx>
|
||||
#include <ShapeFix_Edge.hxx>
|
||||
#include <ShapeFix_Face.hxx>
|
||||
#include <ShapeFix_Shell.hxx>
|
||||
@@ -1489,6 +1491,11 @@ static TopoDS_Edge GlueEdgesWithPCurves(const TopTools_SequenceOfShape& aChain,
|
||||
void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape& theChain,
|
||||
TopoDS_Edge& theEdge)
|
||||
{
|
||||
Standard_Real aFirst3d, aLast3d;
|
||||
Handle(Geom_Curve) aCurve = BRep_Tool::Curve (theEdge, aFirst3d, aLast3d);
|
||||
Standard_Real aTolEdge = BRep_Tool::Tolerance(theEdge);
|
||||
Standard_Real aMaxTol = aTolEdge;
|
||||
|
||||
TopTools_SequenceOfShape aFaceSeq;
|
||||
|
||||
const TopoDS_Edge& aFirstEdge = TopoDS::Edge(theChain.Value(1));
|
||||
@@ -1686,7 +1693,6 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape&
|
||||
}
|
||||
|
||||
TColStd_Array1OfReal tabtolvertex(0, aTolVerSeq.Length() - 1);
|
||||
Standard_Real aMaxTol = 0.0;
|
||||
for (Standard_Integer i = 1; i <= aTolVerSeq.Length(); i++)
|
||||
{
|
||||
Standard_Real aTol = aTolVerSeq(i);
|
||||
@@ -1725,32 +1731,51 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape&
|
||||
}
|
||||
|
||||
BRep_Builder aBuilder;
|
||||
Standard_Real aTol = BRep_Tool::Tolerance(theEdge);
|
||||
|
||||
//Reparametrize pcurves if needed
|
||||
for (Standard_Integer ii = 2; ii <= ResPCurves.Length(); ii++)
|
||||
//Check the results for consistency
|
||||
Standard_Boolean IsBadRange = Standard_False;
|
||||
Standard_Real aRange3d = aLast3d - aFirst3d;
|
||||
for (Standard_Integer ii = 1; ii <= ResPCurves.Length(); ii++)
|
||||
{
|
||||
if (Abs (ResFirsts(1) - ResFirsts(ii)) > Precision::Confusion() ||
|
||||
Abs (ResLasts(1) - ResLasts(ii)) > Precision::Confusion())
|
||||
Standard_Real aRange = ResLasts(ii) - ResFirsts(ii);
|
||||
if (Abs (aRange3d - aRange) > aMaxTol)
|
||||
IsBadRange = Standard_True;
|
||||
}
|
||||
|
||||
if (IsBadRange)
|
||||
{
|
||||
for (Standard_Integer ii = 1; ii <= ResPCurves.Length(); ii++)
|
||||
{
|
||||
Handle(Geom2d_TrimmedCurve) aTrPCurve =
|
||||
new Geom2d_TrimmedCurve (ResPCurves(ii), ResFirsts(ii), ResLasts(ii));
|
||||
Handle(Geom2d_BSplineCurve) aBSplinePCurve = Geom2dConvert::CurveToBSplineCurve(aTrPCurve);
|
||||
TColStd_Array1OfReal aKnots (1, aBSplinePCurve->NbKnots());
|
||||
aBSplinePCurve->Knots (aKnots);
|
||||
BSplCLib::Reparametrize (ResFirsts(1), ResLasts(1), aKnots);
|
||||
aBSplinePCurve->SetKnots (aKnots);
|
||||
ResPCurves(ii) = aBSplinePCurve;
|
||||
const TopoDS_Face& aFace = TopoDS::Face (aFaceSeq(ii));
|
||||
Handle(Geom_Surface) aSurf = BRep_Tool::Surface (aFace);
|
||||
Handle(ShapeAnalysis_Surface) aSAS = new ShapeAnalysis_Surface (aSurf);
|
||||
ShapeConstruct_ProjectCurveOnSurface aToolProj;
|
||||
aToolProj.Init (aSAS, Precision::Confusion());
|
||||
Handle(Geom2d_Curve) aNewPCurve;
|
||||
if (aToolProj.Perform(aCurve, aFirst3d, aLast3d, aNewPCurve))
|
||||
ResPCurves(ii) = aNewPCurve;
|
||||
else
|
||||
{
|
||||
//Reparametrize pcurve
|
||||
Handle(Geom2d_TrimmedCurve) aTrPCurve =
|
||||
new Geom2d_TrimmedCurve (ResPCurves(ii), ResFirsts(ii), ResLasts(ii));
|
||||
Handle(Geom2d_BSplineCurve) aBSplinePCurve = Geom2dConvert::CurveToBSplineCurve(aTrPCurve);
|
||||
TColStd_Array1OfReal aKnots (1, aBSplinePCurve->NbKnots());
|
||||
aBSplinePCurve->Knots (aKnots);
|
||||
BSplCLib::Reparametrize (aFirst3d, aLast3d, aKnots);
|
||||
aBSplinePCurve->SetKnots (aKnots);
|
||||
ResPCurves(ii) = aBSplinePCurve;
|
||||
}
|
||||
ResFirsts(ii) = aFirst3d;
|
||||
ResLasts(ii) = aLast3d;
|
||||
}
|
||||
}
|
||||
|
||||
//Reparametrize 3d curve if needed
|
||||
if (!ResPCurves.IsEmpty())
|
||||
{
|
||||
Standard_Real aFirst, aLast;
|
||||
Handle(Geom_Curve) aCurve = BRep_Tool::Curve (theEdge, aFirst, aLast);
|
||||
if (Abs (aFirst - ResFirsts(1)) > Precision::Confusion() ||
|
||||
Abs (aLast - ResLasts(1)) > Precision::Confusion())
|
||||
if (Abs (aFirst3d - ResFirsts(1)) > aMaxTol ||
|
||||
Abs (aLast3d - ResLasts(1)) > aMaxTol)
|
||||
{
|
||||
GeomAdaptor_Curve aGAcurve (aCurve);
|
||||
GeomAbs_CurveType aType = aGAcurve.GetType();
|
||||
@@ -1758,12 +1783,13 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape&
|
||||
{
|
||||
gp_Lin aLin = aGAcurve.Line();
|
||||
gp_Dir aDir = aLin.Direction();
|
||||
gp_Pnt aPnt = aGAcurve.Value (aFirst);
|
||||
gp_Pnt aPnt = aGAcurve.Value (aFirst3d);
|
||||
gp_Vec anOffset = -aDir;
|
||||
anOffset *= ResFirsts(1);
|
||||
aPnt.Translate (anOffset);
|
||||
Handle(Geom_Line) aLine = new Geom_Line (aPnt, aDir);
|
||||
aBuilder.UpdateEdge (theEdge, aLine, aTol);
|
||||
aBuilder.UpdateEdge (theEdge, aLine, aTolEdge);
|
||||
aBuilder.Range(theEdge, ResFirsts(1), ResLasts(1));
|
||||
}
|
||||
else if (aType == GeomAbs_Circle)
|
||||
{
|
||||
@@ -1771,29 +1797,36 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape&
|
||||
Standard_Real aRadius = aCirc.Radius();
|
||||
gp_Ax2 aPosition = aCirc.Position();
|
||||
gp_Ax1 anAxis = aPosition.Axis();
|
||||
Standard_Real anOffset = aFirst - ResFirsts(1);
|
||||
Standard_Real anOffset = aFirst3d - ResFirsts(1);
|
||||
aPosition.Rotate (anAxis, anOffset);
|
||||
Handle(Geom_Circle) aCircle = new Geom_Circle (aPosition, aRadius);
|
||||
aBuilder.UpdateEdge (theEdge, aCircle, aTol);
|
||||
aBuilder.UpdateEdge (theEdge, aCircle, aTolEdge);
|
||||
aBuilder.Range(theEdge, ResFirsts(1), ResLasts(1));
|
||||
}
|
||||
else //general case
|
||||
{
|
||||
Handle(Geom_TrimmedCurve) aTrCurve =
|
||||
new Geom_TrimmedCurve (aCurve, aFirst, aLast);
|
||||
Handle(Geom_BSplineCurve) aBSplineCurve = GeomConvert::CurveToBSplineCurve(aTrCurve);
|
||||
TColStd_Array1OfReal aKnots (1, aBSplineCurve->NbKnots());
|
||||
aBSplineCurve->Knots (aKnots);
|
||||
BSplCLib::Reparametrize (ResFirsts(1), ResLasts(1), aKnots);
|
||||
aBSplineCurve->SetKnots (aKnots);
|
||||
aBuilder.UpdateEdge (theEdge, aBSplineCurve, aTol);
|
||||
for (Standard_Integer ii = 1; ii <= ResPCurves.Length(); ii++)
|
||||
{
|
||||
if (Abs (aFirst3d - ResFirsts(ii)) > Precision::Confusion() ||
|
||||
Abs (aLast3d - ResLasts(ii)) > Precision::Confusion())
|
||||
{
|
||||
Handle(Geom2d_TrimmedCurve) aTrPCurve =
|
||||
new Geom2d_TrimmedCurve (ResPCurves(ii), ResFirsts(ii), ResLasts(ii));
|
||||
Handle(Geom2d_BSplineCurve) aBSplinePCurve = Geom2dConvert::CurveToBSplineCurve(aTrPCurve);
|
||||
TColStd_Array1OfReal aKnots (1, aBSplinePCurve->NbKnots());
|
||||
aBSplinePCurve->Knots (aKnots);
|
||||
BSplCLib::Reparametrize (aFirst3d, aLast3d, aKnots);
|
||||
aBSplinePCurve->SetKnots (aKnots);
|
||||
ResPCurves(ii) = aBSplinePCurve;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
aBuilder.Range(theEdge, ResFirsts(1), ResLasts(1));
|
||||
}
|
||||
|
||||
for (Standard_Integer j = 1; j <= ResPCurves.Length(); j++)
|
||||
{
|
||||
aBuilder.UpdateEdge(theEdge, ResPCurves(j), TopoDS::Face(aFaceSeq(j)), aTol);
|
||||
aBuilder.UpdateEdge(theEdge, ResPCurves(j), TopoDS::Face(aFaceSeq(j)), aTolEdge);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -43,6 +43,7 @@
|
||||
//! - "beta..." or "rc..." for beta releases or release candidates
|
||||
//! - "project..." for version containing project-specific fixes
|
||||
//#define OCC_VERSION_DEVELOPMENT "dev"
|
||||
#define OCC_VERSION_SERVICEPACK 1
|
||||
|
||||
// Derived (manually): version as real and string (major.minor)
|
||||
#define OCC_VERSION 7.5
|
||||
|
18
tests/bugs/heal/bug32332_1
Normal file
18
tests/bugs/heal/bug32332_1
Normal file
@@ -0,0 +1,18 @@
|
||||
puts "=========================================================="
|
||||
puts "OCC32332: Incorrect result of ShapeUpgrade_UnifySameDomain"
|
||||
puts "=========================================================="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32332_1.brep] a
|
||||
|
||||
unifysamedom result a
|
||||
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -wire 4 -edge 9 -vertex 6
|
||||
|
||||
set tolres [checkmaxtol result]
|
||||
|
||||
if { ${tolres} > 2.e-7} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
18
tests/bugs/heal/bug32332_2
Normal file
18
tests/bugs/heal/bug32332_2
Normal file
@@ -0,0 +1,18 @@
|
||||
puts "=========================================================="
|
||||
puts "OCC32332: Incorrect result of ShapeUpgrade_UnifySameDomain"
|
||||
puts "=========================================================="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32332_2.brep] a
|
||||
|
||||
unifysamedom result a
|
||||
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -wire 4 -edge 12 -vertex 8
|
||||
|
||||
set tolres [checkmaxtol result]
|
||||
|
||||
if { ${tolres} > 2.e-7} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
@@ -19,16 +19,22 @@ checkprops result -s 8206.54
|
||||
set nbshapes_expected "
|
||||
Number of shapes in shape
|
||||
VERTEX : 5
|
||||
EDGE : 9
|
||||
EDGE : 8
|
||||
WIRE : 4
|
||||
FACE : 4
|
||||
SHELL : 1
|
||||
SOLID : 1
|
||||
COMPSOLID : 0
|
||||
COMPOUND : 1
|
||||
SHAPE : 25
|
||||
SHAPE : 24
|
||||
"
|
||||
checknbshapes result -ref ${nbshapes_expected} -t -m "Boolean operations common"
|
||||
|
||||
set tolres [checkmaxtol result]
|
||||
|
||||
if { ${tolres} > 6.e-6} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
checkview -display result -3d -path ${imagedir}/${test_image}-3d.png
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}-2d.png
|
||||
|
@@ -19,16 +19,22 @@ checkprops result -s 34566
|
||||
set nbshapes_expected "
|
||||
Number of shapes in shape
|
||||
VERTEX : 13
|
||||
EDGE : 21
|
||||
EDGE : 20
|
||||
WIRE : 8
|
||||
FACE : 8
|
||||
SHELL : 1
|
||||
SOLID : 1
|
||||
COMPSOLID : 0
|
||||
COMPOUND : 1
|
||||
SHAPE : 53
|
||||
SHAPE : 52
|
||||
"
|
||||
checknbshapes result -ref ${nbshapes_expected} -t -m "Boolean operations cut"
|
||||
|
||||
set tolres [checkmaxtol result]
|
||||
|
||||
if { ${tolres} > 6.e-6} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
checkview -display result -3d -path ${imagedir}/${test_image}-3d.png
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}-2d.png
|
||||
|
29
tests/bugs/modalg_7/bug32291
Normal file
29
tests/bugs/modalg_7/bug32291
Normal file
@@ -0,0 +1,29 @@
|
||||
puts "======================================================="
|
||||
puts " 0032291: General Fuse produces wrong number of solids"
|
||||
puts "======================================================="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32291.brep] s
|
||||
|
||||
explode s
|
||||
baddobjects s_1
|
||||
baddtools s_2 s_3 s_4 s_5 s_6 s_7 s_8
|
||||
bfillds
|
||||
bbuild result
|
||||
|
||||
checkshape result
|
||||
|
||||
checknbshapes result -vertex 79 -edge 176 -wire 112 -face 112 -shell 18 -solid 18
|
||||
|
||||
set tolres [checkmaxtol result]
|
||||
|
||||
if { ${tolres} > 7.e-5} {
|
||||
puts "Error: bad tolerance of result"
|
||||
}
|
||||
|
||||
axo
|
||||
clear
|
||||
explode result So
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
Reference in New Issue
Block a user