HISE Logo Forum
    • Categories
    • Register
    • Login

    How to Detect if Inside Ellipse?

    Scheduled Pinned Locked Moved Scripting
    23 Posts 5 Posters 1.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ustkU
      ustk @ulrik
      last edited by ustk

      @ulrik Well, getting the area of a triangle is possible with trigo but not an easy thing (I don't know how from the top of my head though I tested a while ago two mathematics way of doing it)
      From here, seeing the particular shape you're using and that you are going further than simple ellipse or rectangle, the solution would be the implementation of a Juce function to detect if inside the path. (a different one than getIntersection). Then it'll be very easy and less mind torturing (even if I like that 🙃 )

      Can't help pressing F5 in the forum...

      1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @ulrik
        last edited by ustk

        @ulrik Stupid me... I already added it along with getIntersection 🙄
        It's Path.contains(point)

        HiseSnippet 931.3ocsV8uaaaCDlxIbsVaEaAnO.B8uT.7Dr6OGPQQahi8fQaREp6JJPQQAizYKhPQJPREWig7LrW08FrcTxNRd0oXvn0v1w2ceG4GO9cmRrVk.FiRS7591kE.w6mnSWJsYCyXbIYxIDuCni4xzQBAuv.GoAF43kELiARIdd686NXdc2mT85ue9wLASl.MtHj2o3Ivq34bai23W7RtPLlkBukm2B8CewjDkbnRnJQJsGsOofkbAaNbFyAqCk38CiR4VkdpkYACwa+iUoKmloVHqw+Ntget.bFCHSwEp18XkH0wXmWxvLtHMd8Q2PvUItoPrWcg3tzS4o7q82TP9kp.AMYztd30YS5s2FzaPa50uE81Bk7ZQo8qozAzoIZdgsIhiO+HchzB5YLrr2lJ0XIc9qNzgJDgzFkyt.FqQiqyH7w862K.+5vm5inLJADkH.lNDc36iWFFavkLcPrTD7rf0KzbvNTkWnjnQ38vX2yAuAcQKrInlwBwLalaMKhXooX0QG9gGfaM94i8BdD9Fow8cbwwDebEiLfMFq412nJsbIDNqTlX4JY37C8+S+tyc.pUJg0+wDsHiaALeLXplsnZOK5ET336wpRYpIbPT+C6E39Fg42kOKHzlwMQoLKKhalHM7T3P+t3Nr0sXIHDpEtjwvyPQ7MsINHW4eUqSyopRCLjIDmiZ5liCbIVkpNReIQvxXQDVVsXgvD9gJnQetWP8OV9Q2lTkkFJb0JWEtZK88Wu9AJ4YJK7ZYX0d3ekev+MzrYaMl6BTqDBPu0vtNW8WKwPYY94ftGpHDkv0.Q47l8HzatGocKbRsdpEPkbhjaecAHuoFaxJQH9q+XxIXk00XsxGhq.zVtiBdm.WhSopay5ROALWXUEUXWoxId2xVE8NqaBYRPP3XqFkhWvjO2dl2x1FK3o1LDl266PHY.edlcsEyIlVKIPd7yziDhfFGjubH.N9QkVJX1MmI4FDuJ.dIrwf.WyNplrKaOn9a1fp+uT7.ZL2ljscN1YKbDup9dvwUi2uCczrYPhsgf6SG+9uOyxI0ivleJyp4nNgdVY9TbZRBf6tDkQtl.uNN4ZscemsqBLEjoUF+C9ZUvANauUAGrNHImknUeJot0y8.jaW4A4jr5Ymcom5rCFPpZGcx19Q8I43yx9TRh63+qXGz1y496PNOXGx4g6PNOZGx4w6PNOYGx429p4392HNpzpxqaGPGwiplQ44MRxPkUkJj7u.xPkoEC
        

        pathContains.gif

        Can't help pressing F5 in the forum...

        ulrikU Dan KorneffD E 4 Replies Last reply Reply Quote 5
        • ulrikU
          ulrik @ustk
          last edited by

          @ustk Nice one 👍

          Hise Develop branch
          MacOs 15.3.1, Xcode 16.2
          http://musikboden.se

          1 Reply Last reply Reply Quote 0
          • Dan KorneffD
            Dan Korneff @ustk
            last edited by

            @ustk nice job!

            Dan Korneff - Producer / Mixer / Audio Nerd

            1 Reply Last reply Reply Quote 0
            • ulrikU
              ulrik @ustk
              last edited by

              @ustk Would it also be possible to add text to follow a path you think?

              Hise Develop branch
              MacOs 15.3.1, Xcode 16.2
              http://musikboden.se

              ustkU 1 Reply Last reply Reply Quote 0
              • ustkU
                ustk @ulrik
                last edited by

                @ulrik Alright... It's official... I'm drinking to much...

                writeOnPath.gif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J4dysJ2AMLqH1A+vufTsVgPMqjF0pzZkXXi5f31l2pqjqR+0c0k8f5qqf12Sy+Mo+2yaC9i6mvBQISIkNN.wmtk5HoY5pJccysk8axgphBi4rsmA.y4ox7POjSEJ5Yk3n4sMw2m0vgykmtukTjlBlYdrK.vGPQG93QWQkcftEoio2IHzXe1oE1u+oE0GlEVzFslfBdeNScVFk+9FwgJ68Be8y8ODb05QLkz.4xnRESCAqCouElWWLvog8gz7qUhLirkM7QVetxv8QUiiHbZJhACcrsgfB5c0m9Oo9haXQpj6H72+4dITVbhpNEHmQbSUlCfmu1denK8TBnGNVDFHKhFmRTyNkVe0jRFPvXlQi5we7blZR8qt7Qaz8+WHtpc.SElLeLtzbvHDx9TfwxK77H6iFNjFplBvUrO9W9zb6FTwnwXn8ljA4K1mNdz.XXTHErNGRmzECVKoSaKV6oWq8.CfI7lE+K7TxzWu1pjoeESzHRnT7lvhRP8Up9BCE.SbysIaXehdM1GYJK0oudtdnQvs6dSXn93uATIMec1ZAzY6EPmcV.cdxBnytKfNe+BnyS+f5nuX89iUhQEkC.gfiL8prrNhSfLKSVH5+.KzJo4
                

                Can't help pressing F5 in the forum...

                ulrikU Dan KorneffD 2 Replies Last reply Reply Quote 7
                • ulrikU
                  ulrik @ustk
                  last edited by

                  @ustk Hahaha....beautiful!!! 🍺 cheers

                  Hise Develop branch
                  MacOs 15.3.1, Xcode 16.2
                  http://musikboden.se

                  1 Reply Last reply Reply Quote 0
                  • E
                    ericchesek
                    last edited by

                    Hahaha this is incredible. Excellent work!

                    1 Reply Last reply Reply Quote 0
                    • E
                      ericchesek @ustk
                      last edited by

                      @ustk Just to be clear, this only works with paths and not fillEllipse or drawEllipse, for example? If so, is there an API reference for what shapes can be made with paths? Similar to what you did with

                      const var p = Content.createPath();
                      p.addStar([300,300], 5, 50, 200, 0); 
                      
                      ulrikU 1 Reply Last reply Reply Quote 0
                      • ulrikU
                        ulrik @ericchesek
                        last edited by

                        @ericchesek in the API you'll find this

                        Skärmavbild 2023-08-08 kl. 21.39.04.png

                        Hise Develop branch
                        MacOs 15.3.1, Xcode 16.2
                        http://musikboden.se

                        E 1 Reply Last reply Reply Quote 0
                        • E
                          ericchesek @ulrik
                          last edited by

                          @ulrik Hmm, maybe I'm on an older build. 3.0.0, build 650, 2023 April 3.
                          I only have a fraction of these options in the "Path" API list. I'll look into it. Thanks!

                          ustkU 1 Reply Last reply Reply Quote 0
                          • Dan KorneffD
                            Dan Korneff @ustk
                            last edited by

                            @ustk said in How to Detect if Inside Ellipse?:

                            Alright... It's official... I'm drinking to much...

                            Maybe I'm not drinking enough

                            Dan Korneff - Producer / Mixer / Audio Nerd

                            ustkU 1 Reply Last reply Reply Quote 0
                            • ustkU
                              ustk @Dan Korneff
                              last edited by

                              @Dan-Korneff said in How to Detect if Inside Ellipse?:

                              @ustk said in How to Detect if Inside Ellipse?:

                              Alright... It's official... I'm drinking to much...

                              Maybe I'm not drinking enough

                              🤣 :clinking_beer_mugs:

                              Can't help pressing F5 in the forum...

                              1 Reply Last reply Reply Quote 0
                              • ustkU
                                ustk @ericchesek
                                last edited by ustk

                                @ericchesek April 3 is the date you built, not the branch date. I've implemented the new methods before that so you probably have to build the develop branch again

                                Can't help pressing F5 in the forum...

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post

                                22

                                Online

                                1.7k

                                Users

                                11.8k

                                Topics

                                102.7k

                                Posts