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

    Sync sketchup with vtk tool

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 319 Views 2 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.
    • C Offline
      curator
      last edited by

      Hey all,
      I am trying to use Sketchup as modelling tool for an external application. Both run simultainiously and communication is not a problem.

      As both tools run together, I would prefer that a change of view in SU would result in the same change of view in the vtk Tool. Hence, I already made use of the ViewObserver to get informed about any changes, but I dont know how to "convert" the View information to vtk. I guess, that I have to modify the vtkCamera [1], but I dont know which data to insert (based on Sketchup View [2]). Any suggestions?

      kind regards,
      curator

      [1] http://www.vtk.org/doc/nightly/html/classvtkCamera.html
      [2] http://www.sketchup.com/intl/en/developer/docs/ourdoc/view

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

        You would need to get the view's instance of the Sketchup::Camera class, via:
        cam = Sketchup.active_model.active_view.camera()

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • C Offline
          curator
          last edited by

          Hi,

          thanks for the Tip. I looked their and synced the position with the position, the target with the focal point and view up with view up. That seems to work pretty good in the first attempt, but I am not allowed to zoom in or out, since then both view are not the same anymore (basically the vtk window does not "rescale". vtk has the zoom or setdistance function, but I expected them to be given indirectly be the distance between position and focal point. what information have i missed?

          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