polliwog/polyline/polyline.py
def oriented_along(self, along, reverse=False):
        """
        Flip the polyline, if necessary, so that it points (approximately)
        along the second vector rather than (approximately) opposite it.
        """
        if self.is_closed:
            raise ValueError("Can't reorient a closed polyline")

        vg.shape.check(locals(), "along", (3,))

        if self.num_v < 2:
            return self

        extent = self.v[-1] - self.v[0]
        projected = vg.project(extent, onto=along)
        if vg.scale_factor(projected, along) * (-1 if reverse else 1) < 0:
            return self.copy().flip()
        else:
            return self

        Flip the polyline, if necessary, so that it points (approximately)
        along the second vector rather than (approximately) opposite it.
        
Flip the polyline, if necessary, so that it points (approximately)
along the second vector rather than (approximately) opposite it.
Flip the polyline if necessary so that it points ( approximately ) along the second vector rather than ( approximately ) opposite it .
def oriented_along(self, along, reverse=False):
        if self.is_closed:
            raise ValueError("Can't reorient a closed polyline")
        vg.shape.check(locals(), "along", (3,))
        if self.num_v < 2:
            return self
        extent = self.v[-1] - self.v[0]
        projected = vg.project(extent, onto=along)
        if vg.scale_factor(projected, along) * (-1 if reverse else 1) < 0:
            return self.copy().flip()
        else:
            return self
def oriented_along ( self , along , reverse = False ) : if self . is_closed : raise ValueError ( "Can't reorient a closed polyline" ) vg . shape . check ( locals ( ) , "along" , ( 3 , ) ) if self . num_v < 2 : return self extent = self . v [ - 1 ] - self . v [ 0 ] projected = vg . project ( extent , onto = along ) if vg . scale_factor ( projected , along ) * ( - 1 if reverse else 1 ) < 0 : return self . copy ( ) . flip ( ) else : return self
Flip the polyline, if necessary, so that it points (approximately)
along the second vector rather than (approximately) opposite it.
Flip the polyline if necessary so that it points ( approximately ) along the second vector rather than ( approximately ) opposite it .
"""
        Flip the polyline, if necessary, so that it points (approximately)
        along the second vector rather than (approximately) opposite it.
        """
self
along
reverse