I am trying to write a function which will skin solid elements by group using undocumented jd_create_elem_skin(). It looks like jd_create_elem_skin() takes as input:
element IDs, face IDs, number of elements and some boolean. I tried to obtain elements and free faces after PCL documentation using:
db_get_elems ()
db_get_elem_shape_for_id()
fem_u_get_free_faces()
It looks like the script fails at fem_u_get_free_faces() producing face ID array filled with 0. Could you help to debug the script?
try the following and compare with the original to see what I changed.
Hopefully it makes sense to you but in summary
i_max_faces is the maximum number of faces possible for any element - so 8 here.
then use the output arrays of the get free faces call in the skin function. Now the number of elements being created is equal to the number of free faces (not the original number of elements). The ia_face_el_ids and the ia_face_ids arrays are processed in parallel, so the nth entry in each is an element ID and a Face ID to define a new element. Only the first i_free_faces in each array are populated with numbers not equal to 0, the array was sized to be num_elem * i_max_faces just in case every element is not connected to any other element.