6
$\begingroup$

Why does this evaluate?

DiscretizeGraphics[ Plot3D[0.01905481889611737` + x^2 - 0.5` Sqrt[ 0.7771628918933575` - 1.763136854465197` x^2 + 1.` x^4 + (-1.763136854465197` + 2.` x^2) y^2 + 1.` y^4], {x, 1.4, 2.1}, {y, 0.277, x - 0.94}]] 

But this remains unevaluated?

DiscretizeGraphics[ Plot3D[(0.25` Sqrt[(-0.07621927558446948` y^2 + y^4) (0.7771628918933575` - 1.763136854465197` x^2 + 1.` x^4 + (-1.763136854465197` + 2.` x^2) y^2 + 1.` y^4)])/( x y^2), {x, 1.4, 2.1}, {y, 0.277, x - 0.94}]] 

How do I get it working? v14.2 on win11.

$\endgroup$
7
  • 1
    $\begingroup$ Try it with Mesh -> None. $\endgroup$ Commented Jun 11 at 18:52
  • $\begingroup$ @MichaelE2 thanks, that worked. How do you even come up with this solution? $\endgroup$ Commented Jun 11 at 19:04
  • 1
    $\begingroup$ I guess my inclination was to simplify. Probably the non-working original has some defect in the discrete graphics created by Plot3D[]. I don't know why there's no error message, though. Maybe it should be reported as a bug. In any case, removing the mesh would change the graphics passed to DiscretizeGraphics[]; and a change in input might lead to a change in output. $\endgroup$ Commented Jun 11 at 19:12
  • $\begingroup$ I'd love to give you +25 rep if you put those comments into an answer, that is helpful general information $\endgroup$ Commented Jun 11 at 19:15
  • 1
    $\begingroup$ Thanks!... and done. :) $\endgroup$ Commented Jun 11 at 19:20

2 Answers 2

9
$\begingroup$

Adding Mesh -> None works for me:

DiscretizeGraphics@ Plot3D[(0.25` Sqrt[(-0.07621927558446948` y^2 + y^4) (0.7771628918933575` - 1.763136854465197` x^2 + 1.` x^4 + (-1.763136854465197` + 2.` x^2) y^2 + 1.` y^4)])/(x y^2), {x, 1.4, 2.1}, {y, 0.277, x - 0.94}, Mesh -> None] 

I guess my inclination is to simplify. Probably the non-working original has some defect in the discrete graphics created by Plot3D[]. I don't know why there's no error message, though. Maybe it should be reported as a bug. In any case, removing the mesh would change the graphics passed to DiscretizeGraphics[]; and a change in input might lead to a change in output.

As a further example of the change-in-input principle, changing PlotPoints to 16 (as well as several values other than the default 15) also fixes the problem:

DiscretizeGraphics@ Plot3D[(0.25` Sqrt[(-0.07621927558446948` y^2 + y^4) (0.7771628918933575` - 1.763136854465197` x^2 + 1.` x^4 + (-1.763136854465197` + 2.` x^2) y^2 + 1.` y^4)])/(x y^2), {x, 1.4, 2.1}, {y, 0.277, x - 0.94}, PlotPoints -> 16] 
$\endgroup$
7
$\begingroup$
  • This is a bug since version 14.0 or version 14.1.
  • Rationalize the plot data.
DiscretizeGraphics[Rationalize[plot, 0]] 

enter image description here

  • Another working around is extract the plot data.
coords = Cases[plot, GraphicsComplex[p_List, rest__] :> p, -1][[1]]; polys = Cases[plot, _Polygon, -1]; GraphicsComplex[coords, polys] // DiscretizeGraphics 

enter image description here

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.