Opened 4 years ago

Closed 4 years ago

#23555 closed defect (fixed)

Bounding box bug in Polyhedron plots

Reported by: jipilab Owned by:
Priority: major Milestone: sage-8.2
Component: geometry Keywords: polyhedron, days88
Cc: moritz Merged in:
Authors: Moritz Firsching Reviewers: Jean-Philippe Labbé, Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: 3f02385 (Commits, GitHub, GitLab) Commit: 3f02385aa21d875917a5aef1a26013f1005d56e4
Dependencies: Stopgaps:

Status badges

Description

As reported on sage-devel here (1) and there (2), when creating a polyhedron far from the origin, the bounding box for the plot of the polyhedron includes the origin by default and it makes the polyhedron appear small. This appears to be a bug in the polyhedron.plot currently at line 1248 when an empty Graphics3d object is created.

(1) https://groups.google.com/forum/#!topic/sage-devel/6v-d6PM29YM

(2) https://groups.google.com/forum/#!msg/cocalc/YQQHboBCwPw/d8-NlOS8BwAJ

Change History (12)

comment:1 Changed 4 years ago by mforets

(for reference) difference between 2d and 3d plots:

sage: import itertools
sage: Polyhedron(vertices=itertools.product([100, 101], repeat=2)).plot() # OK, centered around the polyhedron
sage: Polyhedron(vertices=itertools.product([100, 101], repeat=3)).plot() # not centered, displays origin

comment:2 Changed 4 years ago by moritz

  • Branch set to u/moritz/23555

comment:3 Changed 4 years ago by git

  • Commit set to 6fc28c0813efc50d296b16e59a0c4e5bedf431dd

Branch pushed to git repo; I updated commit sha1. New commits:

6fc28c0added doctest

comment:4 Changed 4 years ago by moritz

  • Authors set to Moritz Firsching
  • Cc moritz added
  • Keywords polyhedron added
  • Status changed from new to needs_review

This fixes it, I guess. Check out the doctest. If unpatched, the output should be

((0.0, 0.0, 0.0), (101.0, 101.0, 101.0))

comment:5 Changed 4 years ago by jipilab

  • Keywords days88 added
  • Reviewers set to Jean-Philippe Labbé
  • Status changed from needs_review to positive_review

Looks good to me.

comment:6 Changed 4 years ago by vbraun

  • Status changed from positive_review to needs_work

Documentation doesn't build

comment:7 Changed 4 years ago by git

  • Commit changed from 6fc28c0813efc50d296b16e59a0c4e5bedf431dd to 17ad1012cf65152a43b862e18b2c0727107b3b0f

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

d9ba49cdon't invoke Graphics3d() for empty plot
a24a06eadded doctest
17ad101prevent adding of 'None'

comment:8 Changed 4 years ago by moritz

  • Status changed from needs_work to needs_review

I hope that fixes the issue..

comment:9 Changed 4 years ago by chapoton

typo: "The origin is no included" >>> "The origin is not included"

comment:10 Changed 4 years ago by git

  • Commit changed from 17ad1012cf65152a43b862e18b2c0727107b3b0f to 3f02385aa21d875917a5aef1a26013f1005d56e4

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

5856470don't invoke Graphics3d() for empty plot
244aff0added doctest
856df77prevent adding of 'None'
3f02385typo

comment:11 Changed 4 years ago by chapoton

  • Milestone changed from sage-8.1 to sage-8.2
  • Reviewers changed from Jean-Philippe Labbé to Jean-Philippe Labbé, Frédéric Chapoton
  • Status changed from needs_review to positive_review

ok

comment:12 Changed 4 years ago by vbraun

  • Branch changed from u/moritz/23555 to 3f02385aa21d875917a5aef1a26013f1005d56e4
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.