Added new factory function for rects from points