• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[PLUGIN] Voronoi + Conic Curve

Scheduled Pinned Locked Moved Plugins
136 Posts 53 Posters 222.0k Views 52 Watching
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.
  • M Offline
    MattC
    last edited by MattC 24 Jul 2012, 09:03

    UPDATE
    Rubies modified according to ThomThom quideline
    UPDATE 2
    VoronoiXY updated - code adjusted
    Hello everybody.

    A bit time ago there was an interesting challenge posted on this forums:
    http://forums.sketchucation.com/viewtopic.php?f=323%26amp;t=28521
    I was interested in it , because I want to make something like that for myself. Well maybe a bit smaller.
    Workflow is clearly stated in that discusion, but two problems onderway were not so easy to solve:

    • genereating Voronoi diagram from points cloud (as many people struggle with Qhull plugin)
    • Creating nice cutouts in those cells,

    So here we go :
    Voronoi - At this time it is limited to XY plane, but in a code I have put remarks what have to be adjusted (it is not tested, if it is all You have to change). My algorythm uses delauney3.rb , and is based on code of Tig's triangulation.
    In fact TIG's plugin can create delauney triangulation also for nonplanar set of points, but my voronoi plugin operates on a plane.

    https://lh5.googleusercontent.com/-qcihnVg_w-E/UA5QFyVjXII/AAAAAAAABYc/5LUuu1mjslw/s800/voronoi1.png

    here are base points and result of delauney triangulation

    https://lh6.googleusercontent.com/-7JMZZ5lqXBg/UA5QGP07NiI/AAAAAAAABYc/q9ZvLkVm9Bo/s800/voronoi2.png

    What we also want to know is convex hull of those points, as that will be limit of our voronoi diagram, here You can see convex hull and combined convexhull and delauney triangulation.
    https://lh6.googleusercontent.com/-1EXyagUeZbw/UA5QGJr_UGI/AAAAAAAABYY/6I6UPjw0XYg/s800/voronoi3.png

    And result is a Voronoi diagram for base points. Every Voronoi cell is put in a Group.I have put delauney triangulation under voronoi so You can see dependences between those two.
    Operation:

    • Select cpoints
    • Menu plugin / VoronoiXY

    Next step is creating oval cutouts based on a cells.
    For those I used Rational Bezier Curves.
    http://en.wikipedia.org/wiki/B%C3%A9zier_curve#Rational_B.C3.A9zier_curves
    After executing plugin You can use TAB to change 3 parameters.

    • offset - if You want to leave some material on the edge of cell
    • Points- number of points that create every segment of a curve
    • Weight - it controls how round / pointed curve You get
      Every curve is put in a group.
      I think dat pictures will explain everything:

    https://lh6.googleusercontent.com/-m1717a74UeU/UA5QFfDWT6I/AAAAAAAABYc/iAYtIxepwsc/s800/conic1.png

    https://lh6.googleusercontent.com/-teJ7U6LW-ME/UA5QFejuNlI/AAAAAAAABYc/iQtJp3Xn1lw/s800/coninc2.png

    One remark, because offset produces sometimes intersecting polygon, result of coniccurve can also intersect itself:

    https://lh5.googleusercontent.com/-Crfgeq2Fscw/UA5QFdjR4kI/AAAAAAAABYc/u4zaOygGHAo/s800/conic3.png

    Operation:

    • Menu Plugins/ Conic Curve in Face
    • TAB to set parameters
    • Click Face

    Feel free to play with it.It is intended for non comertial use.
    If You decide to change something / improve it - please report here what have You done, so others can also use improved version.

    Greets Matt[mod=:1sotkqmg]%(#FF0000)[PLEASE GET/USE THE LATEST VERSION...
    FROM THE PluginStore]
    [/mod:1sotkqmg]


    Create closed rational Bezier spline based on a face vertices


    Create voronoi diagram for set of cpoints

    1 Reply Last reply Reply Quote 0
    • K Offline
      Krisidious
      last edited by 24 Jul 2012, 09:12

      so what are some examples of what you would use this for?

      By: Kristoff Rand
      Home DesignerUnique House Plans

      1 Reply Last reply Reply Quote 0
      • M Offline
        MattC
        last edited by 24 Jul 2012, 09:18

        For me it is for a interior decoration purposes.
        Like a wall panel ,or sort of sculpture.
        Matt

        1 Reply Last reply Reply Quote 0
        • M Offline
          mitcorb
          last edited by 24 Jul 2012, 11:56

          I notice you use the name Delaunay and Delauney in this post. Could the various spellings affect functionality of the script? Or, are they not the same thing?

          I take the slow, deliberate approach in my aimless wandering.

          1 Reply Last reply Reply Quote 0
          • M Offline
            MattC
            last edited by 24 Jul 2012, 12:12

            Yup , my fault.
            I've corrected it. there should be delauney3.rb as it uses that ruby for triangulation. Triangulation name is Delauney Triangulation.
            Matt

            1 Reply Last reply Reply Quote 0
            • T Offline
              thomthom
              last edited by 24 Jul 2012, 12:48

              Nice plugin! πŸ‘

              However, Looking at the code I see that there are many methods on the global namespace. These methods will spread to ALL classes - which is not good. Could you please wrap everything into a separate unique namespace - module? Everything, even all the classes etc.
              Have a look at this article I put together with guidelines for SketchUp plugins: http://www.thomthom.net/thoughts/2012/01/golden-rules-of-sketchup-plugin-development/

              Thomas Thomassen β€” SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • S Offline
                srx
                last edited by 24 Jul 2012, 14:33

                Thanks! πŸ‘

                www.saurus.rs

                1 Reply Last reply Reply Quote 0
                • M Offline
                  mitcorb
                  last edited by 24 Jul 2012, 23:45

                  Forgive my further ignorance, please. Why is it called "Conic Curve?"

                  I take the slow, deliberate approach in my aimless wandering.

                  1 Reply Last reply Reply Quote 0
                  • P Offline
                    pilou
                    last edited by 25 Jul 2012, 00:00

                    Some VoronoΓ― fractures in Blender πŸ˜‰

                    [flash=560,315:3l0fl5l0]http://www.youtube.com/v/FIPu9_OGFgc[/flash:3l0fl5l0]

                    Frenchy Pilou
                    Is beautiful that please without concept!
                    My Little site :)

                    1 Reply Last reply Reply Quote 0
                    • I Offline
                      ivreich
                      last edited by 25 Jul 2012, 07:37

                      Hi MattC

                      Thanks for this plugin..been looking for something like this for a while.

                      Anyway, I gave it a go and am experiencing lots of problems generating a proper voronoi lattice. have attached a screenshot and also the SU file for you to look at.

                      Cheers,

                      Joel


                      Voronoi XY Errors


                      Voronoi XY Errors SU File

                      1 Reply Last reply Reply Quote 0
                      • K Offline
                        Krisidious
                        last edited by 25 Jul 2012, 07:54

                        SO Matt are you saying if I had a box shaped plan I could plan a curve through it to fit well?

                        By: Kristoff Rand
                        Home DesignerUnique House Plans

                        1 Reply Last reply Reply Quote 0
                        • M Offline
                          MattC
                          last edited by 25 Jul 2012, 08:24

                          Could You show me an example of box shaped plan and what You would like to obtain ?

                          1 Reply Last reply Reply Quote 0
                          • P Offline
                            pilou
                            last edited by 25 Jul 2012, 08:52

                            Cool things in 3D πŸ˜‰

                            http://matsysdesign.com/wp-content/uploads/2009/06/drawings_01_voronoi3d.jpg

                            Frenchy Pilou
                            Is beautiful that please without concept!
                            My Little site :)

                            1 Reply Last reply Reply Quote 0
                            • P Offline
                              pilou
                              last edited by 25 Jul 2012, 09:35

                              @unknownuser said:

                              Or something else

                              Just image found on the Net πŸ˜‰

                              But will be easy to make with your futur plug! β˜€

                              Frenchy Pilou
                              Is beautiful that please without concept!
                              My Little site :)

                              1 Reply Last reply Reply Quote 0
                              • M Offline
                                MattC
                                last edited by 25 Jul 2012, 09:36

                                Pilou You 're teasing me πŸ˜„
                                Is it Sketchup ??
                                Or something else?
                                Well only step that I miss from those, is generation of 3D Voronoi πŸ˜„
                                For rest I have plugins already.

                                @ Joel, indeed there WAS a problem - file in first message is updated.
                                Matt

                                1 Reply Last reply Reply Quote 0
                                • N Offline
                                  nektares
                                  last edited by 25 Jul 2012, 19:39

                                  Hey i always loved voronoi structures and iΒ΄m very interested on this plugin but when i try to use it i get this:

                                  Error: #<ArgumentError: Cannot convert argument to Sketchup::Point3d>
                                  C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/VoronoiXY.rb:277:in point_in_polygon_2D' C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/VoronoiXY.rb:277:in voropoints'
                                  C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/VoronoiXY.rb:267:in each' C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/VoronoiXY.rb:267:in voropoints'
                                  C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/VoronoiXY.rb:128:in voronoi' C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/VoronoiXY.rb:105:in each'
                                  C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/VoronoiXY.rb:105:in voronoi' C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/VoronoiXY.rb:36:in initialize'
                                  C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/VoronoiXY.rb:384:in `new'
                                  C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/VoronoiXY.rb:384

                                  am i doing something wrong, i read carefully and i think itΒ΄s my SketchUp maybe?

                                  1 Reply Last reply Reply Quote 0
                                  • M Offline
                                    MattC
                                    last edited by 25 Jul 2012, 22:14

                                    Hi Can You attach sketchup file that is causing problems, or is it in general ?
                                    Matt

                                    1 Reply Last reply Reply Quote 0
                                    • T Offline
                                      the.pjt
                                      last edited by 26 Jul 2012, 03:33

                                      HI Matt ...
                                      πŸ˜„
                                      I have made some PNG Icons ,made a loader and toolbar , define Extention for your exelent codes , and developed them a bit πŸ˜‰
                                      added a custom cursor to the ConicCurveInFace.rb
                                      and removed the annoying UI message-box group counter from VoronoiXY.rb
                                      I have also added TIG's pointcloude script as a defoult part of it , and I also made a Icon for that tool too ( points cloud triangulation ) .. I also made codes nicely and full commented .. just for you dear main developer πŸ˜„

                                      suggestion for next versions :
                                      add a point cloud generator ruby tool
                                      add option to decide the resoult of VoronoiXY tool should be grouped or not
                                      add option (ConicCurveInFace.rb) that let user make ConicCurves from grouped face (resoult of VoronoiXY tool)
                                      add option (ConicCurveInFace.rb) that let user make ConicCurves from a set of selections .. no need to click and click and click ... πŸ˜„

                                      and ... thanks a lot for your great script


                                      to dear modorators : please please please don't delet this post !!! 😒 .. TIG says :
                                      Permission to use, copy, modify, and distribute this software for
                                      any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies... I didn't delete that copyright part .. and I also added TIG's name after his tool menu item ! πŸ˜‰ is there any copyright issue again ? [mod=:3b85s0b6]PLEASE GET/USE THE LATEST VERSION...
                                      FROM THE PluginStore...[/mod:3b85s0b6]


                                      voronoi_conic.zip

                                      1 Reply Last reply Reply Quote 0
                                      • T Offline
                                        the.pjt
                                        last edited by 26 Jul 2012, 03:40

                                        here is the PSD files of ICONS


                                        icons.zip

                                        1 Reply Last reply Reply Quote 0
                                        • T Offline
                                          thomthom
                                          last edited by 26 Jul 2012, 08:47

                                          @the.pjt said:

                                          to dear modorators : please please please don't delet this post !!

                                          This one is ok - as it has explicit statement that it can be modified and distributed.
                                          We do however prefer that the downloads for plugins at in the very first post of a plugin's thread. Otherwise it's hard for people to find the latest version if it is buried deep inside the thread. Could you agree with Matt whether that Matt puts the download in the first post - or you create a new thread where you maintain this modified version?

                                          Thomas Thomassen β€” SketchUp Monkey & Coding addict
                                          List of my plugins and link to the CookieWare fund

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 3
                                          • 4
                                          • 5
                                          • 6
                                          • 7
                                          • 1 / 7
                                          1 / 7
                                          • First post
                                            8/136
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement