Many of the parts that I mesh contain a significant number of bolt holes. In order to make the highest quality mesh possible, I have found that it is far better to imprint a square around the hole rather than a circle. This square (with a hole in the middle) gets divided into four sections. The number of elements along each edge depends on the size of the hole, but for most of the holes I am dealing with, I can use two elements along the edge of the hole (making for 8 elements total around the hole), two elements on the 'spokes' between the edge of the hole and the edge of the square, and three elements on each half of the edges of the square. As can be seen in the images below (associated model can be found here: ), this allows for a mesh of far higher quality than a simple washer permits.


The obvious downside is that it is much more tedious to produce. Therefore, I would very much like to find a means of automating this procedure. As such, I have the following questions:
- Is anyone aware of something that has already been written to do this so I don't have to write it myself?
- Given a line ID, is it possible to identify the planar surface associated with it? (Note: I want to distinctly identify the planar surface and not the cylindrical surface since I don't care about the cylindrical surface.)
- Given a surface ID, is it possible to get a list of lines that define the boundaries of that surface?
- Given two line IDs, is it possible to get the shortest distance between the two lines?
- Given two line IDs, is it possible to split the first line at the point nearest to the second line?
I am fairly comfortable in TCL at this point, so that isn't an issue. Also, I'm well aware that doing things like determining the shortest distance between a circle and a straight line are relatively straightforward geometry calculations, but I'm primarily asking if there are built in functions to accomplish these things so I don't have to write the code myself.
Sorry for all the questions, but if you can answer just one of them, I'd greatly appreciate it. Thanks!