# How do I remove artifacts from my ContourPlot3D Valentine?

My version (below) of the "Valentine Formula" that appeared in today's New York Times, has some ugly artifacts that don't appear in the NYT (Java) version:

How do I remove these artifacts?

Manipulate[
ContourPlot3D[(x^2+((1+b)*y)^2+z^2-1)^3-x^2*z^3-a*y^2*z^3 ==0,
{x,-scale,scale},{y,-scale,scale},{z,-scale,scale},
Mesh->None,Axes->None,Boxed->False,
ContourStyle->Directive[Red,Opacity[0.8],Specularity[White,30]],
PerformanceGoal->"Quality"
],
{{a,.1},.0001,1},
{{b,1},.00001,5},
{{scale,1.25},1,5},
SynchronousUpdating->False]


RegionPlot3D can sometimes give cleaner results out of the box. I also upped the PlotPoints manually.

Manipulate[
RegionPlot3D[(x^2 + ((1 + b)*y)^2 + z^2 - 1)^3 - x^2*z^3 -
a*y^2*z^3 <= 0, {x, -scale, scale}, {y, -scale,
scale}, {z, -scale, scale}, Mesh -> None, Axes -> None,
Boxed -> False,
PlotStyle -> Directive[Red, Opacity[0.8], Specularity[White, 30]],
PlotPoints -> ControlActive[Automatic, 40]], {{a, .1}, .0001,
1}, {{b, 1}, .00001, 5}, {{scale, 1.25}, 1, 5},
SynchronousUpdating -> False]


• That's much nicer! – orome Feb 14 at 16:40

Adding the ContourPlot3D option PlotPoints -> n where n is some number greater than or equal to 100 improved things considerably for me. There is still a very faint ring around the lower portion of the heart when I do this, but it's a considerable improvement.

The PlotPoints argument tells Mathematica how many points to use when initially sampling the plot. Many functions (including 2D functions like DensityPlot) accept this argument. For whatever reason, the default is often quite low for functions/plots with rapid changes or singularities.

Demo:

Then with PlotPoints -> 200.
• @orome I bet you place the option in the Directive again. – xzczd Feb 14 at 16:39