mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0027239: Meshing algorithm creates wrong Triangulation
Do not insert consequent duplicating nodes in PolygonOnTriangulation. Small correction of test case bugs/mesh/bug27239
This commit is contained in:
parent
29627b4cdb
commit
dfb3bdd43a
@ -846,6 +846,7 @@ void BRepMesh_FastDiscret::update(
|
|||||||
aNewParamsVec (aNodesCount) = aEAttr.FirstParam;
|
aNewParamsVec (aNodesCount) = aEAttr.FirstParam;
|
||||||
|
|
||||||
++aNodesCount;
|
++aNodesCount;
|
||||||
|
Standard_Integer aPrevNodeId = ivf;
|
||||||
Standard_Integer aLastPointId = myAttribute->LastPointId();
|
Standard_Integer aLastPointId = myAttribute->LastPointId();
|
||||||
for (Standard_Integer i = 2; i < aNodesNb; ++i)
|
for (Standard_Integer i = 2; i < aNodesNb; ++i)
|
||||||
{
|
{
|
||||||
@ -855,15 +856,21 @@ void BRepMesh_FastDiscret::update(
|
|||||||
if (!aEdgeTool->Value(i, aParam, aPnt, aUV))
|
if (!aEdgeTool->Value(i, aParam, aPnt, aUV))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
myBoundaryPoints->Bind(++aLastPointId, aPnt);
|
// Imitate index of 3d point in order to not to add points to map without necessity.
|
||||||
|
|
||||||
Standard_Integer iv2, isv;
|
Standard_Integer iv2, isv;
|
||||||
myAttribute->AddNode(aLastPointId, aUV.Coord(), BRepMesh_Frontier, iv2, isv);
|
myAttribute->AddNode(aLastPointId + 1, aUV.Coord(), BRepMesh_Frontier, iv2, isv);
|
||||||
|
if (aPrevNodeId == iv2)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Ok, now we can add point to the map.
|
||||||
|
myBoundaryPoints->Bind (++aLastPointId, aPnt);
|
||||||
|
|
||||||
aNewNodesInStructVec(aNodesCount) = aLastPointId;
|
aNewNodesInStructVec(aNodesCount) = aLastPointId;
|
||||||
aNewNodesVec (aNodesCount) = isv;
|
aNewNodesVec (aNodesCount) = isv;
|
||||||
aNewParamsVec (aNodesCount) = aParam;
|
aNewParamsVec (aNodesCount) = aParam;
|
||||||
|
|
||||||
++aNodesCount;
|
++aNodesCount;
|
||||||
|
aPrevNodeId = iv2;
|
||||||
}
|
}
|
||||||
|
|
||||||
aNewNodesInStructVec(aNodesCount) = ipl;
|
aNewNodesInStructVec(aNodesCount) = ipl;
|
||||||
|
29
tests/bugs/mesh/bug27239
Normal file
29
tests/bugs/mesh/bug27239
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
puts "========="
|
||||||
|
puts "OCC27239"
|
||||||
|
puts "========="
|
||||||
|
puts ""
|
||||||
|
#################################
|
||||||
|
# Meshing algorithm creates wrong triangulation
|
||||||
|
#################################
|
||||||
|
pload ALL
|
||||||
|
restore [locate_data_file bug27239_f1.brep] result
|
||||||
|
|
||||||
|
set bug_info [incmesh result 0.1]
|
||||||
|
if {[regexp "NoError" $bug_info] != 1} {
|
||||||
|
puts "Error: failure during triangulation"
|
||||||
|
}
|
||||||
|
|
||||||
|
set log [tricheck result]
|
||||||
|
if { [llength $log] != 0 } {
|
||||||
|
puts "Error : Some faces has failed to mesh"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
|
||||||
|
explode result e
|
||||||
|
set edge_dump [dump result_4]
|
||||||
|
if {[regexp "5 5" $edge_dump] != 0} {
|
||||||
|
puts "Error: there are duplicating nodes in polygon on triangulation"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkview -display result -3d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user