Civil engineering feature implementation (Transportation Engineering)

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
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by microelly2 »

Joel_graff wrote: Thu May 10, 2018 5:40 pm
It's not perfect, and it breaks if you try to adjust the skew in increments greater than 5 degrees. I suspect microelly's animation workbench would be a great way to overcome that...
I will look for a method which does not set a constraint value in one step but changes the value of a constraint from the old to the new value way
on an "secure way".
The other thing I'm trying to do is to hook the model into an external spreadsheet (or even a text file), so that you can modify the parameters outside FreeCAD and see the model update. It seems pretty doable with LibreOffice Calc, and I've got a start on it, but no promises on anything useful in the near future...
the simplest way is to run a macro in libre office which saves the data to the file and sends a http request to the FreeCAD webserver.
And than FreeCAD rereads the data.
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by Joel_graff »

microelly2 wrote: Thu May 10, 2018 7:44 pm the simplest way is to run a macro in libre office which saves the data to the file and sends a http request to the FreeCAD webserver.
And than FreeCAD rereads the data.
Right now, I'm working on a direct connection between FreeCAD and Calc via Python / UNO. I think that could work well, but I'm not sure. It could be too unstable to manage. I was a little disappointed when I learned that OO / LO rely on a JVM to provide interoperability.

Otherwise, a server to monitor file changes sounds like the best solution - I haven't explored setting FreeCAD up as a server, yet, though.
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
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by microelly2 »

here is the idea of the connection between svg and freecad lines 1400 - 1480
https://github.com/microelly2/freecad-n ... portSVG.py


the other idea is a webserver:

import Web
t=Web.startServer()
print t

than you can send a string as a command to the adress/port p which is executed as a python command in the python console.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by microelly2 »

I have started to port the methods from the nurbswb to the transportation wb
first the labeling methods
there are 4 methods

create a geodata reference point object
create labels with symbolic faces
create labels for all componentes of an object
create a stationing

these are the methods where the gui is written with miki.it allows me faster to change the layout and extend the interface.

https://github.com/microelly2/freecad-t ... eltools.py
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by Joel_graff »

microelly2 wrote: Fri May 11, 2018 7:25 am I have started to port the methods from the nurbswb to the transportation wb
Out of curiosity, have you thought about migrating code to Python3?

I just got FreeCAD to build with py3.6.5 and it seems to work well, but, of course, I had to spend a lot of time putting parentheses on print() statements in your code ;)

I know full support isn't there yet, but I was just curious what you thought about it...

And thanks for the server tips - I'll start to explore that when I get a chance. The next three weeks will be spent preparing for the webinar I'm giving in early June that's going to feature FreeCAD. I'll post the link once it's available on youtube.
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
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by microelly2 »

Joel_graff wrote: Fri May 11, 2018 12:35 pm
microelly2 wrote: Fri May 11, 2018 7:25 am I have started to port the methods from the nurbswb to the transportation wb
Out of curiosity, have you thought about migrating code to Python3?
I just got FreeCAD to build with py3.6.5 and it seems to work well, but, of course, I had to spend a lot of time putting parentheses on print() statements in your code ;)
oh yes, it's time to leave the old ways, thank you for testing, I will switch soon.
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by Joel_graff »

microelly2 wrote: Fri May 11, 2018 6:42 pm oh yes, it's time to leave the old ways, thank you for testing, I will switch soon.
While I'm at it... is there a preference on whitespace? I've always defaulted to spaces (instead of tabs), but after editing some of your files, I discovered you use strictly tabs...

I think I can configure VSCode to default to tabs [char(9)] when working in specific folders, but I got schooled some time ago on another project that tabs were strictly verboten, which is why I switched...
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
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by microelly2 »

Joel_graff wrote: Fri May 11, 2018 7:17 pm
microelly2 wrote: Fri May 11, 2018 6:42 pm oh yes, it's time to leave the old ways, thank you for testing, I will switch soon.
While I'm at it... is there a preference on whitespace? I've always defaulted to spaces (instead of tabs), but after editing some of your files, I discovered you use strictly tabs...

I think I can configure VSCode to default to tabs [char(9)] when working in specific folders, but I got schooled some time ago on another project that tabs were strictly verboten, which is why I switched...
You are right, tabs are not pep8 conform.
But my experience with tabs is better: I always see the structure and do not have to count spaces. the difference between 8 and 9 white spaces is not too much but the impact of such an extra space is hard to debug. I have tried to use white spaces. It works for me, but when I teach in school then I can faster check the editor windows of my pupils when I see the tab structure.

For our project we should follow pep8 to make cooperation easier, so I will switch to white space too.
we can use autopep8 and pylint to make the code beautiful.
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by Joel_graff »

microelly2 wrote: Sat May 12, 2018 2:38 pm For our project we should follow pep8 to make cooperation easier, so I will switch to white space too.
we can use autopep8 and pylint to make the code beautiful.
Ok - sounds good.

We also need to come up with a shorter-term list of things to do. I know we discussed it, like unit testing and other things. I don't know quite what matters most at this moment - pushing forward on the proof of concept or code cleanup. Or both...
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
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Civil engineering feature implementation (Transportation Engineering)

Post by microelly2 »

Joel_graff wrote: Sat May 12, 2018 4:28 pm We also need to come up with a shorter-term list of things to do. I know we discussed it, like unit testing and other things. I don't know quite what matters most at this moment - pushing forward on the proof of concept or code cleanup. Or both...
my steps:
make labeltools.py pep8 conform
add testcases for labeltools.py
move the next script from nurbs wb to transprtation wb (some of the content of sketch_to_bezier.py: SuperDraftLabel, createStationing and ArcSketch)
Post Reply