Geom2dAPI_ProjectPointOnCurve proj(P,GC,GC->FirstParameter(),
GC->LastParameter());
- for ( Standard_Integer i = 1; i <= proj.NbPoints(); i++) {
- gp_Pnt2d P1 = proj.Point(i);
- Handle(Geom2d_Line) L = new Geom2d_Line(P,gp_Vec2d(P,P1));
- Handle(Geom2d_TrimmedCurve) CT =
- new Geom2d_TrimmedCurve(L, 0., P.Distance(P1));
- Sprintf(name,"%s%d","ext_",i);
- char* temp = name; // portage WNT
- DrawTrSurf::Set(temp, CT);
+ for (Standard_Integer i = 1; i <= proj.NbPoints(); i++)
+ {
+ gp_Pnt2d aP1 = proj.Point(i);
+ const Standard_Real aDist = P.Distance(aP1);
+ Sprintf(name, "%s%d", "ext_", i);
+
+ if (aDist > Precision::PConfusion())
+ {
+ Handle(Geom2d_Line) L = new Geom2d_Line(P, gp_Dir2d(aP1.XY() - P.XY()));
+ Handle(Geom2d_TrimmedCurve) CT = new Geom2d_TrimmedCurve(L, 0., aDist);
+ DrawTrSurf::Set(name, CT);
+ }
+ else
+ {
+ DrawTrSurf::Set(name, aP1);
+ }
+
di << name << " ";
}
explode f e
mk2dcurve c2 f_3 f
2dcvalue c1 0.0025 x y
-2dproj c2 x y
-set bug_info [string trim [length ext_1]]
-set bug_info [string trim [string range $bug_info [expr {[string last " " $bug_info] + 1}] [expr {[string length $bug_info] - 1}]]]
-if {$bug_info >= 1.e-9} {
- puts "ERROR: OCC27322 is reproduced. Incorrect pcurve creation."
+set log [2dproj c2 x y]
+
+if { ![regexp {ext_} $log ] } {
+ puts "Error: empty projection"
+} elseif { ![regexp {point} [whatis ext_1] ] } {
+ puts "ERROR: OCC27322 is reproduced. Incorrect pcurve creation: too long from the source one"
}