Feedback for "contact" - mkraska/meclib GitHub Wiki
fb_contact(o, n, i, description)
olist of objectsnnames fieldiindex ofcontactobjectdescriptionstring with text to identify the object for the user
These functions provide Feedback for Free Body Diagrams.
"contact" represents a frictionless contact point. It is to be replaced by a single normal reaction force once the referenced (cut-away) object is deactivated.
Checks done by fb_contact():
- Is the object really of type "contact" (just for developers)?
- Is the referenced object (
targetRef, resolved by name or by 1-based index viafb_resolve_ref()) found and unambiguous? - Is the referenced object deactivated? If not, the referenced object is named in the feedback (or, if it has no name, reported as "Umgebung bei
targetRef"). - Has meclib found any reactions by proximity check?
- Is there exactly one reaction?
- Is the reaction of type "force"?
- Is the reaction parallel to the contact's normal direction?
fb_resolve_ref(o, ref)
Resolves a targetRef value to an object index: returns ref unchanged if it is already an integer, otherwise searches o for an object whose name matches ref. Returns false if no unambiguous match is found.
This is required because the "contact" object contains references that can either be a numerical index or a name.
Typical PRT
Feedback variables:
obj: stackjson_parse(objects);
[text, isOK]: fb_contact(obj, names, i_N, "Kontakt bei N: ");
PRT node test for correct direction
Algebraic test for isOK = true and feedback of {@text@} for both branches.