#15547: Fix the creation of tikzpictures of projections of polytopes
-------------------------------------+-------------------------------------
Reporter: jipilab | Owner:
Type: defect | Status: needs_work
Priority: major | Milestone: sage-6.3
Component: geometry | Resolution:
Keywords: tikz, projection | Merged in:
Authors: jipilab | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jipilab/ticket15547 | 270e115a2fa376e8a48dc13345c8837b4bd62086
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by jipilab):
* status: needs_review => needs_work
Old description:
> Using the new tikz feature, (see http://trac.sagemath.org/ticket/12083)
> there is a problem when drawing polygons embedded in 3d. The error can be
> reproduced:
>
> {{{
> sage: P = Polyhedron(vertices=[[1,0,0],[0,1,0],[0,0,1]])
> sage: P.ambient_dim()
> 3
> sage: P.dim()
> 2
> sage: PProj = P.projection()
> sage: PProj.polyhedron_ambient_dim
> 3
> sage: PProj.dimension
> 3
> }}}
>
> I believe PProj.dimension should be 2, not 3. Because of this, the tikz
> method misbehaves.
>
> In this case, the function _init_from_3d(self, polyhedron) used for
> projection contains:
>
> {{{
> assert polyhedron.ambient_dim() == 3, "Requires polyhedron in 3d"
> self.dimension = 3
> self._init_points(polyhedron)
> }}}
>
> I believe one should replace the second line by
>
> {{{
> self.dimension = polyhedron.dim()
> }}}
>
> There is also a problem with drawing 3d-polytopes: the back edges are not
> drawn.
New description:
Right now, the tikz method for the projection of a 2d polytope in 3d
relies on the dimension of the projection and not the dimension of the
actual polytope. This is incompatible with the way that the tikz method
works in this case. Moreover, the drawing of back-edges of 3d-polytopes
(in 3d) is broken.
The first error can be reproduced:
{{{
sage: P = Polyhedron(vertices=[[1,0,0],[0,1,0],[0,0,1]])
sage: P.ambient_dim()
3
sage: P.dim()
2
sage: PProj = P.projection()
sage: PProj.polyhedron_ambient_dim
3
sage: PProj.dimension
3
}}}
To fix the issue, I believe one should add an attribute "polyhedron_dim"
to the projection to know what the dimension of the polyhedron actually
is. Something like:
{{{
sage: PProj.polyhedron_dim
2
}}}
Then the tikz method will use this attribute to decide which algorithm to
apply.
The second problem is an indexing issue in the creation of potential back
edges. There is a trivial fix to that.
--
--
Ticket URL: <http://trac.sagemath.org/ticket/15547#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.