MantisBT - Community
View Issue Details
0030874Community[OCCT] OCCT:Modeling Algorithmspublic2019-08-07 15:022021-04-06 12:39
drazmyslovich 
apn 
normalminor 
closedfixed 
WindowsVC++ 201564 bit
[OCCT] 7.4.0 
[OCCT] 7.4.0[OCCT] 7.4.0 
Not needed
0030874: Modeling Algorithms - GCPnts_TangentialDeflection inserts the points between nearby points
GCPnts_TangentialDeflection is able to infinitely insert the points
Unfortunately, I have no example curve to reproduce the problem.
No tags attached.
related to 0032265closed bugmaster Modeling Algorithms - some trivial code improvements in CSLib_Class2d and GCPnts_TangentialDeflection 
Issue History
2019-08-07 15:02drazmyslovichNew Issue
2019-08-07 15:02drazmyslovichAssigned To => oan
2019-08-07 15:03drazmyslovichAssigned Tooan => drazmyslovich
2019-08-07 15:12gitNote Added: 0086065
2019-08-07 15:13drazmyslovichNote Added: 0086066
2019-08-07 15:13drazmyslovichAssigned Todrazmyslovich => oan
2019-08-07 15:13drazmyslovichStatusnew => resolved
2019-08-07 18:39oanCategoryOCCT:Mesh => OCCT:Modeling Algorithms
2019-08-07 18:40oanAssigned Tooan => msv
2019-08-07 18:40oanNote Added: 0086073
2019-08-08 09:57msvNote Added: 0086083
2019-08-08 09:57msvAssigned Tomsv => emv
2019-08-12 14:14emvNote Added: 0086184
2019-08-12 14:14emvAssigned Toemv => drazmyslovich
2019-08-12 14:14emvStatusresolved => feedback
2019-08-12 15:09msvTarget Version7.4.0 => 7.5.0
2019-08-15 14:24gitNote Added: 0086263
2019-08-15 14:27drazmyslovichNote Added: 0086264
2019-08-15 14:27drazmyslovichAssigned Todrazmyslovich => emv
2019-08-15 14:27drazmyslovichStatusfeedback => resolved
2019-08-15 14:33gitNote Added: 0086265
2019-08-15 14:34emvNote Added: 0086266
2019-08-15 18:57kgvSummaryGCPnts_TangentialDeflection inserts the points between nearby points => Modeling Algorithms - GCPnts_TangentialDeflection inserts the points between nearby points
2019-08-16 09:09gitNote Added: 0086269
2019-08-16 09:13emvNote Added: 0086270
2019-08-16 13:32kgvNote Added: 0086278
2019-08-16 13:33kgvNote Edited: 0086278bug_revision_view_page.php?bugnote_id=86278#r21649
2019-08-16 13:53emvNote Added: 0086279
2019-08-16 14:02drazmyslovichNote Added: 0086280
2019-08-16 14:13kgvNote Added: 0086282
2019-08-16 14:20drazmyslovichNote Added: 0086283
2019-08-16 14:25kgvNote Added: 0086284
2019-08-16 17:01gitNote Added: 0086290
2019-08-20 07:31gitNote Added: 0086345
2019-08-22 07:30emvNote Added: 0086390
2019-08-22 07:30emvAssigned Toemv => bugmaster
2019-08-22 07:30emvStatusresolved => reviewed
2019-08-22 20:36apnTest case number => Not needed
2019-08-22 20:36apnNote Added: 0086422
2019-08-22 20:36apnStatusreviewed => tested
2019-08-24 16:56apnChangeset attached => occt master 846245d4
2019-08-24 16:56apnAssigned Tobugmaster => apn
2019-08-24 16:56apnStatustested => verified
2019-08-24 16:56apnResolutionopen => fixed
2019-09-02 17:52gitNote Added: 0086628
2019-09-02 18:00gitNote Added: 0086629
2019-10-21 13:58abvTarget Version7.5.0 => 7.4.0
2021-04-06 12:39kgvRelationship addedrelated to 0032265

Notes
(0086065)
git   
2019-08-07 15:12   
Branch CR30874 has been created by drazmyslovich.

SHA-1: 496afeb5eb2361cf34dc8162c9a0eda1af3f85b4


Detailed log of new commits:

Author: drazmyslovich
Date: Wed Aug 7 14:10:32 2019 +0200

    0030874: GCPnts_TangentialDeflection - check the points distance before inserting a new point in between
(0086066)
drazmyslovich   
2019-08-07 15:13   
The proposed solution is submitted, please, review
(0086073)
oan   
2019-08-07 18:40   
Dear Mikhail,

could you please manage the issue.
(0086083)
msv   
2019-08-08 09:57   
Dear Eugeny, please review it.
(0086184)
emv   
2019-08-12 14:14   
Hello Dima,

Is this bug reproduced on any of your data, confidential or public? Because, looking into the code I see that the points will not be inserted infinitely as you suggest. The conditions
if (umax - U1 > uTol && U2 - umax > uTol)
{
  if (P1.SquareDistance(MiddlePoint) > MinLen2 && P2.SquareDistance(MiddlePoint) > MinLen2)
  
{
    // insert point
  }
}

are actually stronger than yours.

However, I agree that early check such as you implemented should be inserted, but the criterion instead of gp::Resolution() should be uTol for parametric tolerance and MinLen2 for square distance between nearby points.
(0086263)
git   
2019-08-15 14:24   
Branch CR30874 has been updated by drazmyslovich.

SHA-1: 33eb19e6143e3a4a66e576ebded5df20b651e524


Detailed log of new commits:

Author: drazmyslovich
Date: Thu Aug 15 13:22:23 2019 +0200

    0030874: Use uTol and MinLen2 values as threshold

(0086264)
drazmyslovich   
2019-08-15 14:27   
Dear Eugeny,

I have adjusted the code according to your comments.
I will try to find an example data to reproduce the original problem.

Regards,
Dima
(0086265)
git   
2019-08-15 14:33   
Branch CR30874_1 has been created by emv.

SHA-1: eafdde15470f51ddcb369e338671b464abf4bfb6


Detailed log of new commits:

Author: drazmyslovich
Date: Wed Aug 7 15:10:32 2019 +0300

    0030874: GCPnts_TangentialDeflection inserts the points between nearby points
    
    Check the points distance before inserting a new point in between.
(0086266)
emv   
2019-08-15 14:34   
Hello Dima, thanks for the update. I have squashed the commits and going to initiate certification of the patch.
(0086269)
git   
2019-08-16 09:09   
Branch CR30874_1 has been updated forcibly by emv.

SHA-1: 4e41a26ff42d07429eef7ce11712e2823257e77c
(0086270)
emv   
2019-08-16 09:13   
There was a misprint in the patch that has not been noticed, but tests revealed. Instead of condition U2-U1<uTol, there was U1-U2<uTol which was always true and points have never been inserted. I've corrected it and re-run the tests.
(0086278)
kgv   
2019-08-16 13:32   
(edited on: 2019-08-16 13:33)
> However, I agree that early check such as you implemented should be inserted,
Are you sure this is correct check for 3D points?

From my understanding, this might prevent inserting points on curve having a local splash - e.g. two checked points are indeed very close to each other, while point in the middle might have greater distance to both.

(0086279)
emv   
2019-08-16 13:53   
You are right, the check for 3D points is incorrect and should be removed. Let's keep only parametric check.
(0086280)
drazmyslovich   
2019-08-16 14:02   
Therefore I used in the original version gp::Resolution () as it helps to identify the points which are too close.
(0086282)
kgv   
2019-08-16 14:13   
> Therefore I used in the original version gp::Resolution ()
> as it helps to identify the points which are too close.
For degenerate cases it is still incorrect checked distance between 2 points - the check for a middle point should be done, and it uses larger tolerance than gp::Resolution().
(0086283)
drazmyslovich   
2019-08-16 14:20   
But if you have a degenerated case, then it makes no sense to proceed. Even worse if due to some other problems in generated case D0 will deliver a middle point, which is far away from the curve, then it will cause the algorithm to proceed instead of earlier bailing out.
(0086284)
kgv   
2019-08-16 14:25   
> But if you have a degenerated case, then it makes no sense to proceed.
GCPnts_TangentialDeflection is not supposed to hide geometry issues.
(0086290)
git   
2019-08-16 17:01   
Branch CR30874_1 has been updated forcibly by emv.

SHA-1: 167464fbd4512e0a3b72faf4d29772d29f460561
(0086345)
git   
2019-08-20 07:31   
Branch CR30874_1 has been updated forcibly by emv.

SHA-1: a71ec8aee31763182f18b530e82f21a9c45e5f03
(0086390)
emv   
2019-08-22 07:30   
Testing shows no regressions - http://jenkins-test-12.nnov.opencascade.com/view/CR30874-master-emv/view/COMPARE/ [^]
(0086422)
apn   
2019-08-22 20:36   
Combination -
OCCT branch : CR30874_1
master SHA - a71ec8aee31763182f18b530e82f21a9c45e5f03
5f5b1aed1c6e139bbd34314eca77ae7abcd8895c
Products branch : master SHA - 32e882a7b3145a66baa739f965d275c822c0bd8a
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 16087.120000000043 / 16105.290000000065 [-0.11%]
Products
Total CPU difference: 10477.740000000053 / 10484.700000000048 [-0.07%]
Windows-64-VC14:
OCCT
Total CPU difference: 18243.75 / 18149.296875 [+0.52%]
Products
Total CPU difference: 12061.359375 / 12045.34375 [+0.13%]

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0086628)
git   
2019-09-02 17:52   
Branch CR30874 has been deleted by mnt.

SHA-1: 33eb19e6143e3a4a66e576ebded5df20b651e524
(0086629)
git   
2019-09-02 18:00   
Branch CR30874_1 has been deleted by apn.

SHA-1: a71ec8aee31763182f18b530e82f21a9c45e5f03