Geotechnical Work Addon

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
Joel_graff
Posts: 1818
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Geotechnical Work Addon

Postby Joel_graff » Sat Aug 15, 2020 2:43 pm

bernd wrote:
Sun Aug 09, 2020 3:51 pm
it is not only lp on windows, mos linux coin pivy have the same problem.

@joel that would be great if we could just not use on systems whivh do not have it. Most people do not use tons of data if starting with trails.

If we would do this and the recoursive download of submodules with the addon manager trais would install just as simple as any other work bench.
Ok, I'll dig into the code and see what I can do to maybe switch it off. The issue is, it's tied to a specific build of pivy, so if I can determine that, I can probably build a switch that works - though I don't know that I can reliably determine that independent of the platform... Otherwise, I need to switch it off for anyone using v0.18.

As for the submodules, I agree on the recursive suggestion. I don't think it introduces problems for projects that don't have submodules, so I would argue it's harmless to use it when it's not needed.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
bernd
Posts: 10828
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Geotechnical Work Addon

Postby bernd » Thu Aug 20, 2020 8:49 am

Joel_graff wrote:
Sat Aug 15, 2020 2:43 pm
bernd wrote:
Sun Aug 09, 2020 3:51 pm
it is not only lp on windows, mos linux coin pivy have the same problem.

@joel that would be great if we could just not use on systems whivh do not have it. Most people do not use tons of data if starting with trails.

If we would do this and the recoursive download of submodules with the addon manager trais would install just as simple as any other work bench.
Ok, I'll dig into the code and see what I can do to maybe switch it off. The issue is, it's tied to a specific build of pivy, so if I can determine that, I can probably build a switch that works - though I don't know that I can reliably determine that independent of the platform... Otherwise, I need to switch it off for anyone using v0.18.

As for the submodules, I agree on the recursive suggestion. I don't think it introduces problems for projects that don't have submodules, so I would argue it's harmless to use it when it's not needed.
how about write some small method which uses the new coin features. Put in a try: except: If it works everything is fine if not set some variable and use this every time some new features of coin are used. Might not be samrt but should work.

BTW: See https://forum.freecadweb.org/viewtopic.php?f=24&t=49575 I would like to get this somewhere without making another fork Your AddOn would perfectly fit ... I may play and fix more of the old geodata tools.
User avatar
Joel_graff
Posts: 1818
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Geotechnical Work Addon

Postby Joel_graff » Thu Aug 20, 2020 6:29 pm

bernd wrote:
Thu Aug 20, 2020 8:49 am
how about write some small method which uses the new coin features. Put in a try: except: If it works everything is fine if not set some variable and use this every time some new features of coin are used. Might not be samrt but should work.
Yeah, a try/catch test would work, but it's not quite kosher from a programming perspective.

Anyway, I've written the switch code. If your pivy version is less than 6.5, it disables the code for SoGeo coin nodes. It should stop the error for you, anyway.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
bernd
Posts: 10828
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Geotechnical Work Addon

Postby bernd » Thu Aug 20, 2020 6:41 pm

Joel_graff wrote:
Thu Aug 20, 2020 6:29 pm
Yeah, a try/catch test would work, but it's not quite kosher from a programming perspective.
totally agree with you here.

Joel_graff wrote:
Thu Aug 20, 2020 6:29 pm
It should stop the error for you,
I can swith without errors to trails and OSM import works :D

Screenshot_20200820_203959.png
Screenshot_20200820_203959.png (248.96 KiB) Viewed 363 times
User avatar
bernd
Posts: 10828
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Geotechnical Work Addon

Postby bernd » Thu Aug 20, 2020 6:46 pm

Next step would be to make the AddOn manager use the recursive switch or move the additional code outside into Mod and install them separately with the AddOn manager.

BTW what happens if pivy tracker is installed twice, once inside trails and once with the AddOn manager into Mod?
User avatar
Joel_graff
Posts: 1818
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Geotechnical Work Addon

Postby Joel_graff » Thu Aug 20, 2020 7:14 pm

bernd wrote:
Thu Aug 20, 2020 6:41 pm
I can swith without errors to trails and OSM import works
Great!
bernd wrote:
Thu Aug 20, 2020 6:46 pm
Next step would be to make the AddOn manager use the recursive switch or move the additional code outside into Mod and install them separately with the AddOn manager.

BTW what happens if pivy tracker is installed twice, once inside trails and once with the AddOn manager into Mod?
I'd rather keep them as submodules in Trails. However, I can argue it either way. I like the submodule approach because everything comes as one package and it only requires the --recursive switch to make it work. The flip side is implementation - anyone else wanting to use it should include it in their workbench as a submodule as well.

As for which one takes precedence, it's in the order of import. So if pivy_trackers at the /Mod level is imported after FreeCAD.Trails.pivy_trackers, then it will override the submodule, since both share the same top-level path (pivy_trackers/pivy_trackers).

I could mitigate that by removing the extra pivy_trackers/ level, which would make it uninstallable as a /Mod addon and force it to function only as a submodule.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
bernd
Posts: 10828
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Geotechnical Work Addon

Postby bernd » Fri Aug 21, 2020 2:02 pm

IMHO it is up to you which way to go.

Just a remark from my side. I even know how python imports work but found it cumbersome when I first started with trails. When I first tried to install trails I installed it via AddOn manager and than read here and there and than I thought aah I need to install pivy tracker, thus AddOn manager and install pivy tracker but this was totally wrong. The time beeing I know how things work out in trails but someone with no python knowledge will be confused.

There need at least to be some hints in readme. Even if AddOn manager would do the recursive download. If pivy tracker stays in AddOn manager as separate module, there should be a hint in trails that pivy-tracker should not installed separatly but will or should be installed inside trails. As long as AddOn manager does not do the recoursive upload the readme should mentions the git clone command or which submodules to copy where.

People might ask and get confused anyway, but than we could just post a link on the readme. Posting a link to the readme could be done by far more people than you and hakan.

If trails would install more easily it will for sure be used be some more people because this is great stuff :D

Ahh, some small PR ... https://github.com/joelgraff/freecad.trails/pull/61
User avatar
Joel_graff
Posts: 1818
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Geotechnical Work Addon

Postby Joel_graff » Fri Aug 21, 2020 2:09 pm

bernd wrote:
Fri Aug 21, 2020 2:02 pm
People might ask and get confused anyway, but than we could just post a link on the readme. Posting a link to the readme could be done by far more people than you and hakan.

If trails would install more easily it will for sure be used be some more people because this is great stuff :D

Ahh, some small PR ... https://github.com/joelgraff/freecad.trails/pull/61
It is in the readme:

https://github.com/joelgraff/freecad.tr ... pendencies

Before there were a lot of pictures, it may have been easier to spot. Or not. I really don't know. There's too many pictures there now, so I suspect some should maybe get removed... or reduced to a gallery or something.

Merged the PR - thanks for that!

I'm glad geodata has found new life inside trails. So far, none of that is me. I just want to make sure I don't get in anyone's way. :lol:
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
User avatar
bernd
Posts: 10828
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Geotechnical Work Addon

Postby bernd » Fri Aug 21, 2020 4:06 pm

you are dam right everything is in the readme already ... :oops:

I will give it a try on win libpack version too and report back.
User avatar
bernd
Posts: 10828
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Geotechnical Work Addon

Postby bernd » Fri Aug 21, 2020 4:17 pm

is there a special reason why GeoDataWB with upper case chars and not such simple name as geoimport for all these kind of tools?