Esempio n. 1
0
    def __init__(self,
                 points,
                 thickness=5,
                 corner_cutoff=.5,
                 arrow_head=False,
                 **kwds):
        """
        Create the graphics primitive :class:`Line` in 3-D.

        See the docstring of this class for full documentation.

        EXAMPLES::

            sage: from sage.plot.plot3d.shapes2 import Line
            sage: P = Line([(1,2,3),(1,2,2),(-1,2,2),(-1,3,2)],thickness=6,corner_cutoff=.2)
            sage: P.points, P.arrow_head
            ([(1, 2, 3), (1, 2, 2), (-1, 2, 2), (-1, 3, 2)], False)
        """
        if len(points) < 2:
            raise ValueError("there must be at least 2 points")
        PrimitiveObject.__init__(self, **kwds)
        self.points = points
        self.thickness = thickness
        self.corner_cutoff = corner_cutoff
        self.arrow_head = arrow_head
Esempio n. 2
0
    def __init__(self, center, size=1, **kwds):
        """
        Create the graphics primitive :class:`Point` in 3-D.  See the
        docstring of this class for full documentation.

        EXAMPLES::

            sage: from sage.plot.plot3d.shapes2 import Point
            sage: P = Point((1,2,3),2)
            sage: P.loc
            (1.0, 2.0, 3.0)
        """
        PrimitiveObject.__init__(self, **kwds)
        self.loc = (float(center[0]), float(center[1]), float(center[2]))
        self.size = size
        self._set_extra_kwds(kwds)
Esempio n. 3
0
    def __init__(self, points, thickness=5, corner_cutoff=.5, arrow_head=False, **kwds):
        """
        Create the graphics primitive :class:`Line` in 3-D.  See the
        docstring of this class for full documentation.

        EXAMPLES::

            sage: from sage.plot.plot3d.shapes2 import Line
            sage: P = Line([(1,2,3),(1,2,2),(-1,2,2),(-1,3,2)],thickness=6,corner_cutoff=.2)
            sage: P.points, P.arrow_head
            ([(1, 2, 3), (1, 2, 2), (-1, 2, 2), (-1, 3, 2)], False)
        """
        if len(points) < 2:
            raise ValueError, "there must be at least 2 points"
        PrimitiveObject.__init__(self, **kwds)
        self.points = points
        self.thickness = thickness
        self.corner_cutoff = corner_cutoff
        self.arrow_head = arrow_head