def axes(scale=1, radius=None, **kwds): """ Creates basic axes in three dimensions. Each axis is a three dimensional arrow object. INPUT: - ``scale`` - (default: 1) The length of the axes (all three will be the same). - ``radius`` - (default: .01) The radius of the axes as arrows. EXAMPLES:: sage: from sage.plot.plot3d.plot3d import axes sage: S = axes(6, color='black'); S Graphics3d Object :: sage: T = axes(2, .5); T Graphics3d Object """ if radius is None: radius = scale/100.0 return Graphics3dGroup([arrow3d((0,0,0),(scale,0,0), radius, **kwds), arrow3d((0,0,0),(0,scale,0), radius, **kwds), arrow3d((0,0,0),(0,0,scale), radius, **kwds)])
def axes(scale=1, radius=None, **kwds): """ Creates basic axes in three dimensions. Each axis is a three dimensional arrow object. INPUT: - ``scale`` - (default: 1) The length of the axes (all three will be the same). - ``radius`` - (default: .01) The radius of the axes as arrows. EXAMPLES:: sage: from sage.plot.plot3d.plot3d import axes sage: S = axes(6, color='black'); S Graphics3d Object :: sage: T = axes(2, .5); T Graphics3d Object """ if radius is None: radius = scale / 100.0 return Graphics3dGroup([ arrow3d((0, 0, 0), (scale, 0, 0), radius, **kwds), arrow3d((0, 0, 0), (0, scale, 0), radius, **kwds), arrow3d((0, 0, 0), (0, 0, scale), radius, **kwds) ])
def tachyon_repr(self, render_params): """ Returns representation of the line suitable for plotting using the Tachyon ray tracer. TESTS:: sage: L = line3d([(cos(i),sin(i),i^2) for i in srange(0,10,.01)],color='red') sage: L.tachyon_repr(L.default_render_params())[0] 'FCylinder base 1.0 0.0 0.0 apex 0.999950000417 0.00999983333417 0.0001 rad 0.005 texture...' """ T = render_params.transform cmds = [] px, py, pz = self.points[0] if T is None else T(self.points[0]) radius = self.thickness * TACHYON_PIXEL for P in self.points[1:]: x, y, z = P if T is None else T(P) if self.arrow_head and P is self.points[-1]: A = shapes.arrow3d((px, py, pz), (x, y, z), radius = radius, texture = self.texture) render_params.push_transform(~T) cmds.append(A.tachyon_repr(render_params)) render_params.pop_transform() else: cmds.append("FCylinder base %s %s %s apex %s %s %s rad %s %s" % (px, py, pz, x, y, z, radius, self.texture.id)) px, py, pz = x, y, z return cmds
def axes(scale=1, radius=None, **kwds): if radius is None: radius = scale/100.0 return Graphics3dGroup([arrow3d((0,0,0),(scale,0,0), radius, **kwds), arrow3d((0,0,0),(0,scale,0), radius, **kwds), arrow3d((0,0,0),(0,0,scale), radius, **kwds)])