1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0023184: Bad face tessellation result

Consider BSplineKnots to achieve better tessellation result
Adding test cases for this fix
This commit is contained in:
oan 2013-03-22 17:34:37 +04:00
parent 51a849d770
commit 32d878f538
3 changed files with 81 additions and 2 deletions

View File

@ -990,8 +990,39 @@ void BRepMesh_FastDiscret::Add( const TopoDS_Edge& theEdge,
TopLoc_Location L;
Standard_Integer nbpmin = 2;
if (cons.GetType() == GeomAbs_Circle) nbpmin = 4; //OCC287
BRepMesh_GeomTool GT(cons, wFirst, wLast, 0.5*myAngle, otherdefedge, nbpmin);
const GeomAbs_CurveType aCurveType = cons.GetType();
if ( aCurveType == GeomAbs_Circle )
nbpmin = 4; //OCC287
BRepMesh_GeomTool GT(cons, wFirst, wLast, 0.5 * myAngle, otherdefedge, nbpmin);
if ( aCurveType == GeomAbs_BSplineCurve )
{
const Standard_Integer aNbInt = cons.NbIntervals( GeomAbs_C1 );
if ( aNbInt > 0 )
{
TColStd_Array1OfReal anIntervals( 1, aNbInt + 1 );
cons.Intervals( anIntervals, GeomAbs_C1 );
for ( Standard_Integer aIntIt = 1; aIntIt <= aNbInt; ++aIntIt )
{
const Standard_Real& aStartInt = anIntervals.Value( aIntIt );
const Standard_Real& anEndInt = anIntervals.Value( aIntIt + 1 );
BRepMesh_GeomTool aDetalizator( cons, aStartInt, anEndInt,
0.5 * myAngle, otherdefedge, nbpmin );
Standard_Integer aNbAddNodes = aDetalizator.NbPoints();
for ( Standard_Integer aNodeIt = 1; aNodeIt <= aNbAddNodes; ++aNodeIt )
{
Standard_Real aParam;
gp_Pnt aPoint3d;
gp_Pnt2d aPoint2d;
aDetalizator.Value( cons, theGFace, aNodeIt, aParam, aPoint3d, aPoint2d );
GT.AddPoint( aPoint3d, aParam, Standard_False );
}
}
}
}
// PTv, chl/922/G9, Take into account internal vertices
// it is necessary for internal edges, which do not split other edges, by their vertex

24
tests/bugs/mesh/bug23184_1 Executable file
View File

@ -0,0 +1,24 @@
puts "========================"
puts "CR23184"
puts "========================"
puts ""
#######################################################################
# Bad face tessellation result
#######################################################################
brestore [locate_data_file bug23184_tessface2.brep] result
checkshape result
tclean result
set Deflection 0.045
incmesh result ${Deflection}
vinit
vsetdispmode 1
vdisplay result
vfit
set only_screen 1

24
tests/bugs/mesh/bug23184_2 Executable file
View File

@ -0,0 +1,24 @@
puts "========================"
puts "CR23184"
puts "========================"
puts ""
#######################################################################
# Bad face tessellation result
#######################################################################
brestore [locate_data_file bug23184_tessface.brep] result
checkshape result
tclean result
set Deflection 0.045
incmesh result ${Deflection}
vinit
vsetdispmode 1
vdisplay result
vfit
set only_screen 1