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

    Contour lines on irregular surface

    Scheduled Pinned Locked Moved Developers' Forum
    15 Posts 7 Posters 1.1k Views 7 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.
    • fredo6F Offline
      fredo6
      last edited by

      It could be done with a Ruby just using a series of horizontal planes to cut the topographic surface at given altitudes.
      This will allow to generate the contour lines, by constructing the intersections.
      then, you color each face of the topographic surface based on finding out for each face which horizontal planes it is in between.

      Certainly some good use of CPU, but nothing too complex in terms of coding.

      As an input, you would need

      • the topographic surface (as a selection of face or group or components)
      • a master plane (probably the horizontal plane), given by a normal vector
      • an origin and a pace to generate the series of planes
      • a color list (or scheme to change the color) along with the series of plane and pace

      Fredo

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

        Hi,

        @unknownuser said:

        This will allow to generate the contour lines, by constructing the intersections.
        then, you color each face of the topographic surface based on finding out for each face which horizontal planes it is in between.

        I wrote several scripts to do that a while ago. Search for "contour" on my site and "paint altitude faces".
        Regards,

        DB

        1 Reply Last reply Reply Quote 0
        • pbacotP Offline
          pbacot
          last edited by

          OK thanks a million!

          Here's a landform with a better texture I made...topo 5.png

          Here's one with lines in the texture. As you can see the result is not as nice as interstecting the shape with planes.topo 6.png

          This one is using intersect with planes but using a copy and overlaying the resulting lines so the earth form isn't affected.topo 7.png

          Now to see what Didier hath wrought.

          MacOSX MojaveSketchUp Pro v19 Twilight v2 Thea v3 PowerCADD

          1 Reply Last reply Reply Quote 0
          • pbacotP Offline
            pbacot
            last edited by

            Fredo,

            Just having done both methods, it seems to me that the texture would be better, so that you do not compromise the geometry of your shape. You could then revise the shape and have the topographic pattern adjust. The trick of a ruby would be a well dimensioned (in the case of contours), scaled, and standardized texture. Choices of contours and colors or both would be nice. Choice of scale, for lot-sized grading plans versus mountain-sized maps, would be good. The contour intervals and colors would be adjusted for each.

            I began to think of this from a gallery house site render that used a simple colored ground with topographic contours. It was an effective way to finish the image without a lot of texture and entourage. Subtle color change would have been nice too (not rainbow colors as I show here).

            Peter

            MacOSX MojaveSketchUp Pro v19 Twilight v2 Thea v3 PowerCADD

            1 Reply Last reply Reply Quote 0
            • TaffGochT Offline
              TaffGoch
              last edited by

              Peter,

              Sorry I didn't catch this discussion earlier. Any help here?
              Terrain Tech - Google 3D Warehouse

              Taff

              "Information is not knowledge." -- Albert Einstein

              1 Reply Last reply Reply Quote 0
              • pbacotP Offline
                pbacot
                last edited by

                @taffgoch said:

                Peter,

                Sorry I didn't catch this discussion earlier. Any help here?
                Terrain Tech - Google 3D Warehouse

                Taff

                Taff

                Wow, beautiful looking models / demonstrations. Thanks for the post! How do you generate the terrain in the Palo Duro and Panther Creek models?

                Peter

                MacOSX MojaveSketchUp Pro v19 Twilight v2 Thea v3 PowerCADD

                1 Reply Last reply Reply Quote 0
                • pbacotP Offline
                  pbacot
                  last edited by

                  Didier,

                  I get this message:

                  Error Loading File contour_lines.rb
                  undefined method `file_loaded?' for main:Object

                  Peter

                  MacOSX MojaveSketchUp Pro v19 Twilight v2 Thea v3 PowerCADD

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

                    You have to add this line in the Ruby file (if you have access..) :

                    require "sketchup.rb"
                    

                    Frenglish at its best !
                    My scripts

                    1 Reply Last reply Reply Quote 0
                    • pbacotP Offline
                      pbacot
                      last edited by

                      Thanks. I did look at another file and searched for a likely header. I suspected this was part of it, from the little messing around I've done with simple files like DXF before. I'll try that.

                      Peter

                      MacOSX MojaveSketchUp Pro v19 Twilight v2 Thea v3 PowerCADD

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

                        I also wrote a contour script a while ago.

                        Remember to Group the terrain first...

                        .


                        ContourMaker.rb

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • TaffGochT Offline
                          TaffGoch
                          last edited by

                          @pbacot said:

                          How do you generate the terrain in the Palo Duro and Panther Creek models?"

                          Peter,

                          I download USGS DEM data files from the GIS Data Depot, to start.

                          SketchUp can import DEM files, but they're HUGE! I import them into TerraGen, and select the portion of the topographic map in which I'm interested, sub-sample (simply) the data, and export as a DXF file. These steps reduce the complexity of the mesh data, and produce a much more reasonably-sized data file for SketchUp to import. (TerraGen is free, as are a couple of plugins required to do the DXF stuff.)

                          Once you've done it a few times, it goes pretty quickly. (By the way, topographic map imagery can also be downloaded from the GIS Data Depot.)

                          Taff

                          "Information is not knowledge." -- Albert Einstein

                          1 Reply Last reply Reply Quote 0
                          • pbacotP Offline
                            pbacot
                            last edited by

                            TIG,

                            I tried yours and it seems to work great for what I was doing (rather than duplicating planes and intersecting "by hand"). Also gives the lines as a separate group, instead of making them part of the mesh, which I like.

                            Taff,
                            I think your ruby will do the same thing once I fix the header. I am not sure the paint faces ruby works for the effect I was looking for, as it does not give a graduated texture, nor colors by contour. It might be useful if the model is used in analysis. I only got one color, though I picked other ones. It has an interesting look, like an iceberg. Just for your info (not complaining) where you put in a number (default 10) is is not clear what the number is and that there is a limit, seems to be about 46). The lower numbers give a very subtle effect. If you go too hight the colors repeat, starting with the dark color.

                            Your terrain models are very helpful (wish SU were faster in flying over).It would be neat to do the model of a place you are going to visit and hike in. And I like the effect you got with the lake surface.

                            Thank you both for the help.

                            Peter

                            MacOSX MojaveSketchUp Pro v19 Twilight v2 Thea v3 PowerCADD

                            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