FaceGroupsSeparatedByEdges() - physical ordering of the faces

Hi,

I am using .FaceGroupsSeparatedByEdges() for a meshed structure. When I create the faces, the order that faces are created in does not seem to follow a logical or predictable structure.

For the simple case of a cube it looks to follow -x , +x, -y, +y, -z,+z in that order (where +x is the furthest most x faced side, and -x vice versa).
For more complex geometries where I have partitioned and exploded multiple bodies together it is almost random.
Essentially it would be good to know what the face number is of the lowest surface in the x-y plane (so lowest z- coordinate face) without manually going on the GUI and going through the surfaces.
I can’t see anything in the documentation and I can’t find the module source code either.
Any direction would be great, thanks.

I have solved this for my personal case using the BoundingBox function to loop through and find the specific face which corresponds to the one I need.

However I would still be interested in how the faces are ordered for more complicated geometries and if there is a logical order which I was missing.

Hi Patrick - I am curious too! I have been handling this kind of thing for a couple years with BoundingBox() like you but also GetProperties() is useful since it will give you centroidal coordinates of shapes. I think you can find info on the 3D sequencing of output shape ID lists output in ExtractShapes() documentation. I find I am saving myself time with print(item.function.doc) in the Python console (e.g. print(myshape.ExtractShapes.doc)) I try to avoid the GUI as much as I can - so the above is predicated on script kidde mentality. Cheers!

note also there are suppoeed to be doubled underscores on either side of ‘doc’ in my earlier note. something in render i do not understand or care about.

Hi Windy - Yes that’s exactly how I did it. I actually used GetBoundingBox from the SMESH module (which is apparently very different to simply BoundingBox from Geompy) so I could determine which face I was looking for with a bit of maths.

The interesting thing I noticed when I iterated through a few designs was that the numbering of the faces actually often changed with finer / coarser meshes. I assumed the 3D sequencing algorithm would be based on the geometry and not the meshing but it looks like that is not quite the case!

Ah, I am not sure how to help without being closer to the detail. When you say “numbering of the faces” are you referring to the face numbers that the system puts on faces that ‘appear’ in the Salome object browser as a result (byproduct) of meshing in ‘SMESH’? I ask you this because I think the connection between the label in the object browser and the exact numerical ID of the faces in the shape database for each part (e.g. in ‘GEOM’ module) is loose and can be overridden. I don’t know how it works exactly, but it might even involve random integers. Recently I have had to write scripts to name specific faces in ‘GEOM’ and then mesh the edges and faces of those specifically as ‘submesh’ in ‘SMESH’ and to be able to see it all I have been attaching labels and publishing as I go so I can check what I am doing (and what I think I am doing :slight_smile: ) Cheers, Patrick - Kirk