Correction of out transformation for the curves on plane surface.
Added test case bugs/vis/bug22240
Modified test cases according to new behavior.
GP = Handle(Geom_Plane)::DownCast(S);
//fin modif du 21-05-97
GP = Handle(Geom_Plane)::DownCast(S);
//fin modif du 21-05-97
Handle(GeomAdaptor_HCurve) HC;
Handle(GeomAdaptor_HSurface) HS;
HC = new GeomAdaptor_HCurve();
HS = new GeomAdaptor_HSurface();
Handle(GeomAdaptor_HCurve) HC;
Handle(GeomAdaptor_HSurface) HS;
HC = new GeomAdaptor_HCurve();
HS = new GeomAdaptor_HSurface();
+ TopLoc_Location aCurveLocation;
Standard_Real f, l;// for those who call with (u,u).
Standard_Real f, l;// for those who call with (u,u).
- Handle(Geom_Curve) C3d =
- BRep_Tool::Curve(E,/*LC,*/f,l); // transforming plane instead of curve
- // we can loose scale factor of Curve transformation (eap 13 May 2002)
+ Handle(Geom_Curve) C3d = BRep_Tool::Curve(E, aCurveLocation, f, l);
- LC = L/*.Predivided(LC)*/;
+ if (C3d.IsNull())
+ {
+ return nullPCurve;
+ }
- if (C3d.IsNull()) return nullPCurve;
+ aCurveLocation = L.Predivided(aCurveLocation);
Handle(Geom_Plane) Plane = GP;
Handle(Geom_Plane) Plane = GP;
- if (!LC.IsIdentity()) {
- const gp_Trsf& T = LC.Transformation();
+ if (!aCurveLocation.IsIdentity())
+ {
+ const gp_Trsf& T = aCurveLocation.Transformation();
Handle(Geom_Geometry) GPT = GP->Transformed(T);
Plane = *((Handle(Geom_Plane)*)&GPT);
}
GeomAdaptor_Surface& GAS = HS->ChangeSurface();
GAS.Load(Plane);
Handle(Geom_Geometry) GPT = GP->Transformed(T);
Plane = *((Handle(Geom_Plane)*)&GPT);
}
GeomAdaptor_Surface& GAS = HS->ChangeSurface();
GAS.Load(Plane);
Handle(Geom_Curve) ProjOnPlane =
GeomProjLib::ProjectOnPlane(new Geom_TrimmedCurve(C3d,f,l),
Plane,
Plane->Position().Direction(),
Standard_True);
Handle(Geom_Curve) ProjOnPlane =
GeomProjLib::ProjectOnPlane(new Geom_TrimmedCurve(C3d,f,l),
Plane,
Plane->Position().Direction(),
Standard_True);
GeomAdaptor_Curve& GAC = HC->ChangeCurve();
GAC.Load(ProjOnPlane);
GeomAdaptor_Curve& GAC = HC->ChangeCurve();
GAC.Load(ProjOnPlane);
restore [locate_data_file OCC22196-scaled.brep] result
restore [locate_data_file OCC22196-scaled.brep] result
set nb_v_good 75
set nb_e_good 157
set nb_v_good 75
set nb_e_good 157
--- /dev/null
+puts "==========="
+puts "OCC22240"
+puts "==========="
+puts ""
+############################################
+# Bad triangulation of transformed shapes
+############################################
+
+restore [locate_data_file bug22240_Pump_Nut.brep] a
+restore [locate_data_file bug22240_Pump_Nut.brep] b
+bscale b 0 0 0 2.
+vinit
+vdisplay a b
+vsetdispmode a 1
+vsetdispmode b 1
+vfit
+
+checkcolor 320 104 0.78 0.55 0.09
+
+set only_screen 1
+
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 )
TPSTAT : Faulties = 30 ( 36 ) Warnings = 570 ( 1854 ) Summary = 600 ( 1890 )
CHECKSHAPE : Wires = 7 ( 6 ) Faces = 7 ( 6 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 )
TPSTAT : Faulties = 30 ( 36 ) Warnings = 570 ( 1854 ) Summary = 600 ( 1890 )
CHECKSHAPE : Wires = 7 ( 6 ) Faces = 7 ( 6 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
-NBSHAPES : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 3500 ( 3499 ) Summary = 43166 ( 43109 )
-STATSHAPE : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 3500 ( 3499 ) FreeWire = 0 ( 0 ) FreeEdge = 164 ( 164 ) SharedEdge = 18147 ( 18117 )
+NBSHAPES : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 3500 ( 3499 ) Summary = 43162 ( 43109 )
+STATSHAPE : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 3500 ( 3499 ) FreeWire = 0 ( 0 ) FreeEdge = 164 ( 164 ) SharedEdge = 18145 ( 18117 )
TOLERANCE : MaxTol = 0.9816000285 ( 5.284023931 ) AvgTol = 0.02459126458 ( 0.02803193293 )
LABELS : N0Labels = 12 ( 30 ) N1Labels = 3661 ( 3666 ) N2Labels = 0 ( 0 ) TotalLabels = 3673 ( 3696 ) NameLabels = 1379 ( 3694 ) ColorLabels = 3661 ( 3662 ) LayerLabels = 0 ( 0 )
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )
TOLERANCE : MaxTol = 0.9816000285 ( 5.284023931 ) AvgTol = 0.02459126458 ( 0.02803193293 )
LABELS : N0Labels = 12 ( 30 ) N1Labels = 3661 ( 3666 ) N2Labels = 0 ( 0 ) TotalLabels = 3673 ( 3696 ) NameLabels = 1379 ( 3694 ) ColorLabels = 3661 ( 3662 ) LayerLabels = 0 ( 0 )
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )