Modeling question on prerequisites for association

Hi all but especially @Bob_Obara and @johnt,

I’m trying to model surface adhesion and sliding contact between anatomical organs for aeva. These contacts relate side sets on 2 organs (e.g., femur and ACL) to each other. At the point in the workflow where users provide information on adhesion and contact,

  • surface and volume components will have an attribute representing the organ they correspond to (e.g., femur, ACL, tibia) associated to them.
  • side sets (additional components related to the surface and volume components by virtue of belonging to the same parent model) will have been created; they have an integer property marking them as side/node sets.
  • an attribute for the adhesion or contact will already exist (the template file will be pre-populated with the contacts/adhesions to be modeled).

Is there a way to mark the adhesion/contact attribute-definition association rule so that

  • only side sets tagged with a particular organ are shown in the user interface? At this point, I understand that there is no way to say “any component that has the side-set property and whose model contains a primary-geometry component associated with organ X.” That means users will have to associate the side set with the organ directly, but this should be simple. What I am asking is whether the association rules allow property checks (i.e., is the “side-set” property present?) and prerequisites (i.e., is the component already associated with organ X?) simultaneously.
  • 1 or more side sets from each of the organs involved must be associated to be valid (i.e., associating 2 femur side sets is invalid, 2 ACL side sets is invalid, but 1 of each is valid as is 2 of each)?

On a related note, would it be a horrible idea to allow attribute instances to specialize/parameterize their definitions?

Currently, I am creating a surface adhesion attribute definition and a femur bone-acl adhesion definition that inherits surface adhesion, but what I would really like is an attribute instance named femur bone-acl adhesion of type surface adhesion that restricts its associations by forcing a prerequisite association to the femur bone or ACL organ attributes.

Python Association Rules might come in very handy for what you need to do:
https://gitlab.kitware.com/cmb/smtk/-/blob/master/doc/release/notes/changes_to_attribute.md#introduce-custom-association-rules

Also, if you set femur bon-acl as the bone-type property value for your femur bone-acl adhesion attribute instance then you can pick up that value in the association rule and use it to determine what you need to do.

1 Like

I can’t add much to Ahmed’s comment, but for what it’s worth:

  • Regarding your first item about mixing property and association rules, no, there’s nothing in smtk to natively support that. (Wish there was…)

  • As for the association validity question, have you ruled out using two ComponentItem definitions in lieu of the attribute association?

Thanks, I had not thought of the Python association rules!

I did, but the user interface we have makes that kinda painful. Instead of selecting the 2 things I want to tie together and associating to an attribute, I have to select them one at a time even though the attribute doesn’t care about ordering.