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.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Post by NormandC »

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
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Post by abdullah »

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
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Post by NormandC »

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

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Post by abdullah »

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: 55
Joined: Fri Jul 08, 2016 9:02 pm

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Post by Christoph »

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
Veteran
Posts: 1920
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Post by saso »

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
Veteran
Posts: 53930
Joined: Tue Mar 17, 2015 9:14 am

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Post by chrisb »

This seems to be rather close to the FreeCAD concepts. Are there topological naming issues too?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Christoph
Posts: 55
Joined: Fri Jul 08, 2016 9:02 pm

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Post by Christoph »

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.
User avatar
kandelabr
Posts: 12
Joined: Wed Jun 29, 2016 6:10 am
Contact:

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Post by kandelabr »

Interesting, I just found this presentation from the SALOME guys: https://events.prace-ri.eu/event/896/se ... ntro_2.pdf
See slides 13-17, especially 17.

:D
User avatar
kwahoo
Posts: 680
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

Re: Using PlaneGCS as the sketch constraint solver in SALOME

Post by kwahoo »

kandelabr wrote: Tue May 26, 2020 6:25 pm See slides 13-17, especially 17.
Things changed a bit since then
phpBB [video]

realthunder wrote:ping
Post Reply