# Removing a white polygon from a filled parametric plot [closed]

I have the following function

partitionfunction[d_][q_] :=
Piecewise[{
{Sin[(Pi*q)/(2*d)]^2, Inequality[0, LessEqual, q, Less, d]},
{1, Inequality[d, LessEqual, q, Less, 2*Pi - d]},
{Sin[(Pi*(2*Pi - q))/(2*d)]^2, 2*Pi - d <= q <= 2*Pi}}]

radius[d_][q_] := 1 + 1.5*partitionfunction[d][q]*BesselJ[5, (13/(2*Pi))*q + 5]



which I use to generate the following plot

ParametricPlot[curve[1][q], {q, 0, 2*Pi},
Axes -> False,
PlotPoints -> 50,
PlotStyle -> Thickness[0.007]]


So far so good. But when I try to fill the enclosed area, I get a strange white polygon.

ParametricPlot[curve[1][q], {q, 0, 2*Pi},
Axes -> False,
PlotPoints -> 50,
PlotStyle -> Thickness[0.007]] /.
Line[l_List] :> {{Orange, Polygon[l]}, {Black, Line[l]}}


Also the filling goes outside the boundary.

Any ideas to fix this behavior?

### EDIT

Searching here I try this

g =
ParametricPlot[curve[1][q], {q, 0, 2*Pi},
Axes -> False,
PlotPoints -> 50,
PlotStyle -> Thickness[0.007]]

line = Cases[g, l_Line :> First @ l, Infinity];

Graphics[
{Opacity[0.4], Darker @ Orange, EdgeForm[Darker @ Orange], Polygon[line]},
Options[g]]


The polygon is still evident, but this time the filling does not go outside the boundary.

• What is curve? – eldo Nov 18 '15 at 15:23
• Even without curve I think that the problem can be solved with Exclusions->None. – ybeltukov Nov 18 '15 at 15:25
• Sorry! I forgot to add the definitions. Not it should be ok! – Dimitris Nov 18 '15 at 15:28
• @ybeltukov: You are right! Adding Exclusions->None did indeed solve the issue! Amazing without even seeing the definitions. Thanks! – Dimitris Nov 18 '15 at 15:31
• Why Exclusions->None is necessary here? – Dimitris Nov 18 '15 at 16:32

I don't know if it is worth posting an answer, but nevertheless here it goes (code adopted by a discussion with David Park several years ago; then working with Mathematica 5.2. I tried to upgrade it in order to fit Graphics structure of recent versions):

partitionfunction[d_][q_] :=
Piecewise[{
{Sin[(Pi*q)/(2*d)]^2, Inequality[0, LessEqual, q, Less, d]},
{1, Inequality[d, LessEqual, q, Less, 2*Pi - d]},
{Sin[(Pi*(2*Pi - q))/(2*d)]^2, 2*Pi - d <= q <= 2*Pi}}]

radius[d_][q_] := 1 + 1.5*partitionfunction[d][q]*BesselJ[5, (13/(2*Pi))*q + 5]

g =
ParametricPlot[curve[1][q], {q, 0, 2*Pi},
Axes -> False,
PlotPoints -> 50,
PlotStyle -> Thickness[0.007],
Exclusions -> None];

line = Cases[g, l_Line :> First@l, Infinity];

Graphics[
{Opacity[0.4], Darker @ Orange, EdgeForm[Darker @ Orange], Polygon[line]},
Options[g]]


This question and answer is related to the reply I wanted to give here

Thanks to ybeltukov for pointing out Exclusions (which I should have known that it has to be applied here).