How to prevent graphics clipping through each otherHow can I prevent ColorFunction from disabling antialiasing in graphics?position image combined with other graphicsSuperimposing ListContourPlots on each otherDraw Vectors in Spherical Shell and Then AnimateDraw an alternating colors ring with B-splinesHow do I (selectively) prevent clipping of symbols at plot edges when using Show?How to harvest graphics orientationClipping of lines in Graphics, fitting with AxesLabelHow do I prevent graphics from rescaling when rotating it?

Is it good practice to speed up and slow down where not written in a song?

Was a six-engine 747 ever seriously considered by Boeing?

Can two aircraft be allowed to stay on the same runway at the same time?

How to differentiate between two people with the same name in a story?

How can I portray a character with no fear of death, without them sounding utterly bored?

Moscow SVO airport, how to avoid scam taxis without pre-booking?

How to understand payment due date for credit card?

Connecting points from separate Tikz figures

Can authors email you PDFs of their textbook for free?

Why are JWST optics not enclosed like HST?

Calculate Landau's function

Does the telecom provider need physical access to the SIM card to clone it?

Which is the correct version of Mussorgsky's Pictures at an Exhibition?

LWC: Is it safe to rely on window.location.href to get the page url?

Why does Sauron not permit his followers to use his name?

Find the logic in first 2 statements to give the answer for the third statement

What are ways to record who took the pictures if a camera is used by multiple people?

German equivalent to "going down the rabbit hole"

My colleague treats me like he's my boss, yet we're on the same level

How to save money by shopping at a variety of grocery stores?

Why haven't the British protested Brexit as ardently like Hong Kongers protest?

How do I portray irrational anger in first person?

Resources to learn about firearms?

“all of who” or “all of whom”?



How to prevent graphics clipping through each other


How can I prevent ColorFunction from disabling antialiasing in graphics?position image combined with other graphicsSuperimposing ListContourPlots on each otherDraw Vectors in Spherical Shell and Then AnimateDraw an alternating colors ring with B-splinesHow do I (selectively) prevent clipping of symbols at plot edges when using Show?How to harvest graphics orientationClipping of lines in Graphics, fitting with AxesLabelHow do I prevent graphics from rescaling when rotating it?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3












$begingroup$


Consider the following:



g1 = Graphics3D[Black, Sphere[0, 0, 0, 0.1]];
g2 = Graphics3D[Directive[Red, Thickness[0.02]], InfiniteLine[0, 0, 0, 1, 0, 0]];
Show[g1, g2, PlotRange -> -1, 1, -1, 1, -1, 1, Boxed -> False, ImageSize -> Large]


When I rotate the resulting 3D image, the red line will clip through the black sphere, despite being smaller than the sphere radius. The edge where they meet appears two dimensional and at some angles the line is completely visible as though it were outside the sphere, see below. How can I prevent this?



enter image description here



enter image description here










share|improve this question









$endgroup$




















    3












    $begingroup$


    Consider the following:



    g1 = Graphics3D[Black, Sphere[0, 0, 0, 0.1]];
    g2 = Graphics3D[Directive[Red, Thickness[0.02]], InfiniteLine[0, 0, 0, 1, 0, 0]];
    Show[g1, g2, PlotRange -> -1, 1, -1, 1, -1, 1, Boxed -> False, ImageSize -> Large]


    When I rotate the resulting 3D image, the red line will clip through the black sphere, despite being smaller than the sphere radius. The edge where they meet appears two dimensional and at some angles the line is completely visible as though it were outside the sphere, see below. How can I prevent this?



    enter image description here



    enter image description here










    share|improve this question









    $endgroup$
















      3












      3








      3





      $begingroup$


      Consider the following:



      g1 = Graphics3D[Black, Sphere[0, 0, 0, 0.1]];
      g2 = Graphics3D[Directive[Red, Thickness[0.02]], InfiniteLine[0, 0, 0, 1, 0, 0]];
      Show[g1, g2, PlotRange -> -1, 1, -1, 1, -1, 1, Boxed -> False, ImageSize -> Large]


      When I rotate the resulting 3D image, the red line will clip through the black sphere, despite being smaller than the sphere radius. The edge where they meet appears two dimensional and at some angles the line is completely visible as though it were outside the sphere, see below. How can I prevent this?



      enter image description here



      enter image description here










      share|improve this question









      $endgroup$




      Consider the following:



      g1 = Graphics3D[Black, Sphere[0, 0, 0, 0.1]];
      g2 = Graphics3D[Directive[Red, Thickness[0.02]], InfiniteLine[0, 0, 0, 1, 0, 0]];
      Show[g1, g2, PlotRange -> -1, 1, -1, 1, -1, 1, Boxed -> False, ImageSize -> Large]


      When I rotate the resulting 3D image, the red line will clip through the black sphere, despite being smaller than the sphere radius. The edge where they meet appears two dimensional and at some angles the line is completely visible as though it were outside the sphere, see below. How can I prevent this?



      enter image description here



      enter image description here







      plotting graphics graphics3d






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 8 hours ago









      KaiKai

      6961 silver badge10 bronze badges




      6961 silver badge10 bronze badges























          2 Answers
          2






          active

          oldest

          votes


















          6













          $begingroup$

          I recommend using tubes to represent thick lines in 3D graphics. They look better because they are true 3D objects with circular cross-setions and not flat ribbons, which are how thick lines are drawn in 3D graphics.



          Graphics3D[
          Black, Sphere[0, 0, 0, 0.1], Red, Tube[-1, 0, 0, 1, 0, 0, .04],
          PlotRange -> -1, 1, -1, 1, -1, 1,
          ImageSize -> Medium]


          graphics






          share|improve this answer











          $endgroup$






















            0













            $begingroup$

            The problem appears to be the Thickness directive. According to the documentation, it says, "is a graphics directive which specifies that lines which follow are to be drawn with thickness r. The thickness r is given as a fraction of the horizontal plot range."



            I used "AbsoluteThickness" and it seems to do what you want. So try



            g2 = Graphics3D[Directive[Red, AbsoluteThickness[0.02]], InfiniteLine[0, 0, 0, 1,0, 0]];Show[g1, g2, PlotRange -> -1, 1, -1, 1, -1, 1, Boxed -> False, ImageSize -> Large]





            share|improve this answer









            $endgroup$














            • $begingroup$
              Thanks, this didn't fix it for me in my situation unfortunately, I still get clipping in my application. But AbsoluteThickness is still quite useful
              $endgroup$
              – Kai
              5 hours ago











            • $begingroup$
              Sorry it didn't work for you. I do note that in 12.0, the AbsoluteThickness directive doesn't seem to be doing anything so it was a false hope. I like the tube idea from @m_goldberg
              $endgroup$
              – Mark R
              4 hours ago













            Your Answer








            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%2f204591%2fhow-to-prevent-graphics-clipping-through-each-other%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$

            I recommend using tubes to represent thick lines in 3D graphics. They look better because they are true 3D objects with circular cross-setions and not flat ribbons, which are how thick lines are drawn in 3D graphics.



            Graphics3D[
            Black, Sphere[0, 0, 0, 0.1], Red, Tube[-1, 0, 0, 1, 0, 0, .04],
            PlotRange -> -1, 1, -1, 1, -1, 1,
            ImageSize -> Medium]


            graphics






            share|improve this answer











            $endgroup$



















              6













              $begingroup$

              I recommend using tubes to represent thick lines in 3D graphics. They look better because they are true 3D objects with circular cross-setions and not flat ribbons, which are how thick lines are drawn in 3D graphics.



              Graphics3D[
              Black, Sphere[0, 0, 0, 0.1], Red, Tube[-1, 0, 0, 1, 0, 0, .04],
              PlotRange -> -1, 1, -1, 1, -1, 1,
              ImageSize -> Medium]


              graphics






              share|improve this answer











              $endgroup$

















                6














                6










                6







                $begingroup$

                I recommend using tubes to represent thick lines in 3D graphics. They look better because they are true 3D objects with circular cross-setions and not flat ribbons, which are how thick lines are drawn in 3D graphics.



                Graphics3D[
                Black, Sphere[0, 0, 0, 0.1], Red, Tube[-1, 0, 0, 1, 0, 0, .04],
                PlotRange -> -1, 1, -1, 1, -1, 1,
                ImageSize -> Medium]


                graphics






                share|improve this answer











                $endgroup$



                I recommend using tubes to represent thick lines in 3D graphics. They look better because they are true 3D objects with circular cross-setions and not flat ribbons, which are how thick lines are drawn in 3D graphics.



                Graphics3D[
                Black, Sphere[0, 0, 0, 0.1], Red, Tube[-1, 0, 0, 1, 0, 0, .04],
                PlotRange -> -1, 1, -1, 1, -1, 1,
                ImageSize -> Medium]


                graphics







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 6 hours ago

























                answered 6 hours ago









                m_goldbergm_goldberg

                91.3k8 gold badges75 silver badges206 bronze badges




                91.3k8 gold badges75 silver badges206 bronze badges


























                    0













                    $begingroup$

                    The problem appears to be the Thickness directive. According to the documentation, it says, "is a graphics directive which specifies that lines which follow are to be drawn with thickness r. The thickness r is given as a fraction of the horizontal plot range."



                    I used "AbsoluteThickness" and it seems to do what you want. So try



                    g2 = Graphics3D[Directive[Red, AbsoluteThickness[0.02]], InfiniteLine[0, 0, 0, 1,0, 0]];Show[g1, g2, PlotRange -> -1, 1, -1, 1, -1, 1, Boxed -> False, ImageSize -> Large]





                    share|improve this answer









                    $endgroup$














                    • $begingroup$
                      Thanks, this didn't fix it for me in my situation unfortunately, I still get clipping in my application. But AbsoluteThickness is still quite useful
                      $endgroup$
                      – Kai
                      5 hours ago











                    • $begingroup$
                      Sorry it didn't work for you. I do note that in 12.0, the AbsoluteThickness directive doesn't seem to be doing anything so it was a false hope. I like the tube idea from @m_goldberg
                      $endgroup$
                      – Mark R
                      4 hours ago















                    0













                    $begingroup$

                    The problem appears to be the Thickness directive. According to the documentation, it says, "is a graphics directive which specifies that lines which follow are to be drawn with thickness r. The thickness r is given as a fraction of the horizontal plot range."



                    I used "AbsoluteThickness" and it seems to do what you want. So try



                    g2 = Graphics3D[Directive[Red, AbsoluteThickness[0.02]], InfiniteLine[0, 0, 0, 1,0, 0]];Show[g1, g2, PlotRange -> -1, 1, -1, 1, -1, 1, Boxed -> False, ImageSize -> Large]





                    share|improve this answer









                    $endgroup$














                    • $begingroup$
                      Thanks, this didn't fix it for me in my situation unfortunately, I still get clipping in my application. But AbsoluteThickness is still quite useful
                      $endgroup$
                      – Kai
                      5 hours ago











                    • $begingroup$
                      Sorry it didn't work for you. I do note that in 12.0, the AbsoluteThickness directive doesn't seem to be doing anything so it was a false hope. I like the tube idea from @m_goldberg
                      $endgroup$
                      – Mark R
                      4 hours ago













                    0














                    0










                    0







                    $begingroup$

                    The problem appears to be the Thickness directive. According to the documentation, it says, "is a graphics directive which specifies that lines which follow are to be drawn with thickness r. The thickness r is given as a fraction of the horizontal plot range."



                    I used "AbsoluteThickness" and it seems to do what you want. So try



                    g2 = Graphics3D[Directive[Red, AbsoluteThickness[0.02]], InfiniteLine[0, 0, 0, 1,0, 0]];Show[g1, g2, PlotRange -> -1, 1, -1, 1, -1, 1, Boxed -> False, ImageSize -> Large]





                    share|improve this answer









                    $endgroup$



                    The problem appears to be the Thickness directive. According to the documentation, it says, "is a graphics directive which specifies that lines which follow are to be drawn with thickness r. The thickness r is given as a fraction of the horizontal plot range."



                    I used "AbsoluteThickness" and it seems to do what you want. So try



                    g2 = Graphics3D[Directive[Red, AbsoluteThickness[0.02]], InfiniteLine[0, 0, 0, 1,0, 0]];Show[g1, g2, PlotRange -> -1, 1, -1, 1, -1, 1, Boxed -> False, ImageSize -> Large]






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 8 hours ago









                    Mark RMark R

                    3458 bronze badges




                    3458 bronze badges














                    • $begingroup$
                      Thanks, this didn't fix it for me in my situation unfortunately, I still get clipping in my application. But AbsoluteThickness is still quite useful
                      $endgroup$
                      – Kai
                      5 hours ago











                    • $begingroup$
                      Sorry it didn't work for you. I do note that in 12.0, the AbsoluteThickness directive doesn't seem to be doing anything so it was a false hope. I like the tube idea from @m_goldberg
                      $endgroup$
                      – Mark R
                      4 hours ago
















                    • $begingroup$
                      Thanks, this didn't fix it for me in my situation unfortunately, I still get clipping in my application. But AbsoluteThickness is still quite useful
                      $endgroup$
                      – Kai
                      5 hours ago











                    • $begingroup$
                      Sorry it didn't work for you. I do note that in 12.0, the AbsoluteThickness directive doesn't seem to be doing anything so it was a false hope. I like the tube idea from @m_goldberg
                      $endgroup$
                      – Mark R
                      4 hours ago















                    $begingroup$
                    Thanks, this didn't fix it for me in my situation unfortunately, I still get clipping in my application. But AbsoluteThickness is still quite useful
                    $endgroup$
                    – Kai
                    5 hours ago





                    $begingroup$
                    Thanks, this didn't fix it for me in my situation unfortunately, I still get clipping in my application. But AbsoluteThickness is still quite useful
                    $endgroup$
                    – Kai
                    5 hours ago













                    $begingroup$
                    Sorry it didn't work for you. I do note that in 12.0, the AbsoluteThickness directive doesn't seem to be doing anything so it was a false hope. I like the tube idea from @m_goldberg
                    $endgroup$
                    – Mark R
                    4 hours ago




                    $begingroup$
                    Sorry it didn't work for you. I do note that in 12.0, the AbsoluteThickness directive doesn't seem to be doing anything so it was a false hope. I like the tube idea from @m_goldberg
                    $endgroup$
                    – Mark R
                    4 hours ago

















                    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%2f204591%2fhow-to-prevent-graphics-clipping-through-each-other%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

                    ParseJSON using SSJSUsing AMPscript with SSJS ActivitiesHow to resubscribe a user in Marketing cloud using SSJS?Pulling Subscriber Status from Lists using SSJSRetrieving Emails using SSJSProblem in updating DE using SSJSUsing SSJS to send single email in Marketing CloudError adding EmailSendDefinition using SSJS

                    Кампала Садржај Географија Географија Историја Становништво Привреда Партнерски градови Референце Спољашње везе Мени за навигацију0°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.340°11′ СГШ; 32°20′ ИГД / 0.18° СГШ; 32.34° ИГД / 0.18; 32.34МедијиПодациЗванични веб-сајту

                    19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу