sketchucation logo sketchucation
    • 登入
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🔌 Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download

    [Plugin] Voronoi - Convex Hull

    已排程 已置頂 已鎖定 已移動 Plugins
    27 貼文 20 Posters 57.8k 瀏覽 20 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • A 離線
      a4chitect
      最後由 a4chitect 編輯

      see attached jpg for instructions

      original topic with more images

      thanks:
      to the creators of the Qhull program (calculates voronoi, convex hull,...) http://www.qhull.org/
      to this community and all people involved in sketchup/ruby/forums
      licence: your only duty is to share any improvements and/or upgrades of this code under this same condition

      notes:

      All file locations are inside your Sketchup\Plugins\Qhull directory
      All plugins can be found in sketchup under toolbar menu Plugins\Qhull

      Points were created with the qhull\pointify plugin
      -it converts all vertices of the selection into construction points

      to construct Voronoi (or convex Hull) select the points (you don't have to worry about
      different geometry in the selection set, the plugin filters out points only)
      -all points are selected, you have to write them to a file for the qhull engine to process them
      this can be done by pressing qhull\export cpoints

      once exported, you can start the Voronoi buildup by running
      qhull\voronoi
      -please note that this always takes your your most recently exported cpoints
      -nothing has to be selected for the construction to start

      debugging:
      -one error can occur while exporting points, to check this process just delete points.txt file in the qhull directory and run the qhull\export cpoints plugin
      then open the newly created points.txt file and if it is not blank, all went ok
      -second possible problem is that the qhull engine is unable to process your geometry (out of mathematical reasons) just check if a results file gets generated in the
      qhull directory: qvoronoi.txt (of course delete any previous qvoronoi.txt before)
      -the third possibility is that the constructing script cannot process the results into geometry, this is the place to let me know

      when you keep getting a previous result instead of the current one, try to delete the qhull\qvoronoi.txt file manually

      PLUGIN SPECIFIC
      Voronoi: -sometimes result is easier for qhull to compute when you export the bounding box along with the cpoints
      -i couldn't get the engine to export lines reaching infinity, so you will not get these right now
      Convex hull: -when you don't want to get a simple 'box', don't export the bounding box along with cpoints

      windows only
      but is very easily portable for a mac - feel free to do so, you can find the mac version of qhull here: http://qhull.darwinports.com/


      extract to your Sketchup\Plugins directory (folder)

      1 條回覆 最後回覆 回覆 引用 0
      • T 離線
        tolieolson
        最後由 編輯

        Hi. I love the concept of the plugin. Problem is that it won't work even after I've tried deleting the old point file and creating a new one.

        The details of what I'm doing:
        I create a box.
        Draw lines connecting sides in a random fashion, about 9 lines.
        Pointify.
        Export cpoints.
        Click on voronoi, and all that happens is a flash of a dialog box in the corner of my screen that looks like DOS. No shape emerges.

        Perhaps there is a bug that I ran into. Any tips?

        1 條回覆 最後回覆 回覆 引用 0
        • A 離線
          AcesHigh
          最後由 編輯

          I must be sincere about my dumbness. I dont understand what exactly this plugin does and what uses could it have.

          Any example of what type of modelling is made easier by the plugin?

          1 條回覆 最後回覆 回覆 引用 0
          • K 離線
            kwistenbiebel
            最後由 編輯

            I have the same issue as AcesHigh.

            It seems to be a very useful thing for a lot of people but I never understood what it does and how to get the preliminary geometry (curved 3Dlines ?) in place before using the plugin.

            The lingo used (Voronoi?) sounds like chinese to me. 😄

            1 條回覆 最後回覆 回覆 引用 0
            • P 離線
              pav_3j
              最後由 編輯

              ditto

              pav

              Just won the 'Who is Least Competitive Championships' where trying to win will make you lose. Trying to lose makes you win which makes you lose. Not trying at all makes you lose which makes you win which makes you lose.

              1 條回覆 最後回覆 回覆 引用 0
              • R 離線
                remus
                最後由 編輯

                Well i'll add my bit here. My understanding of vornoir (or convex hull) is that its the sort of shape youd get if you draped a cloth over a shape. Apparently its useful for physics simulations, i tihnk sketchyphysics uses them for some shapes.

                Im sure if you do a google search on it youll get lots of info.

                http://remusrendering.wordpress.com/

                1 條回覆 最後回覆 回覆 引用 0
                • A 離線
                  a4chitect
                  最後由 編輯

                  I can't help further at the moment, but please check the link mentioned in the first post (directing to the original thread) for pictures and explanations

                  voronoi is a system of subdividing space - in a special way, so that each element gets enclosed in a cell while each wall is equally far from both points

                  convex hull is like remus said a little like wrapping your points in a stiff cloth (because it covers all concave inserts) hence the name: convex hull

                  script is not a normal ruby script because the whole calculation is done outside of sketchup (the already mentioned dos command prompt) in a program called qhull. I managed to tweak the script to run almost always at my pc, it is far from clean and reliable. I have posted all the possible steps to make it run, and can only wish you luck at the moment. 👍

                  1 條回覆 最後回覆 回覆 引用 0
                  • A 離線
                    a4chitect
                    最後由 編輯

                    this is a little modified version, it has probably the same bugs and unreliable performance, but maybe it will work for you


                    replace your current 'voronoi.rb' make a bckp if possible

                    1 條回覆 最後回覆 回覆 引用 0
                    • halroachH 離線
                      halroach
                      最後由 編輯

                      @tolieolson said:

                      Hi. I love the concept of the plugin. Problem is that it won't work even after I've tried deleting the old point file and creating a new one.

                      The details of what I'm doing:
                      I create a box.
                      Draw lines connecting sides in a random fashion, about 9 lines.
                      Pointify.
                      Export cpoints.
                      Click on voronoi, and all that happens is a flash of a dialog box in the corner of my screen that looks like DOS. No shape emerges.

                      Perhaps there is a bug that I ran into. Any tips?

                      Hi, I'm running into the same problem. Have you found a solution?

                      FlexTools - Super Quick Windows, Doors, Slats...

                      1 條回覆 最後回覆 回覆 引用 0
                      • halroachH 離線
                        halroach
                        最後由 編輯

                        I'm getting the same problem as tolieolson's

                        "I create a box.
                        Draw lines connecting sides in a random fashion, about 9 lines.
                        Pointify.
                        Export cpoints.
                        Click on voronoi, and all that happens is a flash of a dialog box in the corner of my screen that looks like DOS. No shape emerges."

                        In the Ruby Console I get the folloing error:

                        Error; #<Errno;;ENOENT; No such file or directory - C;/Program Files/Google/Google SketchUp 6/Plugins\qhull\qvoronoi.txt>
                        C;/Program Files/Google/Google SketchUp 6/Plugins/voronoi.rb;14;in `initialize'
                        C;/Program Files/Google/Google SketchUp 6/Plugins/voronoi.rb;14;in `new'
                        C;/Program Files/Google/Google SketchUp 6/Plugins/voronoi.rb;14;in `mesh'
                        C;/Program Files/Google/Google SketchUp 6/Plugins/tooling/voronoi.rb;138
                        C;/Program Files/Google/Google SketchUp 6/Plugins/tooling/voronoi.rb;138;in `call'
                        
                        

                        suggestions?
                        Thanks!

                        FlexTools - Super Quick Windows, Doors, Slats...

                        1 條回覆 最後回覆 回覆 引用 0
                        • S 離線
                          sawamura
                          最後由 編輯

                          I have the same problem of Halroach.

                          this plugin works on sketchup 6?

                          i can make the points.txt file by using the extract Cpoints tool, but when i click in voronoi, nothing happends.

                          1 條回覆 最後回覆 回覆 引用 0
                          • Z 離線
                            zhuangsuph
                            最後由 編輯

                            this is a little modified version, it has probably the same bugs and unreliable performance, but maybe it will work for you

                            1 條回覆 最後回覆 回覆 引用 0
                            • Z 離線
                              Z_stern
                              最後由 編輯

                              I have exactly same problem with this plugin. Points are exported correctly, but "voronoi" command brings no result (and I see same errors in ruby console as user harloch had).
                              Sketchup Pro 6.4.112, Win XP HE.

                              1 條回覆 最後回覆 回覆 引用 0
                              • C 離線
                                cyin6
                                最後由 編輯

                                I have some problems with export_points.rb
                                Error: #<NoMethodError: undefined method `triangulate' for Qexport:Class>
                                where is the triangulate def called on line 89?

                                1 條回覆 最後回覆 回覆 引用 0
                                • M 離線
                                  mcdermottadrian
                                  最後由 編輯

                                  Hi,

                                  I'm having the same issues with this plugin; can generate a points file, but neither the convex hull nor voronoi does anything (just a flash of the command prompt window).

                                  Amazing potential... if it worked. Has anyone figured this one out?

                                  1 條回覆 最後回覆 回覆 引用 0
                                  • C 離線
                                    Color_Man
                                    最後由 編輯

                                    There are a large number of significant errors in the command structures in these scripts. the cpoints script hangs most of the time and never gets past writing the first line, unless you respond YES to adding the bounding box.

                                    1 條回覆 最後回覆 回覆 引用 0
                                    • A 離線
                                      andrew1184
                                      最後由 編輯

                                      Anyone figured out what the deal is with these scripts? I've been trying to figure out how to write a voronoi script for Sketchup for quite a while now and every time I start looking for information the only information I find is this thread with a link to a script that doesn't work at all.

                                      1 條回覆 最後回覆 回覆 引用 0
                                      • C 離線
                                        craigbic
                                        最後由 編輯

                                        I can get Convex Hull to work using this procedure:

                                        1. Create points based on whatever geometry using Plugins>Qhull>Pointify
                                        2. Export points (to points.txt file) using Plugins>Qhull>Export CPoints
                                        3. Use a Windows Command Prompt to run the command "qhull.exe TI points.txt o TO qhull.txt" inside the Plugins\Qhull directory which generates the required qhull.txt file.
                                        4. Back in SU, run Plugins>Qhull>Convex Hull, which does generate the convex hull - at least for me at work using SU6

                                        However, even when I create the required qvoronoi.txt file from exported points (have tried with and without bounding box included) via the command prompt command "qhull.exe TI points.txt v Qbb o TO qvoronoi.txt" and I go back into SU and run Plugins>Qhull>Voronoi - nothing happens except a quick flash of the command prompt window. This is really frustrating 👿 since I really have a need to create voronoi-based architecture for a project and i don't want to have to go to Rhino.

                                        Has ANYONE had any luck with this at all?

                                        Checkout the Sketchup Graphics Blog at http://sketchupgraphics.com

                                        1 條回覆 最後回覆 回覆 引用 0
                                        • H 離線
                                          harnstein
                                          最後由 編輯

                                          following craig's footprints i came to the same result. no a very usable way to create qhull, but works.

                                          how did you get to the information, that you can write "qhull.exe TI points.txt v Qbb o TO qvoronoi.txt" ?

                                          this is real research...like going around in the woods eating everything just to find something tasty...

                                          still sketchin'

                                          1 條回覆 最後回覆 回覆 引用 0
                                          • C 離線
                                            craigbic
                                            最後由 編輯

                                            @harnstein said:

                                            how did you get to the information, that you can write "qhull.exe TI points.txt v Qbb o TO qvoronoi.txt" ?

                                            I got that from the qhull.exe documentation from qhull.org. If you open up a command window to the qhull directory in the plugins folder of SU and type "qhull" it will bring up a list of all the little options you can add such as "Qbb" etc... Qhull is working and that's nice but what I really wanted was voronoi to work. I really hope someone takes up the mantle and get this working. I tried for hours, modifying the script and couldn't get it to function (not that I know much about Ruby mind you).

                                            Perhaps what we'll need to do is to export the c-points and then run voronoi.exe to qvoronoi.txt and then run THATfile through MatLab or Mathematica to spit out a model.

                                            Checkout the Sketchup Graphics Blog at http://sketchupgraphics.com

                                            1 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement