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

Revert "0032424: [Regression] Mesh - Slow triangulation of a simple shape."

This reverts commit 56f67cdaab.
This commit is contained in:
vsr
2022-04-15 14:10:02 +03:00
parent 70af2be481
commit b76c5dcdf7
20 changed files with 32 additions and 78 deletions

View File

@@ -34,7 +34,6 @@ public:
//! Constructor.
BRepMesh_DelaunayDeflectionControlMeshAlgo()
: myMaxSqDeflection(-1.),
mySqMinSize(-1.),
myIsAllDegenerated(Standard_False),
myCircles(NULL)
{
@@ -78,7 +77,6 @@ protected:
Handle(NCollection_IncAllocator) aTmpAlloc =
new NCollection_IncAllocator(IMeshData::MEMORY_BLOCK_SIZE_HUGE);
mySqMinSize = this->getParameters().MinSize * this->getParameters().MinSize;
myCouplesMap = new IMeshData::MapOfOrientedEdges(3 * this->getStructure()->ElementsOfDomain().Extent(), aTmpAlloc);
myControlNodes = new IMeshData::ListOfPnt2d(aTmpAlloc);
myCircles = &theMesher.Circles();
@@ -340,10 +338,6 @@ private:
if (!usePoint (aMidPnt2d, LineDeviation (theNodesInfo[i].Point,
theNodesInfo[j].Point)))
{
if (!rejectSplitLinksForMinSize (theNodesInfo[i],
theNodesInfo[j],
aMidPnt2d))
{
if (!checkLinkEndsForAngularDeviation(theNodesInfo[i],
theNodesInfo[j],
@@ -355,18 +349,6 @@ private:
}
}
}
}
//! Checks that two links produced as the result of a split of
//! the given link by the middle point fit MinSize requirement.
Standard_Boolean rejectSplitLinksForMinSize (const TriangleNodeInfo& theNodeInfo1,
const TriangleNodeInfo& theNodeInfo2,
const gp_XY& theMidPoint)
{
const gp_Pnt aPnt = getPoint3d (theMidPoint);
return ((theNodeInfo1.Point - aPnt.XYZ()).SquareModulus() < mySqMinSize ||
(theNodeInfo2.Point - aPnt.XYZ()).SquareModulus() < mySqMinSize);
}
//! Checks the given point (located between the given nodes)
//! for specified angular deviation.
@@ -383,10 +365,8 @@ private:
{
Standard_Real anAngle = aNorm1.Angle(aNorm2);
if (anAngle > this->getParameters().AngleInterior)
{
return Standard_False;
}
}
#if 0
else if (GeomLib::NormEstim(aSurf, theMidPoint, Precision::Confusion(), aNorm1) != 0)
{
@@ -401,14 +381,6 @@ private:
return Standard_True;
}
//! Returns 3d point corresponding to the given one in 2d space.
gp_Pnt getPoint3d (const gp_XY& thePnt2d)
{
gp_Pnt aPnt;
this->getDFace()->GetSurface()->D0(thePnt2d.X(), thePnt2d.Y(), aPnt);
return aPnt;
}
//! Computes deflection of the given point and caches it for
//! insertion in case if it overflows deflection.
//! @return True if point has been cached for insertion.
@@ -417,7 +389,8 @@ private:
const gp_XY& thePnt2d,
const DeflectionFunctor& theDeflectionFunctor)
{
const gp_Pnt aPnt = getPoint3d (thePnt2d);
gp_Pnt aPnt;
this->getDFace()->GetSurface()->D0(thePnt2d.X(), thePnt2d.Y(), aPnt);
if (!checkDeflectionOfPointAndUpdateCache(thePnt2d, aPnt, theDeflectionFunctor.SquareDeviation(aPnt)))
{
myControlNodes->Append(thePnt2d);
@@ -449,14 +422,14 @@ private:
return rejectByMinSize(thePnt2d, thePnt3d);
}
//! Checks distance between the given node and nodes of triangles
//! shot by it for MinSize criteria.
//! This check is expected to roughly estimate and prevent
//! generation of triangles with sides smaller than MinSize.
//! Checks the given node for
Standard_Boolean rejectByMinSize(
const gp_XY& thePnt2d,
const gp_Pnt& thePnt3d)
{
const Standard_Real aSqMinSize =
this->getParameters().MinSize * this->getParameters().MinSize;
IMeshData::MapOfInteger aUsedNodes;
IMeshData::ListOfInteger& aCirclesList =
const_cast<BRepMesh_CircleTool&>(*myCircles).Select(
@@ -478,7 +451,7 @@ private:
const BRepMesh_Vertex& aVertex = this->getStructure()->GetNode(aNodes[i]);
const gp_Pnt& aPoint = this->getNodesMap()->Value(aVertex.Location3d());
if (thePnt3d.SquareDistance(aPoint) < mySqMinSize)
if (thePnt3d.SquareDistance(aPoint) < aSqMinSize)
{
return Standard_True;
}
@@ -491,7 +464,6 @@ private:
private:
Standard_Real myMaxSqDeflection;
Standard_Real mySqMinSize;
Standard_Boolean myIsAllDegenerated;
Handle(IMeshData::MapOfOrientedEdges) myCouplesMap;
Handle(IMeshData::ListOfPnt2d) myControlNodes;

View File

@@ -13,6 +13,6 @@ vdisplay result
vsetdispmode result 1
vfit
checktrinfo result -tri 200 -nod 215
checktrinfo result -tri 244 -nod 237
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -12,7 +12,7 @@ vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
checktrinfo result -tri 62936 -nod 31509 -defl 0.00096399964870812682
checktrinfo result -tri 323820 -nod 161951 -defl 0.00096399964870812682
set log [tricheck result]
if { [llength $log] != 0 } {

View File

@@ -17,7 +17,7 @@ vdefaults -autoTriang 0
vdisplay result
vfit
set rel_tol 0.6928018366802983
set rel_tol 0.035439456401028344
set max_rel_tol_diff 0.001
set area_eps 1

View File

@@ -12,6 +12,6 @@ vdisplay result
vviewparams -scale 8.46292 -proj 0.653203 -0.644806 0.396926 -up -0.0109833 0.51609 0.856464 -at 347.559 1026.89 219.262 -eye 2080.75 -684.022 1272.45
tricheck result
checktrinfo result -tri 6978 -nod 4890 -defl 7.6167024939147652
checktrinfo result -tri 11826 -nod 7310 -defl 7.6167024939147652
checkview -screenshot -3d -path ${imagedir}/${test_image}.png

View File

@@ -15,7 +15,7 @@ vdefaults -autoTriang 0
tclean result
incmesh result 0.004 -a 14
checktrinfo result -tri 70556 -nod 39944 -defl 0.22962869401103247
checktrinfo result -tri 70560 -nod 39946 -defl 0.22962869401103247
vdisplay result -redisplay
vfit
@@ -23,7 +23,7 @@ checkview -screenshot -3d -path ${imagedir}/${test_image}_default.png
tclean result
incmesh result 0.004 -a 14 -force_face_def
checktrinfo result -tri 292556 -nod 150944 -defl 0.04579460790575135
checktrinfo result -tri 292560 -nod 150946 -defl 0.04579460790575135
vdisplay result -redisplay
vfit

View File

@@ -1,18 +0,0 @@
puts "======="
puts "0032424: Mesh - Slow triangulation of a simple shape."
puts "======="
puts ""
cpulimit 3
restore [locate_data_file bug32424.brep] result
incmesh result 0.17 -a 20
checktrinfo result -tri 16168 -nod 8206
vinit
vdefaults -autoTriang 0
vsetdispmode 1
vdisplay result
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}.png

View File

@@ -19,5 +19,5 @@ isos result 0
triangles result
fit
checktrinfo result -tri 7863 -nod 6342
checktrinfo result -tri 10924 -nod 7869
checkview -screenshot -2d -path ${imagedir}/${test_image}_axo.png

View File

@@ -1,5 +1,5 @@
set viewname "vright"
set length 9546.99
set length 9547.11
testreadstep [locate_data_file bug27341_Assembly_ABS_1_CAD.stp] a
COMPUTE_HLR $viewname $algotype

View File

@@ -1,4 +1,4 @@
puts "TODO OCC30286 ALL: Error : The length of result shape is 5499.*, expected 5934.34"
puts "TODO OCC30286 ALL: Error : The length of result shape is 5496.05, expected 5934.34"
set viewname "vright"
set length 5934.34

View File

@@ -1,4 +1,4 @@
puts "TODO OCC30286 ALL: Error : The length of result shape is 2705.91, expected 2765.47"
puts "TODO OCC30286 ALL: Error : The length of result shape is 2707.33, expected 2765.47"
set viewname "vright"
set length 2765.47

View File

@@ -4,7 +4,7 @@ puts "============"
puts ""
set viewname "vfront"
set length 29113.3
set length 28991.6
restore [locate_data_file bug23625_a2.brep] a
COMPUTE_HLR $viewname $algotype

View File

@@ -4,7 +4,7 @@ puts "============"
puts ""
set viewname "vtop"
set length 19604.4
set length 19620.9
restore [locate_data_file bug23625_a3.brep] a
COMPUTE_HLR $viewname $algotype

View File

@@ -1,4 +1,4 @@
puts "TODO OCC30286 ALL: Error : The length of result shape is 4.*, expected 4."
puts "TODO OCC30286 ALL: Error : The length of result shape is 4.6692, expected 4."
puts "========================================================================"
puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"

View File

@@ -1,4 +1,4 @@
puts "TODO OCC30286 ALL: Error : The length of result shape is 4.*, expected 4."
puts "TODO OCC30286 ALL: Error : The length of result shape is 4.15911, expected 4."
puts "========================================================================"
puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"

View File

@@ -1,4 +1,4 @@
puts "TODO OCC30286 ALL: Error : The length of result shape is 3.*, expected 3."
puts "TODO OCC30286 ALL: Error : The length of result shape is 3.2349, expected 3."
puts "========================================================================"
puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"

View File

@@ -11,7 +11,7 @@ dchrono t restart
incmesh a_1 0.01 1
dchrono t stop counter incmesh
checktrinfo a_1 -tri 525271 -nod 263456 -defl 0.081028355715069861
checktrinfo a_1 -tri 743149 -nod 372395 -defl 0.081028355715069861
set log [tricheck a_1]
if { [llength $log] != 0 } {

View File

@@ -11,7 +11,7 @@ dchrono t restart
incmesh a_1 0.1 1
dchrono t stop counter incmesh
checktrinfo a_1 -tri 68779 -nod 34737 -defl 0.11671770612283024
checktrinfo a_1 -tri 182273 -nod 91484 -defl 0.11671770612283024
set log [tricheck a_1]
if { [llength $log] != 0 } {

View File

@@ -11,7 +11,7 @@ dchrono t restart
incmesh a_1 1.0 1
dchrono t stop counter incmesh
checktrinfo a_1 -tri 12469 -nod 6503 -defl 1.0
checktrinfo a_1 -tri 73119 -nod 36828 -defl 1.0
set log [tricheck a_1]
if { [llength $log] != 0 } {

View File

@@ -16,4 +16,4 @@ dchrono h
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
checktrinfo a -tri 14764 -nod 7587 -defl 0.098772787476728782
checktrinfo a -tri 217070 -nod 108740 -defl 0.098772787476728782