How do I remove artifacts from my ContourPlot3D Valentine?












8












$begingroup$


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:



enter image description here



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]









share|improve this question











$endgroup$

















    8












    $begingroup$


    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:



    enter image description here



    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]









    share|improve this question











    $endgroup$















      8












      8








      8


      3



      $begingroup$


      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:



      enter image description here



      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]









      share|improve this question











      $endgroup$




      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:



      enter image description here



      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]






      graphics performance-tuning graphics3d






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 14 at 16:45









      xzczd

      27.3k573251




      27.3k573251










      asked Feb 14 at 16:24









      oromeorome

      6,07223883




      6,07223883






















          2 Answers
          2






          active

          oldest

          votes


















          6












          $begingroup$

          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]







          share|improve this answer









          $endgroup$













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





















          2












          $begingroup$

          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:



          First, without any additional argument:
          enter image description here



          Then with PlotPoints -> 200.
          with argument






          share|improve this answer











          $endgroup$













          • $begingroup$
            That doesn't do anything for me.
            $endgroup$
            – orome
            Feb 14 at 16:38










          • $begingroup$
            @orome I bet you place the option in the Directive again.
            $endgroup$
            – xzczd
            Feb 14 at 16:39










          • $begingroup$
            @xzczd: Yep! (God I hate Mathematica's inadequate syntax checking!)
            $endgroup$
            – orome
            Feb 14 at 16:42










          • $begingroup$
            @orome I'm also surprised that Mathematica doesn't give any warning in this case :D
            $endgroup$
            – xzczd
            Feb 14 at 16:43












          • $begingroup$
            It shows improvement now, but still shows (as you point out) artifacts that ruin it.
            $endgroup$
            – orome
            Feb 14 at 16:46











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "387"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f191570%2fhow-do-i-remove-artifacts-from-my-contourplot3d-valentine%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          6












          $begingroup$

          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]







          share|improve this answer









          $endgroup$













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


















          6












          $begingroup$

          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]







          share|improve this answer









          $endgroup$













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
















          6












          6








          6





          $begingroup$

          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]







          share|improve this answer









          $endgroup$



          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]








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 14 at 16:38









          Chip HurstChip Hurst

          22.2k15791




          22.2k15791












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




















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


















          $begingroup$
          That's much nicer!
          $endgroup$
          – orome
          Feb 14 at 16:40






          $begingroup$
          That's much nicer!
          $endgroup$
          – orome
          Feb 14 at 16:40













          2












          $begingroup$

          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:



          First, without any additional argument:
          enter image description here



          Then with PlotPoints -> 200.
          with argument






          share|improve this answer











          $endgroup$













          • $begingroup$
            That doesn't do anything for me.
            $endgroup$
            – orome
            Feb 14 at 16:38










          • $begingroup$
            @orome I bet you place the option in the Directive again.
            $endgroup$
            – xzczd
            Feb 14 at 16:39










          • $begingroup$
            @xzczd: Yep! (God I hate Mathematica's inadequate syntax checking!)
            $endgroup$
            – orome
            Feb 14 at 16:42










          • $begingroup$
            @orome I'm also surprised that Mathematica doesn't give any warning in this case :D
            $endgroup$
            – xzczd
            Feb 14 at 16:43












          • $begingroup$
            It shows improvement now, but still shows (as you point out) artifacts that ruin it.
            $endgroup$
            – orome
            Feb 14 at 16:46
















          2












          $begingroup$

          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:



          First, without any additional argument:
          enter image description here



          Then with PlotPoints -> 200.
          with argument






          share|improve this answer











          $endgroup$













          • $begingroup$
            That doesn't do anything for me.
            $endgroup$
            – orome
            Feb 14 at 16:38










          • $begingroup$
            @orome I bet you place the option in the Directive again.
            $endgroup$
            – xzczd
            Feb 14 at 16:39










          • $begingroup$
            @xzczd: Yep! (God I hate Mathematica's inadequate syntax checking!)
            $endgroup$
            – orome
            Feb 14 at 16:42










          • $begingroup$
            @orome I'm also surprised that Mathematica doesn't give any warning in this case :D
            $endgroup$
            – xzczd
            Feb 14 at 16:43












          • $begingroup$
            It shows improvement now, but still shows (as you point out) artifacts that ruin it.
            $endgroup$
            – orome
            Feb 14 at 16:46














          2












          2








          2





          $begingroup$

          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:



          First, without any additional argument:
          enter image description here



          Then with PlotPoints -> 200.
          with argument






          share|improve this answer











          $endgroup$



          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:



          First, without any additional argument:
          enter image description here



          Then with PlotPoints -> 200.
          with argument







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 14 at 16:48

























          answered Feb 14 at 16:36









          user16054user16054

          1,606417




          1,606417












          • $begingroup$
            That doesn't do anything for me.
            $endgroup$
            – orome
            Feb 14 at 16:38










          • $begingroup$
            @orome I bet you place the option in the Directive again.
            $endgroup$
            – xzczd
            Feb 14 at 16:39










          • $begingroup$
            @xzczd: Yep! (God I hate Mathematica's inadequate syntax checking!)
            $endgroup$
            – orome
            Feb 14 at 16:42










          • $begingroup$
            @orome I'm also surprised that Mathematica doesn't give any warning in this case :D
            $endgroup$
            – xzczd
            Feb 14 at 16:43












          • $begingroup$
            It shows improvement now, but still shows (as you point out) artifacts that ruin it.
            $endgroup$
            – orome
            Feb 14 at 16:46


















          • $begingroup$
            That doesn't do anything for me.
            $endgroup$
            – orome
            Feb 14 at 16:38










          • $begingroup$
            @orome I bet you place the option in the Directive again.
            $endgroup$
            – xzczd
            Feb 14 at 16:39










          • $begingroup$
            @xzczd: Yep! (God I hate Mathematica's inadequate syntax checking!)
            $endgroup$
            – orome
            Feb 14 at 16:42










          • $begingroup$
            @orome I'm also surprised that Mathematica doesn't give any warning in this case :D
            $endgroup$
            – xzczd
            Feb 14 at 16:43












          • $begingroup$
            It shows improvement now, but still shows (as you point out) artifacts that ruin it.
            $endgroup$
            – orome
            Feb 14 at 16:46
















          $begingroup$
          That doesn't do anything for me.
          $endgroup$
          – orome
          Feb 14 at 16:38




          $begingroup$
          That doesn't do anything for me.
          $endgroup$
          – orome
          Feb 14 at 16:38












          $begingroup$
          @orome I bet you place the option in the Directive again.
          $endgroup$
          – xzczd
          Feb 14 at 16:39




          $begingroup$
          @orome I bet you place the option in the Directive again.
          $endgroup$
          – xzczd
          Feb 14 at 16:39












          $begingroup$
          @xzczd: Yep! (God I hate Mathematica's inadequate syntax checking!)
          $endgroup$
          – orome
          Feb 14 at 16:42




          $begingroup$
          @xzczd: Yep! (God I hate Mathematica's inadequate syntax checking!)
          $endgroup$
          – orome
          Feb 14 at 16:42












          $begingroup$
          @orome I'm also surprised that Mathematica doesn't give any warning in this case :D
          $endgroup$
          – xzczd
          Feb 14 at 16:43






          $begingroup$
          @orome I'm also surprised that Mathematica doesn't give any warning in this case :D
          $endgroup$
          – xzczd
          Feb 14 at 16:43














          $begingroup$
          It shows improvement now, but still shows (as you point out) artifacts that ruin it.
          $endgroup$
          – orome
          Feb 14 at 16:46




          $begingroup$
          It shows improvement now, but still shows (as you point out) artifacts that ruin it.
          $endgroup$
          – orome
          Feb 14 at 16:46


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematica Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f191570%2fhow-do-i-remove-artifacts-from-my-contourplot3d-valentine%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Probability when a professor distributes a quiz and homework assignment to a class of n students.

          Aardman Animations

          Are they similar matrix