#include <DrawTrSurf_Curve2d.hxx>
#include <Geom2dAPI_ProjectPointOnCurve.hxx>
#include <Geom2dAPI_ExtremaCurveCurve.hxx>
+#include <Geom2dAPI_Interpolate.hxx>
#include <Geom2dAPI_PointsToBSpline.hxx>
#include <Geom2dAPI_InterCurveCurve.hxx>
#include <Geom2d_Line.hxx>
else {
// test points ou ordonnees
- hasPoints = Standard_False;
Standard_Integer nc = n - 3;
if (nc == 2 * Nb) {
// points
}
else if (nc - 2 == Nb) {
// YValues
+ hasPoints = Standard_False;
nc = 5;
X0 = Draw::Atof(a[3]);
DX = Draw::Atof(a[4]);
Handle(Geom2d_BSplineCurve) TheCurve;
if (hasPoints)
- TheCurve = Geom2dAPI_PointsToBSpline(Points,Dmin,Dmax,GeomAbs_C2,Tol2d);
+ {
+ if (!strcmp (a[0], "2dinterpole"))
+ {
+ Geom2dAPI_Interpolate anInterpol (new TColgp_HArray1OfPnt2d(Points), Standard_False, Tol2d);
+ anInterpol.Perform();
+ if (!anInterpol.IsDone())
+ {
+ di << "not done";
+ return 1;
+ }
+ TheCurve = anInterpol.Curve();
+ }
+ else
+ {
+ Geom2dAPI_PointsToBSpline anApprox (Points, Dmin, Dmax, GeomAbs_C2, Tol2d);
+ if (!anApprox.IsDone())
+ {
+ di << "not done";
+ return 1;
+ }
+ TheCurve = anApprox.Curve();
+ }
+ }
else
- TheCurve = Geom2dAPI_PointsToBSpline(YValues,X0,DX,Dmin,Dmax,GeomAbs_C2,Tol2d);
+ {
+ if (!strcmp (a[0], "2dinterpole"))
+ {
+ di << "incorrect usage";
+ return 1;
+ }
+ Geom2dAPI_PointsToBSpline anApprox (YValues, X0, DX, Dmin, Dmax, GeomAbs_C2, Tol2d);
+ if (!anApprox.IsDone())
+ {
+ di << "not done";
+ return 1;
+ }
+ TheCurve = anApprox.Curve();
+ }
DrawTrSurf::Set(a[1], TheCurve);
di << a[1];
# Incorrect result of intersection in 2D between circle and line
#######################################################################################
-v2d2
+smallview -2D-
+don
circle c1 2 2 1
2dfit
2dzoom 120
line l1 3 0 0 1
2dintersect l1 c1
erase l1 c1
-2dfit
puts "ATTENTION! Check following:"
puts "There is only one intersection point (green X)"
-checkview -display result -2d -path ${imagedir}/${test_image}.png
-
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
# Incorrect result of intersection in 2D between circle and line
#######################################################################################
-v2d2
+smallview -2D-
line ll1 0 0 0.3 0.7
line ll2 0 0 0.37 0.63
trim tll1 ll1 -0.00001 0.00001
puts "ATTENTION! Check following:"
puts "There is the intersection point (green X) on center of grid axis"
-checkview -display result -2d -path ${imagedir}/${test_image}.png
-
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png