sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    How to get the bounding box of a CAD car?

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 4 Posters 810 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.
    • lbsswuL Offline
      lbsswu
      last edited by lbsswu

      I have some CAD cars and I need to project these 3D models to 2D images, is there a method to get the 2D bounding box coordinate of a car in each image? e.g., the 4 corner coordinates, (x1,y1), (x2,y2), (x3,y3), (x4,y4) of the green bounding box in the following attachment.

      smp.jpg

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        You would insert each car component onto a new layer, switch to that layer, and turn all other layers OFF, and zoom extents.

        Then use view.write_image to create the image files.

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • lbsswuL Offline
          lbsswu
          last edited by

          @dan rathbun said:

          You would insert each car component onto a new layer, switch to that layer, and turn all other layers OFF, and zoom extents.

          Then use view.write_image to create the image files.

          Suppose there is one car in a image, how to get the coordinates of the car's bounding rectangle?

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

            You don't need to find those [even if you could] because the Zoom Extents on a single car does that in the view.
            Of course depending on your screen's current proportions and the exact view of the car you will get some 'white space' around the image.
            If you don't want all images to be the same size then that 'white space' is best removed with an Image editor [like Gimp] - where you can batch-open each file in turn and Auto-Crop it and save, to ensure that each car occupies as much of the image as possible...

            TIG

            1 Reply Last reply Reply Quote 0
            • dukejazzD Offline
              dukejazz
              last edited by

              It is true you may not need bounding box corner coordinate of a car in each image to make 3D models to 2D images,

              @unknownuser said:

              by lbsswu » February 28th, 2013, 11:58 pm

              I have some CAD cars and I need to project these 3D models to 2D images, is there a method to get the 2D bounding box coordinate of a car in each image? e.g., the 4 corner coordinates, (x1,y1), (x2,y2), (x3,y3), (x4,y4)

              Yes You can turn 3D models to 2D images,
              pic_0147.jpg
              pic_0151.jpg
              pic_0155.jpg

              method 1) flatten it with scaleGroupFloat_dj Ver 1.6.5
              Copyright Feb 15, 2013
              DukeJazz: by James Cochran
              when color leaves then it flat
              recolor with in model texture
              pic_0156.jpg
              I use four boxpoints to four corner (boxPoint_dj)
              then readed the c-point to target
              pic_0144.jpg

              method 2) a clip trxture - edit to transpaency background-input image

              There is 2 methods beside mine above to get the 2D bounding box coordinate of a car.(x1,y1), (x2,y2), (x3,y3), (x4,y4)

              method 1) Ruby ATI method is given here for bounding box coordinate
              http://www.sketchup.com/intl/en/developer/docs/ourdoc/boundingbox#corner

              method 2) If you have the SU Pro save a export to VRML and open to notepad, lookie here coordinates

              1 Reply Last reply Reply Quote 0
              • lbsswuL Offline
                lbsswu
                last edited by

                @dukejazz said:

                It is true you may not need bounding box corner coordinate of a car in each image to make 3D models to 2D images,
                ...

                thanks for your kindly reply, I will try these method.

                1 Reply Last reply Reply Quote 0
                • lbsswuL Offline
                  lbsswu
                  last edited by

                  @tig said:

                  You don't need to find those [even if you could] because the Zoom Extents on a single car does that in the view.
                  Of course depending on your screen's current proportions and the exact view of the car you will get some 'white space' around the image.
                  If you don't want all images to be the same size then that 'white space' is best removed with an Image editor [like Gimp] - where you can batch-open each file in turn and Auto-Crop it and save, to ensure that each car occupies as much of the image as possible...

                  thanks for your tip! maybe I will do that in the future.

                  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