def shape_factory_from_coords(neighbor_coords, ref_shape):
    """ Factory function to create a shape given coordinates.
        Use a reference shape as a template.
        
    @param neighbor_coords List of Coord objects for neighboring points
        
    @param ref_shape Shape object of appropriate type for template
        
    @retval Shape object of appropriate type
    
    """
    shape = ref_shape.copy()
    shape.build_from_coords(neighbor_coords)
    return shape