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

    Draw2d

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 1 Posters 242 Views 1 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.
    • A Offline
      avariant
      last edited by

      I'm trying to make a tool that draws 2d shapes (view.draw2d).

      
      def Draw(view)
          view.draw2d(GL_LINE_STRIP, [Geom;;Point3d.new(1,1,1), Geom;;Point3d.new(500, 0, 0), Geom;;Point3d.new(500, 500, 0)])
      puts "update"
      end
      
      

      super simple, just to demo. It works, but it doesn't always work. When I orbit the view, there are times, often actually, where the lines are not drawn and the "update" message is not posted. Does anyone have any suggestions, tips, ideas? It didn't seem like there were to many tools out there using draw2d.

      I've played around with getExtents, but what I put in there doesn't seem to make a difference. It probably only effects 3D drawing?

      1 Reply Last reply Reply Quote 0
      • A Offline
        avariant
        last edited by

        Found it. pushing the middle mouse button invokes the orbit tool. But it also suspends and resumes the currently active tool. By handling the resume method and calling view.invalidate, I can force it to redraw the screen every time the orbit tool finishes and returns to the drawing tool.

        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