• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[REQUEST] bitmap to mesh with materials

Scheduled Pinned Locked Moved Plugins
14 Posts 3 Posters 1.2k Views 3 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.
  • B Offline
    baldaman
    last edited by 17 Dec 2010, 15:21

    Please look at the image below, my english is too poor to explain clearly what I mean thanks to words.
    I was thinking that if thomthom's plugin "bitmap to mesh" can handle bitmaps the way it does, maybe what I am asking for could be possible.
    Thanks in advance.

    Clipboard04.jpg

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 17 Dec 2010, 16:25

      You might be in luck... I have been developing a set of Image manipulation 'jar' files. It would be quite possible take a Selected Image and extract each pixel from in turn with its RGB value and then make a dat file of it that SUP can process into squares equivalent to the image and new materials for each color...
      I see the dat file being like this... assuming a 6x6 image with RRGGRR colors on each line
      255,0,0 255,0,0 0,255,0 0,255,0 255,0,0 255,0,0
      255,0,0 255,0,0 0,255,0 0,255,0 255,0,0 255,0,0
      255,0,0 255,0,0 0,255,0 0,255,0 255,0,0 255,0,0
      255,0,0 255,0,0 0,255,0 0,255,0 255,0,0 255,0,0
      255,0,0 255,0,0 0,255,0 0,255,0 255,0,0 255,0,0
      255,0,0 255,0,0 0,255,0 0,255,0 255,0,0 255,0,0
      Using lines=IO.readlines(datfile) it then works out how wide and high the pixel-image is and makes a grouped set of flat faces so its overall size matches the original Image. It then takes a line from the lines at a time and checks the color of that 'square' using cols=line.split(' '), col=cols[0] etc and col=col.split(',') etc etc.
      Assembling a [new] Material name using something like...

      r=col[0]; g=col[1]; b=col[2]
      name="Mat-"+r+'-'+g+'-'+b
      mats=model.materials
      if not mat=mats[name]
       mat=mats.add(name')
       mat.color.red=r.to_i
       mat.color.green=g.to_i
       mat.color.blue=b.to_i
      end
      face.material=mat
      face.back_material=mat
      
      

      Here the first pixel material.name is "Mat-255-0-0", as that exists later any squares with that color use the existing one not making anew one...
      I'll think it through over the weekend... πŸ€“

      TIG

      1 Reply Last reply Reply Quote 0
      • T Offline
        thomthom
        last edited by 17 Dec 2010, 17:16

        I can easily make Bitmap to Mesh do that. Just a minor change from what it does now.

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • T Offline
          TIG Moderator
          last edited by 17 Dec 2010, 19:42

          @thomthom said:

          I can easily make Bitmap to Mesh do that. Just a minor change from what it does now.

          Over to you ThomThom... πŸ˜‰

          TIG

          1 Reply Last reply Reply Quote 0
          • B Offline
            baldaman
            last edited by 17 Dec 2010, 21:40

            Dear ruby masters, thank you for your response.
            So it seems possible right?
            😍 😍 😍

            I allready imagine what a funny contest we could organise with this tool!!!
            πŸ˜„ β˜€ β˜€ πŸ˜„

            Ok let's prepare some cookies...

            1 Reply Last reply Reply Quote 0
            • B Offline
              baldaman
              last edited by 20 Dec 2010, 10:04

              Here is an exemple of what I did for a custom sunscreens system somwhere near equator. The goal is to stop every sun rays while in the same time according visual porosity toward sky. The visual porosity changes according the position of the observer.

              I used 3ds max and polyboost plugin's "bitmap select" feature. After that, back to Sketchup and "components onto face collections".
              The components layout what painted in photoshop with brushes in order to obtain gradations.

              I am also thinking of using this method for faΓ§ade panels variations.
              My goal is to be able to do the whole process inside Sketchup.

              PS: My english lessons are so far away: sorry for my frenglish

              T041_idmesh.jpg

              T038_idmesh.jpg

              T038_idmesh.jpg

              VOILES4_modif.jpg


              God bless proxies

              1 Reply Last reply Reply Quote 0
              • B Offline
                baldaman
                last edited by 20 Dec 2010, 10:07

                View from below

                T027.1.jpg

                1 Reply Last reply Reply Quote 0
                • T Offline
                  thomthom
                  last edited by 20 Dec 2010, 10:08

                  This is the season to be busy. I didn't manage to finish that update this weekend. I'll come. πŸ˜‰

                  Thomas Thomassen β€” SketchUp Monkey & Coding addict
                  List of my plugins and link to the CookieWare fund

                  1 Reply Last reply Reply Quote 0
                  • B Offline
                    baldaman
                    last edited by 20 Dec 2010, 10:26

                    Ok thanks Thom, please take all the time you need.
                    No hurry πŸ˜„

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      thomthom
                      last edited by 21 Dec 2010, 17:26

                      http://forums.sketchucation.com/download/file.php?id=60572&mode=view

                      http://forums.sketchucation.com/viewtopic.php?f=323&t=31339#p275772

                      Thomas Thomassen β€” SketchUp Monkey & Coding addict
                      List of my plugins and link to the CookieWare fund

                      1 Reply Last reply Reply Quote 0
                      • B Offline
                        baldaman
                        last edited by 22 Dec 2010, 10:46

                        😍 😍 😍 β˜€ β˜€ β˜€
                        You are the don Thom, thank you so much!!!
                        I am at the office now, not time to check this out
                        πŸŽ‰ πŸŽ‰ πŸŽ‰

                        1 Reply Last reply Reply Quote 0
                        • T Offline
                          thomthom
                          last edited by 22 Dec 2010, 11:24

                          Post back some samples of what you use it for. I'm very curious.

                          Thomas Thomassen β€” SketchUp Monkey & Coding addict
                          List of my plugins and link to the CookieWare fund

                          1 Reply Last reply Reply Quote 0
                          • B Offline
                            baldaman
                            last edited by 22 Dec 2010, 16:26

                            Works perfectly. β˜€
                            We need to be carefull with the number of colours of the bitmap!

                            After a few tests,

                            best settings are:
                            . indexed colors in photoshop or another image editor (in Photoshop you can choose the number, in the exemple below we have 12 colors)
                            . save as bmp (8bit, no compression).

                            First exemple is specialy dedicated to Thomthom πŸ˜„

                            pixel_cookie.jpg

                            1 Reply Last reply Reply Quote 0
                            • B Offline
                              baldaman
                              last edited by 22 Dec 2010, 16:27

                              More serious use exemples to come asap. πŸ˜‰

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

                              Advertisement