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

@@ -1491,7 +1491,8 @@ void Contap_Contour::Perform
if (seqpdep.Length() != 0 || seqpins.Length() != 0) {
Contap_TheIWalking iwalk(Preci,Fleche,Pas);
Standard_Boolean theToFillHoles = Standard_True;
Contap_TheIWalking iwalk(Preci,Fleche,Pas,theToFillHoles);
iwalk.Perform(seqpdep,seqpins,mySFunc ,Surf);
if(!iwalk.IsDone()) {
return;

View File

@@ -31,6 +31,7 @@
#include <gp_Vec.hxx>
#include <gp_Dir2d.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
#include <Contap_SequenceOfIWLineOfTheIWalking.hxx>
#include <IntSurf_SequenceOfInteriorPoint.hxx>
#include <Standard_Integer.hxx>
@@ -61,7 +62,11 @@ public:
//! consecutive points (in 2d space).
//! Epsilon is the tolerance beyond which 2 points
//! are confused.
Standard_EXPORT Contap_TheIWalking(const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Step);
//! theToFillHoles is the flag defining whether possible holes
//! between resulting curves are filled or not
//! in case of Contap walking theToFillHoles is True
Standard_EXPORT Contap_TheIWalking(const Standard_Real Epsilon, const Standard_Real Deflection, const Standard_Real Step,
const Standard_Boolean theToFillHoles = Standard_False);
//! Deflection is the maximum deflection admitted between two
//! consecutive points on a resulting polyline.
@@ -117,6 +122,10 @@ protected:
Standard_EXPORT Standard_Boolean TestArretAjout (Contap_SurfFunction& Section, math_Vector& UV, Standard_Integer& Irang, IntSurf_PntOn2S& PSol);
Standard_EXPORT void FillPntsInHoles (Contap_SurfFunction& Section,
TColStd_SequenceOfInteger& CopySeqAlone,
IntSurf_SequenceOfInteriorPoint& PntsInHoles);
Standard_EXPORT void TestArretCadre (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const Handle(Contap_TheIWLineOfTheIWalking)& Line, Contap_SurfFunction& Section, math_Vector& UV, Standard_Integer& Irang);
Standard_EXPORT IntWalk_StatusDeflection TestDeflection (Contap_SurfFunction& Section, const Standard_Boolean Finished, const math_Vector& UV, const IntWalk_StatusDeflection StatusPrecedent, Standard_Integer& NbDivision, Standard_Real& Step, const Standard_Integer StepSign);
@@ -125,6 +134,12 @@ protected:
Standard_EXPORT void OpenLine (const Standard_Integer N, const IntSurf_PntOn2S& Psol, const IntSurf_SequenceOfPathPoint& Pnts1, Contap_SurfFunction& Section, const Handle(Contap_TheIWLineOfTheIWalking)& Line);
Standard_EXPORT Standard_Boolean IsValidEndPoint (const Standard_Integer IndOfPoint, const Standard_Integer IndOfLine);
Standard_EXPORT void RemoveTwoEndPoints (const Standard_Integer IndOfPoint);
Standard_EXPORT Standard_Boolean IsPointOnLine (const gp_Pnt2d& theP2d, const Standard_Integer Irang);
Standard_EXPORT void ComputeCloseLine (const TColStd_SequenceOfReal& Umult, const TColStd_SequenceOfReal& Vmult, const IntSurf_SequenceOfPathPoint& Pnts1, const IntSurf_SequenceOfInteriorPoint& Pnts2, Contap_SurfFunction& Section, Standard_Boolean& Rajout);
Standard_EXPORT void AddPointInCurrentLine (const Standard_Integer N, const IntSurf_PathPoint& PathPnt, const Handle(Contap_TheIWLineOfTheIWalking)& CurrentLine) const;
@@ -159,7 +174,10 @@ private:
gp_Vec previousd3d;
gp_Dir2d previousd2d;
TColStd_SequenceOfInteger seqAjout;
TColStd_SequenceOfInteger seqAlone;
TColStd_DataMapOfIntegerListOfInteger PointLineLine;
Contap_SequenceOfIWLineOfTheIWalking lines;
Standard_Boolean ToFillHoles;
};