MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0025593Open CASCADE[OCCT] OCCT:Modeling Algorithmspublic2014-12-11 17:232015-05-14 16:27
Reportergka 
Assigned Tobugmaster 
PrioritynormalSeveritymajor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 6.8.0 
Target Version[OCCT] 6.9.0Fixed in Version[OCCT] 6.9.0 
Summary0025593: Number of intersection points for 2d curves depends on the order of arguments in command "2dintersect"
DescriptionResult operation "2dintersect" is different in dependance of order of arguments.
 
Steps To ReproduceDraw[]> restore face1.brep b
Draw[]> pcu b

Draw[]> 2dintersect b_2 b_3 1.e-10
Earlier: Intersection point 1 : 0.99999534950600377 1.2949486464785163e-007
Now:
         Intersection point 1 : 0.99999534950600377 1.2949486464785163e-007
         parameter on the fist: 0.99999999999982991 parameter on the second: 2.6838888001791637e-012

Draw[]> 2dintersect b_3 b_2 1.e-10
Earlier: Intersection point 1 : 0.99999534950600377 1.2949486464289001e-007
         Intersection point 2 : 0.99998431851402714 1.2952318676537672e-007
Now:
         Intersection point 1 : 0.99999534950600377 1.2949486464289001e-007
         parameter on the fist: 2.6838888001791637e-012 parameter on the second: 0.99999999999982991

###################################
SCRIPT FOR TEST CASE
restore face1.brep b
pcu b

puts "Intersection 1"
2dintersect b_2 b_3 1.e-10
# NbIntersectionPont1 = 1
# p1x=0.99999534950600377
# p1y=1.2949486464785163e-007
# par1f=0.99999999999982991
# par1s=2.6838888001791637e-012

puts "Intersection 2"
2dintersect b_3 b_2 1.e-10
# NbIntersectionPont2 = 1
# p2x=0.99999534950600377
# p2y=1.2949486464289001e-007
# par2f=2.6838888001791637e-012
# par2s=0.99999999999982991

### CHECK

if { $NbIntersectionPont1 != $NbIntersectionPont2 } {
  puts "ERROR: Wrong solutions number"
}

set sqd [expr ($p1x-$p2x)*($p1x-$p2x)+($p1y-$p2y)*($p1y-$p2y)]
# 2.4617750797260253e-35

if { $sqd > 1.0e-14 } {
  puts "ERROR: Intersection points are different"
}

if { (abs($par1f - $par2s) > 1.0e-9) || (abs($par1s - $par2f) > 1.0e-9) } {
  puts "ERROR: Parameters on intersecting curves are not coincided"
}

# Test complete
TagsNo tags attached.
Test case numberbugs modalg_6(011) bug25593
Attached Files? file icon face1.brep (47,672 bytes) 2014-12-11 17:23
png file icon sat read A9 picture.PNG (43,181 bytes) 2015-04-10 11:32

- Relationships
related to 0025594verifiedapn Valid shape is not visualize in shading mode. 
related to 0025635closedbugmaster Wrong result of 2D-extrema between two ellipsis 

-  Notes
(0036112)
git (administrator)
2015-01-15 16:18

Branch CR25593 has been created by nbv.

SHA-1: 924f417b099e2346b2c6aee511caa910d7dc8279


Detailed log of new commits:

Author: nbv
Date: Fri Dec 26 16:20:36 2014 +0300

    0025593: Number of intersection points for 2d curves depends on the order of arguments in command "2dintersect"
    
    1. Unification of the polygons creation (it is regardless of arguments order).
    2. Output of 2dintersect DRAW-command was changed.
    3. Geom2dGcc_Circ2d2TanRadGeo.cxx:
         Precise intersection point found by Extrema Curve-Curve method (dot product between every tangent vector and vector between points on two curves must be equal to zero).
(0038420)
git (administrator)
2015-03-17 12:14

Branch CR25593 has been updated forcibly by nbv.

SHA-1: 7aa5901bcf23b95d9cc5131153a109164b1a678e
(0038421)
nbv (developer)
2015-03-17 12:19

Dear Mikhail.

Please review CR25593 branch.
(0038442)
msv (developer)
2015-03-17 17:14

Remarks:

src\IntCurve\IntCurve_IntPolyPolyGen.gxx
- avoid copy-paste code, consider restructuring and simplification.

src\Geom2dGcc\Geom2dGcc_Circ2d2TanRadGeo.cxx
- do not precise intersection point if it is not tangent.
(0038653)
git (administrator)
2015-03-18 16:06

Branch CR25593 has been updated forcibly by nbv.

SHA-1: c67a75ec01c0a2c2bafe3e3742694273818ef777
(0038654)
nbv (developer)
2015-03-18 16:08

Dear Mikhail!

Please review CR25593 branch.
(0038657)
git (administrator)
2015-03-18 16:43

Branch CR25593 has been updated forcibly by nbv.

SHA-1: b984da7ebbe622bd2dd804665368c98b85f30408
(0038660)
git (administrator)
2015-03-18 17:29

Branch CR25593 has been updated forcibly by nbv.

SHA-1: 7b47f2c8a93954c5516bf6b9a4b61ab3ccb64fa8
(0038674)
msv (developer)
2015-03-19 10:21

Please change as we agreed.
(0039254)
git (administrator)
2015-04-06 13:42

Branch CR25593 has been updated forcibly by nbv.

SHA-1: c77fdee3d4a26be411ebd445dfffe90d714e800d
(0039257)
nbv (developer)
2015-04-06 14:12

Dear Mikhail!

Please review CR25593 branch.
(0039268)
msv (developer)
2015-04-06 16:33

Reviewed.
(0039327)
git (administrator)
2015-04-07 17:27

Branch CR25593 has been updated forcibly by mkv.

SHA-1: 83da86c7ebe429c11e2f16c78b45862f1e6c18f9
(0039520)
mkv (tester)
2015-04-09 17:57

Dear BugMaster,
Branch CR25593 was rebased on current master of occt git-repository.
(0039521)
mkv (tester)
2015-04-09 17:59

Dear BugMaster,
Branch CR25593 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 83da86c7ebe429c11e2f16c78b45862f1e6c18f9

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)

Regressions/Differences:
http://occt-tests/CR25593-master-products-64/Debian60-64/sat/doc_5/H6.html [^]
http://occt-tests/CR25593-master-products-64/Windows-64-VC10/sat/doc_5/H6.html [^]
sat doc_5 H6: IMPROVEMENT

http://occt-tests/CR25593-master-products-64/Debian60-64/sat/read/A9.html [^]
http://occt-tests/CR25593-master-products-64/Windows-64-VC10/sat/read/A9.html [^]
sat read A9: FAILED

Testing cases:
http://occt-tests/CR25593-master-occt-64/Debian60-64/bugs/modalg_6/bug25593.html [^]
http://occt-tests/CR25593-master-occt-64/Windows-64-VC10/bugs/modalg_6/bug25593.html [^]
bugs modalg_6(011) bug25593: OK

Testing on Linux:
occt component :
Total MEMORY difference: 93055874 / 93523283 [-0.50%]
Total CPU difference: 59693.88999999941 / 51732.989999999634 [+15.39%]
products component :
Total MEMORY difference: 23485792 / 23549237 [-0.27%]
Total CPU difference: 18011.909999999996 / 15558.799999999997 [+15.77%]

Testing on Windows:
occt component :
Total MEMORY difference: 56532205 / 56545478 [-0.02%]
Total CPU difference: 16072.517828298956 / 16509.991432599072 [-2.65%]
products component :
Total MEMORY difference: 15287158 / 15273934 [+0.09%]
Total CPU difference: 5899.770618799958 / 6001.2492692999795 [-1.69%]

There are no differences in images found by testdiff.
(0039522)
git (administrator)
2015-04-09 18:00

Branch CR25593 has been updated by mkv.

SHA-1: 5117c077668b3693393266d560d79938a2ac5416


Detailed log of new commits:

Author: mkv
Date: Thu Apr 9 18:00:03 2015 +0300

    Test case for issue CR25593

(0039523)
mkv (tester)
2015-04-09 18:00

Dear nbv,
could you please review test case
bugs modalg_6(011) bug25593
(0039553)
nbv (developer)
2015-04-10 11:31
edited on: 2015-04-10 11:33

sat doc_5 H6: IMPROVEMENT
It is OK. Please change reference behavior in test script.


      sat read A9: FAILED
Really, there is self-intersection. Current behaviour of this test script is better than on the MASTER.

Try the following script for confirmation:

...
Draw[]> checkshape result
#Faulty shapes in variables faulty_1 to faulty_2

Draw[]> copy faulty_2 ff
Draw[]> explode ff w
#ff_1. Only one wire is found

Draw[]> explode ff v
Draw[]> copy ff_1 vv
Draw[]> explode ff e

Draw[]> copy ff_1 e1
Draw[]> copy ff_5 e2

Draw[]> don e1 e2 vv

Draw[]> toler e2
#Tolerance MAX=0.00070868051373344852 AVG=0.00023959350457781616 MIN=9.9999999999999995e-008

Draw[]> toler vv
#Tolerance MAX=0.00070868051373344852 AVG=0.00070868051373344852 MIN=0.00070868051373344852

Draw[]> mkcurv c1 e1
Draw[]> mkcurv c2 e2

Draw[]> cval c1 -3.3871 xx1 yy1 zz1
Draw[]> cval c2 5.2351 xx2 yy2 zz2

#Point on e1
Draw[]> vertex vv1 xx1 yy1 zz1
#Point on e2
Draw[]> vertex vv2 xx2 yy2 zz2

Draw[]> distmini dd vv1 vv2
#0.00068634 < tolerance of e2. I.e. point vv1 lies in e2 too.

Draw[]> distmini dd vv vv1
#0.000723785 > Toler of vv. I.e. point vv1 is not covered by tolerance of shape vertex.

See sat read A9 picture.PNG file attached.

(0039555)
nbv (developer)
2015-04-10 11:41

Dear Mikhail,

Please confirm message http://tracker.dev.opencascade.org/view.php?id=25593#c39553 [^]
(0039614)
msv (developer)
2015-04-12 23:46

> sat read A9: FAILED

I agree that the shape produced in the result of this test is invalid. However, the cause of considering it invalid is different than described by NBV.

Indeed, we can see intersection between pcurves of the edges 1 and 5 of the face faulty_2. And the point of intersection, after computing its 3D representation, is distant from the vertex more than the vertex tolerance. However, there is a pair of representations of the edges 1 and 5 that do not have intersections (they are their 3D curves); and according to the rule of shape validity BRep_I_2, such shape can be considered valid.

We can see, that if we project the 3D curve of the edge 1 on the surface, we will obtain a pcurve that has no intersection with pcurve of the edge 5.

On the other hand, if we compute the real maximal distance between 3D curve and curve on surface of the edge 1, we will see that this distance is about 0.002, which is greater than the edge tolerance (0.0007). And this fact must make this shape invalid.

This shape can be made valid either by reconstructing the pcurve (preferred way), or by increasing tolerance of both this edge and its vertices (it is a rough solution).

So, I suggest that we insert a "TODO" sentence in the test script, as it should complain about invalid SameParameter flag of the edge rather than about self-intersection of the wire.
(0039615)
nbv (developer)
2015-04-13 09:25

Small additions.

1. checkshape says: "Self Intersecting Wire" (not "Invalid same-parameter"). Therefore, we must have failed to consider differences between 2D and 3D-curve. Nevertheless, this difference exists and it is addition criteria why this shape is invalid indeed.

2. Indeed, projection algorithm finds minimal distance between c1 and c2 more than edge tolerance. Nevertheless, it works wrong here because there is less distance (and this fact is proven in http://tracker.dev.opencascade.org/view.php?id=25593#c39553 [^]), which is less than edge tolerance. Therefore, wire is self-intersecting really.
(0039619)
msv (developer)
2015-04-13 10:47

I do not agree with the second point. The maximal deflection between 2d and 3d curve representations indeed more than tolerance. And the calculations given in 0025593:0039553 are wrong, because the commands:

  Draw[]> cval c1 -3.3871 xx1 yy1 zz1
  Draw[]> cval c2 5.2351 xx2 yy2 zz2

Use wrong parameter. If we use another parameter that corresponds to intersection point then the computed distance will give a value about 0.002 instead of 0.0007.
(0039620)
msv (developer)
2015-04-13 10:50
edited on: 2015-04-13 12:40

Dear bugmaster, please add "TODO" in the failed test case and integrate the branch.

(0039647)
mkv (tester)
2015-04-13 17:42

Dear BugMaster,
Test cases
sat doc_5 H6
sat read A9
are corrected and pushed to new branch CR25593 in products git-repository.
(0039648)
mkv (tester)
2015-04-13 17:44

Dear BugMaster,
Branch CR25593 is TESTED.
(0040976)
git (administrator)
2015-05-14 16:27

Branch CR25593 has been deleted by inv.

SHA-1: 5117c077668b3693393266d560d79938a2ac5416

- Related Changesets
occt: master 1d19db8d
Timestamp: 2015-04-16 07:32:53
Author: nbv
Committer: bugmaster
Details ] Diff ]
0025593: Number of intersection points for 2d curves depends on the order of arguments in command "2dintersect"

1. Unification of the polygons creation (it is regardless of arguments order).
2. Output of 2dintersect DRAW-command was changed.
3. Geom2dGcc_Circ2d2TanRadGeo.cxx:
     Precise intersection point found by Extrema Curve-Curve method (dot product between every tangent vector and vector between points on two curves must be equal to zero).
4. Some comments have been translated from French to English.

Some test case have been updated.

Changes in accordance with the last remark

Test case for issue CR25593
mod - src/Geom2dGcc/Geom2dGcc_Circ2d2TanRad.cxx Diff ] File ]
mod - src/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx Diff ] File ]
mod - src/GeomliteTest/GeomliteTest_API2dCommands.cxx Diff ] File ]
mod - src/IntCurve/IntCurve_IntPolyPolyGen.gxx Diff ] File ]
mod - src/IntCurve/IntCurve_Polygon2dGen.cdl Diff ] File ]
mod - src/IntCurve/IntCurve_Polygon2dGen.gxx Diff ] File ]
mod - tests/bugs/modalg_4/bug714 Diff ] File ]
mod - tests/bugs/modalg_5/bug24303 Diff ] File ]
add - tests/bugs/modalg_6/bug25593 Diff ] File ]
mod - tests/de/iges_1/G6 Diff ] File ]
mod - tests/de/iges_1/J9 Diff ] File ]
mod - tests/de/iges_1/K3 Diff ] File ]
mod - tests/de/iges_1/L8 Diff ] File ]
mod - tests/de/iges_1/M7 Diff ] File ]
mod - tests/de/iges_1/N9 Diff ] File ]
mod - tests/de/iges_1/P5 Diff ] File ]
mod - tests/de/iges_1/P8 Diff ] File ]
mod - tests/de/iges_1/R1 Diff ] File ]
mod - tests/de/iges_1/R8 Diff ] File ]
mod - tests/de/iges_2/B8 Diff ] File ]
mod - tests/de/iges_2/C2 Diff ] File ]
mod - tests/de/iges_2/I7 Diff ] File ]
mod - tests/de/iges_3/A4 Diff ] File ]
mod - tests/de/step_2/B6 Diff ] File ]
mod - tests/de/step_2/M4 Diff ] File ]
mod - tests/de/step_2/M6 Diff ] File ]
mod - tests/de/step_2/S1 Diff ] File ]
mod - tests/de/step_2/S9 Diff ] File ]
mod - tests/de/step_2/T9 Diff ] File ]
mod - tests/de/step_2/W7 Diff ] File ]
mod - tests/de/step_2/Y5 Diff ] File ]
mod - tests/de/step_3/A9 Diff ] File ]
mod - tests/de/step_3/C4 Diff ] File ]
mod - tests/de/step_3/C6 Diff ] File ]
mod - tests/de/step_3/D3 Diff ] File ]
mod - tests/de/step_3/D8 Diff ] File ]
mod - tests/de/step_3/D9 Diff ] File ]
mod - tests/de/step_3/F4 Diff ] File ]
mod - tests/de/step_4/E6 Diff ] File ]
mod - tests/de/step_5/A1 Diff ] File ]
mod - tests/heal/split_angle/F2 Diff ] File ]

- Issue History
Date Modified Username Field Change
2014-12-11 17:23 gka New Issue
2014-12-11 17:23 gka Assigned To => msv
2014-12-11 17:23 gka File Added: face1.brep
2014-12-11 17:48 msv Summary Number of interswection points for 2d curves depends from order of curves in command "2dintersect" => Number of intersection points for 2d curves depends on the order of arguments in command "2dintersect"
2014-12-12 09:16 nbv Assigned To msv => nbv
2014-12-12 14:10 msv Status new => assigned
2014-12-16 10:34 msv Severity minor => major
2014-12-16 10:38 msv Relationship added related to 0025594
2014-12-22 10:31 nbv Relationship added related to 0025635
2015-01-15 16:18 git Note Added: 0036112
2015-03-17 12:14 git Note Added: 0038420
2015-03-17 12:19 nbv Note Added: 0038421
2015-03-17 12:19 nbv Assigned To nbv => msv
2015-03-17 12:19 nbv Status assigned => resolved
2015-03-17 12:19 nbv Steps to Reproduce Updated View Revisions
2015-03-17 17:14 msv Note Added: 0038442
2015-03-17 17:14 msv Assigned To msv => nbv
2015-03-17 17:14 msv Status resolved => assigned
2015-03-18 11:32 nbv Steps to Reproduce Updated View Revisions
2015-03-18 16:06 git Note Added: 0038653
2015-03-18 16:08 nbv Note Added: 0038654
2015-03-18 16:08 nbv Assigned To nbv => msv
2015-03-18 16:08 nbv Status assigned => resolved
2015-03-18 16:43 git Note Added: 0038657
2015-03-18 16:46 nbv Steps to Reproduce Updated View Revisions
2015-03-18 17:29 git Note Added: 0038660
2015-03-19 10:21 msv Note Added: 0038674
2015-03-19 10:21 msv Assigned To msv => nbv
2015-03-19 10:21 msv Status resolved => assigned
2015-04-06 13:42 git Note Added: 0039254
2015-04-06 14:12 nbv Note Added: 0039257
2015-04-06 14:12 nbv Assigned To nbv => msv
2015-04-06 14:12 nbv Status assigned => resolved
2015-04-06 14:12 nbv Steps to Reproduce Updated View Revisions
2015-04-06 14:12 nbv Steps to Reproduce Updated View Revisions
2015-04-06 16:33 msv Note Added: 0039268
2015-04-06 16:33 msv Assigned To msv => bugmaster
2015-04-06 16:33 msv Status resolved => reviewed
2015-04-07 16:58 mkv Assigned To bugmaster => mkv
2015-04-07 17:27 git Note Added: 0039327
2015-04-09 17:57 mkv Note Added: 0039520
2015-04-09 17:59 mkv Note Added: 0039521
2015-04-09 18:00 git Note Added: 0039522
2015-04-09 18:00 mkv Note Added: 0039523
2015-04-09 18:00 mkv Assigned To mkv => nbv
2015-04-09 18:00 mkv Status reviewed => feedback
2015-04-09 18:01 mkv Test case number => bugs modalg_6(011) bug25593
2015-04-10 11:31 nbv Note Added: 0039553
2015-04-10 11:32 nbv File Added: sat read A9 picture.PNG
2015-04-10 11:33 nbv Note Edited: 0039553 View Revisions
2015-04-10 11:41 nbv Note Added: 0039555
2015-04-10 11:41 nbv Assigned To nbv => msv
2015-04-10 11:41 nbv Status feedback => resolved
2015-04-12 23:46 msv Note Added: 0039614
2015-04-12 23:47 msv Assigned To msv => bugmaster
2015-04-12 23:47 msv Status resolved => reviewed
2015-04-13 09:25 nbv Note Added: 0039615
2015-04-13 10:47 msv Note Added: 0039619
2015-04-13 10:50 msv Note Added: 0039620
2015-04-13 12:40 msv Note Edited: 0039620 View Revisions
2015-04-13 13:05 mkv Assigned To bugmaster => mkv
2015-04-13 17:42 mkv Note Added: 0039647
2015-04-13 17:44 mkv Note Added: 0039648
2015-04-13 17:44 mkv Assigned To mkv => bugmaster
2015-04-13 17:44 mkv Status reviewed => tested
2015-04-17 15:40 bugmaster Changeset attached => occt master 1d19db8d
2015-04-17 15:40 bugmaster Status tested => verified
2015-04-17 15:40 bugmaster Resolution open => fixed
2015-05-14 15:28 user533 Status verified => closed
2015-05-14 15:31 user533 Fixed in Version => 6.9.0
2015-05-14 16:27 git Note Added: 0040976


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker