View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0032649 | Community | OCCT:Modeling Algorithms | public | 2021-11-04 08:14 | 2023-02-03 04:55 |
Reporter | xuzhongxing | Assigned To | |||
Priority | normal | Severity | trivial | ||
Status | closed | Resolution | fixed | ||
Platform | Linux | OS | Ubuntu | ||
Product Version | 7.6.0 | ||||
Target Version | 7.6.1 | Fixed in Version | 7.7.0 | ||
Summary | 0032649: Modeling Algorithms - Bug in BRepLib::EnsureNormalConsistency() | ||||
Description | A var name typo: diff --git a/src/BRepLib/BRepLib.cxx b/src/BRepLib/BRepLib.cxx index 18733f8563..d89ecb4c1f 100644 --- a/src/BRepLib/BRepLib.cxx +++ b/src/BRepLib/BRepLib.cxx @@ -2423,7 +2423,7 @@ Standard_Boolean BRepLib:: gp_Vec3f aNorm1f, aNorm2f; aPT1->Normal (aFNodF1, aNorm1f); - aPT1->Normal (aFNodF2, aNorm2f); + aPT2->Normal (aFNodF2, aNorm2f); const gp_XYZ aNorm1 (aNorm1f.x(), aNorm1f.y(), aNorm1f.z()); const gp_XYZ aNorm2 (aNorm2f.x(), aNorm2f.y(), aNorm2f.z()); const Standard_Real aDot = aNorm1 * aNorm2; | ||||
Steps To Reproduce | None | ||||
Tags | No tags attached. | ||||
Test case number | Not required | ||||
|
Branch CR0032649 has been created by xuzhongxing. SHA-1: fccbbbf1500da7fe1554086d2ba316dfe671d06b Detailed log of new commits: Author: Xu Zhongxing Date: Thu Nov 4 13:15:49 2021 +0800 0032649: Bug in BRepLib::EnsureNormalConsistency() Fix a typo in variable name. |
|
Test job http://jenkins-test-occt/view/CR0032649-master-MSV/view/COMPARE/ |
|
Hi Xu Zhongxing, Thank you very much for the registered bug and the patch. |
|
For integration: occt - CR0032649 products - none |
|
Dear Xu, you have specified the severity of the bug as "crash". I wonder in which scenario does it crash for you? Mikhail, we have just a single test case using command "correctnormals" (bugs/modalg_6/bug27391). Would it make any sense adding an image dump to it? |
|
It has no sense, as the shape in that test is not changed by the command correctnormals. That test case is just to check for no crash in case if polygons on triangulations do not match. |
|
This bug computes wrong normals. It alone does not necessarily cause crash. Its consequences depend on what the normals are used to do. In some cases, it causes errors in rendering. But the bug is obvious. |
|
Thanks for clarifying. |
|
But I do not think this is trivial. It should be a major bug. |
|
> But I do not think this is trivial. > It should be a major bug. So far, we do not have a well-defined criteria for bug severity levels. Most bugs use "minor" level (default) even when impact is pretty high. BRepLib::EnsureNormalConsistency() is not used (much) in OCCT itself nor in applications that I've seen so far. I don't even understand yet in which context this function might be / should be used at all. There are even no test cases for this functionality. It would be helpful if you would contribute your scenario (e.g. representative model) that could be used for regression testing in future. |
|
I spotted it by looking at the image rendered. I created a simple cube, triangulated it, calculated the normals of triangles with BRepLib::EnsureNormalConsistency(), and rendered it with OpenGL. Then I saw some triangles had wrong lighting. I printed the normals of each triangle and found some of them are wrong. |
|
> I created a simple cube, triangulated it, > calculated the normals of triangles with BRepLib::EnsureNormalConsistency() From description, BRepLib::EnsureNormalConsistency() is supposed to correct existing normals, not to create them. OCCT visualization classes rely on StdPrs_ToolTriangulatedShape::ComputeNormals() for computing normals. |
|
Thank you. I will try StdPrs_ToolTriangulatedShape::ComputeNormals(). |
|
I could reproduce bad visualization after applying the wrong version of EnsureNormalConsistency. The following script to reproduce: box a 10 10 10 incmesh a 0.1 correctnormals a vinit vdefaults -autotriang 0 vdisplay a vsetdispmode 1 The result is in the attached picture. |
2021-11-11 13:06 developer |
snapshot.png (5,756 bytes) |
|
StdPrs_ToolTriangulatedShape::ComputeNormals() works fine. I will use this in my code. |
|
Is this ready to be merged? |
|
> Is this ready to be merged? Patches in REVIEWED state are going to be pushed to the "master" branch within the next integration series (weekly). https://dev.opencascade.org/doc/overview/html/occt_contribution__contribution_workflow.html#occt_contribution_workflow_integrate |
|
Combination - OCCT branch : IR-2021-11-19 master SHA - ea0ffd6efe2e05d9764495fa0a877ab75ab5f4e9 49e51745631c52b6c452c65adae4d6dfa21a1b1e Products branch : IR-2021-11-19 SHA - 24ac02cc67913557271bc70687b86b53e78f9c44 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: 17763.090000000444 / 17742.320000000425 [+0.12%] Products Total CPU difference: 11658.550000000125 / 11669.660000000133 [-0.10%] Windows-64-VC14: OCCT Total CPU difference: 19745.71875 / 19762.140625 [-0.08%] Products Total CPU difference: 13066.0625 / 12843.21875 [+1.74%] Image differences : No differences that require special attention Memory differences : No differences that require special attention |
|
Branch CR0032649 has been deleted by mnt. SHA-1: fccbbbf1500da7fe1554086d2ba316dfe671d06b |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-11-04 08:14 | xuzhongxing | New Issue | |
2021-11-04 08:14 | xuzhongxing | Assigned To | => msv |
2021-11-04 08:18 | git | Note Added: 0105046 | |
2021-11-04 18:20 |
|
Relationship added | child of 0032133 |
2021-11-04 18:27 |
|
Category | OCCT:Modeling Data => OCCT:Modeling Algorithms |
2021-11-04 18:27 |
|
Product Version | => 7.6.0 |
2021-11-04 18:27 |
|
Target Version | => 7.7.0 |
2021-11-04 18:27 |
|
Summary | Bug in BRepLib::EnsureNormalConsistency() => Modeling Algorithms - Bug in BRepLib::EnsureNormalConsistency() |
2021-11-04 18:31 |
|
Note Added: 0105047 | |
2021-11-04 18:33 |
|
Note Added: 0105048 | |
2021-11-04 18:35 |
|
Status | new => resolved |
2021-11-04 18:35 |
|
Steps to Reproduce Updated | |
2021-11-04 20:42 |
|
Note Added: 0105049 | |
2021-11-04 20:42 |
|
Assigned To | msv => bugmaster |
2021-11-04 20:42 |
|
Status | resolved => reviewed |
2021-11-08 09:21 | kgv | Note Added: 0105057 | |
2021-11-08 09:50 |
|
Note Added: 0105058 | |
2021-11-11 11:08 | xuzhongxing | Note Added: 0105105 | |
2021-11-11 11:11 | xuzhongxing | Note Edited: 0105105 | |
2021-11-11 11:15 | kgv | Severity | crash => trivial |
2021-11-11 11:15 | kgv | Note Added: 0105106 | |
2021-11-11 11:23 | xuzhongxing | Note Added: 0105107 | |
2021-11-11 11:37 | kgv | Note Added: 0105109 | |
2021-11-11 11:37 | kgv | Note Edited: 0105109 | |
2021-11-11 11:38 | kgv | Note Edited: 0105109 | |
2021-11-11 11:39 | kgv | Note Edited: 0105109 | |
2021-11-11 11:39 | kgv | Target Version | 7.7.0 => 7.6.1 |
2021-11-11 11:46 | xuzhongxing | Note Added: 0105111 | |
2021-11-11 11:55 | kgv | Note Added: 0105113 | |
2021-11-11 12:18 | xuzhongxing | Note Added: 0105116 | |
2021-11-11 13:05 |
|
Note Added: 0105123 | |
2021-11-11 13:06 |
|
File Added: snapshot.png | |
2021-11-11 15:45 | xuzhongxing | Note Added: 0105132 | |
2021-11-19 05:00 | xuzhongxing | Note Added: 0105260 | |
2021-11-19 10:04 | kgv | Note Added: 0105263 | |
2021-11-21 12:27 | bugmaster | Status | reviewed => tested |
2021-11-21 12:30 | bugmaster | Note Added: 0105281 | |
2021-11-21 12:46 |
|
Changeset attached | => occt master 97e80b8c |
2021-11-21 12:46 |
|
Assigned To | bugmaster => inv |
2021-11-21 12:46 |
|
Status | tested => verified |
2021-11-21 12:46 |
|
Resolution | open => fixed |
2021-11-21 13:00 | git | Note Added: 0105296 | |
2021-11-21 13:51 |
|
Test case number | => Not required |
2023-02-03 04:55 | vglukhik | Status | verified => closed |
2023-02-03 04:55 | vglukhik | Fixed in Version | => 7.7.0 |