# Graphics3D: the box vertices do not coincide with triangle

I have drawn a triangle using Line graphics primitive and Graphics3D function:

 Graphics3D[Line[{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}, {1, 0, 0}}],
Axes -> False, Boxed -> True, AspectRatio -> 1] But in the shape I get, the vertices of triangle do not coincide with the vertices of the box, how can I solve this problem?

• I think you can try PlotRangePadding -> 0 May 16 '13 at 5:20

The comment is right, but here is a thought. If you'd like a cube you should use Cuboid and leave the 3D box for the role it plays - to put things in a better 3D perspective (if needed). Then you precisely control all coordinates. You could try something like

Graphics3D[{
{Red, Opacity[.7], Polygon[{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}]},
{Opacity[.2], Cuboid[{0, 1, 0}, {1, 0, 1}]}
}, Axes -> False, Boxed -> False, AspectRatio -> 1] • Very nice, thank you very much. May 16 '13 at 5:55

As noted by xslittlegrass you can get coincident vertices by instructing Graphics3D not to use padding of the plot range, by using PlotRangePadding -> 0.

AspectRatio controls the two dimensional image aspect ratio rather the proportions of the three dimensional rendering which is what I expect you intended; for that use BoxRatios.

Specifying Boxed -> True should (by default) produce a graph without axis lines shown, therefore the Axes -> False option is redundant.

Graphics3D[
Line[Tuples[{0, 1}, 3][[{5, 3, 2, 5}]]],
Boxed -> True, 