Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wireframe=False option for rendering 2d polyhedron plots #14181

Closed
nthiery opened this issue Feb 25, 2013 · 15 comments
Closed

Add wireframe=False option for rendering 2d polyhedron plots #14181

nthiery opened this issue Feb 25, 2013 · 15 comments

Comments

@nthiery
Copy link
Contributor

nthiery commented Feb 25, 2013

Implement:

sage: square_from_vertices = Polyhedron(vertices = [[1, 1], [1, -1], [-1, 1], [-1, -1]])
sage: square_from_vertices.plot()
sage: square_from_vertices.plot(wireframe=False)

In the later case, only the two-dimensional piece of the polyhedron is drawn, and not its wireframe: vertices and edges.

This feature is implemented by #14175.

Depends on #14175

CC: @sagetrac-sage-combinat

Component: geometry

Reviewer: Volker Braun, Nicolas M. Thiéry

Issue created by migration from https://trac.sagemath.org/ticket/14181

@vbraun
Copy link
Member

vbraun commented Feb 25, 2013

comment:2

You can, in principle, only drawn projections in 2 or 3 dimensions. There is no such thing as "drawing a non-projected polyhedron".

If you want to implement your own plotting style then you should create the projection and use the methods of the Projection object directly.

@nthiery
Copy link
Contributor Author

nthiery commented Feb 25, 2013

comment:3

Replying to @vbraun:

You can, in principle, only drawn projections in 2 or 3 dimensions. There is no such thing as "drawing a non-projected polyhedron".

If you want to implement your own plotting style then you should create the projection and use the methods of the Projection object directly.

I guess there is a misunderstanding here:-)

This ticket is just about drawing without outline Polyhedrons living in a dimension 2 ambient space. This is all I need for #4327.

If I mentionned projections that's just because, if someone would want the same feature for a Polyhedron that has been projected in dimension 2, then this is not yet handled by this patch.

Cheers,
Nicolas

@vbraun
Copy link
Member

vbraun commented Feb 25, 2013

comment:4

I think I understand what you want, but it is at odds with the strict separation of polyhedron and its projection that I very much would like to keep in the code.

Having more control about the plot output is definitely desirable, but I find outline as a keyword very confusing. X.plot(outline=True) sounds like it ought to plot only the outline of X, but thats not what you propose.

If you just want to draw a polygon you only need

sage: P = Polyhedron([(0,0),(1,0),(0,1)])
sage: polygon2d(P.vertices())

@vbraun
Copy link
Member

vbraun commented Feb 25, 2013

comment:5

How about we let the user specify three dictionaries

P.plot(point={color='red'}, line={...}, polygon={...})

that are then passed to the **kwds of the respective graphics objects. And as special case you can specify None to switch them off. Then your outline-free plot would just be

P.plot(point=None, line=None)

@nthiery
Copy link
Contributor Author

nthiery commented Feb 26, 2013

comment:6

Replying to @vbraun:

How about we let the user specify three dictionaries

P.plot(point={color='red'}, line={...}, polygon={...})

that are then passed to the **kwds of the respective graphics objects. And as special case you can specify None to switch them off. Then your outline-free plot would just be

P.plot(point=None, line=None)

Not quite: if P is a polyhedron of dimension 1 in an ambient space of dimension 2, then I want it to be drawn as a line (no points, no polygon). Similarly, if P is a point, I want it to be drawn as a point (no line, no polygon). See the examples in the patch.

I agree that the name "outline" is not good. What I really mean is "draw only the piece of the same dimension as P", but I did not manage to get a good name for that. Suggestions?

Thanks for the brainstorming :-)

                                Nicolas

@nthiery
Copy link
Contributor Author

nthiery commented Feb 26, 2013

Dependencies: #14175

@nthiery
Copy link
Contributor Author

nthiery commented Feb 26, 2013

comment:7

Rebased upon #14175 (creating conflicts with myself ...)

@vbraun
Copy link
Member

vbraun commented Feb 26, 2013

comment:8

Replying to @nthiery:

Not quite: if P is a polyhedron of dimension 1 in an ambient space of dimension 2, then I want it to be drawn as a line (no points, no polygon). Similarly, if P is a point, I want it to be drawn as a point (no line, no polygon).

Whats the expected output if the polyhedron is of dimension > 3?

@nthiery
Copy link
Contributor Author

nthiery commented Feb 26, 2013

comment:9

Replying to @vbraun:

Replying to @nthiery:

Not quite: if P is a polyhedron of dimension 1 in an ambient space of dimension 2, then I want it to be drawn as a line (no points, no polygon). Similarly, if P is a point, I want it to be drawn as a point (no line, no polygon).

Whats the expected output if the polyhedron is of dimension > 3?

Well, since I don't have a need for this feature I might not have the right perspective to have good insight :-) I guess the natural analogue would be to take the projected polyhedron and only draw it's non trivial face of highest dimension. E.g. if we started from some hypercube in 4D that would project onto a cube in 3D, then that cube would be drawn without its wireframe.

Cheers,

@vbraun
Copy link
Member

vbraun commented Mar 2, 2013

comment:10

With my patch at #14175 this ticket would be obsolete, I think. I propose to close it as duplicate.

@vbraun vbraun removed this from the sage-5.8 milestone Mar 2, 2013
@nthiery

This comment has been minimized.

@nthiery nthiery changed the title Add outline=False option for rendering 2d polyhedron plots Add wireframe=False option for rendering 2d polyhedron plots Mar 3, 2013
@nthiery

This comment has been minimized.

@nthiery
Copy link
Contributor Author

nthiery commented Mar 3, 2013

Changed reviewer from Voker Braun? to Voker Braun, Nicolas M. Thiéry

@nthiery
Copy link
Contributor Author

nthiery commented Mar 3, 2013

Changed author from Nicolas M. Thiéry to none

@jdemeyer
Copy link

Changed reviewer from Voker Braun, Nicolas M. Thiéry to Volker Braun, Nicolas M. Thiéry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants