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

### Re: Civil engineering feature implementation (Transportation Engineering)

microelly2 wrote:ping
Alone you go faster. Together we go farther
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

### Re: Civil engineering feature implementation (Transportation Engineering)

I work at the moment on the problem finding a two arc connection between two lines AB and BC with tangential constraints
bp_577.png (9.75 KiB) Viewed 1074 times
There are always two solutions
the expected short yellow curve
and the longer pink solution
both solutions have one degree of freedom.
It is the point T/T2 where the arcs connect.
I expect that is possible to create an unambigious parametric solution for that problem;start with two lines create this kind of connector.

here the example
Attachments
zwei_tangentenkreise_mehrere_loesungen.fcstd
saso
Posts: 1597
Joined: Fri May 16, 2014 1:14 pm
Contact:

### Re: Civil engineering feature implementation (Transportation Engineering)

I never did any real road designs but back in the school we always used the euler spiral (klotoide) for this, like line-klotoide-arc-klotoide-line

https://en.wikipedia.org/wiki/Euler_spiral
https://de.wikipedia.org/wiki/Klothoide
https://sl.wikipedia.org/wiki/Klotoida# ... _curve.svg
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

### Re: Civil engineering feature implementation (Transportation Engineering)

There exists a lot of problems with multiple solutions.

Example:
Given 2 side lengths and one non enclosed angle for a triangle the solution can be ambigious.
How I have to model this task with the sketcher functionality to get exactly the solution I want?

The sketcher (always) gives you one solution. But is this solution that what you expect.
How I can constraint a sketch by using "inequalities" like: the point should lie inside a certain area (example rectangle or circle).

The other example is my last post.

I have looked for a method to describe inequalities/intervals in terms of the sketcher.
With these methods I can restrict the searching area for the sketcher solver.
Joel_graff
Posts: 1881
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

### Re: Civil engineering feature implementation (Transportation Engineering)

microelly2 wrote:
Wed Sep 20, 2017 8:56 pm
How I can constraint a sketch by using "inequalities" like: the point should lie inside a certain area (example rectangle or circle).
If we can figure out how to support inequalities, I can see how to easily create a boundary that contains the correct solution. Another option would be to require that the rotation angle of the arc be less than 360 degrees as, in every case, the two solutions will be less than and greater than / equal to 360 degrees. A third approach would be to force it to calculate both solutions and choose the one with the shorter curve length.

In fact, it would be ideal to be able to specify an inequality as a property of the constraint itself, based on a property / properties of the adjoining geometry. Thus, when the solver solves the problem, it checks the constraint for any user-defined inequalities and rejects solutions which fail it.

That, in fact, might go a long way to solve the "user expectation" problem that we discussed earlier.

I don't see any way to get it done without rewriting the solver to support new functionality. But the concept of a "constraint inequality" makes a lot of sense to me.

edit: I didn't look closely enough to realize that these were two curves and not one. That said, a constraint with an inequality that doesn't permit the angle of either curve to meet or exceed 180 degrees would be sufficient, here.

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

### Re: Civil engineering feature implementation (Transportation Engineering)

this is an example of a circle which can only lie inside the square.
inequality_sketch.FCStd
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

### Re: Civil engineering feature implementation (Transportation Engineering)

an animation of the possible solution to connect two lines by tangential arcs.
phpBB [video]

I needed some investigation to "see" a robust structure for modeling the problem.

the next step will be a python sketch extension to create these parametric objects by one click from gui.
Joel_graff
Posts: 1881
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

### Re: Civil engineering feature implementation (Transportation Engineering)

That definitely looks like it solves the problem. Good work!

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
Kunda1
Posts: 9222
Joined: Thu Jan 05, 2017 9:03 pm

### Re: Civil engineering feature implementation (Transportation Engineering)

@microelly2 nice! What's the next step ?
Alone you go faster. Together we go farther
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

### Re: Civil engineering feature implementation (Transportation Engineering)

This is the first version of a general feedback sketch
The idea of such a sketch was to reduce the inner complexity of a sketch by swap out helper construction to another sketch or to combine multiple sketches for complex constructions.
it is more powerful than expressions.
It is possible to deactivate some components to speed up design or flip between different sketches on demand.

this is the first version and not all parameters are already used.

phpBB [video]

bp_598.png (92.03 KiB) Viewed 641 times
Description
The Sketch_Rectangle contains a rectangle with constraints ax,ay for the position of the left lower corner and bx,by for the lenght an height of the rectangle.

The Skethc001_Circle contains a circle with constraint cr for the radoius of the circle.

The goal is to resize the rectangle depending on ax,ay with this conditions:

1) one corner is on the circle
2) the diagonal from this corner goes through the origin

The TwoClientsFeedback is a Sketch obekct, which does the calculation of bx,by and sends the values back to Sketch_Rectangle

it has 4 named constraints
ax,bx,cr are red constraints and get their values from the other skteches
bx,by are blue constraints and are used for feedback.

configuration of the TwoClientsFeedback

ClientA is Sketch_Rectangle
data from ClientA are ax,ay
date back to ClientA are bx,by

ClientB is Sketch_Circle
data from ClientB are cr
there are no date back to ClientB

Whenever ClientA or ClientB changes the Feedback Sketch is recomputed and the values are send back to ClientA.

To demonstrate this there are 3 Animation Managers.
When you double clickj a Manager and start it,
it changes one constraint (ax,ay, cr) by expressions

You can stop updating of a client <?> be setting its "active Client <?>" Flag to False.

Example file
https://www.dropbox.com/s/llyubzr3594rv ... fcstd?dl=0
required workbenches