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

    [IDEA] Platform / Street levelling / fixing script

    Scheduled Pinned Locked Moved Developers' Forum
    14 Posts 4 Posters 659 Views 4 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.
    • PixeroP Offline
      Pixero
      last edited by

      I have a script JS Align that can kind of do this.
      Select edges and run plugin.
      There might be issues with non triangle surfaces and such so be sure you backup before use.
      http://www.pixero.com

      1 Reply Last reply Reply Quote 0
      • G Offline
        godswife
        last edited by

        thanks for your replies guys!

        @thomthom
        yep, the terrain was made from a 2d cad file (containing contours only). the streets are a seperate 2d file and don't have any kind of height information. the way you describe it would work for straight/level streets indeed, but not if there is any difference in height.

        @pixero
        your script is basically the perfect start for the script i am looking for. it just needs the calculation routine to be able to make slopes, additionally to just aligning it to one chosen level (max, mid, min). it does help me with the level roads though, same as thomthom's idea. actually, it solves the problem seen on my screenshots.

        both your methods work perfectly to get 100% level areas, but that doesn't occure as often as slopes in this terrain. i guess there is not ruby to get around that out yet.

        [edit] i see what you mean with your script might cause problems pixero. i just tried it as seen on the attached screenshots. it makes a nice and smooth road, but there are lots of faces lost afterwards. and in a weird way. they are not just deleted (which would leave empty, white holes), something still seems to be there, but i can't select anything.


        before.jpg


        after.jpg

        1 Reply Last reply Reply Quote 0
        • PixeroP Offline
          Pixero
          last edited by

          godswife, have you seen this thread?
          Road on terrain: http://forums.sketchucation.com/viewtopic.php?f=18&t=19522

          Thomthom, maybe you could tweak something useful out of my script.
          Like adding falloff based on a gauss curve and averaging the points position?
          (I'm in the middle of rendering a looong animation and dont have time to look into it at the moment.)

          1 Reply Last reply Reply Quote 0
          • G Offline
            godswife
            last edited by

            no, i haven't see that topic yet, but the tutorial in it describes almost the same way i am doing it now. for small areas okay, but if you have a terrain with a couple of square kilometers and lots of roads, it's a huge time consumer.

            it would be awesome if somebody could enhance your already nice script. i have not enough experience in coding to try myself πŸ˜• it sure would be a huge plus for the community.

            any idea why it messed up those faces when i tried your align ruby?

            1 Reply Last reply Reply Quote 0
            • PixeroP Offline
              Pixero
              last edited by

              @godswife said:

              any idea why it messed up those faces when i tried your align ruby?

              I think it has to do with the fact that when used on lines/points it moves them one by one thus making polygons nonplanar even if its just while the script is running. There was another topic in this forum about how to move several items at the same time. I think that would help. Cant remember the name of the poster now.

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

                It might have been a thread I was involved in. Use entities.transform_by_vectors to move multiple entities at the same time, but by different distances.

                http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#transform_by_vectors

                You build an array that holds your entities and an array that holds a vector that describes the direction and distance to move each entity. The vector array needs to be in the same order as the entity array.

                That makes SU move them all at the same time, making for a MUCH cleaner move.

                Chris

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

                1 Reply Last reply Reply Quote 0
                • PixeroP Offline
                  Pixero
                  last edited by

                  Chris, I have done the transform_by_vectors changes and that seem to work fine.
                  However there still is the problem when using the script on edges inside a group. Then the face gets put outside the group and at 0,0,0. πŸ˜•
                  Any idea how to fix that?

                  1 Reply Last reply Reply Quote 0
                  • G Offline
                    godswife
                    last edited by

                    thanks, i understand the cause of the error now. initially i thought it does the same as i am doing (higher/lower each POINT, not LINE). is it going to work when i explode the group before i use your script? is it possible to change the script to the way that it only changes the height at the connecting points instead of working with the lines?

                    1 Reply Last reply Reply Quote 0
                    • PixeroP Offline
                      Pixero
                      last edited by

                      I think I have fixed it in the updated version here: http://forums.sketchucation.com/viewtopic.php?f=180&t=20080

                      1 Reply Last reply Reply Quote 0
                      • G Offline
                        godswife
                        last edited by

                        nicely done, works like a charm now! what i like even better: it's possible to undo it with one click (before it was undoing point by point). now we just have to find somebody, who can integrate the discussed functions to make it perfect.

                        1 Reply Last reply Reply Quote 0
                        • G Offline
                          godswife
                          last edited by

                          nobody got time for this at the moment? 😞

                          how hard is it to get this programmed on a scale from let's say 1 to 10? let me know and it might be easier to stay patient! πŸ™‚

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

                          Advertisement