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
Kunda1
Posts: 5505
Joined: Thu Jan 05, 2017 9:03 pm

Re: Civil engineering feature implementation

Postby Kunda1 » Fri Jun 23, 2017 10:20 am

Joel_graff wrote:
Fri Jun 23, 2017 2:28 am
I only saw the response a few days ago, so not much progress yet. I have to watch the video a couple more times I think.

Really, it's been a mental game just trying to figure out how to use Sketcher's constrained geometry to model horizontal and vertical alignments. The requirements for civil geometry are really pretty simple and Sketcher should have no problem managing it. I've got a fair idea of how to approach it, but coding Python's slow - you know.. documentation. :)

Plus, there's a weird bug it seems in sketcher's selection code...
Documentation is sparse. Do you mind making notes as you go or even submitting some as documentation additions as you go? Feel free to ask on the forums as well!

Is the bug you found lnown and listed on the tracker?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
microelly2
Posts: 4361
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Civil engineering feature implementation

Postby microelly2 » Fri Jun 23, 2017 8:04 pm

I have done a prototype of a "basic object" as a sketcherobject python to get an idea how this can work
I call it a star (its topological a tree and can be simplified back to a line or a curve )
so it can be a segement fo a road but a crossing too

stars can be connected to build larger trees.
there are parameters where to connect.
furthermore an offset and a rotation between two stars is possible,
and there is a tangent constraint between two stars.

the source is here
https://github.com/microelly2/freecad-n ... /curves.py
(i put it in this workbench because I need this functionality for my bspline curves too)

video 1:
https://youtu.be/vinVDF1qL30
create two stars and connect them

video2:
https://youtu.be/xrmjhv9uMoI
modify a start - add a bsplinecurve
connect them with tangent constraints
bp_532.png
bp_532.png (50.35 KiB) Viewed 1275 times
User avatar
Joel_graff
Posts: 1494
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation

Postby Joel_graff » Fri Jun 23, 2017 10:37 pm

So far as documentation goes, I can try. I can just document the sketcher functions I've used thus far, at least.

So far as the pytohn objects go, I know what the basic constructs look like and what the total geometry is that will accompany it. I just have to sit down and focus on the sketcher demo micro elly2 has put together and get my head wrapped around it. Maybe sometime this weekend.

Really frustrating when I can picture everything in my head but have no idea what it'll take to make it work in FreeCAD. :) I'm really encouraged by the default functionality that Sketcher provides, 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
Joel_graff
Posts: 1494
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation

Postby Joel_graff » Sat Jun 24, 2017 1:17 pm

So I took a look at the sketcher object videos. That looks like it's exactly what I need. It's actually far more powerful than I need. Driving it by script inside the Sketcher workbench should work quite nicely.

Now to just wrap my head around the implementation details.

Also, I'm going to try to put together a screencast demonstrating my workflow thus far for building civil engineering curves. Sketcher really serves the purpose well, I think, with a few odd quirks aside...
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
Kunda1
Posts: 5505
Joined: Thu Jan 05, 2017 9:03 pm

Re: Civil engineering feature implementation

Postby Kunda1 » Sat Jun 24, 2017 1:29 pm

Awesome!
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Joel_graff
Posts: 1494
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation

Postby Joel_graff » Mon Jun 26, 2017 3:26 pm

Youtube video on building alignments in FeeCAD 0.16:

phpBB [video]
Last edited by Joel_graff on Mon Jun 26, 2017 4:22 pm, edited 1 time in total.
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
Kunda1
Posts: 5505
Joined: Thu Jan 05, 2017 9:03 pm

Re: Civil engineering feature implementation

Postby Kunda1 » Mon Jun 26, 2017 4:01 pm

Joel_graff wrote:
Mon Jun 26, 2017 3:26 pm
Youtube video on building alignments in FeeCAD 0.16:

https://youtu.be/i1XM3_uUYH0
Informative! Useful to see where the direction of this Workbench can go. I also wonder if you'll see any differences by testing latest 0.17 ?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Joel_graff
Posts: 1494
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation

Postby Joel_graff » Mon Jun 26, 2017 4:10 pm

I'll test it under 0.17 when I get a chance.

I was also thinking about microelly's star network demo for the sketcher objects. It seems like a handy idea for connecting secondary alignments, but as I thought about it, each alignment has it's own stationing and it's own vertical curvature. So that means they would have to exist as separate entities in sketcher, as well. They wouldn't actually get connected until after the 3D curves are generated.

Still, I need to get the code and see if I can use it to create curve objects - it looks really useful.
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
Kunda1
Posts: 5505
Joined: Thu Jan 05, 2017 9:03 pm

Re: Civil engineering feature implementation

Postby Kunda1 » Mon Jun 26, 2017 4:17 pm

FYI you can enclose videos in

Code: Select all

[video][/video]
to view it within the thread.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Joel_graff
Posts: 1494
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Civil engineering feature implementation

Postby Joel_graff » Mon Jun 26, 2017 4:22 pm

Kunda1 wrote:
Mon Jun 26, 2017 4:17 pm
FYI you can enclose videos in

Code: Select all

[video][/video]
to view it within the thread.
Noted ;)
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