1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0027720: HLRBrep_Algo BSpline missing edges

The algorithm that builds outlines ("silhouettes") makes an outline in 2d parametric space of the surface starting from some previously detected point where normal is orthogonal to direction of view. So, the surface is previously discretized into (m*n) sample points and some of them become starting points for future outlines.

    If the surface has non-uniform parametrization and/or some local extremums of curvature, the outlines can not be built without breaks, so there are several groups of consequent outlines in this case. Unfortunately, it leads to the situation when current number of sample points becomes insufficient to build all the parts of outlines.

    The idea is to detect the "holes" between already constructed parts of outlines and then complete the construction.

New auxiliary draw command for testing of HLR.

Correction according to the remarks.

Update of test case according to the developer's directive
This commit is contained in:
jgv
2016-09-08 18:20:57 +03:00
committed by bugmaster
parent b1c5466550
commit 8d795b5130
16 changed files with 600 additions and 30 deletions

View File

@@ -501,6 +501,61 @@ static Standard_Integer hlrin3d(Draw_Interpretor& , Standard_Integer n, const ch
return 0;
}
//=======================================================================
//function : hlrin2d
//purpose :
//=======================================================================
static Standard_Integer hlrin2d(Draw_Interpretor& , Standard_Integer n, const char** a)
{
if (n < 9)
return 1;
TopoDS_Shape aShape = DBRep::Get(a[2]);
if (aShape.IsNull())
return 1;
Standard_Real anAISViewProjX = atof(a[3]);
Standard_Real anAISViewProjY = atof(a[4]);
Standard_Real anAISViewProjZ = atof(a[5]);
Standard_Real Eye_X = atof(a[6]);
Standard_Real Eye_Y = atof(a[7]);
Standard_Real Eye_Z = atof(a[8]);
gp_Pnt anOrigin(0.,0.,0.);
gp_Dir aNormal(anAISViewProjX, anAISViewProjY, anAISViewProjZ);
gp_Dir aDX(Eye_X, Eye_Y, Eye_Z);
HLRAppli_ReflectLines Reflector(aShape);
Reflector.SetAxes(aNormal.X(), aNormal.Y(), aNormal.Z(),
anOrigin.X(), anOrigin.Y(), anOrigin.Z(),
aDX.X(), aDX.Y(), aDX.Z());
Reflector.Perform();
TopoDS_Compound Result;
BRep_Builder BB;
BB.MakeCompound(Result);
TopoDS_Shape SharpEdges = Reflector.GetCompoundOf3dEdges(HLRBRep_Sharp, Standard_True, Standard_False);
if (!SharpEdges.IsNull())
BB.Add(Result, SharpEdges);
TopoDS_Shape OutLines = Reflector.GetCompoundOf3dEdges(HLRBRep_OutLine, Standard_True, Standard_False);
if (!OutLines.IsNull())
BB.Add(Result, OutLines);
TopoDS_Shape SmoothEdges = Reflector.GetCompoundOf3dEdges(HLRBRep_Rg1Line, Standard_True, Standard_False);
if (!SmoothEdges.IsNull())
BB.Add(Result, SmoothEdges);
DBRep::Set(a[1], Result);
return 0;
}
//=======================================================================
//function : Commands
//purpose :
@@ -533,6 +588,10 @@ void HLRTest::Commands (Draw_Interpretor& theCommands)
"hlrin3d res shape proj_X proj_Y proj_Z",
__FILE__, hlrin3d, g);
theCommands.Add("hlrin2d",
"hlrin2d res shape proj_X proj_Y proj_Z eye_x eye_y eye_z",
__FILE__, hlrin2d, g);
hider = new HLRBRep_Algo();
}