1
$\begingroup$

When I compute the Region Bounds of a simple Pyramid, like:

view = Pyramid[{{0., 0., 0.}, {2., 0., 0.}, {2., 1., 0.}, {0., 1., 0.}, {0.5, 0.5, -1.}}];
Graphics3D[view, Axes -> True]
RegionBounds[view]

Everything works as expected:

Pyramid[{{0., 0., 0.}, {2., 0., 0.}, {2., 1., 0.}, {0., 1., 0.}, {0.5, 0.5, -1.}}]

enter image description here

{{0., 2.}, {0., 1.}, {-1., 0.}}

But if I come up with the following pyramid, RegionBounds sends an error message despite the pyramid being correctly specified...

pyr = Pyramid[{{-2.5, 106., -2.025}, {-2.5, 106., 2.025}, {-1.75, 106., 2.025}, {-1.75, 106., -2.025}, {0., 0., 0.}}]

Graphics3D[pyr, Axes -> True]

RegionBounds[pyr]

This produces the return:

Pyramid[{{-2.5, 106., -2.025}, {-2.5, 106., 2.025}, {-1.75, 106., 2.025}, {-1.75, 106., -2.025}, {0., 0., 0.}}]

enter image description here

RegionBounds::reg: Pyramid[{{-2.5,106.,-2.025},{-2.5,106.,2.025},{-1.75,106.,2.025},{-1.75,106.,-2.025},{0.,0.,0.}}] is not a correctly specified region.

But if it's not correctly specified how can I plot it and how does Pyramid[] not show any message?

Add:

I'm running this on version 11.3 student edition on a win10 64bit

$\endgroup$
7
  • 1
    $\begingroup$ Works on 11.3 Mac OS {{-2.5, 0.}, {0., 106.}, {-2.025, 2.025}} $\endgroup$ Feb 4, 2019 at 17:43
  • $\begingroup$ Works in version 11.3 on Windows 10 both 32 bit and 64 bit. $\endgroup$
    – user64494
    Feb 4, 2019 at 20:12
  • $\begingroup$ Sorry, I had a typo in the question, the third point of the pyramid should be: {-1.75, 106., 2.025} instead of {-1.75, 106., .025}. The latter also works for me, but not the former. $\endgroup$
    – Daniel H.
    Feb 4, 2019 at 22:13
  • $\begingroup$ @user64494 Could you run again the code and see if the bug pops up? Thx $\endgroup$
    – Daniel H.
    Feb 5, 2019 at 15:41
  • 1
    $\begingroup$ Rationalze helps: pyr = Pyramid[ Rationalize[{{-2.5, 106., -2.025}, {-2.5, 106., 2.025}, {-1.75, 106., 2.025}, {-1.75, 106., -2.025}, {0., 0., 0.`}}]] $\endgroup$
    – user64494
    Feb 5, 2019 at 20:10

1 Answer 1

2
$\begingroup$

I´ve reached out to Wolfram Technical Support and their answer suggests that this is indeed a bug.

Thank you for taking the time to send this report about RegionBounds. I have been able to reproduce the issue mentioned and, therefore, I have made the proper report to our development team so it can be solved for future versions of Mathematica.

In the meantime, as @user64494 pointed out, using Rationalize seems to solve the issue:

Pyramid[ Rationalize[{{-2.5, 106., -2.025}, {-2.5, 106., 2.025}, {-1.75, 106., 2.025}, {-1.75, 106., -2.025}, {0., 0., 0.`}}]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.