Trails Workbench (Transportation and Earthwork Workbench)

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
HakanSeven12
Posts: 1065
Joined: Wed Feb 06, 2019 10:30 pm

Re: Trails Workbench (Transportation and Earthwork Workbench)

Post by HakanSeven12 » Sat Nov 14, 2020 5:58 pm

You don't need them.

User avatar
sgrogan
Posts: 6205
Joined: Wed Oct 22, 2014 5:02 pm

Re: Trails Workbench (Transportation and Earthwork Workbench)

Post by sgrogan » Sat Nov 14, 2020 6:44 pm

ajoeiam wrote:
Sat Nov 14, 2020 5:48 pm
How do I install cv2, urllib, chardet, certifi, idna - - - please?
Are all included in the .AppImage
gdal is still a problem. It is causing a hdf5 conflict on Conda.
gdalconst, can anyone explain this? Duck duck go says it's a java binding?
"fight the good fight"

User avatar
bernd
Posts: 11091
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Trails Workbench (Transportation and Earthwork Workbench)

Post by bernd » Sat Nov 14, 2020 9:20 pm

You are on Linux, just use your package manager to install missing python modules. The only one I did not use the pm for was srtm4 for osm elevations.

User avatar
HakanSeven12
Posts: 1065
Joined: Wed Feb 06, 2019 10:30 pm

Re: Trails Workbench (Transportation and Earthwork Workbench)

Post by HakanSeven12 » Sun Nov 15, 2020 1:23 pm

New treeview icons.


TreeViewIcons.png
TreeViewIcons.png (70.04 KiB) Viewed 436 times

Fleg
Posts: 3
Joined: Sun Nov 15, 2020 5:24 pm
Location: France

Re: Trails Workbench (Transportation and Earthwork Workbench)

Post by Fleg » Sun Nov 15, 2020 11:22 pm

Hi,

Geodata workbench had a feature called "Navigator" :
Image

Its purpose was to give you a "first person mode navigation" where you can walk or fly, and where you can use the mouse or the keyboard to control the camera (orientation, zoom etc.).

This type of navigation tool is useful for exemple in BIM context or in geotechnical context and is implemented in commercial softwares. See this exemple, in an autodesk product :

phpBB [video]


Please take a look too at the video tutorial made by microelly2 on his Geodata/Navigator tool :

phpBB [video]


My needs in a BIM context are what made me digging on Geodata/navigator.

Trails have replaced Geodata but it does not include this type of navigation tool and as far as I know this navigation tool is not integrated in Freecad anywhere else (I scanned the forum for hours).

I tried to make it work as a macro or by installing Geodata WB from microelly2 github repo (Navigator is said there to have been ported to Python 3) but Freecad return errors probably caused by obsolete code in geodata WB.

This navigation tool could have a general use in every workbench and therefore it could attract people on trails WB and make its community grow.

I am new to the forum. I am an engineer (ship building) and have some basic knowledge in programming. I am ok with Python but I am completely new to Qt or PySide or other specific libraries.

Could Trails WB devs consider porting this tool in ?

I am willing to help on my free time but I certainly will spend more time learning than producing something useful at the beggining (a situation which I am happy with - as long as documentation is well written).

Regards,

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22846 (Git)
Build type: Release
Branch: master
Hash: 1f46b72491a0008384a6db4f2615a656249f6f08
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: French/France (fr_FR)

User avatar
HakanSeven12
Posts: 1065
Joined: Wed Feb 06, 2019 10:30 pm

Re: Trails Workbench (Transportation and Earthwork Workbench)

Post by HakanSeven12 » Mon Nov 16, 2020 5:59 am

Did you test it in Trails? I made some updates but it's long time ago. So I'm not sure if it works or not.

Edit: I tested and made some fix. Test Trails wb and make feedback.
navigation.png
navigation.png (80.89 KiB) Viewed 297 times

Fleg
Posts: 3
Joined: Sun Nov 15, 2020 5:24 pm
Location: France

Re: Trails Workbench (Transportation and Earthwork Workbench)

Post by Fleg » Mon Nov 16, 2020 11:18 pm

HakanSeven12 wrote:
Mon Nov 16, 2020 5:59 am
Did you test it in Trails? I made some updates but it's long time ago. So I'm not sure if it works or not.

Edit: I tested and made some fix. Test Trails wb and make feedback.
Thank you for your time.

My bad, I did not scan correctly every Trails WB's menus icons. I missed the navigator command between all import commands in this drop-down menu :
Image

GUI suggestion for blind people like me : separate in another menu the 3 commands circled in the picture above from the import commands ?

Before your fix, navigator launched itself but I was getting this error at the first event :
22:37:23 Running the Python command 'Navigator' failed:
Traceback (most recent call last):
File "C:\Program Files\FreeCAD_0.19.22846\Mod\freecad.trails\freecad\trails\geomatics\geoimport_gui.py", line 146, in Activated
navigator.navi()
File "C:\Program Files\FreeCAD_0.19.22846\Mod\freecad.trails\freecad\trails\geomatics\geoimport\navigator.py", line 1054, in navi
mw.installEventFilter(ef)

installEventFilter() takes exactly one argument (0 given)
After your fix, navigator launchs itself but at the first event (keystroke, click etc.), I get this error :
sys:1: RuntimeWarning: Invalid return value in function QObject.eventFilter, expected bool, got NoneType.
Then it does not crash but it seems to be irresponsive to some event (F2...F9 keystrokes, arrows keystrokes) but I still get some messages in the report view. For exemple :
23:46:24 !Mouse one left
23:46:24 on clicks 3 Left
23:46:24 [['QWindow', '???'], ['QMainWindow', 'FreeCAD 0.19']]
Then, clicking on "Stop Navigation" button makes you go back to standard FC navigation mode but I noticed that the 3D model is not rendered anymore from the viewpoint to a certain distance A and from a certain distance B to infinity (B > A) in perspective view mode at least.

I tried to dig into freecad.trails\freecad\trails\geomatics\geoimport\navigator.py code and noticed some references to image files pointing in the old Geodata files or pointing directly on a local file :
## background image winter
def background1(ef):
fn=os.path.dirname(__file__) +"/../pics/winter.jpg"
ef.tex.filename = fn
and
if keystring=='F2':
fn='/home/microelly2/FCB/b175_camera_controller/P1170438.JPG'
ef.tex.filename = fn
The last one is in "on_keypress2" method which might not be called in this version of Navigator but this probably explains why buttons related to background modifications do not produce any effect. This pics are still available on microelly2 repo.

I read your fixes. Principally :
- widget = QtGui.qApp.widgetAt(self.lastpos)
+ widget = QtGui.QApplication.widgetAt(self.lastpos)
So issues described above are related to calls to obsolete Qt libraries ? Can I help ? Where can I start learning in Qt documentation ?

Regards,

User avatar
HakanSeven12
Posts: 1065
Joined: Wed Feb 06, 2019 10:30 pm

Re: Trails Workbench (Transportation and Earthwork Workbench)

Post by HakanSeven12 » Tue Nov 17, 2020 7:10 am

Fleg wrote:
Mon Nov 16, 2020 11:18 pm
GUI suggestion for blind people like me : separate in another menu the 3 commands circled in the picture above from the import commands ?
I will merge most of the importer in one place and remove them from dropdown menu.
After your fix, navigator launchs itself but at the first event (keystroke, click etc.), I get this error :

Code: Select all

sys:1: RuntimeWarning: Invalid return value in function QObject.eventFilter, expected bool, got NoneType.
I cant find what is cousing this but its not effect navigator. So ok for now.
Then it does not crash but it seems to be irresponsive to some event (F2...F9 keystrokes, arrows keystrokes) but I still get some messages in the report view. For exemple :

Code: Select all

23:46:24  !Mouse one left
23:46:24  on clicks 3 Left
23:46:24  [['QWindow', '???'], ['QMainWindow', 'FreeCAD 0.19']]
Then, clicking on "Stop Navigation" button makes you go back to standard FC navigation mode but I noticed that the 3D model is not rendered anymore from the viewpoint to a certain distance A and from a certain distance B to infinity (B > A) in perspective view mode at least.
Yeah need some work here.
I tried to dig into freecad.trails\freecad\trails\geomatics\geoimport\navigator.py code and noticed some references to image files pointing in the old Geodata files or pointing directly on a local file :

Code: Select all

## background image winter
def background1(ef):
	fn=os.path.dirname(__file__) +"/../pics/winter.jpg"
	ef.tex.filename = fn
and

Code: Select all

if keystring=='F2':
			fn='/home/microelly2/FCB/b175_camera_controller/P1170438.JPG'
			ef.tex.filename = fn
The last one is in "on_keypress2" method which might not be called in this version of Navigator but this probably explains why buttons related to background modifications do not produce any effect. This pics are still available on microelly2 repo.
Fixed

I read your fixes. Principally :

Code: Select all

-				widget = QtGui.qApp.widgetAt(self.lastpos)
+				widget = QtGui.QApplication.widgetAt(self.lastpos)
So issues described above are related to calls to obsolete Qt libraries ? Can I help ? Where can I start learning in Qt documentation ?
Yes. There is things changes after geodata released. It needs some changes in python and qt codes. You can find usefull stuff in youtube or forums and pyside github.io: https://srinikom.github.io/pyside-docs/index.html

User avatar
bernd
Posts: 11091
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Trails Workbench (Transportation and Earthwork Workbench)

Post by bernd » Tue Nov 17, 2020 1:13 pm

:shock: I did not know this in included in geodata and trails. We had a disscussion abut this some days ago ...

for reference ... https://forum.freecadweb.org/viewtopic.php?f=23&t=51770

User avatar
HakanSeven12
Posts: 1065
Joined: Wed Feb 06, 2019 10:30 pm

Re: Trails Workbench (Transportation and Earthwork Workbench)

Post by HakanSeven12 » Tue Nov 17, 2020 1:21 pm

Yes it's included but need some works on it. So if you interested, you can make some contribution :) I'm very busy with geomatics features.

Post Reply