PDN Sweep

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

PDN Sweep

Postby abdullah » Tue Jan 02, 2018 5:24 pm

Hi!

I would like to know how broken PDN Sweep functionality is. I do not know if it is FC or it is me.

I have a toy (FreeCAD file) for you:
https://freecadweb.org/tracker/view.php?id=2464#c10671

Image

The tracker bug is:
https://freecadweb.org/tracker/view.php?id=2464

I have this part, which is based on one of a german forum topic, adapted to PDN:
https://forum.freecadweb.org/viewtopic.php?f=13&t=14207

The german forum thread shows that they change the lengths of the lines in the profile and sometimes it does not make a solid.

With my rebuild model, changing the sweep path causes the sweep mostly not to reconstruct. However, I do not get a hollowed shape like in the german forum. Other issue in the original file is the Arc of Ellipse to line normal, which icby shows it is not a good tangent. This appears to be "fixed" now, as I get 0.0 for the dot product.

Anyway, what I am seeking:
Identify the potential problems with this model. and see if new bugs have to be reported, or they have already been reported, or if it is just me ;)

I am checking with:
OS: Ubuntu 16.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12852 (Git)
Build type: None
Branch: master
Hash: 8e3b2d7e84924444bc219133a7e0bbd07413cf4f
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Last edited by abdullah on Wed Jan 03, 2018 3:15 am, edited 1 time in total.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: PDN Sweep

Postby NormandC » Tue Jan 02, 2018 5:36 pm

Your image does not show because it is not an url recognized by the forum. In fact, paste that link in your browser address field and you will get a blank page.

Code: Select all

[img]https://freecadweb.org/tracker/file_download.php?file_id=1787&type=bug&show_inline=1&file_show_inline_token=20180102LDcpNSeZZHJOev4hjAKfR4nwOkMWVxj9[/img]
If you remove everything after "&type=bug", it works:

Code: Select all

[img]https://freecadweb.org/tracker/file_download.php?file_id=1787&type=bug[/img]
Image
UR_
Posts: 1012
Joined: Tue Jan 03, 2017 8:42 pm

Re: PDN Sweep

Postby UR_ » Tue Jan 02, 2018 6:08 pm

I downloaded "Test4.FCStd" from https://forum.freecadweb.org/viewtopic. ... 07#p113846

After opening "Sweep1" is a shell
After recompute it's a solid (no changes done)

Tested on:
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12847 (Git)
Build type: Release
Branch: master
Hash: 4034851a5d2ed5c93a8ebedbf0ef40dab8700d94
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)


Where is the beaf? :roll:
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: PDN Sweep

Postby NormandC » Tue Jan 02, 2018 6:11 pm

UR_ wrote:
Tue Jan 02, 2018 6:08 pm
I downloaded "Test4.FCStd"
I believe you should rather download abdullah's own file from the bug report, as he wrote.
abdullah wrote:
Tue Jan 02, 2018 5:24 pm
Identify the potential problems with this model.
What puzzles me, is how can P09_GebläseauslassSketch001 show three different colours? :?:
FC017_abdullah_Test5_PDN_01.png
FC017_abdullah_Test5_PDN_01.png (2.85 KiB) Viewed 1238 times
abdullah wrote:
Tue Jan 02, 2018 5:24 pm
With my rebuild model, changing the sweep path causes the sweep mostly not to reconstruct.
What exactly do you mean? I changed the sweep path's width from 32mm to 42mm (Constraint13) and the AdditiveSweep did not fail. But, the sweep profile is not linked to the sweep path, and does not move when the path is changed; so it's to be expected that the sweep shape does not change.

In fact, P09_GebläseauslassKonturV2Sketch is not attached to anything in the Body, as shown in the dependency graph. IMO, the proper method of constructing the two sketches is to
  1. Create the path sketch first, attach it to the Body's XY plane
  2. Create a datum plane normal to the path sketch
  3. Map the section sketch to the datum plane to ensure it follows any edits to the path.
abdullah wrote:
Tue Jan 02, 2018 5:24 pm
I would like to know how broken PDN Sweep functionality is.
For me, the PDN Sweep works pretty reliably. As for usability, it's another matter. Improving its UI would be most beneficial.

A couple of problems I've seen:
  • The Sweep parameters labels the section to add path segments as "Profile". IMO it is utterly confusing, because users expect "Profile" to identify the sweep sections to be used, not the path.
  • Once the first sweep profile is selected, it is not displayed in the Pipe parameters; even changing the Transformation Mode to Multisection, it is not shown in the list. So it is impossible to change it to another sketch.
chrisb
Posts: 19455
Joined: Tue Mar 17, 2015 9:14 am

Re: PDN Sweep

Postby chrisb » Tue Jan 02, 2018 6:47 pm

As far as usability is concerned: the selection and even more so the deselection could be improved; e.g. the Path Workbench shows how.
Select: allow multi select using ctrl-key
Deselect: Allow selection of the items listed in the panel. When a sweep has to be repaired due to changes in previous steps it often is hard to find the right element in the 3D view, as they most often are hiding in the smallest segment available on the whole object.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: PDN Sweep

Postby NormandC » Tue Jan 02, 2018 7:33 pm

I looked further into the original issue (German topic). The problem is a bad use of coincident constraints along with tangent constraints in the path sketch. It has nothing to do with the Part Sweep tool. https://forum.freecadweb.org/viewtopic. ... 45#p206945

A great number of users do that mistake, even experienced FreeCAD users. The reason is that this issue is really specific to FreeCAD's Sketcher. In all other CAD software (that I know of) that have a sketcher solver, point-to-point tangent (and perpendicular) constraints don't exist, you must apply a coincident constraint on the line and arc ends, then a tangent (perpendicular) constraint between the objects themselves (not their endpoints).

So maybe something could be done about that in the Sketcher, but I don't know what, and how complicated it would be.
  • Make the solver detect these conflicts and warn the user about it?
  • Make the solver detect these conflicts and transparently replace the dual constraint with the proper point-on-point tangent constraint?
chrisb
Posts: 19455
Joined: Tue Mar 17, 2015 9:14 am

Re: PDN Sweep

Postby chrisb » Tue Jan 02, 2018 8:45 pm

NormandC wrote:
Tue Jan 02, 2018 7:33 pm
So maybe something could be done about that in the Sketcher, but I don't know what, and how complicated it would be.
That would be great and I can imagine that a warning might not be too complicated.

You added to the german topic, I'm sorry I missed that one. Usually when someone has problems with a model or a newbie asks for general remarks I look at these constraints, and very often I find the wrong usage. I have to confess that it took very long for myself before I learned about it.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: PDN Sweep

Postby NormandC » Tue Jan 02, 2018 9:01 pm

It took me some time myself, I had the chance to learn about it from the original Sketcher solver developer, logari81 (who's not been active here for many years). We are lucky that abdullah picked up Sketcher development.

Thanks again abdullah! :)
chrisb
Posts: 19455
Joined: Tue Mar 17, 2015 9:14 am

Re: PDN Sweep

Postby chrisb » Tue Jan 02, 2018 9:06 pm

Actually the situation is even worse when using the ValidateSketch tool. It reports false positives on these tangential joins, and if the auto repair is used sketcher reports redundant constraints - if you are lucky.
So a look at the validation tool would be great as well and it would already be of some help if the tool reported the other way round, without the need of changing the sketcher.
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: PDN Sweep

Postby abdullah » Wed Jan 03, 2018 3:56 am

NormandC wrote:
Tue Jan 02, 2018 5:36 pm
Your image does not show because it is not an url recognized by the forum. In fact, paste that link in your browser address field and you will get a blank page.
Thanks. I had to leave in a rush and I did not even check the post after posting.
NormandC wrote:
Tue Jan 02, 2018 6:11 pm
What exactly do you mean? I changed the sweep path's width from 32mm to 42mm (Constraint13) and the AdditiveSweep did not fail. But, the sweep profile is not linked to the sweep path, and does not move when the path is changed; so it's to be expected that the sweep shape does not change.
Funny enough now it works (I have updated from the PPA in the meanwhile totally unrelated to this).
NormandC wrote:
Tue Jan 02, 2018 6:11 pm
In fact, P09_GebläseauslassKonturV2Sketch is not attached to anything in the Body, as shown in the dependency graph. IMO, the proper method of constructing the two sketches is to

Create the path sketch first, attach it to the Body's XY plane
Create a datum plane normal to the path sketch
Map the section sketch to the datum plane to ensure it follows any edits to the path.
I guess I was too focus on the shell/solid issue... but it is always good to have some reminder on how it shall be done ;)
UR_ wrote:
Tue Jan 02, 2018 6:08 pm
Where is the beaf?
The original beef (original sketch) was in that changing the length to different values, at the time, resulted in sometimes a solid, sometimes a shell. The tangency between the ellipse arc and the line was not actually tangent. As for my reconstruction, he tangent is just ok. I had no longer reproducible problems as explained above.
NormandC wrote:
Tue Jan 02, 2018 6:11 pm
For me, the PDN Sweep works pretty reliably.
Good to know. Yesterday I somehow panicked that a very unstable Sweep would make its way to 0.17 release. As
NormandC wrote:
Tue Jan 02, 2018 6:11 pm
As for usability, it's another matter. Improving its UI would be most beneficial.

A couple of problems I've seen:

The Sweep parameters labels the section to add path segments as "Profile". IMO it is utterly confusing, because users expect "Profile" to identify the sweep sections to be used, not the path.
Once the first sweep profile is selected, it is not displayed in the Pipe parameters; even changing the Transformation Mode to Multisection, it is not shown in the list. So it is impossible to change it to another sketch.
Yep. I could not understand the "profile" part in FC, I just did trial and error and ended up concluding it was path what was intended. This is easy to change. I'll do.

The second one is annoying as well. Will try.
chrisb wrote:
Tue Jan 02, 2018 6:47 pm
As far as usability is concerned: the selection and even more so the deselection could be improved; e.g. the Path Workbench shows how.
Select: allow multi select using ctrl-key
Deselect: Allow selection of the items listed in the panel. When a sweep has to be repaired due to changes in previous steps it often is hard to find the right element in the 3D view, as they most often are hiding in the smallest segment available on the whole object.
Yes, this is another pain. Selection in PDN is quite a nightmare, also for filleting.
NormandC wrote:
Tue Jan 02, 2018 7:33 pm
So maybe something could be done about that in the Sketcher, but I don't know what, and how complicated it would be.

Make the solver detect these conflicts and warn the user about it?
Make the solver detect these conflicts and transparently replace the dual constraint with the proper point-on-point tangent constraint?
I think so. Lately I have implemented transparent removal of constraints in the interface between the sketcher and the solver for the "Block constraint". replacement should be rather straightforward. I will wait for Werner to merge the "Block constraint", otherwise I will have lots of merge conflicts.
NormandC wrote:
Tue Jan 02, 2018 9:01 pm
It took me some time myself, I had the chance to learn about it from the original Sketcher solver developer, logari81 (who's not been active here for many years). We are lucky that abdullah picked up Sketcher development.

Thanks again abdullah! :)
Welcome!

logari did an awesome job in the solver. I have learnt a lot from his code. DeepSOIC is really good with solver issues too. When I have problems with the solver I ask him for help.

I am happy to contribute. With this is another bug that leaves the tracker. Lately it has been great that sketcher bugs are actually mostly gone:
Bugs_sketcher.png
Bugs_sketcher.png (30.12 KiB) Viewed 1161 times
For #2275 there is a PR waiting for merge. For #2299 it is no longer a problem with my FC, it appears to be OCC related. Fixed in OCC 7.1.

So guys, what are waiting for? I have no bugs to fix! Report bugs :P

Of course it is a joke, there are tons of features still there ;)
chrisb wrote:
Tue Jan 02, 2018 9:06 pm
Actually the situation is even worse when using the ValidateSketch tool. It reports false positives on these tangential joins, and if the auto repair is used sketcher reports redundant constraints - if you are lucky.
So a look at the validation tool would be great as well and it would already be of some help if the tool reported the other way round, without the need of changing the sketcher.


Please report these things to the tracker. I have very bad memory and I will eventually forget. :D