added near functions for PLine and PGon