mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0032261: Mesh - some trivial improvements for mesher
BRepMesh_Delaun::decomposeSimplePolygon(): minor change to improve code readability; Correct test case
This commit is contained in:
parent
3326f9238c
commit
793d165af6
@ -994,7 +994,6 @@ Standard_Boolean BRepMesh_Delaun::meshLeftPolygonOf(
|
|||||||
aPivotNode = aRefEdge.FirstNode();
|
aPivotNode = aRefEdge.FirstNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const BRepMesh_Vertex& aStartEdgeVertexS = GetVertex( aStartNode );
|
const BRepMesh_Vertex& aStartEdgeVertexS = GetVertex( aStartNode );
|
||||||
BRepMesh_Vertex aPivotVertex = GetVertex( aPivotNode );
|
BRepMesh_Vertex aPivotVertex = GetVertex( aPivotNode );
|
||||||
|
|
||||||
@ -1914,7 +1913,7 @@ void BRepMesh_Delaun::meshPolygon(IMeshData::SequenceOfInteger& thePolygon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (aPolyStack.IsEmpty())
|
if (aPolyStack.IsEmpty())
|
||||||
return;
|
break;
|
||||||
|
|
||||||
aPolygon1 = &(*aPolyStack.ChangeFirst());
|
aPolygon1 = &(*aPolyStack.ChangeFirst());
|
||||||
aPolyBoxes1 = &(*aPolyBoxStack.ChangeFirst());
|
aPolyBoxes1 = &(*aPolyBoxStack.ChangeFirst());
|
||||||
@ -2019,6 +2018,10 @@ void BRepMesh_Delaun::decomposeSimplePolygon(
|
|||||||
aNextEdge.FirstNode() :
|
aNextEdge.FirstNode() :
|
||||||
aNextEdge.LastNode();
|
aNextEdge.LastNode();
|
||||||
|
|
||||||
|
// We have end points touch case in the polygon - ignore it
|
||||||
|
if (aPivotNode == aNodes[1])
|
||||||
|
continue;
|
||||||
|
|
||||||
gp_Pnt2d aPivotVertex = GetVertex( aPivotNode ).Coord();
|
gp_Pnt2d aPivotVertex = GetVertex( aPivotNode ).Coord();
|
||||||
gp_Vec2d aDistanceDir( aRefVertices[1], aPivotVertex );
|
gp_Vec2d aDistanceDir( aRefVertices[1], aPivotVertex );
|
||||||
|
|
||||||
@ -2105,7 +2108,6 @@ void BRepMesh_Delaun::decomposeSimplePolygon(
|
|||||||
myMeshData->AddLink( aNewEdges[0] ),
|
myMeshData->AddLink( aNewEdges[0] ),
|
||||||
myMeshData->AddLink( aNewEdges[1] ) };
|
myMeshData->AddLink( aNewEdges[1] ) };
|
||||||
|
|
||||||
|
|
||||||
Standard_Integer anEdges[3];
|
Standard_Integer anEdges[3];
|
||||||
Standard_Boolean anEdgesOri[3];
|
Standard_Boolean anEdgesOri[3];
|
||||||
for ( Standard_Integer aTriEdgeIt = 0; aTriEdgeIt < 3; ++aTriEdgeIt )
|
for ( Standard_Integer aTriEdgeIt = 0; aTriEdgeIt < 3; ++aTriEdgeIt )
|
||||||
@ -2116,27 +2118,38 @@ void BRepMesh_Delaun::decomposeSimplePolygon(
|
|||||||
}
|
}
|
||||||
addTriangle( anEdges, anEdgesOri, aNodes );
|
addTriangle( anEdges, anEdgesOri, aNodes );
|
||||||
|
|
||||||
// Create triangle and split the source polygon on two
|
if (aUsedLinkId == 3)
|
||||||
// parts (if possible) and mesh each part as independent
|
|
||||||
// polygon.
|
|
||||||
if ( aUsedLinkId < aPolyLen )
|
|
||||||
{
|
{
|
||||||
thePolygon.Split(aUsedLinkId, thePolygonCut);
|
thePolygon.Remove ( 1 );
|
||||||
thePolygonCut.Prepend( -aNewEdgesInfo[2] );
|
thePolyBoxes.Remove( 1 );
|
||||||
thePolyBoxes.Split(aUsedLinkId, thePolyBoxesCut);
|
|
||||||
|
thePolygon.SetValue( 1, -aNewEdgesInfo[2] );
|
||||||
|
|
||||||
Bnd_B2d aBox;
|
Bnd_B2d aBox;
|
||||||
UpdateBndBox(aRefVertices[0].Coord(), aRefVertices[2].Coord(), aBox);
|
UpdateBndBox(aRefVertices[0].Coord(), aRefVertices[2].Coord(), aBox);
|
||||||
thePolyBoxesCut.Prepend( aBox );
|
thePolyBoxes.SetValue( 1, aBox );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
thePolygon.Remove ( aPolyLen );
|
// Create triangle and split the source polygon on two
|
||||||
thePolyBoxes.Remove( aPolyLen );
|
// parts (if possible) and mesh each part as independent
|
||||||
}
|
// polygon.
|
||||||
|
if ( aUsedLinkId < aPolyLen )
|
||||||
|
{
|
||||||
|
thePolygon.Split(aUsedLinkId, thePolygonCut);
|
||||||
|
thePolygonCut.Prepend( -aNewEdgesInfo[2] );
|
||||||
|
thePolyBoxes.Split(aUsedLinkId, thePolyBoxesCut);
|
||||||
|
|
||||||
|
Bnd_B2d aBox;
|
||||||
|
UpdateBndBox(aRefVertices[0].Coord(), aRefVertices[2].Coord(), aBox);
|
||||||
|
thePolyBoxesCut.Prepend( aBox );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
thePolygon.Remove ( aPolyLen );
|
||||||
|
thePolyBoxes.Remove( aPolyLen );
|
||||||
|
}
|
||||||
|
|
||||||
if ( aUsedLinkId > 3 )
|
|
||||||
{
|
|
||||||
thePolygon.SetValue( 1, -aNewEdgesInfo[1] );
|
thePolygon.SetValue( 1, -aNewEdgesInfo[1] );
|
||||||
|
|
||||||
Bnd_B2d aBox;
|
Bnd_B2d aBox;
|
||||||
|
@ -19,5 +19,5 @@ isos result 0
|
|||||||
triangles result
|
triangles result
|
||||||
fit
|
fit
|
||||||
|
|
||||||
checktrinfo result -tri 10924 -nod 7869
|
checktrinfo result -tri 10917 -nod 7869
|
||||||
checkview -screenshot -2d -path ${imagedir}/${test_image}_axo.png
|
checkview -screenshot -2d -path ${imagedir}/${test_image}_axo.png
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
puts "TODO OCC30286 ALL: Error : The length of result shape is 1664.\\d+, expected 1664.48"
|
||||||
|
|
||||||
set viewname "vright"
|
set viewname "vright"
|
||||||
set length 1664.48
|
set length 1664.48
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
puts "TODO OCC30286 ALL: Error : The length of result shape is 1723.\\d+, expected 1721.69"
|
||||||
|
|
||||||
set viewname "vright"
|
set viewname "vright"
|
||||||
set length 1721.69
|
set length 1721.69
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
puts "TODO OCC30286 ALL: Error : The length of result shape is 3.53405, expected 3."
|
puts "TODO OCC30286 ALL: Error : The length of result shape is 3.\\d+, expected 3."
|
||||||
|
|
||||||
puts "========================================================================"
|
puts "========================================================================"
|
||||||
puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"
|
puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
puts "TODO OCC30286 ALL: Error : The length of result shape is 12.4883, expected 12."
|
puts "TODO OCC30286 ALL: Error : The length of result shape is 12.\\d+, expected 12."
|
||||||
|
|
||||||
puts "========================================================================"
|
puts "========================================================================"
|
||||||
puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"
|
puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
puts "TODO OCC30286 ALL: Error : The length of result shape is 11.4458, expected 11."
|
puts "TODO OCC30286 ALL: Error : The length of result shape is 11.\\d+, expected 11."
|
||||||
|
|
||||||
puts "========================================================================"
|
puts "========================================================================"
|
||||||
puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"
|
puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
puts "TODO OCC30286 ALL: Error : The length of result shape is 11.2065, expected 11."
|
puts "TODO OCC30286 ALL: Error : The length of result shape is 11.\\d+, expected 11."
|
||||||
|
|
||||||
puts "========================================================================"
|
puts "========================================================================"
|
||||||
puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"
|
puts "OCC27979: Parasolid converted BREP shows weird lines on hidden line Algo"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user