- 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.
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;
{
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)
{
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)
{
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)
{
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)
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.
}
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,
//! 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
}
}
+//=======================================================================
+//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
//! 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