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

    [Plugin] Point Merger tools v1.2 UPDATED@ 23/06/09

    Scheduled Pinned Locked Moved Plugins
    68 Posts 20 Posters 41.9k Views 20 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.
    • L Offline
      leixing
      last edited by

      A good idea!i agree with jims idea and i think we could saw the circle when we do it.

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        To keep 'max_weld_distance' set during a session call it @@max_weld_distance, on activate set it to 1" at the start if it's not set in the form

        @@max_weld_distance=1.to_l if not @@max_weld_distance
        

        and in the inputbox use

        defaults = [@@max_weld_distance]
        

        to use it...

        TIG

        1 Reply Last reply Reply Quote 0
        • pilouP Offline
          pilou
          last edited by

          Does it possible to make the same but collapse points on an axe (X,Y,Z) or on a straight line given?


          Collapse.jpg

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

          1 Reply Last reply Reply Quote 0
          • mitcorbM Offline
            mitcorb
            last edited by

            BTM:
            I have not tried the ruby yet, but I have some questions.
            Is there an upper and lower limit to the selection radius?
            From the description, this could be used as a seam stitcher, maybe? In other words, you construct a line or curve, or loop along which you can snap nearby vertices to it?

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

            1 Reply Last reply Reply Quote 0
            • kenK Offline
              ken
              last edited by

              BTM

              I have tried you script and find it useful. However, is it necessary to pick a distance? Why not, pick point A, a point B, and have point A move to point B.

              Thanks for all your work
              Ken

              Fight like your the third monkey on Noah's Ark gangway.

              1 Reply Last reply Reply Quote 0
              • B Offline
                BTM
                last edited by

                @unknownuser said:

                BTM

                I have tried you script and find it useful. However, is it necessary to pick a distance? Why not, pick point A, a point B, and have point A move to point B.

                Thanks for all your work
                Ken
                Well, as I see it, I'd usually use the move tool to move a single point to another single point. This script was made for those areas with a bunch of points, that are mostly unnecessary, and you just want to make them all into a single point.

                @mitcorb said:

                …you construct a line or curve, or loop along which you can snap nearby vertices to it?
                Not yet, sorry. 😞 maybe I'll add it as a feature eventually.

                @unknownuser said:

                Does it possible to make the same but collapse points on an axe (X,Y,Z) or on a straight line given?
                Pilou, je ne sais pas exactement ce que tu veux dire, mais je pense que tu demande si c’est possible de changer la code, pour qu’il puisse attacher des points proches à une ligne sélectionner. Sinon, peux-tu expliquer plus?

                @tig said:

                To keep 'max_weld_distance' set during a session call it @@max_weld_distance, on activate set it to 1" at the start if it's not set in the form

                @@max_weld_distance=1.to_l if not @@max_weld_distance
                

                and in the inputbox use

                defaults = [@@max_weld_distance]
                

                to use it...
                I've tried some similar things, but I always seem to get the error that @@max_weld_distance is an 'uninitialized class variable'.

                @jim said:

                …make it highlight each point within the weld distance so you know what is about to happen when you click.
                I'll try. 😄 Visualization isn't something I'm all that good with yet.

                1 Reply Last reply Reply Quote 0
                • TIGT Offline
                  TIG Moderator
                  last edited by

                  Initially set

                  @@max_weld_distance=1.to_l if not @@max_weld_distance
                  

                  inside the class BUT not inside a sub-definition...

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • pilouP Offline
                    pilou
                    last edited by

                    is that more clear? 😄


                    flat.jpg

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

                    1 Reply Last reply Reply Quote 0
                    • Chris FullmerC Offline
                      Chris Fullmer
                      last edited by

                      Is there a practical application for that type of functionality? Seems faster to juist draw it.

                      Chris

                      Lately you've been tan, suspicious for the winter.
                      All my Plugins I've written

                      1 Reply Last reply Reply Quote 0
                      • B Offline
                        BTM
                        last edited by

                        @mitcorb said:

                        BTM:
                        I have not tried the ruby yet, but I have some questions.
                        Is there an upper and lower limit to the selection radius?
                        From the description, this could be used as a seam stitcher, maybe? In other words, you construct a line or curve, or loop along which you can snap nearby vertices to it?

                        Today, I've made another script to do this… well, I think it does this.

                        http://www.screencast.com/t/zIfDNh5jG

                        You select a number of edges, and click the tool. It asks you for a radius, like in the other one. You select it, and any points within that distance from a selected line, are moved to the closest point on any of the lines selected. In the next release, most likely tonight, both of the scripts will be included in a submenu.

                        1 Reply Last reply Reply Quote 0
                        • pilouP Offline
                          pilou
                          last edited by

                          @unknownuser said:

                          Is there a practical application for that type of functionality?

                          Very practical for flatten or deform (for any reason) an existing volume (or part of volume) on any orientation!
                          Normal way when that is collapsed on a plan 3D
                          Funny when that is collapsed on a line

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

                          1 Reply Last reply Reply Quote 0
                          • B Offline
                            BTM
                            last edited by

                            OK, I have 2 issues, one with each script, that are holding me back from posting the next version. 😡

                            1. With the current 'Merge Points' script, the transformation isn't always 'perfect'. since SketchUp only allows vertices to be transformed by vectors, and not able to be given a specific point to move to, the points don't always end up exactly in the same place. Sometimes they are off by an amount SketchUp barely even recognizes. This causes them to not be attached, and thus are annoying. This doesn't always happen, but it does happen on occasion. Does Anyone know of a way to get the transformation to be perfect every time?

                            2. The next script moves points to the closest position on the lines of the selected edges. The annoying part is that lines are infinite. I could probably figure out how to get it working properly, with the edges and not lines by using if functions, but it wouldn't be ready by tonight.

                            1 Reply Last reply Reply Quote 0
                            • Chris FullmerC Offline
                              Chris Fullmer
                              last edited by

                              #1 - yeah, the easiest way to do it is using the transform by vector method. But there is also Entities.transform_entities method which lets you apply a single transformation object to multiple objects simultaneously....but in your case you would only tansform a single entity at a time. Then, since you are using a transformation object, you can transform something to a given 3d point. So your code that looks like this:

                              dist = pos.distance @mouse_point
                              	if dist <= @max_weld_distance
                              	vec = p.position.vector_to @mouse_point
                              	@entities.transform_entities(vec,p)
                              	end
                              end
                              

                              could look like this:

                              dist = pos.distance @mouse_point
                              	if dist <= @max_weld_distance
                              	t = Geom;;Transformation.new(@mouse_point)
                              	@entities.transform_entities(t,p)
                              	end
                              end
                              

                              I have not tested that for syntax and I don't know if it will fix your #1 problem, but I think it might.

                              Chris

                              Lately you've been tan, suspicious for the winter.
                              All my Plugins I've written

                              1 Reply Last reply Reply Quote 0
                              • B Offline
                                BTM
                                last edited by

                                ...I figured out how to solve problem 2!!!

                                As for problem 1, Chris, the transform_entities works pretty much the same way whether you give it a transformation or a vector; the script you have down there moves the points by the vector @mouse_point, so they end up in a completely different spot. That's why I used vector_to. The only problem, is that SketchUp sees things like 3.999m as 4 meters ( Well, according to the VCB, it doesn't show up as ~4.00m, but as if it were just 4.00m), and I think it's inaccuracies like this that can mess it up sometimes. 😕 😞

                                1 Reply Last reply Reply Quote 0
                                • B Offline
                                  BTM
                                  last edited by

                                  I might not have the accuracy issue fixed, but I've updated the first post, now Merge Points to Lines is available, and Merge Points has been slightly updated. 😄

                                  1 Reply Last reply Reply Quote 0
                                  • EdsonE Offline
                                    Edson
                                    last edited by

                                    i still have no clue as to what this script is supposed to do. thus the following.

                                    i know this is probably asking too much of guys who make their creative work available for free to all of us. however, i think it is in their own interest that their creations be understood and put to use to the full.

                                    thus i respectfully suggest that all scripts should be accompanied with some kind of demonstration about what they are supposed to do: a guide, a tutorial or a short video (perhaps the easiest to do).

                                    edson mahfuz, architect| porto alegre • brasil
                                    http://www.mahfuz.arq.br

                                    1 Reply Last reply Reply Quote 0
                                    • B Offline
                                      BTM
                                      last edited by

                                      OK, a video has been added for Merge Points. 👍

                                      1 Reply Last reply Reply Quote 0
                                      • mitcorbM Offline
                                        mitcorb
                                        last edited by

                                        BTM:
                                        Wow! Congratulations. Excellent video.
                                        A humble thank you.
                                        mitcorb

                                        edit: this appears to be able to close those tiny triangles-- is that correct?

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

                                        1 Reply Last reply Reply Quote 0
                                        • pilouP Offline
                                          pilou
                                          last edited by

                                          Seems another very cool plug! ☀

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

                                          1 Reply Last reply Reply Quote 0
                                          • B Offline
                                            BTM
                                            last edited by

                                            @mitcorb said:

                                            this appears to be able to close those tiny triangles-- is that correct?

                                            Yes, it can, but it depends on where you click, and the range of the tool.

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

                                            Advertisement