Get the face of the HLR projection direction

LJK

Looking around for some CAD
How to get all the faces of the model in the HLR projection direction?
1657782967230.png
It is assumed that annotations 1 and 2 are the faces to be identified in the projection direction. These vertical faces are easy to obtain, so how to capture the faces in other projection directions?
 

natalia

CAD community veteran
Hi LJK,

Please give more details about this case. What do you mean under HLR projection? Do you prepare HLR presentation with help of OCCT?
How this topic relates to this one?

Regards, Natalia
 
Last edited:

JSlyadne

Administrator
Staff member

JSlyadne

Administrator
Staff member
How to get all the faces of the model in the HLR projection direction?
View attachment 332
It is assumed that annotations 1 and 2 are the faces to be identified in the projection direction. These vertical faces are easy to obtain, so how to capture the faces in other projection directions?
The similar question, where the edges were a point of interest, was discussed here.
 

LJK

Looking around for some CAD
Hi LJK,

Please give more details about this case. What do you mean under HLR projection? Do you prepare HLR presentation with help of OCCT?
How this topic relates to this one?

Regards, Natalia
Hi Natalia,thanks for your reply。Maybe my question is not clear。The core of my problem is to artificially set a projection direction, similar to that when the sun shines on the object, it will leave a shadow. What I want to do is how to extract the face of the object that is hit by the sun in the projection direction.
 

LJK

Looking around for some CAD
The similar question, where the edges were a point of interest, was discussed here.
Hi JSLydne.Thank you for your advice .But what I currently need is not the outline of the model, but the faces I can see on the model in the projection direction I set. Similar to a sunlit object, the sunlit side of the object is my desired side. Finally thank you very much for your reply.

 

JSlyadne

Administrator
Staff member
Hi JSLydne.Thank you for your advice .But what I currently need is not the outline of the model, but the faces I can see on the model in the projection direction I set. Similar to a sunlit object, the sunlit side of the object is my desired side. Finally thank you very much for your reply.

Even if HLRBRep_HLRToShape doesn't provide the API for extracting the filtered faces, you might look inside its implementation and follow the way it extracts the edges. There you'll see that these edges are extracted from the faces stored in another class, and I believe these faces is what you're looking for and, likely, there should be a way to access them as well.

However, if you're not interested in getting the edges, OCCT's HLR algorithm might be excessive, and implementation of custom function would be worth to try. You might want to investigate the sources how this algorithm treats the faces - if it's visible or not, and adapt this code according to your needs.

Typically such a kind of problems are solved by intersection of a ray with BVH structure of tessellation mesh, where each triangle has a back-reference to originated topological face.
 

LJK

Looking around for some CAD
Even if HLRBRep_HLRToShape doesn't provide the API for extracting the filtered faces, you might look inside its implementation and follow the way it extracts the edges. There you'll see that these edges are extracted from the faces stored in another class, and I believe these faces is what you're looking for and, likely, there should be a way to access them as well.

However, if you're not interested in getting the edges, OCCT's HLR algorithm might be excessive, and implementation of custom function would be worth to try. You might want to investigate the sources how this algorithm treats the faces - if it's visible or not, and adapt this code according to your needs.

Typically such a kind of problems are solved by intersection of a ray with BVH structure of tessellation mesh, where each triangle has a back-reference to originated topological face.
Hi JSLydne.Thank you for your advice,(y)I'll give it a try.If I succeed, I will post my method and experience in the forum.
 
Top