sketchucation logo sketchucation
    • Login
    1. Home
    2. lbsswu
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 9
    • Posts 30
    • Groups 1

    lbsswu

    @lbsswu

    10
    Reputation
    1
    Profile views
    30
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    lbsswu Unfollow Follow
    registered-users

    Latest posts made by lbsswu

    • RE: How to judge whether a 3D point is visible or not

      @sdmitch said:

      @lbsswu said:

      Hi everyone,

      Suppose I have opened the Sketchup software, I want to know whether a 3D point is visible or not in current view.
      For example, the 3D point may locate on the back of a person, thus we can't see it when the person facing to us.

      This should be done by Sketchup ruby code.Could anyone help me?

      I placed a construction point, the little black dot just below the horizon, and "Nancy" in the model. I then used the following code to test if the point was visible.

      mod = Sketchup.active_model
      > ent = mod.active_entities
      > sel = mod.selection
      > vue = mod.active_view
      > eye = vue.camera.eye
      > cp = ent.grep(Sketchup;;ConstructionPoint)[0]
      > pt = cp.position
      > vec = pt.vector_to(eye)
      > hit = mod.raytest([pt,vec])
      > if hit
      >  puts "pt is not visible"
      > else
      >  puts "pt is visible"
      > end
      > 
      

      Hi, sdmitch. Thank you very much. It works!

      posted in Developers' Forum
      lbsswuL
      lbsswu
    • RE: How to get the projected coordinate of a 3D point?

      @tig said:

      view.screen_coords returns the point in the Model as X,Y coords - screen value.
      But you must ensure that the exported image used the same size as the window, otherwise there is no direct relationship between the point and the image's pixels...

      Got it! Thanks for your help!

      posted in Developers' Forum
      lbsswuL
      lbsswu
    • RE: How to get the projected coordinate of a 3D point?

      @slbaumgartner said:

      view.screen_coords

      Got it! Thanks for you help!

      posted in Developers' Forum
      lbsswuL
      lbsswu
    • How to judge whether a 3D point is visible or not

      Hi everyone,

      Suppose I have opened the Sketchup software, I want to know whether a 3D point is visible or not in current view.
      For example, the 3D point may locate on the back of a person, thus we can't see it when the person facing to us.

      This should be done by Sketchup ruby code.Could anyone help me?

      posted in Developers' Forum
      lbsswuL
      lbsswu
    • How to get the projected coordinate of a 3D point?

      Hi everyone,

      I have a problem about how to get the projected coordinate of a 3D point.

      Suppose the 3D point locates at [10 20 30], then I save an image of the scene in current view.

      Then, how do I know the coordinate of the 3D point in the saved image?

      Does anyone have some ideas?

      posted in Developers' Forum
      lbsswuL
      lbsswu
    • RE: How to get the bounding box of a CAD car?

      @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.

      posted in Developers' Forum
      lbsswuL
      lbsswu
    • RE: How to get the bounding box of a CAD car?

      @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.

      posted in Developers' Forum
      lbsswuL
      lbsswu
    • RE: How to get the bounding box of a CAD car?

      @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?

      posted in Developers' Forum
      lbsswuL
      lbsswu
    • How to get the bounding box of a CAD car?

      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

      posted in Developers' Forum
      lbsswuL
      lbsswu
    • RE: Skb files

      @tig said:

      @rich o brien said:

      Try TIG's Purge All plugin. It does mean doing this for each file.
      Although with a little rewriting you could 'batch' purge all SKP files in a folder say, removing the dialog/option prompts... ๐Ÿ˜‰

      OK, thanks a lot!

      posted in Newbie Forum
      lbsswuL
      lbsswu