fix a bug in gx script which cause error when there is no full layer termination; expand the geometric feature of tetrahedral by considering top angle offset and distal oxygen length offset