Keyboard manipulator 3D

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
efyx
Posts: 280
Joined: Fri Sep 26, 2014 7:36 pm

Keyboard manipulator 3D

Post by efyx »

Hi,
this is an idea which following me around for long time. Keyboard manipulator 3D based on idea of 3d connexion spacemouse. This is ergonomic utility which fasten desingning process. Unfortunatelly my programming skills are poor (still increasing in python, but I found recently that this cannot be realized by python at least I don't know how), so I am looking for developer who would be interested and be able to pull this project.
The idea is to do all manipulator things with keyboard with fast access (doble space for example). I found in my opinion optimal configuration of keys, which are easy access and all operations (roatations/zooming at the same time) should be possible to do without bigger problem and using only one hand.
My idea of keys preset (can be configurable):
Keyboard manipulator 3D.png
Keyboard manipulator 3D.png (356.36 KiB) Viewed 959 times
Looking for your comments

Presentation of 3d space mouse: https://youtu.be/C9lIYmkYrXk?t=2m
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Keyboard manipulator 3D

Post by NormandC »

LOL. Are you a PC FPS player by any chance? :D
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Keyboard manipulator 3D

Post by triplus »

Hi @efyx

Just looking at the image (good job on providing one) your suggestion doesn't stand a real chance (defaults). Your proposal is occupying one third of the keyboard. All sort of local/global shortcuts already occupy that by default. Therefore if somebody would create a feature like you suggest. It likely would require for the end user to customizes the shortcut keys to a scheme as you suggest. As for the feature itself. If somebody is prepared to code it. Sure, why not.
mario52
Veteran
Posts: 4692
Joined: Wed May 16, 2012 2:13 pm

Re: Keyboard manipulator 3D

Post by mario52 »

hi efix

here to start with many link for the camera documentation other in my signature (extract of my Macro_Mouse_Cross)

Code: Select all

# -*- coding: utf-8 -*-

from PySide import QtCore, QtGui

#################### create document if not exist #######################
doc = FreeCAD.ActiveDocument                                         ####
if doc == None:                                                      ####
    doc = FreeCAD.newDocument()                                      ####
#########################################################################

class ViewObserver:
   def logPosition(self, info):

       print info
       print "_______________________"

       self.pos = info["Key"]
       if (self.pos.upper() == "Q"):    # quit and close the ViewObserver() (or choice other key)
           v.removeEventCallback("SoKeyboardEvent",c)
           print "End Macro_Mouse_Cross"

       if (self.pos.upper() == "S"):

            print cam
            print "S"
       elif (self.pos.upper() == "F"):
            print "F"
       elif (self.pos.upper() == "E"):
            print "E"
       elif (self.pos.upper() == "D"):
            print "D"
       elif (self.pos.upper() == "Z"):
            print "Z"
       elif (self.pos.upper() == "V"):
            print "V"
       elif (self.pos.upper() == "W"):
            print "W"
       elif (self.pos.upper() == "R"):
            print "R"
#       elif (self.pos.upper() == "Q"):
#            print "Q"
       elif (self.pos.upper() == "T"):
            print "T"
       elif (self.pos.upper() == "A"):
            print "A"

try:
    v=Gui.activeDocument().activeView()
    o = ViewObserver()
    c = v.addEventCallback("SoKeyboardEvent",o.logPosition)

    App.Console.PrintMessage("Type Key Q to Quit"+"\n")
except Exception:
    FreeCAD.Console.PrintError("\n"+"Not document open"+"\n") 


## documentation Camera
##
## http://web.mit.edu/ivlib/www/iv/cameras.html
## http://forum.freecadweb.org/viewtopic.php?f=22&t=5576#p45446
## http://forum.freecadweb.org/viewtopic.php?f=10&t=2552&p=18998&hilit=setCamera#p18998
## http://forum.freecadweb.org/viewtopic.php?f=8&t=3520&p=27474&hilit=setCameraOrientation#p27474
## https://grey.colorado.edu/coin3d/classSoOrthographicCamera.html
## http://forum.freecadweb.org/viewtopic.php?f=22&t=6745
## http://forum.freecadweb.org/viewtopic.php?f=22&t=10157
## http://forum.freecadweb.org/viewtopic.php?f=22&t=11734
## http://forum.freecadweb.org/viewtopic.php?f=8&t=10573&start=80
## https://www.forum.freecadweb.org/viewtopic.php?f=22&t=22850
## http://forum.freecadweb.org/viewtopic.php?f=3&t=7029&p=56735&hilit=setCameraOrientation#p56735
## http://forum.freecadweb.org/viewtopic.php?f=13&t=14213
## https://www.forum.freecadweb.org/viewtopic.php?f=22&t=26391
## http://developer90.openinventor.com/content/42-cameras
## https://www.forum.freecadweb.org/viewtopic.php?f=22&t=26391
## https://www.forum.freecadweb.org/viewtopic.php?f=22&t=26500
##
#"""
#
#    PerspectiveCamera. A PerspectiveCamera shows you the scene and applies foreshortening to give you a better impression of distance.
#
#        PerspectiveCamera {
#            viewportMapping  ADJUST_CAMERA
#            position         0 0 1
#            orientation      0 0 1  0
#            aspectRatio      1
#            nearDistance     1
#            farDistance      10
#            focalDistance    5
#            heightAngle      0.785398
#        }
#
#    OrthographicCamera. A OrthographicCamera shows you the scene but doesn't apply any foreshortening.
#
#        OrthographicCamera {
#            viewportMapping  ADJUST_CAMERA
#            position         0 0 1
#            orientation      0 0 1  0
#            aspectRatio      1
#            nearDistance     1
#            farDistance      10
#            focalDistance    5
#            height           2
#        }
#"""
#
#Gui.activeDocument().activeView().setCamera('#Inventor V2.1 ascii \n OrthographicCamera { \n viewportMapping ADJUST_CAMERA \n position 0 0 87 \n orientation 0 0 1 0 \n nearDistance 37 \n farDistance 137 \n aspectRatio 1 \n focalDistance 87 \n height 119 }')
#
###########################################################################

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
User avatar
Chris_G
Veteran
Posts: 2598
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Keyboard manipulator 3D

Post by Chris_G »

NormandC wrote: Wed Jul 18, 2018 6:16 pm LOL. Are you a PC FPS player by any chance? :D
FP ... what ? Nobody should play that. That's bad ! :lol: :lol: :lol:

tf2.jpeg
tf2.jpeg (19.54 KiB) Viewed 888 times
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Keyboard manipulator 3D

Post by NormandC »

Man I loved TF2. :D I may have played more hours than you, back in the day... (I haven't logged in to my Steam account in years)

Heavy wrote:I love this doctor!
Soldier wrote:MEDIC!!!!
efyx
Posts: 280
Joined: Fri Sep 26, 2014 7:36 pm

Re: Keyboard manipulator 3D

Post by efyx »

NormandC wrote: Wed Jul 18, 2018 6:16 pm LOL. Are you a PC FPS player by any chance? :D
Nope, but always wanted to :D
triplus wrote: Wed Jul 18, 2018 7:20 pm Your proposal is occupying one third of the keyboard.
Thanks for meritoric voice
mario52 wrote: Wed Jul 18, 2018 8:15 pm
This is really cool, I'll look at it. Thanks.
Chris_G wrote: Wed Jul 18, 2018 8:26 pm
NormandC wrote: Wed Jul 18, 2018 6:16 pm
Looks like it is designed, right for your needs ;)
Post Reply