Vertex from TopoDS,
Pnt from gp,
Trsf from gp,
+ Shape from GeomAbs,
Trihedron from GeomFill
raises
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)
myDegmax : Integer from Standard;
mySegmax : Integer from Standard;
+ myContinuity : Shape from GeomAbs;
myMode : Trihedron from GeomFill;
myForceApproxC1 : Boolean from Standard;
BRepFill_Pipe::BRepFill_Pipe()
{
- myDegmax = 10;
+ myDegmax = 11;
mySegmax = 100;
+ myContinuity = GeomAbs_C2;
myMode = GeomFill_IsCorrectedFrenet;
myForceApproxC1 = Standard_False;
}
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);
}
// 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());
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();
}
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
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)
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;
}
-- composite solid.
returns MakePipe from BRepOffsetAPI;
- 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.
-
+ Create( Spine : Wire from TopoDS;
+ Profile : Shape from TopoDS;
+ aMode : Trihedron from GeomFill;
+ ForceApproxC1 : Boolean from Standard = Standard_False)
+ ---Purpose: the same as previous but with setting of
+ -- mode of sweep and the flag that indicates attempt
+ -- to approximate a C1-continuous surface if a swept
+ -- surface proved to be C0.
+ returns MakePipe from BRepOffsetAPI;
Pipe(me) returns Pipe from BRepFill
---C++: return const &
//=======================================================================
//function : BRepOffsetAPI_MakePipe
-//purpose :
+//purpose : constructor
//=======================================================================
BRepOffsetAPI_MakePipe::BRepOffsetAPI_MakePipe(const TopoDS_Wire& Spine ,
- const TopoDS_Shape& Profile)
+ const TopoDS_Shape& Profile)
: myPipe(Spine, Profile)
{
Build();
}
//=======================================================================
-//function : SetMode
-//purpose : Set the mode of sweeping
+//function : BRepOffsetAPI_MakePipe
+//purpose : constructor
+// Set the mode of sweeping
// It can be:
// - Frenet
// - Corrected Frenet
// - Discrete Trihedron
-//=======================================================================
-
-void BRepOffsetAPI_MakePipe::SetMode(const GeomFill_Trihedron aMode)
-{
- myPipe.SetMode(aMode);
-}
-
-//=======================================================================
-//function : SetForceApproxC1
-//purpose : Set the flag that indicates attempt to approximate
+// Also set the flag that indicates attempt to approximate
// a C1-continuous surface if a swept surface proved
// to be C0.
//=======================================================================
-void BRepOffsetAPI_MakePipe::SetForceApproxC1(const Standard_Boolean ForceApproxC1)
+BRepOffsetAPI_MakePipe::BRepOffsetAPI_MakePipe(const TopoDS_Wire& Spine ,
+ const TopoDS_Shape& Profile,
+ const GeomFill_Trihedron aMode,
+ const Standard_Boolean ForceApproxC1)
+ : myPipe(Spine, Profile, aMode, ForceApproxC1)
{
- myPipe.SetForceApproxC1(ForceApproxC1);
+ Build();
}
//=======================================================================
// pipe
//=======================================================================
-static Standard_Integer pipe(Draw_Interpretor& ,
+static Standard_Integer pipe(Draw_Interpretor& di,
Standard_Integer n, const char** a)
{
- if ( n < 4) return 1;
+ if (n == 1)
+ {
+ di << "pipe result Wire_spine Profile [Mode [Approx]]" << "\n";
+ di << "Mode = 0 - CorrectedFrenet," << "\n";
+ di << " = 1 - Frenet," << "\n";
+ di << " = 2 - DiscreteTrihedron" << "\n";
+ di << "Approx - force C1-approximation if result is C0" << "\n";
+ return 0;
+ }
+
+ if (n > 1 && n < 4) return 1;
TopoDS_Shape Spine = DBRep::Get(a[2],TopAbs_WIRE);
if ( Spine.IsNull()) return 1;
TopoDS_Shape Profile = DBRep::Get(a[3]);
if ( Profile.IsNull()) return 1;
+
+ GeomFill_Trihedron Mode = GeomFill_IsCorrectedFrenet;
+ if (n >= 5)
+ {
+ Standard_Integer iMode = atoi(a[4]);
+ if (iMode == 1)
+ Mode = GeomFill_IsFrenet;
+ else if (iMode == 2)
+ Mode = GeomFill_IsDiscreteTrihedron;
+ }
+
+ Standard_Boolean ForceApproxC1 = Standard_False;
+ if (n >= 6)
+ ForceApproxC1 = Standard_True;
- TopoDS_Shape S = BRepOffsetAPI_MakePipe(TopoDS::Wire(Spine),Profile);
+ TopoDS_Shape S = BRepOffsetAPI_MakePipe(TopoDS::Wire(Spine),
+ Profile,
+ Mode,
+ ForceApproxC1);
DBRep::Set(a[1],S);
return 0;
}
+
//=======================================================================
static Standard_Integer geompipe(Draw_Interpretor& ,
__FILE__,revol,g);
theCommands.Add("pipe",
- "pipe result Wire_spine Profile",
+ "pipe result Wire_spine Profile [Mode [Approx]], no args to get help",
__FILE__,pipe,g);
theCommands.Add("evolved",
LocOpe_Pipe::LocOpe_Pipe(const TopoDS_Wire& Spine,
const TopoDS_Shape& Profile) :
- myPipe(Spine,Profile,Standard_False)
+ myPipe(Spine,Profile)
{
TopoDS_Shape Result = myPipe.Shape();
--- /dev/null
+puts "============"
+puts "OCC23870"
+puts "============"
+puts ""
+#######################################################################
+# Integration of new options of sweeping into BRepOffsetAPI_MakePipe algorithm.
+#######################################################################
+
+set BugNumber OCC23870
+
+restore [locate_data_file bug23824_AXE.brep] spine
+restore [locate_data_file bug23824_profil.brep] profile
+
+wire spine spine
+
+pipe result spine profile 2 approx
+
+set square 516.633
+
+set nb_v_good 4
+set nb_e_good 7
+set nb_w_good 3
+set nb_f_good 3
+set nb_sh_good 1
+set nb_sol_good 0
+set nb_compsol_good 0
+set nb_compound_good 0
+set nb_shape_good 18
+
+set 2dviewer 1
--- /dev/null
+puts "============"
+puts "OCC23870"
+puts "============"
+puts ""
+#######################################################################
+# Integration of new options of sweeping into BRepOffsetAPI_MakePipe algorithm.
+#######################################################################
+
+set BugNumber OCC23870
+
+restore [locate_data_file bug23824_Case1_Path.brep] spine
+restore [locate_data_file bug23824_Case1_Profile.brep] profile
+
+wire spine spine
+wire profile profile
+
+pipe result spine profile 2 approx
+
+set square 8997.97
+
+set nb_v_good 1
+set nb_e_good 2
+set nb_w_good 1
+set nb_f_good 1
+set nb_sh_good 1
+set nb_sol_good 0
+set nb_compsol_good 0
+set nb_compound_good 0
+set nb_shape_good 6
+
+set 2dviewer 1
--- /dev/null
+puts "============"
+puts "OCC23870"
+puts "============"
+puts ""
+#######################################################################
+# Integration of new options of sweeping into BRepOffsetAPI_MakePipe algorithm.
+#######################################################################
+
+set BugNumber OCC23870
+
+restore [locate_data_file bug23824_Case2_Path.brep] spine
+restore [locate_data_file bug23824_Case2_Profile.brep] profile
+
+wire spine spine
+wire profile profile
+
+pipe result spine profile 2 approx
+
+set square 848.989
+
+set nb_v_good 1
+set nb_e_good 2
+set nb_w_good 1
+set nb_f_good 1
+set nb_sh_good 1
+set nb_sol_good 0
+set nb_compsol_good 0
+set nb_compound_good 0
+set nb_shape_good 6
+
+set 2dviewer 1
--- /dev/null
+puts "============"
+puts "OCC23870"
+puts "============"
+puts ""
+#######################################################################
+# Integration of new options of sweeping into BRepOffsetAPI_MakePipe algorithm.
+#######################################################################
+
+set BugNumber OCC23870
+
+restore [locate_data_file bug23824_Case3_Path.brep] spine
+restore [locate_data_file bug23824_Case3_Profile.brep] profile
+
+wire profile profile
+explode spine
+wire spine spine_1
+
+pipe result spine profile 2 approx
+
+set square 38260.5
+
+set nb_v_good 1
+set nb_e_good 2
+set nb_w_good 1
+set nb_f_good 1
+set nb_sh_good 1
+set nb_sol_good 0
+set nb_compsol_good 0
+set nb_compound_good 0
+set nb_shape_good 6
+
+set 2dviewer 1
--- /dev/null
+puts "============"
+puts "OCC23870"
+puts "============"
+puts ""
+#######################################################################
+# Integration of new options of sweeping into BRepOffsetAPI_MakePipe algorithm.
+#######################################################################
+
+set BugNumber OCC23870
+
+restore [locate_data_file bug20807_helix_10.brep] spine
+restore [locate_data_file bug20807_profile.brep] profile
+
+wire spine spine
+
+pipe result spine profile 1
+
+set square 254837
+
+set nb_v_good 4
+set nb_e_good 8
+set nb_w_good 4
+set nb_f_good 4
+set nb_sh_good 1
+set nb_sol_good 0
+set nb_compsol_good 0
+set nb_compound_good 0
+set nb_shape_good 21
+
+set 2dviewer 1