View Issue Details

IDProjectCategoryView StatusLast Update
0032076CommunityOCCT:Visualizationpublic2022-11-01 18:30
Reporteralexzkw Assigned Toalexzkw  
PrioritynormalSeverityminor 
Status feedbackResolutionopen 
PlatformWindowsOSWindows 
Product Version7.3.0 
Summary0032076: Strange mesh normal in cone apex
DescriptionIn OCC 7.3.0 the normal of the node in the apex of the cone was (0,0,0), now it is some strange direction
Steps To Reproduce1) Load cone shape in .brep file
2) Use the following mesher to generate the appropriate mesh:

BRepMesh_IncrementalMesh mesh(cone_face, 0.56993390835593716, 0 0.87266465028127038);
TopLoc_Location loc;
const Handle_Poly_Triangulation& triang(BRep_Tool::Triangulation(cone_face, loc));
auto normal = triang.Normal(5); //Was 0, 0, 0 in OCC 7.3.0, now strange direction
TagsNo tags attached.
Test case number

Attached Files

  • cone.brep (2,984 bytes)

Relationships

related to 0021753 resolvedmzernova Open CASCADE Visualization - improve shaded display of conical objects 

Activities

alexzkw

2021-01-22 15:06

reporter  

cone.brep (2,984 bytes)

oan

2022-11-01 18:27

developer   ~0111826

@alexzkw,

Due to the fact that there are several methods to compute normals, it is not responsibility of BRepMesh which is used to produce triangles only.
In particular, normals are useful in context of visualization, thus visualization part generates normals on its own and further uses Poly_Triangulation to cache this data.
So, having initial shape without triangulation and passing it to BRepMesh, you will obtain result with triangulation, but without normals which looks like the behavior you need (do not forget to use Poly_Triangulation::HasNormals() method to check that there is normal data at all). By the way, it is rather incorrect to rely on hardcoded index in hope that it will always correspond to the apex. Depending on some conditions or order of processing it may be different.

Like this, the reported problem seems representing some side effect of your application, but, unfortunately, not the true state of the things.
Probably, it would be the following issue:
- you generate or have a shape with already generated mesh;
- this shape is displayed in 3d viewer (which generates and updates normals data);
- then the shape is passed to incmesh which leaves previous data untouched as fitting the specified deflection;
- you check existing triangulation pre-processed by visualization part for normals and notice that normal data is far different from expected.

You can prove yourself by adding the same check for normal data right before the call to BRepMesh_IncrementalMesh.
If there is triangulation and normal data, that's it.

However, if the problem is also in changed directions of normals produced by visualization part, you may figure it out directly with visualization experts.
I will change category of the issue anyway.

In general, I see no issue here in context of BRepMesh, so it could be closed.

Issue History

Date Modified Username Field Change
2021-01-22 15:06 alexzkw New Issue
2021-01-22 15:06 alexzkw Assigned To => oan
2021-01-22 15:06 alexzkw File Added: cone.brep
2021-01-22 15:10 kgv Relationship added related to 0021753
2022-11-01 18:27 oan Note Added: 0111826
2022-11-01 18:28 oan Assigned To oan => alexzkw
2022-11-01 18:28 oan Status new => feedback
2022-11-01 18:28 oan Category OCCT:Mesh => OCCT:Visualization