// Associate 2d
Handle(Geom2d_Line) L;
TopLoc_Location Loc;
+ Standard_Real Umin, Umax, Vmin, Vmax;
+ S->Bounds(Umin, Umax, Vmin, Vmax);
if (isUiso) {
- gp_Pnt2d P(ValIso, 0);
+ //gp_Pnt2d P(ValIso, 0);
+ gp_Pnt2d P( ValIso, Vmin - Iso->FirstParameter() );
gp_Vec2d V(0., 1.);
L = new (Geom2d_Line) (P, V);
}
else {
- gp_Pnt2d P(0., ValIso);
+ //gp_Pnt2d P(0., ValIso);
+ gp_Pnt2d P( Umin -Iso->FirstParameter() , ValIso );
gp_Vec2d V(1., 0.);
L = new (Geom2d_Line) (P, V);
}
#include <gp_GTrsf.hxx>
#include <gp_Mat.hxx>
#include <gp_Ax2.hxx>
+#include <gp_Sphere.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TColgp_Array2OfPnt.hxx>
#include <Geom_SphericalSurface.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
+#include <Geom_TrimmedCurve.hxx>
#include <Approx_SweepApproximation.hxx>
#include <AdvApprox_PrefAndRec.hxx>
#include <Precision.hxx>
#include <ElCLib.hxx>
+#include <ElSLib.hxx>
//=======================================================================
//class : GeomFill_Sweep_Eval
Standard_Real f = UFirst , l = ULast;
SError = error;
Centre.BaryCenter(1.0, C.Location(), 1.0);
- gp_Ax3 AxisOfSphere(Centre, DN, DS);
- S = new (Geom_SphericalSurface)
- (AxisOfSphere, (RotRadius + C.Radius())/2 );
+ gp_Ax3 AxisOfSphere(Centre, DN, DS);
+ gp_Sphere theSphere( AxisOfSphere, (RotRadius + C.Radius())/2 );
+ S = new Geom_SphericalSurface(theSphere);
// Pour les spheres on ne peut pas controler le parametre
// V (donc U car myExchUV = Standard_True)
// Il faut donc modifier UFirst, ULast...
- if (C.Position().Direction().
- IsOpposite(AxisOfSphere.YDirection(), 0.1) ) {
+ Standard_Real fpar = AC.FirstParameter();
+ Standard_Real lpar = AC.LastParameter();
+ Handle(Geom_Curve) theSection = new Geom_TrimmedCurve(Section, fpar, lpar);
+ theSection->Transform(Tf2);
+ gp_Pnt FirstPoint = theSection->Value(theSection->FirstParameter());
+ gp_Pnt LastPoint = theSection->Value(theSection->LastParameter());
+ Standard_Real UfirstOnSec, VfirstOnSec, UlastOnSec, VlastOnSec;
+ ElSLib::Parameters(theSphere, FirstPoint, UfirstOnSec, VfirstOnSec);
+ ElSLib::Parameters(theSphere, LastPoint, UlastOnSec, VlastOnSec);
+ if (VfirstOnSec < VlastOnSec)
+ {
+ f = VfirstOnSec;
+ l = VlastOnSec;
+ }
+ else
+ {
// L'orientation parametrique est inversee
- l = 2*M_PI - UFirst;
- f = 2*M_PI - ULast;
+ f = VlastOnSec;
+ l = VfirstOnSec;
isUReversed = Standard_True;
}
- // On calcul le "glissement" parametrique.
- Standard_Real rot;
- rot = C.Position().XDirection().AngleWithRef
- (AxisOfSphere.XDirection(), AxisOfSphere.YDirection());
- f -= rot;
- l -= rot;
if ( (f >= -M_PI/2) && (l <= M_PI/2)) {
Ok = Standard_True;
--- /dev/null
+puts "============"
+puts "OCC24738"
+puts "============"
+puts ""
+#######################################################################
+# BRepOffsetAPI_MakePipe algorithm fails on circular path and section (the case where result is part of sphere)
+#######################################################################
+
+restore [locate_data_file bug24738_path.brep] sp
+restore [locate_data_file bug24738_profile.brep] pr
+
+pipe result sp pr
+
+set nb_v_good 2
+set nb_e_good 3
+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 8
+
+set info [sprops result]
+
+set string {Center +of +gravity +:[\t\n]*[\s\t]*X +=[\s\t]*([-0-9.+eE]+)[\t\n]*Y +=[\s\t]*([-0-9.+eE]+)[\t\n]*Z +=[\s\t]*([-0-9.+eE]+)[\t\n]*}
+
+regexp ${string} ${info} full X Y Z
+
+puts "X=${X}"
+puts "Y=${Y}"
+puts "Z=${Z}"
+
+set good_Z 94.9994
+
+checkreal "Z" ${Z} ${good_Z} 0.1 0.1
+
+set 2dviewer 1