Selection of edges, vertex, faces of solid in shaper TUI

Hello,
I am trying to use shaper for the creation of my geometry and would like to add a fillet to the resulting edges between several intersecting spheres that are fused together.
my issue is that I don’t understand how the selection function works.
when I do it for two spheres in GUI and dump it in a python script. for the fillet creation I am getting the following line:

Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "Fuse_1_1/Generated_Edge&Sphere_2_1/Face_1&Sphere_1_1/Face_1&new_weak_name_1")], 2, keepSubResults = True)

what I get from it, is that model.addFillet has 4 arguments, the document, the edges where it should add the fillet, the radius, and if it keeps the sub results. my problem is with the second argument,

model.selection("EDGE", "Fuse_1_1/Generated_Edge&Sphere_2_1/Face_1&Sphere_1_1/Face_1&new_weak_name_1")

is used for the selection of the edges, and I get that model.selection has two arguments, the first one the type, but the second one I do not understand at all how it is created/ how to do it (the logic behind it)
for the selection of a complete feature I use the .result() (for example for the creation of the sphere with its center in Point_1, I use:

Sphere_1 = model.addSphere(Part_1_doc, Point_1.result(), 10)

but originally from the dump study I get:

Sphere_1 = model.addSphere(Part_1_doc, model.selection("VERTEX", "all-in-Point_1"), 10)

as in the previous case, I don’t understand the “all-in-Point_1” (I know it is shown as the text entry in the GUI if the Sphere_1 was created using GUI)
any help would be appreciated as I am completely blocked as there is no info about this in the TUI example.
best regards.

Hello Franco,
did I understand you correctly? Two spheres merge with each other. The intersection line should be rounded.

This case works for me. Look at my script.

with kind regards
Fillet_Test.hdf (151,5 KB)

Hello luve,
I am not currently in the pc to open it but I will do it this afternoon, nevertheless,
Thanks for sharing it, but I was looking to find this in the TUI, not in the Gui of Salome (here I know how to do it). And if you created like that and the executed the script and you shared the .hdf result, the original script that created it, as far as I know it is lost in the sens that if you ré dump it into script the variables are executed, the loops and ifs will be already runned so I will be not able to get the info I am looking for.
Just for info in my side, I solved the issue by using this line:

model.selection("EDGE", "Fuse_1_1/Generated_Edge") 

The thing is, I want to understand it not only make it work. And the “Fuse_1_1/Generated_Edge” does not have a clear explanation from the doc. As for example where is coming from the second “_1”? The original object/function where I fuse the objects it is called Fuse_1 only and not Fuse_1_1, what happens if I have another function that is called Fuse_1_1 before calling this one? Furthermore this function (model.selection) has as input a string to identify an object in shaper? What I was looking was an explanation for how it works…

Regards

Hi,

there are several ways to select sub-shapes in SHAPER. In the script test_fillet.py (6,3 Ko), I show:

  1. selection by naming. It is the internal name of the sub-shapes in SHAPER to be able to select them in a stable way. This name can hardly be guessed. A manual selection in the graphic interface and python dump allows to get these names.

  2. guess the internal names from the selected names, if it can be :wink:

  3. select all the edges of a feature’s result, with all-in- prefix + the name of the feature. It might select more edges than needed (but in this case it works)

  4. selection by coordinates. This has to be the coordinates of a point on the sub-shape. Either you know them (because you have built your model), or you can get them by dump by coordinates available via the menu Part> Dump. It is like GetEdgeNearPoint, GetFaceNearPoint, GetBlockNearPoint in geompy.

  5. selection by filter (like for group’s creation). In this case, I used the filter FeatureEdges to select all the edges at the intersection of the spheres (not continuous faces)

  6. selection by the filter EdgeSize to select the edges in a range of sizes. You might use other filters depending on your use case.

Best regards,

Christophe

Hello christophe,
thanks for your answer,
actually what I was “looking” help for was exactly your two last approaches (5 and 6), as thats what I was trying to do, “smart” selections, nevertheless, this brings me to the following questions about them:

  1. just to confirm, this filter selection is only implemented in the group creation feature (in GUI) no? or is it possible to use it in other features? I did not see anywhere in the GUI to use the ‘selection by filter tool’ outside of the groups.
  2. where can I find the different possible filters names for TUI?, i see several of them (not sure that there are all of them) in doc\salome\gui\SHAPER\FiltersPlugin\FiltersPlugin.html but it does not mention the name used in TUI. I imagine that is the same one but without spaces and all words with capital letter in the begining?
    best regards,
    F.
  1. Yes, in GUI it is only available for group creation for now. But in python it can be used in any feature.
  2. The filters name in TUI can be got in src/FiltersPlugin/Test/TestFilters_Supported.py. Or by creating a group with the wanted filters and python dump.

Christophe

Cita 1. Yes, in GUI it is only available for group creation for now. But in python it can be used in any feature.

thanks to confirm this, I thought I was missing something

Cita 2. The filters name in TUI can be got in src/FiltersPlugin/Test/TestFilters_Supported.py. Or by creating a group with the wanted filters and python dump.

wow. I did not know about this python tests, it is not mentionned elsewhere. I will dig in them to learn a little bit more about scripting with SHAPER, as it is not so direct as with geometry. thanks in any case.
F.

1 Like