sketchucation logo sketchucation
    • Login
    1. Home
    2. lbsswu
    3. Topics
    ℹ️ 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

    Topics

    • lbsswuL

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

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      376 Views
      lbsswuL
      @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!
    • lbsswuL

      How to get the projected coordinate of a 3D point?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      374 Views
      lbsswuL
      @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!
    • lbsswuL

      How to get the bounding box of a CAD car?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      811 Views
      lbsswuL
      @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.
    • lbsswuL

      Correspondence of color names in Paint Bucket

      Watching Ignoring Scheduled Pinned Locked Moved Newbie Forum sketchup
      3
      0 Votes
      3 Posts
      249 Views
      lbsswuL
      @tig said: I'm not sure that there is any correspondence between the external SKM file's RGB values and the built-in [OpenGL] colors. You can of course make new materials directly from from colors - like 'AliceBlue' - just by specifying a valid name as the material. You can also get any material's RGB color values in API code and from that you can compare it to the 'built-in' colors' RGB values. See the Material AND Color parts of the API docs... If you have a material already in the SKP why do you need to use a new 'color' based one at all ? Hi, TIG. Sorry for my late thanks. Actually, other people im my group use two styles of colors, e.g.the external SKM file's colors and the built-in [OpenGL] colors. I want to integrate them.
    • lbsswuL

      How to get the absolute coordinates of faces?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      3k Views
      liquid98L
      Hi Ibswu, Check this: http://sketchucation.com/forums/viewtopic.php?f=180&t=48769 -- Liquid
    • lbsswuL

      How to get the center of a ComponentDefinition array?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      98 Views
      lbsswuL
      @tig said: If you meant ComponentInstance then they each have bounds. Make a new empty bounding-box object [ bb], and then add each of the instance.bounds to that bb.add(instance.bounds). The center is bb.center......... Thanks for your tip. I will test the code.
    • lbsswuL

      How to add an entity to entities?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      68 Views
      lbsswuL
      @thomthom said: You're aware of the API documentation, right? https://developers.google.com/sketchup/docs/classes The Entities class has many method to add entites - depending what you want to add: https://developers.google.com/sketchup/docs/ourdoc/entities You're not talking about adding an existing entity to a different Entities collection? I am sorry I made a mistake about the concepts of Sketchup::Entity and Sketchup::ComponentInstance. I have two car models, and I should use entities.add_instance to add a car.
    • lbsswuL

      How to get entities from selection?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      11
      0 Votes
      11 Posts
      588 Views
      thomthomT
      Sample test model?
    • lbsswuL

      How to import several models to designated positions

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      13
      0 Votes
      13 Posts
      457 Views
      Dan RathbunD
      When I first listed the methods, I thot for a moment (until I looked twice,) that the seventh method was named eat_me! ...
    • 1 / 1