sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Voronoi, convex hull, geometry modification toolset

    Scheduled Pinned Locked Moved Developers' Forum
    27 Posts 12 Posters 13.8k Views 12 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.
    • A Offline
      a4chitect
      last edited by

      nice cell structure in a few steps

      1.create a box, delete one of the faces
      2.draw a few lines inside the box connecting faces at various places
      3.select this new line and run Plugins/Tooling/Pointify
      4.now select these points and export them using Plugins/Tooling/Export cpoints
      -allow the program to export the bounding box too
      5.now to construct the voronoi mesh run Plugins/Tooling/Voronoi
      6.now select all the lines and Didier's line 2 cylinder ruby, enter precision 6 (means the the profile of the line extrusion is 6 sided - is enough for the effect)
      7.voila - finished


      example.png

      1 Reply Last reply Reply Quote 0
      • A Offline
        a4chitect
        last edited by

        one more thing about the voronoi structure: it is great for experiments in architecture since it divides space in cells (remember the Beijing Aquatic Stadium?)
        -i hope someone with spare times uses this plugin to model it, just to prove that sketchup is a powerful piece of an app

        1 Reply Last reply Reply Quote 0
        • A Offline
          a4chitect
          last edited by

          recursive dent does this, when you need a nice point cloud, just apply the Plugins/Tooling/Pointify command to these dented lines


          recursive-dent.png

          1 Reply Last reply Reply Quote 0
          • Didier BurD Offline
            Didier Bur
            last edited by

            Hi,
            Thanks for sharing. Extremely interresting, especially the convex hull. I don't know what to do with it for now, but it will surely be a good start for goodies develpment.
            Regards,

            DB

            1 Reply Last reply Reply Quote 0
            • AdamBA Offline
              AdamB
              last edited by

              re: convex hull

              Wonder if its of any use for SketchyPhysics? (Though I'm not sure whether it uses GJK searching.) Anyone?

              Developer of LightUp Click for website

              1 Reply Last reply Reply Quote 0
              • A Offline
                a4chitect
                last edited by

                the convex hull generation is pretty solid (works far more reliable than the voronoi solution) but the workflow is awkward for realtime generation - since the plugin exports vertices to a file and then calls qhull.exe which writes the results to a file, then these results are built in SU. i don't know much about the actual algorithm behind the calculation - please refer to http://www.qhull.org/html/qconvex.htm

                1 Reply Last reply Reply Quote 0
                • AdamBA Offline
                  AdamB
                  last edited by

                  Ah (so this doesn't work on Macs I guess). However, QHull does a great job - I've used it for many years. If SketchyPhysics doesn't use convex hulls it probably should rather than do full prim.prim collision wrt performance.

                  Developer of LightUp Click for website

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    a4chitect
                    last edited by

                    re: macs
                    no it's not gonna work, since i don't have any mac at hand there is no way to port it myself (i guess there is a qhull for mac http://qhull.darwinports.com/)

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      Jim
                      last edited by

                      @a4chitect said:

                      the convex hull generation is pretty solid (works far more reliable than the voronoi solution) but the workflow is awkward for realtime generation - since the plugin exports vertices to a file and then calls qhull.exe which writes the results to a file, then these results are built in SU. i don't know much about the actual algorithm behind the calculation - please refer to http://www.qhull.org/html/qconvex.htm

                      It may be awkward, but it's a valid technique which I didn't think to use before. The source code for qhull is available and a native plugin could possibly be compiled, and a sketchup-ruby interface made. I've heard it's not terribly difficult, but then I've not tried it.

                      Hi

                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        minimar
                        last edited by

                        Hello

                        I've tried it up but i am stuck when I've started voronoi. It made nothing just bumped out
                        the command line that it cant read point.txt dont you know what can be potential problem?
                        I hahve checked the file points.txt, it is there and it has been made up. It would superb
                        if it works, this is what i have been dreaming off.

                        thanks for the answer

                        martin

                        1 Reply Last reply Reply Quote 0
                        • N Offline
                          nerz
                          last edited by

                          hi a4chitect...

                          i've download the plugin but i cannot make it works.
                          I can export the points, it seems to work...
                          but when i try to launch voronoi or convex qhull seems to be launched without any problem but nothing appears in sketcuhp...

                          i'm an architecture's student and i think i could be a powerful engine to design...
                          can you help me?

                          1 Reply Last reply Reply Quote 0
                          • A Offline
                            a4chitect
                            last edited by

                            i have already let a few of you down, sorry. i promise to look into it and hopefully fix all main issues asap. you are free to do the needed changes yourselves, i think that currently there are 2 possible problems>

                            1. the script is unable to call the qhull program to compute the actual result, and/or is unable to read the exported points or unable to write the results to a file or unable to read the results

                            (all of this is probably due to incorrect paths in the script/or system incompatibility)

                            1. the problem is due to a specific points placement and the nature of the qhull algorithm (is often unable to find the correct result and therefore end without any...)

                            so when you run point exporter first, check if the points.txt file gets created in the Plugins\Tooling

                            then when you run for example 'voronoi' - and nothing gets created, check if there is a file named qvoronoi.txt at the Plugins\Tooling location

                            if all of the above works, the problem lies probably with the geometry, try with fewer or different points

                            if you are desperate, please wait for a change by me..

                            1 Reply Last reply Reply Quote 0
                            • A Offline
                              a4chitect
                              last edited by

                              thanks for your patience

                              301 Moved Permanently

                              favicon

                              (www.sketchucation.com)

                              1 Reply Last reply Reply Quote 0
                              • N Offline
                                nerz
                                last edited by

                                hello a4chitect

                                well, i have just download the update, i tried it but i have the same problem..

                                I can pointify, i can export (i have looked in the folder and the file with the coordonate of my point exist. But when i launch voronoi or convex hull, the program seems to launch but nothing is drawn.. and no other file (for instance voronoi.txt ) is created

                                i will retry of course but i don't understand..

                                is there anybody in the same case? or am i alone ?
                                i will search what the problem is..

                                thank you for your work wich seems to be great !

                                1 Reply Last reply Reply Quote 0
                                • A Offline
                                  a4chitect
                                  last edited by

                                  please try exporting points with or without the bounding box (depending on which way you went before - choose the other way this time) and try to run voronoi.

                                  or

                                  download the attached skp and follow the instructions to test.
                                  (maybe the qhull can't compute the results for your specific points alignment)

                                  or

                                  please attach your points in a skp for me to try


                                  debug.skp

                                  1 Reply Last reply Reply Quote 0
                                  • majidM Offline
                                    majid
                                    last edited by

                                    dear a4chitect , thanks for your ruby ,but i had the same problem (voronoi doesnt work for me too ) maybe its because of operating system or something ( 32 or 64bit) dual prosseccoror... I dont know what! yours majid

                                    My inspiring A, B, Sketches book: https://sketchucation.com/shop/books/intermediate/2612-alphabet-inspired-sketches--inspiring-drills-for-architects--3d-artists-and-designers-

                                    1 Reply Last reply Reply Quote 0
                                    • A Offline
                                      a4chitect
                                      last edited by

                                      please try this:

                                      windows - open command prompt and navigate to your sketchup\plugins\qhull
                                      (windows vista: it is easier to open qhull folder in windows explorer, press and hold shift and right-click anywhere inside empty space in qhull, choose 'Open Command Window Here')

                                      paste the following code 'qhull.exe TI points.txt v Qbb Qj o Fv' (without quotes) and press enter
                                      (paste works by clicking in the top left corner on the small black icon, choose edit>paste)

                                      let me know your results

                                      thanks

                                      1 Reply Last reply Reply Quote 0
                                      • majidM Offline
                                        majid
                                        last edited by

                                        dear a4chitetct , i did and here is the result ( i paste all the result in a text file and zipped)


                                        New Text Document (2).zip

                                        My inspiring A, B, Sketches book: https://sketchucation.com/shop/books/intermediate/2612-alphabet-inspired-sketches--inspiring-drills-for-architects--3d-artists-and-designers-

                                        1 Reply Last reply Reply Quote 0
                                        • A Offline
                                          a4chitect
                                          last edited by

                                          from the file you have attached, it is clear that the voronoi computation is all right, I have copied the following part

                                          3
                                          19 12 1
                                          -10.101 -10.101 -10.101
                                          69.50972188371688 213.9843863157402 423.5501981233883
                                          ...
                                          ...
                                          ...
                                          5 8 10 0 4 3
                                          6 9 11 0 13 15 18
                                          

                                          and pasted into an empty sketchup\plugins\qhull\qvoronoi.txt
                                          then imported using a modified voronoi.rb (attached) which doesn't run the computation it only builds geometry from the qvoronoi.txt

                                          I am attaching the result as a .skp file


                                          the result in sketchup


                                          modified voronoi (replace your current but keep the original since this is for debugging)

                                          1 Reply Last reply Reply Quote 0
                                          • N Offline
                                            nerz
                                            last edited by

                                            hello a4chitect

                                            excuse me for havn't said a word these days (a virus strike in my school..)
                                            i have tried and tried different ways but nothing gets better. the file voronoi.txt (and convex hull too) is not created when i run voronoi (or convex hull)

                                            well i don't know how to do to attach a file... sorry..
                                            i'll keep on trying on an other computer..

                                            thanks for your work !!

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement