mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0023870: Integration of new options of sweeping into BRepOffsetAPI_MakePipe algorithm.
Adding test cases for this fix Test cases correction Correction of instability.
This commit is contained in:
@@ -42,6 +42,7 @@ uses
|
||||
Vertex from TopoDS,
|
||||
Pnt from gp,
|
||||
Trsf from gp,
|
||||
Shape from GeomAbs,
|
||||
Trihedron from GeomFill
|
||||
|
||||
raises
|
||||
@@ -54,24 +55,11 @@ is
|
||||
|
||||
Create ( Spine : Wire from TopoDS;
|
||||
Profile : Shape from TopoDS;
|
||||
aMode : Trihedron from GeomFill = GeomFill_IsCorrectedFrenet;
|
||||
ForceApproxC1 : Boolean from Standard = Standard_False;
|
||||
GeneratePartCase : Boolean from Standard = Standard_False)
|
||||
returns Pipe from BRepFill;
|
||||
|
||||
SetMode(me : in out;
|
||||
aMode : Trihedron from GeomFill);
|
||||
---Purpose: Set the mode of sweeping
|
||||
-- It can be:
|
||||
-- - Frenet
|
||||
-- - Corrected Frenet
|
||||
-- - Discrete Trihedron
|
||||
-- By default the mode is Corrected Frenet
|
||||
|
||||
SetForceApproxC1(me : in out;
|
||||
ForceApproxC1 : Boolean from Standard);
|
||||
---Purpose: Set the flag that indicates attempt to approximate
|
||||
-- a C1-continuous surface if a swept surface proved
|
||||
-- to be C0.
|
||||
|
||||
Perform (me : in out; Spine : Wire from TopoDS;
|
||||
Profile : Shape from TopoDS;
|
||||
GeneratePartCase : Boolean from Standard = Standard_False)
|
||||
@@ -190,6 +178,7 @@ fields
|
||||
|
||||
myDegmax : Integer from Standard;
|
||||
mySegmax : Integer from Standard;
|
||||
myContinuity : Shape from GeomAbs;
|
||||
myMode : Trihedron from GeomFill;
|
||||
myForceApproxC1 : Boolean from Standard;
|
||||
|
||||
|
@@ -70,8 +70,9 @@ static Standard_Boolean Affich = 0;
|
||||
|
||||
BRepFill_Pipe::BRepFill_Pipe()
|
||||
{
|
||||
myDegmax = 10;
|
||||
myDegmax = 11;
|
||||
mySegmax = 100;
|
||||
myContinuity = GeomAbs_C2;
|
||||
myMode = GeomFill_IsCorrectedFrenet;
|
||||
myForceApproxC1 = Standard_False;
|
||||
}
|
||||
@@ -84,42 +85,26 @@ BRepFill_Pipe::BRepFill_Pipe()
|
||||
|
||||
BRepFill_Pipe::BRepFill_Pipe(const TopoDS_Wire& Spine,
|
||||
const TopoDS_Shape& Profile,
|
||||
const GeomFill_Trihedron aMode,
|
||||
const Standard_Boolean ForceApproxC1,
|
||||
const Standard_Boolean KPart)
|
||||
|
||||
{
|
||||
myDegmax = 10;
|
||||
myDegmax = 11;
|
||||
mySegmax = 100;
|
||||
|
||||
myMode = GeomFill_IsCorrectedFrenet;
|
||||
myForceApproxC1 = Standard_False;
|
||||
Perform(Spine, Profile, KPart);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMode
|
||||
//purpose : Set the mode of sweeping
|
||||
// It can be:
|
||||
// - Frenet
|
||||
// - Corrected Frenet
|
||||
// - Discrete Trihedron
|
||||
//=======================================================================
|
||||
|
||||
void BRepFill_Pipe::SetMode(const GeomFill_Trihedron aMode)
|
||||
{
|
||||
if (aMode == GeomFill_IsFrenet ||
|
||||
aMode == GeomFill_IsCorrectedFrenet ||
|
||||
aMode == GeomFill_IsDiscreteTrihedron)
|
||||
myMode = aMode;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetForceApproxC1
|
||||
//purpose : Set the flag that indicates attempt to approximate
|
||||
// a C1-continuous surface if a swept surface proved
|
||||
// to be C0.
|
||||
//=======================================================================
|
||||
|
||||
void BRepFill_Pipe::SetForceApproxC1(const Standard_Boolean ForceApproxC1)
|
||||
{
|
||||
myContinuity = GeomAbs_C2;
|
||||
if (myMode == GeomFill_IsDiscreteTrihedron)
|
||||
myContinuity = GeomAbs_C0;
|
||||
|
||||
myForceApproxC1 = ForceApproxC1;
|
||||
Perform(Spine, Profile, KPart);
|
||||
}
|
||||
|
||||
|
||||
@@ -411,7 +396,7 @@ TopoDS_Wire BRepFill_Pipe::PipeLine(const gp_Pnt& Point) const
|
||||
// Sweeping
|
||||
BRepFill_Sweep MkSw(Section, myLoc, Standard_True);
|
||||
MkSw.SetForceApproxC1(myForceApproxC1);
|
||||
MkSw.Build( BRepFill_Modified, GeomAbs_C2, GeomFill_Location, myDegmax, mySegmax );
|
||||
MkSw.Build( BRepFill_Modified, myContinuity, GeomFill_Location, myDegmax, mySegmax );
|
||||
TopoDS_Shape aLocalShape = MkSw.Shape();
|
||||
return TopoDS::Wire(aLocalShape);
|
||||
// return TopoDS::Wire(MkSw.Shape());
|
||||
@@ -537,7 +522,7 @@ TopoDS_Shape BRepFill_Pipe::MakeShape(const TopoDS_Shape& S,
|
||||
new (BRepFill_ShapeLaw) (TopoDS::Vertex(TheS));
|
||||
BRepFill_Sweep MkSw(Section, myLoc, Standard_True);
|
||||
MkSw.SetForceApproxC1(myForceApproxC1);
|
||||
MkSw.Build( BRepFill_Modified, GeomAbs_C2, GeomFill_Location, myDegmax, mySegmax );
|
||||
MkSw.Build( BRepFill_Modified, myContinuity, GeomFill_Location, myDegmax, mySegmax );
|
||||
result = MkSw.Shape();
|
||||
}
|
||||
|
||||
@@ -548,7 +533,7 @@ TopoDS_Shape BRepFill_Pipe::MakeShape(const TopoDS_Shape& S,
|
||||
MkSw.SetBounds(TopoDS::Wire(TheFirst),
|
||||
TopoDS::Wire(TheLast));
|
||||
MkSw.SetForceApproxC1(myForceApproxC1);
|
||||
MkSw.Build( BRepFill_Modified, GeomAbs_C2, GeomFill_Location, myDegmax, mySegmax );
|
||||
MkSw.Build( BRepFill_Modified, myContinuity, GeomFill_Location, myDegmax, mySegmax );
|
||||
result = MkSw.Shape();
|
||||
|
||||
// Labeling of elements
|
||||
|
@@ -282,7 +282,7 @@ static Handle(Geom2d_Curve) Couture(const TopoDS_Edge& E,
|
||||
|
||||
static Standard_Boolean CheckSameParameter
|
||||
(const Handle(Adaptor3d_HCurve)& C3d,
|
||||
Handle(Geom2d_Curve)& Pcurv,
|
||||
const Handle(Geom2d_Curve)& Pcurv,
|
||||
const Handle(Adaptor3d_HSurface)& S,
|
||||
const Standard_Real tol3d,
|
||||
Standard_Real& tolreached)
|
||||
@@ -1458,6 +1458,15 @@ static TopoDS_Edge BuildEdge(const Handle(Geom_Surface)& S,
|
||||
Iso->FirstParameter(),
|
||||
Iso->LastParameter());
|
||||
|
||||
Standard_Real MaxTol = 1.e-4;
|
||||
Standard_Real theTol;
|
||||
GeomAdaptor_Curve GAiso(Iso);
|
||||
Handle(GeomAdaptor_HCurve) GAHiso = new GeomAdaptor_HCurve(GAiso);
|
||||
GeomAdaptor_Surface GAsurf(S);
|
||||
Handle(GeomAdaptor_HSurface) GAHsurf = new GeomAdaptor_HSurface(GAsurf);
|
||||
CheckSameParameter( GAHiso, L, GAHsurf, MaxTol, theTol);
|
||||
B.UpdateEdge(E, theTol);
|
||||
|
||||
return E;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user