• 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.1k 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.
  • S Offline
    Sl-m
    last edited by 28 Jul 2012, 03:21

    @mattc said:

    @unknownuser said:

    Few comments :
    1/ Could it be possible to undo the voronoi generation in one go ?(ctrl Z is going back through all the steps of the generation)

    @mattc said:

    • added to the wish list - see some posts above

    Thanks !
    If I may add one wish : The tab options for the conics should remember the last options chosen.

    @unknownuser said:

    2/ It does not generate the voronoi all the time. Sometimes nothing happens. Any idea ?

    @mattc said:

    • if You can post Your .skp file then I can take a look at it.

    Here it is.
    By the way I'm using pjt's plugin. Thanks for looking at this!
    Sl!m


    XY plan cloud points. Can't generate a voronoi

    1 Reply Last reply Reply Quote 0
    • T Offline
      the.pjt
      last edited by 28 Jul 2012, 22:04

      Hi Matt β˜€ ... please post the toolbar (my work )to the first post ... copyrhight ? !! feel free .. it's our plugin .. not my" plugin . and I also posted PSD icons for you .. πŸ˜›
      ICON folder path ? .. I'm surry for this bug .... but I myself tested it on my 2 computers with windows 7 and 8 (SU8) .. and It was fine for me .. 😐 😐 ... but if there is a problem please repair it and use my works in future versions ... πŸ˜‰
      good luck πŸ˜„

      1 Reply Last reply Reply Quote 0
      • M Offline
        MattC
        last edited by 29 Jul 2012, 07:55

        Hi,
        I will do it as soon as I correct bug that nectares reported.
        Also I already adressed some things from a wishlist.
        So stay tune.
        Also , evereyone that is using pjt's wrapped wersion with toolbar, please report if You can see icons, I don't know if it is only me that have this problem ??
        I don't want to fix things that are ok.

        In general Stat tuned. Version 1.1 is coming.
        Matt

        1 Reply Last reply Reply Quote 0
        • G Offline
          gilles
          last edited by 29 Jul 2012, 09:09

          @unknownuser said:

          However, some regions will not work for some strange reason

          Same thing for me.

          Also Tab key does not open dialog box (Macbook pro), for me.

          " c'est curieux chez les marins ce besoin de faire des phrases "

          1 Reply Last reply Reply Quote 0
          • T Offline
            TIG Moderator
            last edited by 29 Jul 2012, 09:23

            On a MAC the TAB a onKeyDown method doesn't work [known bug!] - you need to use a onKeyUp method to spot the press of the TAB-key for MAC AND PC.
            Also note that TAB key-mapping will differ between PC and MAC - if key==9 || key==15... DON'T use key 48 as that is only TAB on some Linux setups [I think] and causes issues with mainstream users [== 0 ?] - an error is some of my older code that should be fixed in MY scripts πŸ˜•

            The regional differences might be caused because there's a ',' as a decimal separator rather than a '.' ?
            If dialog values are taken as 'float' or 'length' then this should be accounted for automatically by Sketchup ?

            Use inputbox rather than UI.inputbox as it checks user inputs better...
            [include a require 'sketchup.rb' in the first line of the script to ensure it's available to you]
            Don't use @@dek.to_mm you've already predefined it as a 'length' as @@dek=25.mm - later you mess with it again .to_f.mm - because you first set it as a length then the user's current units will be used instead anyway - there's no need to restrict it to 'mm' at all - just use 'Offset:' as the prompt... similarly the other inputbox values can only be what you set them as so if it starts as a float the user's input must be a valid float so typing 3 returns 3.0 anyway...

            TIG

            1 Reply Last reply Reply Quote 0
            • I Offline
              ivreich
              last edited by 30 Jul 2012, 00:54

              Hi MattC

              Still unable to use your plugin. Here's the error message and file...

              Joel


              Error file


              Error message

              1 Reply Last reply Reply Quote 0
              • T Offline
                TIG Moderator
                last edited by 30 Jul 2012, 07:58

                It's possible to have two 'lines' that don't intersect and produce 'nil' as the result, so the code needs to trap for the existence of the point and only proceed with it if it's not nil...
                That should be a relatively simple 'trap' to construct...

                TIG

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

                  True TIG
                  I already implemented this trap, but also encountered another case that is a bit problematic.
                  It is geometry limitation of Sketchup.

                  I will update script when this will be solved, in a meantime if anyone also has non-working combination of points, post it here.
                  I will have more material to analyse.

                  Matt

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    TIG Moderator
                    last edited by 30 Jul 2012, 10:06

                    Putting the code inside a begin...do_point...rescue...end structure will allow the code to fail on the point without a crash ?
                    But a simple intersect_lines...if point...do_stuff...else...next_point...end would suffice here...
                    Something like:
                    if **int &&** (test[0]==0)&&(test[1]==0)&&(test[2]==0) intprim=int+int.vector_to(pointstable[bpntindx])+int.vector_to(pointstable[bpntindx]) points<<intprim.project_to_line([midlines[0][0],midlines[0][1]]) points<<intprim points<<intprim.project_to_line([midlines[1][0],midlines[1][1]]) els**if int** points<<int end
                    and
                    if **int &&** point_is_between(p1,p2,int)&&point_is_between(polygon[i],polygon[j],int) point<<int end
                    AND any other place where int is set as an 'intersection' that might fail - test for its existence before trying to use it.
                    Only uses int if it's not ' nil'.

                    TIG

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      MattC
                      last edited by 30 Jul 2012, 11:34

                      Yup, second way is exactly how I changed it.
                      My fault was testing it on set of random points, and combination of 3 colinear points didn't occure.
                      Matt

                      1 Reply Last reply Reply Quote 0
                      • S Offline
                        Sl-m
                        last edited by 3 Aug 2012, 01:09

                        Hi there,

                        I found this Voronoi so cool... couldn't resist posting this.
                        Interacting with the mouse moving over the points.

                        Is that code any useful to ruby Heros ?

                        http://mbostock.github.com/d3/ex/voronoi.html

                        Have a great day/night!
                        Sl!m

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          juanjo
                          last edited by 7 Aug 2012, 18:37

                          Hi Matt
                          Great plugin mate... lots of potential here
                          But I have a little problem: you say that for this to run properly this plugin requires "delauney3.rb"
                          I don't have it... I only have "delaunay2.rb".
                          I get the Typical plugin error..."Error loading file VoronoiXY.rb no such file to load -- delauney3.rb"

                          But I can't find the robust version that TIG is refering to here: http://forums.sketchucation.com/viewtopic.php?t=8314

                          I did got the "conic curve" plugin to work and it's awesome.

                          Also tried to use "qhull.rb" but it's a mess! I just get flashing DOS-screen ans crashes.... It's a shame, since it would also be a super-tool...
                          Have you heard of any progress on that???
                          http://forums.sketchucation.com/viewtopic.php?t=19040
                          http://forums.sketchucation.com/viewtopic.php?t=8116

                          I'd really appreciate your help so i can start using this baby!
                          Thanks!

                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            TIG Moderator
                            last edited by 7 Aug 2012, 21:38

                            My 'modularized' version of 'delauney' [ delauney3.rb] ships as part of my 'Triangulate Points' tool - which is very much like Didier's original... BUT avoids potential clashes with common loose method names like 'triangulate' !
                            http://forums.sketchucation.com/viewtopic.php?p=301274#p301274
                            It doesn't replace the original, it just makes a 'safer' alternative for any tool that is using it instead...

                            TIG

                            1 Reply Last reply Reply Quote 0
                            • M Offline
                              MattC
                              last edited by 8 Aug 2012, 06:25

                              @juanjo said:

                              But I have a little problem: you say that for this to run properly this plugin requires "delauney3.rb"
                              I don't have it... I only have "delaunay2.rb".
                              Also tried to use "qhull.rb" but it's a mess! I just get flashing DOS-screen ans crashes.... It's a shame, since it would also be a super-tool...
                              Have you heard of any progress on that???

                              Hi juanjo, if You download a zip package made by pjt, and not separate files from first post, then You will have "delauney3.rb" as a part of it.
                              I couldn't get "qhull.rb" to work, and that was one of the reasons why I started to work on this project.
                              But I have some problems with the code. Some cases generates strange forms. So the work continues.
                              Greets

                              Matt

                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                dtolios
                                last edited by 9 Aug 2012, 15:54

                                @mattc said:

                                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

                                Would it be too much to ask for 3D Voronoi?
                                I would be in...even if not for free... πŸ‘

                                1 Reply Last reply Reply Quote 0
                                • M Offline
                                  MattC
                                  last edited by 10 Aug 2012, 06:32

                                  Well... I think 2D voronoi package (delauney triangulation by TIG + Voronoi on XY plane + Conic Curve + Convex hull on XY plane) is almost ready.
                                  Next step will be: (delauney triangulation in 3D + Voronoi 3D + Conic Curve + Convex hull 3D).
                                  But it is a lot more complicated.
                                  So it is a bit to early to decide free / paid - but I think donationware ( if You like it - gratify creator) is the way to go.
                                  Cheers
                                  Matt

                                  1 Reply Last reply Reply Quote 0
                                  • T Offline
                                    the.pjt
                                    last edited by 21 Aug 2012, 07:09

                                    hello Matt, did you got the Icons ? ... or a more important question: is this plugin still alive ?

                                    1 Reply Last reply Reply Quote 0
                                    • M Offline
                                      MattC
                                      last edited by 21 Aug 2012, 20:55

                                      Hi
                                      Yes I got it, Thanks a lot, I am a bit busy at my normal work, but plugin is still alive.
                                      I will try to get updated version online this weekend, but I was already focused on Voronoi2D version 2.0
                                      Cheers
                                      Matt

                                      1 Reply Last reply Reply Quote 0
                                      • M Offline
                                        MattC
                                        last edited by 24 Aug 2012, 17:37

                                        @ mitcorb - example : If You have polygon with 4 vertices, You can create 4 sets of points ([0,1,2],[1,2,3],[2,3,0],[3,0,1]).
                                        You can use those sets of points to create rational bezier spline(http://en.wikipedia.org/wiki/B%C3%A9zier_curve#Rational_B.C3.A9zier_curves) by asigning weight to every point.
                                        Special case is when You set for first and third point weight = 1 , and weight "w" for second point.

                                        • when w>1 then created curve is a hyperbole
                                        • when w=1 then created curve is a parabole
                                        • when w<1 then created curve is an ellipse (in special case circle)
                                          Hyperbole, parabole ellipse and circle are known as a conic curves or conic sections , because You can create them by cutting cone with a plane.
                                          For further read : http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/NURBS/RB-conics.html
                                          http://en.wikipedia.org/wiki/Conic_section

                                        If You draw square, and apply coniccurve with weight w = sqrt(2)/2 = 0,7071, You will get a circle.

                                        @ Pilou - This is an implementation of 3DVoronoi - this is my next step, but at this moment I struggle a bit with a code...

                                        Matt

                                        1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          dekay
                                          last edited by 26 Oct 2012, 07:19

                                          tanks a lot, your script is very easy to use compared to others.it has been very helpful to me.

                                          thank you once again..

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

                                          Advertisement