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

Support of implementation of the algorithm for replacing faces in shape with new faces based on other surfaces - PatchFaces. For that:

- Add the flag UseInfini in the method BRepOffset_Tool::EnLargeFace, defining whether it is needed to use infinite enlarge of a face or not.

- Add the method TopExp::MapShapesAndUniqueAncestors().

- Increase the value of extension in EnlargeGeometry to provide proper intersection of adjacent faces.
This commit is contained in:
jgv
2017-08-14 14:48:07 +03:00
committed by msv
parent 61f2ce47cd
commit 2031d84f45
4 changed files with 90 additions and 10 deletions

View File

@@ -2834,7 +2834,7 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
const Standard_Boolean GlobalEnlargeVfirst,
const Standard_Boolean GlobalEnlargeVlast)
{
const Standard_Real coeff = 4.;
const Standard_Real coeff = 1.;
const Standard_Real TolApex = 1.e-5;
Standard_Boolean SurfaceChange = Standard_False;
@@ -2882,7 +2882,7 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
{
viso = S->VIso( vf1 );
GeomAdaptor_Curve gac( viso );
du = GCPnts_AbscissaPoint::Length( gac ) / coeff;
du = GCPnts_AbscissaPoint::Length( gac ) * coeff;
uiso1 = S->UIso( uf1 );
uiso2 = S->UIso( uf2 );
if (BRepOffset_Tool::Gabarit( uiso1 ) <= TolApex)
@@ -2903,7 +2903,7 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
{
uiso = S->UIso( uf1 );
GeomAdaptor_Curve gac( uiso );
dv = GCPnts_AbscissaPoint::Length( gac ) / coeff;
dv = GCPnts_AbscissaPoint::Length( gac ) * coeff;
viso1 = S->VIso( vf1 );
viso2 = S->VIso( vf2 );
if (BRepOffset_Tool::Gabarit( viso1 ) <= TolApex)
@@ -2958,7 +2958,7 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
{
viso = S->VIso( v1 );
gac.Load( viso );
du = GCPnts_AbscissaPoint::Length( gac ) / coeff;
du = GCPnts_AbscissaPoint::Length( gac ) * coeff;
uiso1 = S->UIso( u1 );
uiso2 = S->UIso( u2 );
if (BRepOffset_Tool::Gabarit( uiso1 ) <= TolApex)
@@ -2970,7 +2970,7 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S,
{
uiso = S->UIso( u1 );
gac.Load( uiso );
dv = GCPnts_AbscissaPoint::Length( gac ) / coeff;
dv = GCPnts_AbscissaPoint::Length( gac ) * coeff;
viso1 = S->VIso( v1 );
viso2 = S->VIso( v2 );
if (BRepOffset_Tool::Gabarit( viso1 ) <= TolApex)
@@ -3217,7 +3217,8 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
const Standard_Boolean UpdatePCurve,
const Standard_Boolean enlargeU,
const Standard_Boolean enlargeVfirst,
const Standard_Boolean enlargeVlast)
const Standard_Boolean enlargeVlast,
const Standard_Boolean UseInfini)
{
//---------------------------
// extension de la geometrie.
@@ -3249,8 +3250,20 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
}
S->Bounds (US1,US2,VS1,VS2);
UU1 = VV1 = - infini;
UU2 = VV2 = infini;
if (UseInfini)
{
UU1 = VV1 = - infini;
UU2 = VV2 = infini;
}
else
{
Standard_Real FaceDU = UF2 - UF1;
Standard_Real FaceDV = VF2 - VF1;
UU1 = UF1 - FaceDU;
UU2 = UF2 + FaceDU;
VV1 = VF1 - FaceDV;
VV2 = VF2 + FaceDV;
}
if (CanExtentSurface) {
SurfaceChange = EnlargeGeometry( S, UU1, UU2, VV1, VV2, isVV1degen, isVV2degen, UF1, UF2, VF1, VF2,

View File

@@ -104,8 +104,15 @@ public:
//! if <UpdatePCurve> is TRUE, update the pcurves of the
//! edges of <F> on the new surface.if the surface has been changed,
//! Returns True if The Surface of <NF> has changed.
Standard_EXPORT static Standard_Boolean EnLargeFace (const TopoDS_Face& F, TopoDS_Face& NF, const Standard_Boolean ChangeGeom, const Standard_Boolean UpDatePCurve = Standard_False, const Standard_Boolean enlargeU = Standard_True, const Standard_Boolean enlargeVfirst = Standard_True, const Standard_Boolean enlargeVlast = Standard_True);
Standard_EXPORT static Standard_Boolean EnLargeFace (const TopoDS_Face& F,
TopoDS_Face& NF,
const Standard_Boolean ChangeGeom,
const Standard_Boolean UpDatePCurve = Standard_False,
const Standard_Boolean enlargeU = Standard_True,
const Standard_Boolean enlargeVfirst = Standard_True,
const Standard_Boolean enlargeVlast = Standard_True,
const Standard_Boolean UseInfini = Standard_True);
Standard_EXPORT static void ExtentFace (const TopoDS_Face& F, TopTools_DataMapOfShapeShape& ConstShapes, TopTools_DataMapOfShapeShape& ToBuild, const TopAbs_State Side, const Standard_Real TolConf, TopoDS_Face& NF);
//! Via the wire explorer store in <NOnV1> for

View File

@@ -99,7 +99,55 @@ void TopExp::MapShapesAndAncestors
}
}
//=======================================================================
//function : MapShapesAndUniqueAncestors
//purpose :
//=======================================================================
void TopExp::MapShapesAndUniqueAncestors
(const TopoDS_Shape& S,
const TopAbs_ShapeEnum TS,
const TopAbs_ShapeEnum TA,
TopTools_IndexedDataMapOfShapeListOfShape& M,
const Standard_Boolean useOrientation)
{
TopTools_ListOfShape empty;
// visit ancestors
TopExp_Explorer exa(S,TA);
while (exa.More())
{
// visit shapes
const TopoDS_Shape& anc = exa.Current();
TopExp_Explorer exs(anc,TS);
while (exs.More())
{
Standard_Integer index = M.FindIndex(exs.Current());
if (index == 0)
index = M.Add(exs.Current(),empty);
TopTools_ListOfShape& aList = M(index);
// check if anc already exists in a list
TopTools_ListIteratorOfListOfShape it(aList);
for (; it.More(); it.Next())
if (useOrientation? anc.IsEqual(it.Value()) : anc.IsSame(it.Value()))
break;
if (!it.More())
aList.Append(anc);
exs.Next();
}
exa.Next();
}
// visit shapes not under ancestors
TopExp_Explorer ex(S,TS,TA);
while (ex.More())
{
Standard_Integer index = M.FindIndex(ex.Current());
if (index == 0)
M.Add(ex.Current(),empty);
ex.Next();
}
}
//=======================================================================
//function : FirstVertex

View File

@@ -66,6 +66,18 @@ public:
//! Warning: The map is not cleared at first.
Standard_EXPORT static void MapShapesAndAncestors (const TopoDS_Shape& S, const TopAbs_ShapeEnum TS, const TopAbs_ShapeEnum TA, TopTools_IndexedDataMapOfShapeListOfShape& M);
//! Stores in the map <M> all the subshape of <S> of
//! type <TS> for each one append to the list all
//! unique ancestors of type <TA>. For example map all
//! the edges and bind the list of faces.
//! useOrientation = True : taking account the ancestor orientation
//! Warning: The map is not cleared at first.
Standard_EXPORT static void MapShapesAndUniqueAncestors (const TopoDS_Shape& S,
const TopAbs_ShapeEnum TS,
const TopAbs_ShapeEnum TA,
TopTools_IndexedDataMapOfShapeListOfShape& M,
const Standard_Boolean useOrientation = Standard_False);
//! Returns the Vertex of orientation FORWARD in E. If
//! there is none returns a Null Shape.
//! CumOri = True : taking account the edge orientation