View Issue Details

IDProjectCategoryView StatusLast Update
0021753Open CASCADEOCCT:Visualizationpublic2024-04-08 13:11
ReporterabvAssigned Tomzernova  
PrioritynormalSeverityminor 
Status resolvedResolutionopen 
OSAll 
Product Version7.8.1 
Target Version7.8.1 
Summary0021753: Visualization - improve shaded display of conical objects
DescriptionShading of truncated conical objects in OCC viewer looks as if Gouraud shading
was not applied: edges between triangles are very visible due to sharp change
of reflected color. See attached image (shaded_cone.gif).

Note that in case of cylinder (or even cone very close to cylinder) shading is
very nice and smooth (see shaded_cylinrdical_cone.gif).

Also shading is smooth for most of the surface of complete cone, though it is
bad on its seam (see shaded_complete_cone.gif).

Here are DRAW commands to create test cones shown on pictures:

- Truncated cone:
Draw{}> pcone p 1 100 100

- Cylindrical cone:
Draw[]> pcone p 99 100 100

- Complete cone:
Draw[] pcone p 0 100 100

The problem is clearly connected with the fact that normals at the corners of
the triangles (used for smoothing) are not taken from the surface but computed
somehow like by averaging normals of each two neighboring triangles. In the
case of truncated cone well-shaped triangles are alternating with very narrow
ones, and likely this causes normals to be computed inadequately.

To solve this problem we can either take normals directly from underlying
surface (which is most correct approach, though probably not so fast), or
improve somehow current algorithm (e.g. do averaging of normals using weights
proportional to area / angle of each triangle connected in the node).
TagsNo tags attached.
Test case numberNot needed

Attached Files

  • shaded_cone.gif (34,615 bytes)
  • shaded_cylinrdical_cone.gif (19,312 bytes)
  • shaded_complete_cone.gif (32,209 bytes)
  • badTruncConeR10.JPG (36,644 bytes)
  • badSeamEdge.JPG (35,635 bytes)
  • ConeComparison_1.png (335,213 bytes)
  • ConeComparison_2.png (271,815 bytes)
  • ConeNormals.png (163,422 bytes)
  • cone_KO.png (99,446 bytes)
  • cone_OK.png (95,514 bytes)
  • cone_KO_phong.png (99,971 bytes)
  • cone_OK_phong.png (96,797 bytes)
  • CR21753.png (143,722 bytes)
  • sphere.png (529,862 bytes)
  • cone_after_1_100_100_issues.png (112,909 bytes)
  • cone_after_50_100_100_edges.png (323,199 bytes)
  • cone_after_tesselation_issues.png (388,026 bytes)
  • cone_before_0_100_100.png (51,842 bytes)
  • cone_before_0_100_100_2.png (94,798 bytes)
  • cone_before_1_100_100.png (109,796 bytes)
  • cone_before_tesselation_issues.png (266,113 bytes)
  • cone_after_0_100_100.png (117,649 bytes)
  • cone_after_0_100_100_without_bad_seams.png (53,702 bytes)
  • cone_after_1_100_100.png (97,981 bytes)
  • cone_after_1_100_100_edges.png (674,221 bytes)
  • cone_after_1_100_100_issues_edges.png (576,940 bytes)
  • image.png (15,985 bytes)

Relationships

related to 0024268 closedbugmaster Open CASCADE Wrong triangulation on the boundaries of the cones 
related to 0024250 closedbugmaster Open CASCADE TKOpenGl - per-pixel lighting using GLSL program (Phong shading) 
related to 0032076 feedbackalexzkw Community Strange mesh normal in cone apex 

Activities

2010-05-21 18:48

 

shaded_cone.gif (34,615 bytes)

2010-05-21 18:49

 

shaded_cylinrdical_cone.gif (19,312 bytes)

2010-05-21 18:49

 

shaded_complete_cone.gif (32,209 bytes)

2010-08-16 13:54

 

badTruncConeR10.JPG (36,644 bytes)

2010-08-16 13:55

 

badSeamEdge.JPG (35,635 bytes)

dbp

2013-10-11 16:09

developer  

ConeComparison_1.png (335,213 bytes)

dbp

2013-10-11 16:10

developer  

ConeComparison_2.png (271,815 bytes)

dbp

2013-10-11 16:10

developer  

ConeNormals.png (163,422 bytes)

dbp

2013-10-11 16:17

developer   ~0026053

The rendering results with Phong shading shader program was attached:

1. ConeComparison_1.png shows smooth-looking shading on "regular" triangles of the cone.

2. ConeComparison_2.png shows discontinuity in colors on the "border" edge.

3. ConeNormals.png shows result of simple "normal" shader: normals are treated as colors. It is easy to see that surface normals are discontinuous.

kgv

2016-05-05 14:10

developer   ~0053839

These degenerated cases can not be (efficiently) handled on visualization layer after triangulation has been already computed.

Thus, most optimal solution to avoid visual artifacts would be extending BRepMesh algorithm with an option to prepare triangulation taking into account limitations of visualizer. E.g. degenerative vertex should be duplicated in triangulation (with different precomputed normales); narrow triangles should be split into more triangles (cut cone).

git

2016-05-05 17:35

administrator   ~0053861

Branch CR21753 has been created by kgv.

SHA-1: 533ef08392537212dc115116d305d37885cc594a


Detailed log of new commits:

Author: kgv
Date: Thu May 5 17:35:24 2016 +0300

    0021753: Visualization - improve shaded display of conical objects
    
    StdPrs_ShadedShape - duplicate nodes originated from degenerated edge with normal to triangle.

kgv

2016-05-05 17:37

developer  

cone_KO.png (99,446 bytes)

kgv

2016-05-05 17:37

developer  

cone_OK.png (95,514 bytes)

kgv

2016-05-05 17:38

developer  

cone_KO_phong.png (99,971 bytes)

kgv

2016-05-05 17:38

developer  

cone_OK_phong.png (96,797 bytes)

kgv

2016-05-05 17:44

developer   ~0053864

You can see the prototype implementing handling of degenerated Edge on StdPrs_ShadedShape level in branch CR21753. The nodes originated from degenerated Edge are duplicated with normal computed from triangle itself.

Note that apart from normal it is not possible to restore UV texture coordinates for such duplicated nodes at StdPrs_ShadedShape. So extending triangulation algorithm might provide better results.

abv

2016-05-10 21:16

manager  

CR21753.png (143,722 bytes)

abv

2016-05-10 21:18

manager   ~0053975

I confirm that the fix produces much better image on full cone than on master. There seem to be no visible difference in how textures ae mapped. See attached image CR21753.png.

kgv

2016-05-16 14:28

developer   ~0054057

> There seem to be no visible difference in how textures ae mapped.
> See attached image CR21753.png.
Patch does not introduce changes for UV texture coordinates - at visualization time there is not information to guess / reconstruct this information properly for available degenerate node.

Therefore texture is mapped with artifacts near to the cone top.

kgv

2016-06-14 09:56

developer   ~0054935

Please review the patch.

san

2016-06-14 13:49

developer   ~0054950

Branch CR21753 reviewed without remarks, ready for testing.

git

2016-06-14 16:39

administrator   ~0054970

Branch CR21753 has been updated forcibly by mkv.

SHA-1: 9a17f43739c389010e77f841f5db1043c2edfe56

mkv

2016-06-15 14:18

tester   ~0055015

Dear BugMaster,
Branch CR21753 was rebased on current master of occt git-repository.
SHA-1: 9a17f43739c389010e77f841f5db1043c2edfe56

mkv

2016-06-15 14:18

tester   ~0055016

Dear BugMaster,
Branch CR21753 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: 9a17f43739c389010e77f841f5db1043c2edfe56

Number of compiler warnings:

occt component :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

products component :
Linux: 72 (72 on master)
Windows: 4 (4 on master)
MacOS : 1148

Regressions/Differences/Improvements:
http://occt-tests/CR21753-master-OCCT/Debian70-64/summary.html
http://occt-tests/CR21753-master-OCCT/Windows-64-VC10/summary.html
Failed:
  bugs vis bug173_1, bug173_2, bug173_3, bug22701
  bugs xde bug23969
http://occt-tests/CR21753-master-Products/Debian70-64/summary.html
http://occt-tests/CR21753-master-Products/Windows-64-VC10/summary.html
Failed:
  dxf read F5, F7, G1
  sat read E6

Testing cases:
Not needed

Testing on Linux:
occt component :
Total MEMORY difference: 88221360 / 88097063 [+0.14%]
Total CPU difference: 19506.319999999985 / 19425.25999999997 [+0.42%]
products component :
Total MEMORY difference: 27499885 / 27490548 [+0.03%]
Total CPU difference: 5127.929999999984 / 5118.629999999994 [+0.18%]

Testing on Windows:
occt component :
Total MEMORY difference: 55878201 / 55844043 [+0.06%]
Total CPU difference: 18285.095611398763 / 19040.46805349891 [-3.97%]
products component :
Total MEMORY difference: 18657026 / 18608765 [+0.26%]
Total CPU difference: 4980.4723258999475 / 5052.700788899949 [-1.43%]

There are following differences in images found by testdiff.
http://occt-tests/CR21753-master-OCCT/Debian70-64/diff-Debian70-64.html
http://occt-tests/CR21753-master-OCCT/Windows-64-VC10/diff-Windows-64-VC10.html
IMAGE v3d materials bug24855: bug24855_gold.png differs
IMAGE v3d materials bug24855: bug24855_rt_copper.png differs
IMAGE v3d materials bug24855: bug24855_rt_neon_phc.png differs
IMAGE v3d materials bug24855: bug24855_obsidian.png differs
IMAGE v3d materials bug24855: bug24855_phong_satin.png differs
IMAGE v3d materials bug24855: bug24855_charcoal.png differs
IMAGE v3d materials bug24855: bug24855_phong_plaster.png differs
IMAGE v3d materials bug24855: bug24855_rt_pewter.png differs
IMAGE v3d materials bug24855: bug24855_phong_gold.png differs
IMAGE v3d materials bug24855: bug24855_steel.png differs
IMAGE v3d materials bug24855: bug24855_rt_bronze.png differs
IMAGE v3d materials bug24855: bug24855_aluminium.png differs
IMAGE v3d materials bug24855: bug24855_phong_aluminium.png differs
IMAGE v3d materials bug24855: bug24855_phong_charcoal.png differs
IMAGE v3d materials bug24855: bug24855_phong_plastic.png differs
IMAGE v3d materials bug24855: bug24855_phong_chrome.png differs
IMAGE v3d materials bug24855: bug24855_rt_stone.png differs
IMAGE v3d materials bug24855: bug24855_rt_chrome.png differs
IMAGE v3d materials bug24855: bug24855_phong_neon_phc.png differs
IMAGE v3d materials bug24855: bug24855_satin.png differs
IMAGE v3d materials bug24855: bug24855_phong_copper.png differs
IMAGE v3d materials bug24855: bug24855_phong_pewter.png differs
IMAGE v3d materials bug24855: bug24855_rt_charcoal.png differs
IMAGE v3d materials bug24855: bug24855_phong_jade.png differs
IMAGE v3d materials bug24855: bug24855_neon_phc.png differs
IMAGE v3d materials bug24855: bug24855_bronze.png differs
IMAGE v3d materials bug24855: bug24855_rt_steel.png differs
IMAGE v3d materials bug24855: bug24855_plastic.png differs
IMAGE v3d materials bug24855: bug24855_phong_steel.png differs
IMAGE v3d materials bug24855: bug24855_plaster.png differs
IMAGE v3d materials bug24855: bug24855_rt_gold.png differs
IMAGE v3d materials bug24855: bug24855_rt_obsidian.png differs
IMAGE v3d materials bug24855: bug24855_phong_stone.png differs
IMAGE v3d materials bug24855: bug24855_rt_satin.png differs
IMAGE v3d materials bug24855: bug24855_rt_jade.png differs
IMAGE v3d materials bug24855: bug24855_rt_brass.png differs
IMAGE v3d materials bug24855: bug24855_copper.png differs
IMAGE v3d materials bug24855: bug24855_phong_brass.png differs
IMAGE v3d materials bug24855: bug24855_rt_aluminium.png differs
IMAGE v3d materials bug24855: bug24855_brass.png differs
IMAGE v3d materials bug24855: bug24855_jade.png differs
IMAGE v3d materials bug24855: bug24855_rt_silver.png differs
IMAGE v3d materials bug24855: bug24855_silver.png differs
IMAGE v3d materials bug24855: bug24855_pewter.png differs
IMAGE v3d materials bug24855: bug24855_rt_plastic.png differs
IMAGE v3d materials bug24855: bug24855_phong_bronze.png differs
IMAGE v3d materials bug24855: bug24855_chrome.png differs
IMAGE v3d materials bug24855: bug24855_rt_plaster.png differs
IMAGE v3d materials bug24855: bug24855_phong_obsidian.png differs
IMAGE v3d materials bug24855: bug24855_phong_silver.png differs
IMAGE v3d materials bug24855: bug24855_stone.png differs

IMAGE v3d raytrace bug26617: bug26617.png differs
IMAGE v3d raytrace bug24130: bug24130.png differs
IMAGE v3d raytrace bug24130: bug24130_9.png differs
IMAGE v3d raytrace bug24130: bug24130_3.png differs
IMAGE v3d raytrace bug24130: bug24130_7.png differs
IMAGE v3d raytrace bug24130: bug24130_13.png differs
IMAGE v3d raytrace bug24130: bug24130_15.png differs
IMAGE v3d raytrace bug24130: bug24130_11.png differs
IMAGE v3d raytrace bug24130: bug24130_12.png differs
IMAGE v3d raytrace bug24130: bug24130_4.png differs
IMAGE v3d raytrace bug24130: bug24130_18.png differs
IMAGE v3d raytrace bug24130: bug24130_16.png differs
IMAGE v3d raytrace bug24130: bug24130_19.png differs
IMAGE v3d raytrace bug24130: bug24130_6.png differs
IMAGE v3d raytrace bug24130: bug24130_8.png differs
IMAGE v3d raytrace bug24130: bug24130_10.png differs
IMAGE v3d raytrace bug24130: bug24130_2.png differs
IMAGE v3d raytrace bug24130: bug24130_17.png differs
IMAGE v3d raytrace bug24130: bug24130_5.png differs
IMAGE v3d raytrace bug24130: bug24130_0.png differs
IMAGE v3d raytrace bug24130: bug24130_1.png differs
IMAGE v3d raytrace bug24130: bug24130_14.png differs
IMAGE v3d raytrace bug25201: bug25201.png differs
IMAGE v3d raytrace bug25201: bug25201_0.png differs
IMAGE v3d raytrace bug25201: bug25201_1.png differs
IMAGE v3d raytrace bug25201: bug25201_2.png differs

IMAGE mesh advanced_shading B2: B2.png differs
IMAGE mesh advanced_shading B9: B9.png differs
IMAGE mesh advanced_shading B7: B7.png differs
IMAGE mesh advanced_shading B3: B3.png differs
IMAGE mesh advanced_shading B6: B6.png differs
IMAGE mesh advanced_shading C1: C1.png differs

IMAGE mesh standard_shading H4: H4.png differs
IMAGE mesh standard_shading E3: E3.png differs
IMAGE mesh standard_shading E9: E9.png differs
IMAGE mesh standard_shading X1: X1.png differs
IMAGE mesh standard_shading F4: F4.png differs
IMAGE mesh standard_shading G6: G6.png differs
IMAGE mesh standard_shading K4: K4.png differs
IMAGE mesh standard_shading W5: W5.png differs
IMAGE mesh standard_shading B8: B8.png differs
IMAGE mesh standard_shading O1: O1.png differs
IMAGE mesh standard_shading W9: W9.png differs
IMAGE mesh standard_shading P1: P1.png differs
IMAGE mesh standard_shading U1: U1.png differs
MAGE mesh standard_shading A4: A4.png differs
IMAGE mesh standard_shading J7: J7.png differs
IMAGE mesh standard_shading I8: I8.png differs
IMAGE mesh standard_shading R4: R4.png differs
IMAGE mesh standard_shading N8: N8.png differs
IMAGE mesh standard_shading V3: V3.png differs
IMAGE mesh standard_shading H1: H1.png differs
IMAGE mesh standard_shading W4: W4.png differs
IMAGE mesh standard_shading R5: R5.png differs
IMAGE mesh standard_shading M1: M1.png differs
IMAGE mesh standard_shading R9: R9.png differs
IMAGE mesh standard_shading E7: E7.png differs
IMAGE mesh standard_shading H3: H3.png differs
IMAGE mesh standard_shading F5: F5.png differs
IMAGE mesh standard_shading U6: U6.png differs
IMAGE mesh standard_shading U3: U3.png differs
IMAGE mesh standard_shading G5: G5.png differs
IMAGE mesh standard_shading N9: N9.png differs
IMAGE mesh standard_shading Q7: Q7.png differs
IMAGE mesh standard_shading D5: D5.png differs
IMAGE mesh standard_shading I7: I7.png differs
IMAGE mesh standard_shading U7: U7.png differs
IMAGE mesh standard_shading R6: R6.png differs

IMAGE demo samples drill: drill.png differs
IMAGE demo samples dimensionsglsl: dimensionsglsl.png differs
IMAGE demo samples dimensions: dimensions.png differs
IMAGE demo samples raytrace: raytrace.png differs
IMAGE demo samples bottle: bottle.png differs

IMAGE bugs modalg_4 bug8370: bug8370.png differs
IMAGE bugs modalg_4 bug822_2: bug822_2.png differs
IMAGE bugs modalg_4 bug6725: bug6725.png differs

IMAGE bugs moddata_1 bug54: bug54.png differs

IMAGE bugs modalg_1 buc60905: buc60905.png differs

IMAGE bugs iges bug22715_2: bug22715_2.png differs
IMAGE bugs iges bug306: bug306.png differs
IMAGE bugs iges bug22715_1: bug22715_1.png differs

IMAGE bugs step bug5708: bug5708.png differs
IMAGE bugs step bug26451: bug26451.png differs

IMAGE bugs vis bug331: bug331.png differs
IMAGE bugs vis bug331: bug331_1.png differs
IMAGE bugs vis buc60858: buc60858.png differs
IMAGE bugs vis bug331_1: bug331_1.png differs
IMAGE bugs vis bug25132: bug25132_solid_with_cavities.png differs
IMAGE bugs vis bug25132: bug25132_flight_solid.png differs
IMAGE bugs vis bug24867: bug24867_selected.png differs
IMAGE bugs vis bug24867: bug24867_highlighted.png differs
IMAGE bugs vis bug319: bug319.png differs
IMAGE bugs vis bug316: bug316.png differs
IMAGE bugs vis bug288_4: bug288_4.png differs
IMAGE bugs vis bug288_10: bug288_10.png differs

IMAGE bugs mesh bug25364: bug25364.png differs
IMAGE bugs mesh bug23512_1: bug23512_1.png differs
IMAGE bugs mesh bug23512_2: bug23512_2.png differs
IMAGE bugs mesh bug24022: bug24022.png differs
IMAGE bugs mesh bug25045: bug25045.png differs

IMAGE bugs moddata_2 bug22746_3: bug22746_3.png differs

IMAGE bugs moddata_3 bug23738: bug23738.png differs

IMAGE bugs modalg_2 bug22770_15: bug22770_15.png differs
IMAGE bugs modalg_2 bug22306_2: bug22306_2.png differs
IMAGE bugs modalg_2 bug23651_2: bug23651_2.png differs
IMAGE bugs modalg_2 bug22770_28: bug22770_28.png differs
IMAGE bugs modalg_2 bug22770_8: bug22770_8.png differs
IMAGE bugs modalg_2 bug22770_30: bug22770_30.png differs
IMAGE bugs modalg_2 bug22306_1: bug22306_1.png differs
IMAGE bugs modalg_2 bug22631: bug22631.png differs
IMAGE bugs modalg_2 bug22770_11: bug22770_11.png differs
IMAGE bugs modalg_2 bug22770_9: bug22770_9.png differs
IMAGE bugs modalg_2 bug22770_13: bug22770_13.png differs
IMAGE bugs modalg_2 bug21261_25: bug21261_25.png differs
IMAGE bugs modalg_2 bug22770_14: bug22770_14.png differs
IMAGE bugs modalg_2 bug22818_2: bug22818_2.png differs
IMAGE bugs modalg_2 bug22770_12: bug22770_12.png differs
IMAGE bugs modalg_2 bug22770_24: bug22770_24.png differs
IMAGE bugs modalg_2 bug22770_27: bug22770_27.png differs
IMAGE bugs modalg_2 bug22818_1: bug22818_1.png differs
IMAGE bugs modalg_2 bug22770_26: bug22770_26.png differs
IMAGE bugs modalg_2 bug22306_5: bug22306_5.png differs
IMAGE bugs modalg_2 bug22641: bug22641.png differs
IMAGE bugs modalg_2 bug22770_29: bug22770_29.png differs
IMAGE bugs modalg_2 bug22770_25: bug22770_25.png differs
IMAGE bugs modalg_2 bug23137_2: bug23137_2.png differs
IMAGE bugs modalg_2 bug22770_23: bug22770_23.png differs
IMAGE bugs modalg_2 bug23651_1: bug23651_1.png differs
IMAGE bugs modalg_2 bug22990: bug22990.png differs
IMAGE bugs modalg_2 bug23137_1: bug23137_1.png differs
IMAGE bugs modalg_2 bug22770_10: bug22770_10.png differs

IMAGE bugs modalg_5 bug25127: bug25127.png differs
IMAGE bugs modalg_5 bug25505: bug25505.png differs
IMAGE bugs modalg_5 bug25982: bug25982.png differs
IMAGE bugs modalg_5 bug24758_2: bug24758_2.png differs

IMAGE bugs modalg_6 bug26431_3: bug26431_3.png differs
IMAGE bugs modalg_6 bug26440_3: bug26440_3.png differs
IMAGE bugs modalg_6 bug26440_2: bug26440_2.png differs
IMAGE bugs modalg_6 bug25880: bug25880.png differs
IMAGE bugs modalg_6 bug26440_1: bug26440_1.png differs

http://occt-tests/CR21753-master-Products/Debian70-64/diff-Debian70-64.html
http://occt-tests/CR21753-master-Products/Windows-64-VC10/diff-Windows-64-VC10.html
IMAGE parasolid read C5: C5.png differs
IMAGE parasolid read C6: C6.png differs
IMAGE parasolid read B9: B9.png differs
IMAGE parasolid read C8: C8.png differs
IMAGE parasolid read B7: B7.png differs
IMAGE parasolid read C3: C3.png differs
IMAGE parasolid read B6: B6.png differs
IMAGE parasolid read C9: C9.png differs
IMAGE sat read E4: E4.png differs

mkv

2016-06-15 14:19

tester   ~0055017

Dear kgv,
Branch CR21753 has been rejected due to:
- regressions/differences/improvements
- differences in images

git

2016-06-15 19:48

administrator   ~0055047

Branch CR21753 has been updated by kgv.

SHA-1: db453edb9834f1fd17e90d3eae94bba3a9371ae9


Detailed log of new commits:

Author: kgv
Date: Wed Jun 15 19:48:20 2016 +0300

    fix index of degenerated vertex within multiple faces

kgv

2016-06-15 19:56

developer  

sphere.png (529,862 bytes)

kgv

2016-06-15 19:57

developer   ~0055048

Using normal to the entire triangle introduces artifacts on the sphere (see sphere.png).

oan

2018-11-07 16:58

developer   ~0080850

Please check after integration of #28379.

git

2023-10-18 19:37

administrator   ~0114398

Branch CR21753_1 has been created by drochalo.

SHA-1: 611ba16d81fcf6f02496158afa9b70ebb0cb3623


Detailed log of new commits:

Author: drochalo
Date: Wed Oct 18 17:27:27 2023 +0100

    0021753: Visualization - improve shaded display of conical objects
    
    Removed bad seams from full cone by averaging top vertex normals. Tuned cone mesh subdivision parameters.

drochalo

2023-10-18 20:00

developer   ~0114399

The changes made to the solution resolve the bad seams that occurred in some examples (see figures cone_before_0_100_100.png and cone_before_0_100_100_2.png). Now the very top seems round although not ideal (solution could pass by reduplicating the top vertex for each connecting triangle and giving it the respective face normal) or by allowing to set a 0 normal to the top vertex (currently not possible in OCCT).

Improved cone mesh subdivision which miscalculated the subdivisions on the top and bottom circles causing irregular triangulation (see figure cone_before_tesselation_issues.png). Now the circles top and bottom subdivisions match (compare with figure cone_after_tesselation_issues.png).

To mitigate some of the issues seen in the shading of the cone (figure shaded_cone.gif) a subdivision factor was added to take into account the cone aperture, i.e., a larger difference between the top and bottom radius will lead to more subdivisions (figure cone_after_1_100_100_edges.png) compared with cones whose difference is smaller (figure cone_after_50_100_100_edges.png).

Even after the changes the cone shading still produces results that could be improved by a better meshing algorithm (see figure cone_after_1_100_100_issues.png). This still happens because the fragment shading normal interpolation takes these top triangles which are very narrow and their lateral shift is too abrupt which is something that does not happen with the bottom triangles where that change is smoother.

Nonetheless by looking at figures cone_after_1_100_100.png and cone_after_0_100_100.png, we can see that we obtain better results than before.
cone_after_1_100_100_issues.png (112,909 bytes)
cone_after_50_100_100_edges.png (323,199 bytes)
cone_after_tesselation_issues.png (388,026 bytes)
cone_before_0_100_100.png (51,842 bytes)
cone_before_0_100_100_2.png (94,798 bytes)
cone_before_1_100_100.png (109,796 bytes)
cone_before_tesselation_issues.png (266,113 bytes)
cone_after_0_100_100.png (117,649 bytes)
cone_after_0_100_100_without_bad_seams.png (53,702 bytes)
cone_after_1_100_100.png (97,981 bytes)
cone_after_1_100_100_edges.png (674,221 bytes)
cone_after_1_100_100_issues_edges.png (576,940 bytes)

git

2023-10-19 18:36

administrator   ~0114401

Branch CR21753_1 has been updated by drochalo.

SHA-1: e6a11fa375677eb0284c3f1264c0169abcdfd26c


Detailed log of new commits:

Author: drochalo
Date: Thu Oct 19 16:35:09 2023 +0100

    0021753: Visualization - improve shaded display of conical objects
    
    Update on the method to solve cone apex point issue. Revamped previous solution proposed on CR21753 branch.

git

2023-10-20 17:51

administrator   ~0114404

Branch CR21753_1 has been updated by drochalo.

SHA-1: d9d071e0ce414308d0ae60a20cfb12fcc2ecb7fe


Detailed log of new commits:

Author: drochalo
Date: Fri Oct 20 15:39:46 2023 +0100

    0021753: Visualization - improve shaded display of conical objects
    
    Removal of apex duplication.

drochalo

2023-10-24 17:59

developer   ~0114417

Issue ready for review. Tests done produced minor visual changes in some tests but that do not represent errors induced.
Jenkins test link:
http://jenkins-test-10.nnov.opencascade.com/view/CR21753_1-master-drochalo/view/COMPARE/

mzernova

2024-04-03 14:16

developer   ~0115552

Please check these tests, the values there may need to be updated.

Also check image difference for these tests:
v3d bugs bug21753
v3d bugs bug25300_2
bugs modalg_2 bug5805_42
bugs modalg_7 bug25939
bugs modalg_7 bug25395_1
de_mesh step_read A2
image.png (15,985 bytes)

git

2024-04-05 19:22

administrator   ~0115618

Branch CR21753_2 has been created by drochalo.

SHA-1: 0cf4da2a8f5729bf63ef5468a7d0321b07ac3fc8


Detailed log of new commits:

Author: drochalo
Date: Fri Apr 5 17:21:01 2024 +0100

    0021753: Visualization - improve shaded display of conical objects
    
    Modified cone mesh subdivision parameters.

drochalo

2024-04-08 13:11

developer   ~0115635

Dear Marina,
I have updated the values on the tests as well as made a small correction on the calculations.
New tests on Jenkins shows no major issues - http://jenkins-test-10.nnov.opencascade.com/view/CR21753-master-mzernova/view/COMPARE/
Image differences on the mentioned cases were also solved.

Please review.

Issue History

Date Modified Username Field Change
2010-05-21 18:48 abv CC => san
2010-07-29 13:59 bugmaster Assigned To bugmaster => abv
2010-07-29 13:59 bugmaster Status new => assigned
2011-08-02 11:31 bugmaster Category OCCT:MOA => OCCT:Modeling Algorithms
2013-08-30 17:57 abv Assigned To abv => san
2013-08-30 17:57 abv Category OCCT:Modeling Algorithms => OCCT:Visualization
2013-08-30 17:57 abv Fixed in Version EMPTY =>
2013-08-30 17:57 abv Description Updated
2013-10-11 08:32 abv Relationship added related to 0024250
2013-10-11 15:53 san Assigned To san => dbp
2013-10-11 16:09 dbp File Added: ConeComparison_1.png
2013-10-11 16:10 dbp File Added: ConeComparison_2.png
2013-10-11 16:10 dbp File Added: ConeNormals.png
2013-10-11 16:17 dbp Note Added: 0026053
2014-02-13 10:43 kgv Relationship added related to 0024268
2014-02-13 10:47 kgv Severity trivial => minor
2014-02-13 10:47 kgv Target Version => 6.7.1
2014-04-04 18:16 abv Target Version 6.7.1 => 6.8.0
2014-09-26 09:28 abv Target Version 6.8.0 => 7.1.0
2016-05-05 14:10 kgv Note Added: 0053839
2016-05-05 14:10 kgv Assigned To dbp => abv
2016-05-05 17:26 kgv Summary Bad smoothing in shaded display of conical objects => Visualization - improve shaded display of conical objects
2016-05-05 17:35 git Note Added: 0053861
2016-05-05 17:37 kgv File Added: cone_KO.png
2016-05-05 17:37 kgv File Added: cone_OK.png
2016-05-05 17:38 kgv File Added: cone_KO_phong.png
2016-05-05 17:38 kgv File Added: cone_OK_phong.png
2016-05-05 17:44 kgv Note Added: 0053864
2016-05-05 17:44 kgv Status assigned => feedback
2016-05-10 21:16 abv File Added: CR21753.png
2016-05-10 21:18 abv Note Added: 0053975
2016-05-10 21:19 abv Assigned To abv => kgv
2016-05-16 14:28 kgv Note Added: 0054057
2016-05-16 14:28 kgv Assigned To kgv => abv
2016-06-14 09:56 kgv Note Added: 0054935
2016-06-14 09:56 kgv Assigned To abv => san
2016-06-14 09:56 kgv Status feedback => resolved
2016-06-14 13:49 san Note Added: 0054950
2016-06-14 13:49 san Assigned To san => bugmaster
2016-06-14 13:49 san Status resolved => reviewed
2016-06-14 16:26 mkv Assigned To bugmaster => mkv
2016-06-14 16:39 git Note Added: 0054970
2016-06-15 14:18 mkv Note Added: 0055015
2016-06-15 14:18 mkv Note Added: 0055016
2016-06-15 14:19 mkv Note Added: 0055017
2016-06-15 14:19 mkv Assigned To mkv => kgv
2016-06-15 14:19 mkv Status reviewed => assigned
2016-06-15 14:19 mkv Test case number => Not needed
2016-06-15 19:48 git Note Added: 0055047
2016-06-15 19:56 kgv File Added: sphere.png
2016-06-15 19:57 kgv Note Added: 0055048
2016-06-16 10:34 kgv Assigned To kgv => abv
2016-10-25 09:38 kgv Target Version 7.1.0 => 7.2.0
2017-07-20 11:29 kgv Target Version 7.2.0 => 7.4.0
2018-11-07 16:58 oan Note Added: 0080850
2018-11-07 16:58 oan Status assigned => feedback
2019-07-11 21:40 abv Target Version 7.4.0 => 7.5.0
2020-09-25 20:35 abv Target Version 7.5.0 => 7.6.0
2021-01-22 15:10 kgv Relationship added related to 0032076
2021-09-20 11:08 kgv Target Version 7.6.0 => 7.7.0
2022-10-24 10:43 szy Target Version 7.7.0 => 7.8.0
2023-10-06 13:37 drochalo Assigned To abv => drochalo
2023-10-18 19:37 git Note Added: 0114398
2023-10-18 20:00 drochalo Note Added: 0114399
2023-10-18 20:00 drochalo File Added: cone_after_1_100_100_issues.png
2023-10-18 20:00 drochalo File Added: cone_after_50_100_100_edges.png
2023-10-18 20:00 drochalo File Added: cone_after_tesselation_issues.png
2023-10-18 20:00 drochalo File Added: cone_before_0_100_100.png
2023-10-18 20:00 drochalo File Added: cone_before_0_100_100_2.png
2023-10-18 20:00 drochalo File Added: cone_before_1_100_100.png
2023-10-18 20:00 drochalo File Added: cone_before_tesselation_issues.png
2023-10-18 20:00 drochalo File Added: cone_after_0_100_100.png
2023-10-18 20:00 drochalo File Added: cone_after_0_100_100_without_bad_seams.png
2023-10-18 20:00 drochalo File Added: cone_after_1_100_100.png
2023-10-18 20:00 drochalo File Added: cone_after_1_100_100_edges.png
2023-10-18 20:00 drochalo File Added: cone_after_1_100_100_issues_edges.png
2023-10-19 18:36 git Note Added: 0114401
2023-10-20 17:51 git Note Added: 0114404
2023-10-24 17:57 drochalo Assigned To drochalo => mzernova
2023-10-24 17:57 drochalo Status feedback => resolved
2023-10-24 17:59 drochalo Note Added: 0114417
2024-03-25 12:55 dpasukhi Product Version => 7.8.1
2024-03-25 12:55 dpasukhi Target Version 7.8.0 => 7.8.1
2024-04-03 14:16 mzernova Note Added: 0115552
2024-04-03 14:16 mzernova File Added: image.png
2024-04-03 14:17 mzernova Assigned To mzernova => drochalo
2024-04-03 14:17 mzernova Status resolved => assigned
2024-04-05 19:22 git Note Added: 0115618
2024-04-08 13:11 drochalo Note Added: 0115635
2024-04-08 13:11 drochalo Assigned To drochalo => mzernova
2024-04-08 13:11 drochalo Status assigned => resolved