Using PlaneGCS as the sketch constraint solver in SALOME

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Postby NormandC » Sun Feb 04, 2018 1:06 am

Hello,

I stumbled on this topic while searching for something else entirely, but I figured that the SALOME people may find interesting some changes to the Sketcher solver that abdullah recently did.

https://github.com/FreeCAD/FreeCAD/comm ... b0933b6672

In short:
DeepSOIC wrote:
Wed Mar 15, 2017 9:29 pm
the project can be repaired by replacing coincident+tangent with endpoint-to-endpoint tangent.
This is no longer necessary, as the solver now automatically switches the coincident+tangent combo with the proper endpoint-to-endpoint tangent constraint.
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Postby abdullah » Sun Feb 04, 2018 5:03 am

NormandC wrote:
Sun Feb 04, 2018 1:06 am
This is no longer necessary, as the solver now automatically switches the coincident+tangent combo with the proper endpoint-to-endpoint tangent constraint.
There is such a change now in FC. However, this statement is not absolutely accurate. It is my fault, because of the terminology used and because I had to change my original implementation idea. IF not_interested_in_history GOTO Conclusion (Some history here, feel free to jump to the last two paragraphs).

PlaneGCS is the solver. There is no doubt there.

Sketch.cpp is the interface between the Sketcher and the solver. Here we do special mappings now, for example for the Block constraint, which is implemented by removing other constraints and fixing the parameters of some geometric elements. Many times I call this "at solver level", as the change is not visible to the Sketcher, but it is not accurate to call it "the solver". It is the intermediary.

The sketcher. That in reality is all of it, but usually I use this terminology to refer to the higher level representation of geometries and constraints that very reasonably matches with what the user sees on the screen.

When tackling this tangency issue, I originally thought of using the intermediary, "sketch.cpp" to make the change and I said "at solver level". I realize I misled many of you. I started an implementation of this. However, because of the way the "sketcher" constraints travel within the solver (via pointer), the change could not be simply undone at the intermediary, sketch.cpp. As I did not like the changes necessary at "Intermediary" level to enable this transparent changes, I decided to implement it at Sketcher level. So it is when you add a tangency or a coincident at "Sketcher" level, that the Sketcher checks for the other constraint and it then makes the change of the constraint at "Sketcher" level to a point-to-point tangency. Then for the "Intermediary" it is like if the user would have deleted the coincident and added a point-to-point tangency himself.

To make this simple to understand, if the change were at "intermediary level", in the Sketcher's constraints widget you would still see a coincident and a tangency, but it would work just as if you had a point-to-point tangency there. As it is done at "Sketcher" level, what you actually see is that whatever constraints you added are changed to a point-to-point tangency (you can no longer see the coincident in the widget, is not there).

I thought it would be right to explain the whole thing.

Conclusion:
I am unaware of the specifics of how SALOME uses PlaneGCS. PlaneGCS itself has not been changed to implement this "automatic swap".

I am sorry for the misunderstanding. :(
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Postby NormandC » Sun Feb 04, 2018 5:58 am

That's OK, thanks for the clarification! And BTW I absolutely love it. Many thanks! :D
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Postby abdullah » Sun Feb 04, 2018 6:35 am

NormandC wrote:
Sun Feb 04, 2018 5:58 am
And BTW I absolutely love it. Many thanks! :D
Good! You are welcome :D
Christoph
Posts: 52
Joined: Fri Jul 08, 2016 9:02 pm

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Postby Christoph » Fri Jun 28, 2019 4:53 pm

Downloading a newer version of Salome, I realized the Shaper Module is now available. With a bit of FreeCAD experience, it is quite easy to use. Alas, many features like group creation by filters are not available yet.

I coudn't resist to document by first step with a small video tutorial (german), maybe it is helpful for others:

phpBB [video]
User avatar
saso
Posts: 1336
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Postby saso » Fri Jun 28, 2019 5:09 pm

Their "in Part" workflow and "Part tree" structure (including the bodies) is IMO much better then ours, it is obvious they know what they are doing... :|

https://www.youtube.com/channel/UCm7CSP ... rzmTlV9c3Q
chrisb
Posts: 19511
Joined: Tue Mar 17, 2015 9:14 am

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Postby chrisb » Fri Jun 28, 2019 9:20 pm

This seems to be rather close to the FreeCAD concepts. Are there topological naming issues too?
Christoph
Posts: 52
Joined: Fri Jul 08, 2016 9:02 pm

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Postby Christoph » Fri Jun 28, 2019 11:46 pm

chrisb wrote:
Fri Jun 28, 2019 9:20 pm
This seems to be rather close to the FreeCAD concepts. Are there topological naming issues too?
I think so, yes. Tested in Shaper-Modul:

1) Create rectangle sketch with equal constraint on length and width (30 mm)
2) Extrude rectangle (30 mm)
3) Extrude (i.e. cut) a circular hole into extruded face (8 mm)
4) Create fillet on the four edges of the extruded face (3 mm)
5) Remove equal constraint in the 1. sketch and assign different length (40 mm) and width (30 mm)
6) Now the fillet on one edge isn't there anymore

I assume that is a topological naming problem. Good thing is, FreeCAD stable 0.18 does the job without problem.