Thx, ron!
nice one:) It's very helpful for me.
As to the line-boundary question, either way you mentioned will be ok if there are inside boudaries. We have to give the routine some hints, I guess. But, if there is only one boundary, the outside boundary, could you let the routine recoginze it automatically, no matter the outside boundary is made of lines or circles or splines?