MantisBT - Community
View Issue Details
0026198Community[OCCT] OCCT:Modeling Algorithmspublic2015-05-07 17:432015-10-23 20:51
[OCCT] 6.9.0 
[OCCT] 6.9.1[OCCT] 6.9.1 
Not needed
0026198: ShapeConstruct_ProjectCurveOnSurface builds infinite line instead of bounded curve
ShapeConstruct_ProjectCurveOnSurface.Perform returns infinite line instead of bounded curve. In 6.8.0 Perform return Geom2d_BSplineCurve, but 6.9.0 Perform return Geom2d_Line. Returning infinite curve does not allow to get boundaries corresponding to original 3d curve. Please check it for correct behaviour.
Steps To Reproduce:
const Handle(Geom_Curve)& aCurve;
const Handle(Geom_Surface)& aSurface;
Standard_Real theTol;
Handle (Geom2d_Curve) aPCurve;
const Standard_Real aFirst = aCurve->FirstParameter();
const Standard_Real aLast = aCurve->LastParameter();
ShapeConstruct_ProjectCurveOnSurface aProj;
aProj.Init (aSurface, aTol);
aProj.Perform (aCurve, aFirst, aLast, aPCurve);
No tags attached.
zip (1,329) 2015-05-07 17:43
Issue History
2015-05-07 17:43solomin_sNew Issue
2015-05-07 17:43solomin_sAssigned To => msv
2015-05-07 17:43solomin_sFile Added:
2015-05-07 17:46solomin_sNote Added: 0040762
2015-05-08 15:26msvNote Added: 0040785
2015-05-08 15:27msvStatusnew => assigned
2015-05-08 15:44gitNote Added: 0040786
2015-05-08 15:45msvTarget Version6.9.0 => 7.1.0
2015-05-08 15:47msvNote Added: 0040787
2015-05-08 15:47msvAssigned Tomsv => abv
2015-05-08 15:47msvStatusassigned => resolved
2015-05-08 15:52msvAssigned Toabv => gka
2015-05-08 16:02gkaNote Added: 0040790
2015-05-08 16:02gkaAssigned Togka => bugmaster
2015-05-08 16:02gkaStatusresolved => reviewed
2015-05-08 16:16Roman LyginNote Added: 0040794
2015-05-08 16:20apvAssigned Tobugmaster => apv
2015-05-08 17:00gitNote Added: 0040804
2015-05-08 17:00apvNote Added: 0040805
2015-05-08 17:06abvNote Added: 0040806
2015-05-08 17:06abvSeverityminor => text
2015-05-08 17:06abvSummary[6.9.0 Regression] ShapeConstruct_ProjectCurveOnSurface builds infinite line instead of bounded curve => ShapeConstruct_ProjectCurveOnSurface builds infinite line instead of bounded curve
2015-05-12 17:29apvNote Added: 0040835
2015-05-12 17:29apvAssigned Toapv => bugmaster
2015-05-12 17:29apvStatusreviewed => tested
2015-05-12 17:29apvTest case number => Not needed
2015-05-15 15:38bugmasterChangeset attached => occt master 56e26740
2015-05-15 15:38bugmasterStatustested => verified
2015-05-15 15:38bugmasterResolutionopen => fixed
2015-05-29 14:19bugmasterTarget Version7.1.0 => 7.0.0
2015-08-14 11:01gitNote Added: 0044282
2015-08-26 11:11abvTarget Version7.0.0 => 6.9.1
2015-10-16 14:56aivStatusverified => closed
2015-10-23 20:51aivFixed in Version => 6.9.1

2015-05-07 17:46   
This error has relationship with #22598, but I has no access to it.
2015-05-08 15:26   
Such behavior is intended. If the result curve 2D lies on a direct line then direct line is returned. Earlier, b-spline with much degree and much poles was created for such case.
The caller must not have concerns about boundaries of returned curve, as the output curve 2D is guaranteed to be same-parameter with input curve 3D on the interval [First, Last], and First and Last are known values for the caller.
The returned curve is usually put into an edge as a p-curve, and it always has a finite range, so there is no need to put the line into a TrimmedCurve. It is possible, and the edge created will be also good, but it will have extra nesting structure.

However, looking at the description of the method Perform of the class ShapeConstruct_ProjectCurveOnSurface, I have found improper comments, which were simply copied from another method. So, the documentation for this method should be updated.
2015-05-08 15:44   
Branch CR26198 has been created by msv.

SHA-1: 3b5f7d0c0f312ee8f3736cb5439b76c89e71bd77

Detailed log of new commits:

Author: msv
Date: Fri May 8 15:44:48 2015 +0300

    0026198: ShapeConstruct_ProjectCurveOnSurface builds infinite line instead of bounded curve
    Description of the method ShapeConstruct_ProjectCurveOnSurface::Perform has been updated to actual state.
2015-05-08 15:47   
Please review the change of the method description in the branch CR26198.
2015-05-08 16:02   
Branch CR26198 should not be tested.
Roman Lygin   
2015-05-08 16:16   
Hello Mikhail,

Thank you for your helpful comment. If there is a guarantee that the returned line is same parameter, this is good.

The fact that SC_PCoS returns an infinite line for a finite input is somewhat confusing but users can cope with this if the documentation is aligned indeed. The consideration for the edge creation should rather be addressed by the edge creation routines, not by the geometry ones (which SC_PCoS is). For instance, BRepBuilderAPI_MakeEdge will remove trimming (at least for 3D curve).

We encountered this 'regression' as the following code gave access violation
(where theCurve is H_Geom2d_Curve returned by SC_PCoS):

    Standard_Real aF = theCurve->FirstParameter(),
        aL = theCurve->LastParameter(), aMaxD, anAveD;
    Adaptor3d_CurveOnSurface aCOS (
        new Geom2dAdaptor_HCurve (theCurve, aF, aL),
        new GeomAdaptor_HSurface (theSurface));
    GeomLib::BuildCurve3d (theTol, aCOS, aF, aL, aRes, aMaxD, anAveD,
        (GeomAbs_Shape)Min (Min (GeomAbs_C1, theCurve->Continuity()), theSurface->Continuity()),
        BSplCLib::MaxDegree(), 10000);

It used to work in 6.8.0 and crashed in 6.9.0. Apparently GL::BC3d() cannot deal with infinite (iso)lines. So this creates extra overhead for us to recognize this new case. We will survive but will have to introduce another tweak :-(.
2015-05-08 17:00   
Branch CR26198 has been updated forcibly by apv.

SHA-1: 57fdf74508e19e1d2660a20ef5b362bee6ec5b8d
2015-05-08 17:00   
Branch CR26198 has been rebased on the current master.
2015-05-08 17:06   
No testing is required -- the fix consist in change of documentation comment
2015-05-12 17:29   
Dear BugMaster,

Branch CR26198 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms.
SHA-1: 57fdf74508e19e1d2660a20ef5b362bee6ec5b8d

Number of compiler warnings:
occt component:
   Linux: 18 (18 on master)
   Windows: 0 (0 on master)
products component:
   Linux: 4 (4 on master)
   Windows: 0 (0 on master)
2015-08-14 11:01   
Branch CR26198 has been deleted by inv.

SHA-1: 57fdf74508e19e1d2660a20ef5b362bee6ec5b8d