Anonymous | Login 2019-04-26 01:21 MSK Project: All Projects Community Open CASCADE
 My View | View Issues | Change Log | Roadmap

View Issue Details  Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0027112Community[OCCT] OCCT:Modeling Algorithmspublic2016-01-25 20:222017-12-05 17:09
ReporterRoman Lygin
Assigned Toaml
PrioritynormalSeveritymajor
StatusassignedResolutionopen
PlatformOSOS Version
Product Version[OCCT] 6.9.1
Target Version[OCCT] 7.4.0*Fixed in Version
Summary0027112: GeomAPI_Interpolate produces wrong result
DescriptionApparently GeomAPI_Interpolate tries to compute a curve using cubic spline interpolation.

However it seems to incorrectly compute first and last tangents, leading to result which can be significantly far from expected.

Enclosed is the screenshot of the interpolation of a curve specified via its points and approximate expected result (in blue). The source data are from a Parasolid file which contains a set of points used to define an interpolation curve and vertices an edge lying on this curve passes through. Edge vertices are shown as cubes.

Open CASCADE computes first tangent calling PLib::EvalLagrange() which returns a vector lo (3.64055896 1.24782193 0.351508766). However if to compute a vector lg using formula from Golavanov's book "Geometric modeling" as:

q0 = 3/2 (p1-p0)/(t1-t0) - 1/2 q1, where
t0 and t1 are parameters (0 and 29.73384)
p0 and p1 are first two points
q0 and q1 are derivatives at points p0 and p1 respectively,
q1=p0*(t1-t2)/((t0-t1)(t0-t2)) + p1 (2t1-t0-t2)/((t1-t0)(t1-t2))+ p2(t1-t0)/((t2-t0)(t2-t1)).

lg is (-0.013074235, -0.993197391, -0.279352588) which is much closer to expected.

Perhaps the bug is in broken logic in BuildTangents() in GeomAPI_Interpolate.cxx which computes tangents at first and last points.

Severity is set to major as this affects data correctness of the interpolation algorithm which is a core one in OCC. A fix is left for discretion of the OCC team. Perhaps any modification may lead to significant test failures and update of the reference base.
interpol c points.txt
#compare visually and some property (e.g. length) with the expected result

#test bugs moddata_3 bug27112_1
#test bugs moddata_3 bug27112_2
#test bugs moddata_3 bug27112_3
#test bugs moddata_3 bug27112_4
# No shapes needed - public available
TagsNo tags attached.
Test case number
Attached Files points.txt (776 bytes) 2016-01-25 20:22
interpolated.png (27,389 bytes) 2016-01-25 20:22
interpolated_expected.png (23,298 bytes) 2016-01-25 20:23
interpolated_tangents.png (21,963 bytes) 2016-01-25 20:25
interpolated_result_with_explicit_boundary_tangents.png (19,211 bytes) 2016-01-27 10:32

 Relationships