def extract_pillar_shape(grid):
    """Returns string indicating whether whether pillars are curved, straight, or vertical as stored in xml.

    returns:
       string: either 'curved', 'straight' or 'vertical'

    note:
       resqml datasets often have 'curved', even when the pillars are actually 'vertical' or 'straight';
       use actual_pillar_shape() method to determine the shape from the actual xyz points data
    """

    if grid.pillar_shape is not None:
        return grid.pillar_shape
    ps_node = grid.resolve_geometry_child('PillarShape')
    if ps_node is None:
        return None
    grid.pillar_shape = ps_node.text
    return grid.pillar_shape