# Problem with GraphicsPolygonUtilsPolygonCombine

Writing:

Normal@ParametricPlot[{x, x^2 t}, {x, 0, 2}, {t, 0, 1}] /.
p : {__Polygon} :> GraphicsPolygonUtilsPolygonCombine[p]


I get:

but if I write:

Normal@ParametricPlot[{x, x^2 t}, {x, 0, 2}, {t, 0, .1}] /.
p : {__Polygon} :> GraphicsPolygonUtilsPolygonCombine[p]


I get:

How can I avoid this problem by having to use this function?

A small modification of the original code solves the problem:

Normal@ParametricPlot[{x, x^2 t}, {x, 0, 2}, {t, 0, .1}] /.
p : {{__Polygon} ..} :> GraphicsPolygonUtilsPolygonCombine[p]


The new code also works for the initial problem.

• Thanks, it works perfectly! – TeM Aug 14 '18 at 8:44

You can use GraphicsPolygonUtilsPolygonCombine on all polygons rather than on groups of polygons separately:

pp = ParametricPlot[{x, x^2 t}, {x, 0, 2}, {t, 0, .1}] ;
allpolygons = Join @@ Cases[Normal@pp, {__Polygon}, Infinity];
Graphics[{ EdgeForm[Darker@LightBlue], Opacity[.5, LightBlue],
GraphicsPolygonUtilsPolygonCombine[allpolygons]}, Options[pp]]


• (+1) Or simpler: Normal@ParametricPlot[{x, x^2 t}, {x, 0, 2}, {t, 0, .1}] /. p : {{__Polygon} ..} :> GraphicsPolygonUtilsPolygonCombine[p]. – Alexey Popkov Aug 14 '18 at 8:36
• @AlexeyPopkov, i could have sworn that I tried that first; somehow it didn't work then:) You might want to post that as an answer. – kglr Aug 14 '18 at 8:38
• Simply brilliant, thanks to both! P.S .: is it possible to find a list of the unofficial features of Wolfram Mathematica? – TeM Aug 14 '18 at 8:43
• @TeM, some are collected in What are some useful, undocumented Mathematica functions? – kglr Aug 14 '18 at 8:57