BRepFill_IndexedDataMapOfOrientedShapeListOfShape& Map,
const Handle(Geom_Plane)& RefPlane,
const Standard_Boolean IsOpenResult,
+ const GeomAbs_JoinType theJoinType,
const TopoDS_Vertex * Ends);
//=======================================================================
IsOpenResult)
{
Standard_Real anOffset = myOffset;
- if (E.Orientation() == TopAbs_REVERSED) anOffset *= -1;
Handle(Geom2d_Curve) aPCurve = BRep_Tool::CurveOnSurface(E, mySpine, f, l);
Handle(Geom2dAdaptor_HCurve) AHC = new Geom2dAdaptor_HCurve(aPCurve, f, l);
Handle(Geom2d_Curve) OC;
if (AHC->GetType() == GeomAbs_Line)
{
+ if (E.Orientation() == TopAbs_REVERSED) anOffset *= -1;
Adaptor3d_OffsetCurve Off(AHC,anOffset);
OC = new Geom2d_Line(Off.Line());
}
else if (AHC->GetType() == GeomAbs_Circle)
{
+ if (E.Orientation() == TopAbs_FORWARD) anOffset *= -1;
gp_Circ2d theCirc = AHC->Circle();
- if (anOffset < 0. || Abs(anOffset) < theCirc.Radius())
- OC = new Geom2d_Circle (theCirc.Position(), theCirc.Radius() - anOffset);
+ if (anOffset > 0. || Abs(anOffset) < theCirc.Radius())
+ OC = new Geom2d_Circle (theCirc.Position(), theCirc.Radius() + anOffset);
+ else
+ {
+ myIsDone = Standard_False;
+ return Standard_False;
+ }
}
else
{
+ if (E.Orientation() == TopAbs_REVERSED) anOffset *= -1;
Handle(Geom2d_TrimmedCurve) G2dT = new Geom2d_TrimmedCurve(aPCurve, f, l);
OC = new Geom2d_OffsetCurve( G2dT, anOffset);
}
}
else {
MakeOffset (TopoDS::Edge(SE),myWorkSpine,myOffset,myMap,RefPlane,
- myIsOpenResult, Ends);
+ myIsOpenResult, myJoinType, Ends);
PE = SE;
}
}
BRepFill_IndexedDataMapOfOrientedShapeListOfShape& Map,
const Handle(Geom_Plane)& RefPlane,
const Standard_Boolean IsOpenResult,
+ const GeomAbs_JoinType theJoinType,
const TopoDS_Vertex * Ends)
{
Standard_Real f,l;
Handle(Geom2d_Circle) CC = new Geom2d_Circle(Off.Circle());
Standard_Real Delta = 2*M_PI - l + f;
- if (ToExtendFirstPar)
- f -= 0.2*Delta;
- if (ToExtendLastPar)
- l += 0.2*Delta;
-
+ if (theJoinType == GeomAbs_Arc)
+ {
+ if (ToExtendFirstPar)
+ f -= 0.2*Delta;
+ if (ToExtendLastPar)
+ l += 0.2*Delta;
+ }
+ else //GeomAbs_Intersection
+ {
+ if (ToExtendFirstPar && ToExtendLastPar)
+ {
+ Standard_Real old_l = l;
+ f = old_l + Delta/2.;
+ l = f + 2*M_PI;
+ }
+ else if (ToExtendFirstPar)
+ {
+ f = l;
+ l = f + 2*M_PI;
+ }
+ else if (ToExtendLastPar)
+ {
+ l = f + 2*M_PI;
+ }
+ }
G2dOC = new Geom2d_TrimmedCurve(CC,f,l);
}
}
Handle(Geom2d_Line) CC = new Geom2d_Line(Off.Line());
Standard_Real Delta = (l - f);
if (ToExtendFirstPar)
- f -= Delta;
+ {
+ if (theJoinType == GeomAbs_Arc)
+ f -= Delta;
+ else //GeomAbs_Intersection
+ f = -Precision::Infinite();
+ }
if (ToExtendLastPar)
- l += Delta;
+ {
+ if (theJoinType == GeomAbs_Arc)
+ l += Delta;
+ else //GeomAbs_Intersection
+ l = Precision::Infinite();
+ }
G2dOC = new Geom2d_TrimmedCurve(CC,f,l);
}
else {