View Issue Details

IDProjectCategoryView StatusLast Update
0024772CommunityOCCT:Modeling Algorithmspublic2023-03-19 18:54
ReporterRoman Lygin Assigned Toknosulko 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.7.0 
Target Version7.7.0Fixed in Version7.6.2 
Summary0024772: Modeling Algorithms - Intersection of cylinder and cone produces incorrect results
DescriptionThere are 4 segments produced by the intersector, including closed ones with parts not lying on a cylinder (e.g. r_1 - see screenshot).

The cone is a flat one, with angle ~PI/2. This combination comes from a Parasolid file.

Note that 6.6.0 produces no result at all. So some changes integrated 6.7.0 lead to this incorrect computation.
Steps To Reproducerestore s1
restore s2
intersect r s1 s2
TagsNo tags attached.
Test case numberbugs modalg_7 bug24772

Attached Files

  • archive.zip (5,873 bytes)
  • r_1.png (31,054 bytes)
  • bug24772_s3.draw (226 bytes)

Relationships

related to 0027705 assignedmsv Community Modeling Algorithms - Boolean operation returns empty compound for a shape containing a nearly plane cone 
related to 0024418 closedbugmaster Open CASCADE Modeling Algorithms - Wrong section curves when intersecting analytical surfaces 

Activities

Roman Lygin

2014-03-28 01:02

developer  

archive.zip (5,873 bytes)

Roman Lygin

2014-03-28 01:03

developer  

r_1.png (31,054 bytes)

apv

2017-08-01 10:49

tester   ~0069011

Problem described in issue is reproduced on current state of OCCT.

nbv

2018-06-19 13:09

developer   ~0076833

This problem is limitation for the current version of the intersection algorithm. The reason is following:

1. Cone-Cylinder intersection algorithm produces ALine. Aline is internal (for OCCT) 3D-intersection curve.

2. This ALine is projected to the every intersected surfaces (in order to obtain correspond p-curve). For that, ALine is discretized on several points, every point is projected to the surfaces and after that obtained set of 2D-points is approximated to the p-curve. In case of near-plane cones projection of 3D-point to the cone cannot be computed correctly because projector cannot decide from which side of the apex the projection point should be chosen (for valid cones, the nearest point is chosen but for near-plane cones correspond distances differ insignificantly).

3. Moreover, projection is used while computation of value of the ALine. So, methods IntAna_Curve::Value(...) and IntPatch_ALine::Value(...) work wrong with near-plane cones.

Possible ways to fix:

1. Use bi-parametric intersection algorithm (IntPatch_PrmPrmIntersection). This algorithm initially works in 2D-space. So it does not made any projections. Consequently, it will produce valid result.

2. Replace existing intersection algorithm with new one like already used while Cylinder-Cylinder intersecting. New algorithm will work in 2D-space too and is oriented to special types of intersected surfaces (analytical cases: Cylinder-Cylinder, Cylinder-Cone, Cone-Sphere etc.)

The bright advantage of 2nd step in compare with 1st is the fix 0023178 and 0026894 where bi-parametric intersector worked too long but could not find any result. New algorithm currently works perfectly.

I am going to implement the way 2 while fixing the issue 0024418.

nbv

2018-10-26 13:20

developer   ~0080373

Dear Mikhail,

We are looking forward your decision. Is this issue possible to be fixed?

P.S.

Please look at the messages 0024772:0076833 and 0027705:0080371.

msv

2018-10-30 12:39

developer   ~0080517

I propose to go by 2nd way.

msv

2018-10-30 12:43

developer   ~0080519

When have time.

git

2022-03-16 15:49

administrator   ~0107304

Branch CR24772 has been created by knosulko.

SHA-1: 9df9bbb898d35e08c19f3b252badb7b886799eea


Detailed log of new commits:

Author: knosulko
Date: Wed Mar 16 13:13:15 2022 +0300

    0024772: Modeling Algorithms - Intersection of cylinder and cone produces incorrect results
    
    GeomInt/GeomInt_IntSS.cxx - handle flat cone case

git

2022-03-22 14:05

administrator   ~0107388

Branch CR24772 has been updated forcibly by knosulko.

SHA-1: 643461bd8373524cd03b6ce4e96beb7592f9d560

git

2022-03-22 17:09

administrator   ~0107393

Branch CR24772 has been updated by knosulko.

SHA-1: d8535d1a9204a89e5243b6d8dfa697c83b5b9c5a


Detailed log of new commits:

Author: knosulko
Date: Tue Mar 22 16:46:32 2022 +0300

    fix remarks

git

2022-03-22 17:10

administrator   ~0107394

Branch CR24772 has been updated forcibly by knosulko.

SHA-1: 578dfad9d7f3d10d84488d2d9272e8a842fd4af1

git

2022-03-23 11:28

administrator   ~0107395

Branch CR24772 has been updated forcibly by knosulko.

SHA-1: 5f0142c3f126dbfbbc903f4ac3be23f32817d73b

git

2022-03-23 11:32

administrator   ~0107396

Branch CR24772 has been updated forcibly by knosulko.

SHA-1: 30e9dd6d88b9b7380c52ddb3e1f127bd6b94fa6c

knosulko

2022-03-23 11:32

reporter   ~0107397

bug24772_s3.draw (226 bytes)

knosulko

2022-03-23 14:54

reporter   ~0107398

Branch CR24772 is ready for review
http://jenkins-test-occt.nnov.opencascade.com/view/CR24772-master-knosulko/view/COMPARE/

Branches for Integration:
OCCT - CR24772
Products - Not

ifv

2022-03-23 17:09

developer   ~0107400

Branch CR24772

Branches for Integration:
OCCT - CR24772
Products - Not

kgv

2022-03-23 17:25

developer   ~0107401

@knosulko, a couple of cosmetic remarks

+    else {
+        U = atan2(Ploc.Y(), Ploc.X());

Please reformat new code using 2-spaces indentation (see OCCT Coding Style).

 
+  Standard_EXPORT static void GetConeApexParam (const gp_Cone& C, Standard_Real& U, Standard_Real& V);

Please provide description to the method on it's purpose and arguments.
It is recommended to rename arguments with `the` prefix following OCCT Coding Style.

+  if (theS->GetType() != GeomAbs_Cone)
+    throw Standard_NoSuchObject("IntPatch_Intersection : Surface is not Cone");

It is recommended to put single-line statements into figure brackets.

+static void SplitCone(

It is better naming local/private/protected methods with lower-case, and it is desired adding a description.

+      const Handle(Adaptor3d_TopolTool)& theD2,
+      const Standard_Real Tol,
+      NCollection_Vector< Handle(Adaptor3d_Surface)>& aSeqHS1,
+      NCollection_Vector< Handle(Adaptor3d_Surface)>& aSeqHS2);

`the` prefix.

+  NCollection_Vector< Handle(Adaptor3d_Surface)> aVecHS1;

NCollection_Vector looks confusing for this usage scenario (NCollection_List or NCollection_Sequence should suffice), but OK to leave as is.

+    const Handle(Adaptor3d_Surface) aHS1 = aVecHS1.Value (aNumOfHS1);
...
+      const Handle(Adaptor3d_Surface) aHS2 = aVecHS2.Value (aNumOfHS2);

 const Handle(Adaptor3d_Surface)&

+//purpose  : .

Please avoid trailing spaces in new code.

git

2022-03-23 18:56

administrator   ~0107402

Branch CR24772 has been updated forcibly by knosulko.

SHA-1: f0e0f945b3a420ee7d5817f188e3145adc621798

knosulko

2022-03-23 19:06

reporter   ~0107403

Please review the branch CR24772.

kgv

2022-03-24 09:55

developer   ~0107406

@knosulko

+  //! @param theC [in] conical surface

The valid Doxygen syntax for in/out is:
> //! @param[in] theC conical surface

git

2022-03-24 10:26

administrator   ~0107409

Branch CR24772 has been updated forcibly by knosulko.

SHA-1: 93330d3b40a7a6d89c5903aaff407279ef5f7d3c

knosulko

2022-03-24 10:32

reporter   ~0107410

Please review the branch CR24772.

smoskvin

2022-03-27 10:46

administrator   ~0107438

Combination -
OCCT branch : IR-2022-03-25
master SHA - e4753a7d1658331a79025964d1c55f2a6d999c6c
49e51745631c52b6c452c65adae4d6dfa21a1b1e
Products branch : IR-2022-03-25 SHA - 303106116fcb5c01a598ea01cc5174a45aae8f18
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: 18507.51000000038 / 18488.570000000385 [+0.10%]
Products
Total CPU difference: 11703.320000000122 / 11709.530000000132 [-0.05%]
Windows-64-VC14:
OCCT
Total CPU difference: 20451.96875 / 20413.53125 [+0.19%]
Products
Total CPU difference: 13191.96875 / 13181.65625 [+0.08%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2022-04-02 19:34

administrator   ~0107561

Branch CR24772 has been deleted by mnt.

SHA-1: 93330d3b40a7a6d89c5903aaff407279ef5f7d3c

Related Changesets

occt: master 5ae6f08c

2022-03-16 13:13:15

knosulko


Committer: smoskvin Details Diff
0024772: Modeling Algorithms - Intersection of cylinder and cone produces incorrect results

GeomInt/GeomInt_IntSS.cxx - handle flat cone case
IntPatch/IntPatch_Intersection.hxx, IntPatch/IntPatch_Intersection.cxx - method for preparing surfaces is added
bugs/lowalgos/intss/bug24772 - test case is changed according new behavior
Affected Issues
0024772
mod - src/Adaptor3d/Adaptor3d_TopolTool.cxx Diff File
mod - src/Adaptor3d/Adaptor3d_TopolTool.hxx Diff File
mod - src/GeomInt/GeomInt_IntSS.cxx Diff File
mod - src/IntPatch/IntPatch_Intersection.cxx Diff File
mod - src/IntPatch/IntPatch_Intersection.hxx Diff File
mod - tests/lowalgos/intss/bug24772 Diff File

Issue History

Date Modified Username Field Change
2014-03-28 01:02 Roman Lygin New Issue
2014-03-28 01:02 Roman Lygin Assigned To => ifv
2014-03-28 01:02 Roman Lygin File Added: archive.zip
2014-03-28 01:03 Roman Lygin File Added: r_1.png
2014-09-12 14:36 abv Target Version => 7.1.0
2016-10-28 11:54 msv Target Version 7.1.0 => 7.2.0
2017-07-21 11:34 msv Target Version 7.2.0 => 7.3.0
2017-08-01 10:49 apv Test case number => bugs modalg_7 bug24772
2017-08-01 10:49 apv Note Added: 0069011
2017-12-05 17:01 msv Target Version 7.3.0 => 7.4.0
2018-05-24 14:17 nbv Relationship added related to 0027705
2018-06-19 10:38 nbv Relationship added related to 0029807
2018-06-19 13:09 nbv Note Added: 0076833
2018-06-19 13:10 nbv Relationship deleted related to 0029807
2018-06-19 13:10 nbv Relationship added related to 0024418
2018-10-26 13:20 nbv Note Added: 0080373
2018-10-26 13:21 nbv Assigned To ifv => msv
2018-10-26 13:21 nbv Status new => feedback
2018-10-30 12:39 msv Note Added: 0080517
2018-10-30 12:43 msv Note Added: 0080519
2018-10-30 12:43 msv Assigned To msv => nbv
2018-10-30 12:43 msv Status feedback => assigned
2019-08-12 19:08 msv Assigned To nbv => msv
2019-08-12 19:22 msv Target Version 7.4.0 => Unscheduled
2019-09-04 12:11 kgv Summary Intersection of cylinder and cone produces incorrect results => Modeling Algorithms - Intersection of cylinder and cone produces incorrect results
2021-12-24 16:45 ifv Assigned To msv => knosulko
2022-02-25 15:42 knosulko Time allocated 21.2.2022: 8 h. => set
2022-02-25 15:43 knosulko Time allocated 22.2.2022: 7 h. => set
2022-02-25 15:43 knosulko Time allocated 24.2.2022: 8 h. => set
2022-02-25 15:43 knosulko Time allocated 25.2.2022: 8 h. => set
2022-03-04 15:05 knosulko Time allocated 28.2.2022: 8 h. => set
2022-03-04 15:05 knosulko Time allocated 1.3.2022: 8 h. => set
2022-03-04 15:05 knosulko Time allocated 2.3.2022: 8 h. => set
2022-03-04 15:06 knosulko Time allocated 3.3.2022: 8 h. => set
2022-03-04 15:06 knosulko Time allocated 4.3.2022: 8 h. => set
2022-03-11 15:52 knosulko Time allocated 7.3.2022: 7 h. => set
2022-03-11 15:52 knosulko Time allocated 9.3.2022: 8 h. => set
2022-03-11 15:52 knosulko Time allocated 10.3.2022: 8 h. => set
2022-03-11 15:53 knosulko Time allocated 11.3.2022: 8 h. => set
2022-03-11 15:53 knosulko Time allocated Deleted 2022-03-10: 8,00 h. => deleted
2022-03-11 15:53 knosulko Time allocated 10.3.2022: 8 h. => set
2022-03-11 15:53 knosulko Time allocated Deleted 2022-03-10: 8,00 h. => deleted
2022-03-11 15:54 knosulko Time allocated 10.3.2022: 8 h. => set
2022-03-16 15:49 git Note Added: 0107304
2022-03-18 15:05 knosulko Time allocated 11.3.2022: 8 h. => set
2022-03-18 15:07 knosulko Time allocated 12.3.2022: 8 h. => set
2022-03-18 15:08 knosulko Time allocated 13.3.2022: 8 h. => set
2022-03-18 15:09 knosulko Time allocated Deleted 2022-03-13: 8,00 h. => deleted
2022-03-18 15:09 knosulko Time allocated Deleted 2022-03-12: 8,00 h. => deleted
2022-03-18 15:09 knosulko Time allocated Deleted 2022-03-11: 8,00 h. => deleted
2022-03-18 15:10 knosulko Time allocated 14.3.2022: 8 h. => set
2022-03-18 15:10 knosulko Time allocated 15.3.2022: 8 h. => set
2022-03-18 15:12 knosulko Time allocated 16.3.2022: 8 h. => set
2022-03-18 15:13 knosulko Time allocated 17.3.2022: 8 h. => set
2022-03-18 15:13 knosulko Time allocated Deleted 2022-03-17: 8,00 h. => deleted
2022-03-18 15:13 knosulko Time allocated 17.3.2022: 8 h. => set
2022-03-18 15:13 knosulko Time allocated 18.3.2022: 8 h. => set
2022-03-22 14:05 git Note Added: 0107388
2022-03-22 17:09 git Note Added: 0107393
2022-03-22 17:10 git Note Added: 0107394
2022-03-23 11:28 git Note Added: 0107395
2022-03-23 11:32 git Note Added: 0107396
2022-03-23 11:32 knosulko Note Added: 0107397
2022-03-23 11:32 knosulko File Added: bug24772_s3.draw
2022-03-23 14:54 knosulko Assigned To knosulko => ifv
2022-03-23 14:54 knosulko Status assigned => resolved
2022-03-23 14:54 knosulko Note Added: 0107398
2022-03-23 17:09 ifv Assigned To ifv => bugmaster
2022-03-23 17:09 ifv Status resolved => reviewed
2022-03-23 17:09 ifv Note Added: 0107400
2022-03-23 17:25 kgv Note Added: 0107401
2022-03-23 17:26 kgv Assigned To bugmaster => knosulko
2022-03-23 17:26 kgv Status reviewed => assigned
2022-03-23 17:26 kgv Target Version Unscheduled => 7.7.0
2022-03-23 18:56 git Note Added: 0107402
2022-03-23 19:06 knosulko Assigned To knosulko => kgv
2022-03-23 19:06 knosulko Status assigned => resolved
2022-03-23 19:06 knosulko Note Added: 0107403
2022-03-24 09:55 kgv Note Added: 0107406
2022-03-24 09:55 kgv Assigned To kgv => bugmaster
2022-03-24 09:55 kgv Status resolved => reviewed
2022-03-24 10:13 knosulko Assigned To bugmaster => knosulko
2022-03-24 10:13 knosulko Status reviewed => assigned
2022-03-24 10:26 git Note Added: 0107409
2022-03-24 10:32 knosulko Assigned To knosulko => kgv
2022-03-24 10:32 knosulko Status assigned => resolved
2022-03-24 10:32 knosulko Note Added: 0107410
2022-03-24 10:35 kgv Assigned To kgv => bugmaster
2022-03-24 10:35 kgv Status resolved => reviewed
2022-03-25 15:48 knosulko Time allocated 21.3.2022: 8 h. => set
2022-03-25 15:49 knosulko Time allocated 22.3.2022: 8 h. => set
2022-03-25 15:49 knosulko Time allocated 23.3.2022: 8 h. => set
2022-03-27 10:46 smoskvin Status reviewed => tested
2022-03-27 10:46 smoskvin Note Added: 0107438
2022-03-27 12:32 smoskvin Changeset attached => occt master 5ae6f08c
2022-03-27 12:32 knosulko Assigned To bugmaster => knosulko
2022-03-27 12:32 knosulko Status tested => verified
2022-03-27 12:32 knosulko Resolution open => fixed
2022-04-02 19:34 git Note Added: 0107561
2023-03-19 18:54 vglukhik Status verified => closed
2023-03-19 18:54 vglukhik Fixed in Version => 7.6.2