In an LS-DYNA simulation, a hole is formed in a part. How can i automatically measure the diameter of this hole, and how it changes through the thickness of the part.
Attached is a Python script to achieve this. The script loads d3plot results using PyDPF, extracts cross-sections of the deformed mesh, rasterizes the cross sections into images, uses image processing techniques to detect internal holes, identifies the largest hole and finally, fits a circle. The script creates a visualization like below, for interrogation: on the left is the sliced mesh; in the middle is the rasterized image with the internal hole detected; on the right is the circle fit.
Version 2 of the script is attached, which includes reflection, to deal with models that utilise symmetry. Note: the script can only find closed holes.