How to check if a face 'belongs' to surface

ilpup

CAD practitioner
How to check if a face is a sub-surface of a bigger surface ?

I have attached an example step file. By iterating over entities I get the following:

Found StepShape_OpenShell with name 'Join'
Found StepShape_FaceSurface with name 'Join'
Found StepShape_FaceSurface with name 'Join'
Found StepShape_FaceSurface with name 'Join'
Found StepShape_FaceSurface with name 'Join'
Found StepShape_FaceSurface with name 'Join'
Found StepShape_FaceSurface with name 'Join'


So StepShape_OpenShell is the complete surface and there are 6 StepShape_FaceSurface.

By digging into documentation, I found nothing useful.
I was thinking that maybe I have to transform from StepShape_ --> Geom_ , or something else. Or maybe use a more high level approach using TDF_Label.

Thanks for any suggestion

1659334014548.png
 

Attachments

  • example_surface.stp
    29.2 KB · Views: 3

Quaoar

Administrator
Staff member
@ilpup Hello there.

Is there a reason why you're working directly with STEP entities and not translate them into OpenCascade's geometry?

The problem with your model is that each face is a spline surface living in its own restricted UV space and not knowing other faces' domains. Therefore, you cannot easily check that these splines are all coplanar unless you convert them into analytical planes. A planar surface is apparently infinite in all directions (unlike splines), so you can then check if all neighboring faces geometrically reside on the same plane.

Actually, you don't even need to convert splines or edit them anyhow. The easiest solution might be checking the positions of control points to see that all points lie on the same plane. I did a couple of quick conversions to see if all these faces can be turned into a single plane, and it seems it can be done.

Not sure if it helps, let me know.
 

Attachments

  • canrec-planes.gif
    canrec-planes.gif
    852.5 KB · Views: 9

ilpup

CAD practitioner
Thank you very much Quaoar.
Maybe my question was a bit stupid:)... in fact I was only trying to better understand how the library handles the conversion of step entities.
I think in the specific an OPEN_SHELL item is declared in step file because the surfaces are joined. I think in the translation opencascade check if a face has a reference to same sort of higher topology, which is then used as default output. So in the viewer an open shell is show and not the single surfaces.


1659950598139.png
 

Quaoar

Administrator
Staff member
This OPEN_SHELL entity says that the contained faces should be considered as one group, but it does not express sharing. For the shared edges, it would be necessary to go down to the FACE_OUTER_BOUND and EDGE_LOOP entities to see if the same edge is used twice. Or just let OpenCascade translate those entitles to the geometric/topological data structures and then check it all through the modeling API.
 
Top