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.
    • 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
                    • B Offline
                      BTM
                      last edited by

                      UPDATED:
                      The Merge Points to Lines tool now has a feature to allow you to pick between moving the points to the closest positions on selected lines, or moving the points to the closest endpoints of selected lines.

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

                        @unknownuser said:

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

                        thanks a lot! this is what i had in mind. 👍 👍

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

                        1 Reply Last reply Reply Quote 0
                        • JClementsJ Offline
                          JClements
                          last edited by

                          What a time saver this could turn out to be.

                          This functionality should be a standard/built in tool of SketchUp pro.

                          Thank you.

                          John | Illustrator | Beaverton, Oregon

                          1 Reply Last reply Reply Quote 0
                          • GaieusG Offline
                            Gaieus
                            last edited by

                            Imagine you take a couple of neighbouring snapshots from GE and simply "stitch" them together with this tool in no time!

                            Thanks BTM! 👍

                            Gai...

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

                              No possible to make this with automatic process? (Merge points)
                              Exploring all points! ❓

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

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

                                @unknownuser said:

                                No possible to make this with automatic process? (Merge points)
                                Exploring all points! ❓

                                Actually, I was thinking about something like this initially, before making the scripts. It would go through the entire selection, find which points were close to each-other, then move them together.

                                I didn't try it though, because I would imagine that it would be extremely slow, having to find the distance between every single point that's part of the selection.

                                To put the amount of times it would have to find the distance between 2 points into perspective, (I think) the equation for possible lines between a number of points(a) is:
                                (a-1)÷2=b
                                ab = c = amount of equations necessary.

                                …so if you have 60 vertices in the selection, it would need to find the distance between points 1770 times.
                                60 - 1 = 59
                                59 ÷ 2 = 29.5
                                29.5 x 60= 1770

                                …So yes, it's possible, but maybe slow, unless used with a fairly low amount of vertices in the selection.

                                Nonetheless, I'll try it sometime soon, but first I'm going to start getting some visualizations working with the current scripts. 😉 Maybe I'll make it highlight affected points in yellow, and the point they'll move to in blue or something.

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

                                  This script is really coming along nicely, good work!

                                  As for stitching together terrains...it could work, but there is a good chance it will have overlap. That overlap wil still need to be cleaned by hand. I'd be interested in seeing a demo on that Gaieus if you get around to 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

                                    @chris fullmer said:

                                    This script is really coming along nicely, good work!

                                    As for stitching together terrains...it could work, but there is a good chance it will have overlap. That overlap wil still need to be cleaned by hand. I'd be interested in seeing a demo on that Gaieus if you get around to it.

                                    Chris

                                    …I don't know exactly what GE terrains look like, but you could probably overlap them, and select all geometry of one of the terrains; then you could use Merge Points to Lines, probably using endpoints, with a small enough max radius. As for the messy parts, the Merge Points tool could probably help fix them up some.

                                    I'm saying 'probably' a lot, because I've never done it, and, as I mentioned, I don't know what GE terrains' geometry look like.

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

                                      Their geometry comes in very cleanly. But when you take lots of snapshots, the different terrains don't actually match up very well. So it is those interesections that most people want to clean up. This tool looks very promising for that!

                                      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

                                        …Anyways, If the above doesn't work, which I don't know when it comes to having more than 2 snapshots, I think I know a way to make a script that would work.

                                        @unknownuser said:

                                        Actually, I was thinking about something like this initially, before making the scripts. It would go through the entire selection, find which points were close to each-other, then move them together.

                                        I didn't try it though, because I would imagine that it would be extremely slow, having to find the distance between every single point that's part of the selection.

                                        If it turns out it runs faster than I'd expect, it would do this:

                                        • setting the 'affect radius'
                                        • taking the selected vertices and finding the distance between each one. If the distance between 2 points is smaller then the 'affect radius', and if it's smaller than the distance between the point and any other point, find the halfway point between the 2 points and move them both there.

                                        1 Reply Last reply Reply Quote 0
                                        • GaieusG Offline
                                          Gaieus
                                          last edited by

                                          @chris fullmer said:

                                          As for stitching together terrains...it could work, but there is a good chance it will have overlap. That overlap wil still need to be cleaned by hand. I'd be interested in seeing a demo on that Gaieus if you get around to it.

                                          Yeah, I actually have a bigger area to cover and have been encouraging myself to get to work on it for weeks now. Maybe I'll give it a try and make some "progress report" on how it is going.

                                          @unknownuser said:

                                          I don't know what GE terrains' geometry look like.

                                          Actually the case with GE is that it's streaming nicely but it's achieved by some good "level of detail" engine (both for the imagery and the terrain details) so if you want to grab a bigger area from (obviously) a bigger distance/height, the details are low therefore if you want to cover that area as detailed as possible, you have to go closer but then it means that you also have to pan aside, snapshot another one etc. and you end up with a bunch of pieces that need to be stitched together if you want something else than simply geolocating.

                                          Otherwise it's just a regular TIN


                                          Keep these ideas coming along and we'll also bug you with ours. 😉

                                          Gai...

                                          1 Reply Last reply Reply Quote 0
                                          • JClementsJ Offline
                                            JClements
                                            last edited by

                                            ❓
                                            The script does not quite work for me like what is shown in the video.

                                            Perhaps I copied the wrong files to the Plugin directory?

                                            From the ZIP folder I copied the two .rb's shown below:


                                            Files.png

                                            John | Illustrator | Beaverton, Oregon

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

                                            Advertisement