Bug? Mysterious over zealous pad to face

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!
User avatar
Sam
Posts: 171
Joined: Sun Mar 20, 2016 6:19 pm

Bug? Mysterious over zealous pad to face

Postby Sam » Thu Jul 20, 2017 11:44 pm

Code: Select all

OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11616 (Git)
Build type: None
Branch: master
Hash: aba4338808178b508f3170237f205e0066a5b437
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedKingdom (en_GB)
In the attached file, in Body003, I am attempting to patch a hole in Pad003 by padding through it.

Sketch on one side, Sketch034, pad up to the other face. But the pad extends far beyond the other face.

Am I missing something?
Attachments
1x x-end-motor-remade.fcstd
(395.34 KiB) Downloaded 6 times
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Bug? Mysterious over zealous pad to face

Postby NormandC » Fri Jul 21, 2017 2:36 am

O/T: regarding body visibility management; to hide a Body, don't hide its last feature (Main Body vs LinearPattern), hide the Body itself.

Your file seems corrupted. When I try to use the Std DependencyGraph, I get an error telling me Graphviz cannot generate an image. I've never seen that error before since the dependency graph was added to FreeCAD 4 years ago!

Next I set the document to recompute by right-clicking on its label in the Model tree (1x x-end-motor-remade) and selecting "set to recompute", and did a refresh. Pad004 and Sketch004 both then got a white exclamation point in a red circle over their icons in the tree, hovering over them showing a tooltip with an error.

Main Body also had a failed feature (linear bearing hole Pocket).

The Report view showed these errors:

Code: Select all

Not able to delete a constraint on point with the given index: 0
Equality constraints between circle and bspline are not supported.
Equality constraints between circle and bspline are not supported.
It's only after I realized that Body003's ShapeBinder completely changed shape after the recompute that I guessed you were using automatic refine options (I don't). Closing/reopening your file and setting auto-refine option then recomputing the document confirmed my guess as there were no more unexpected changes.

I would really be interested to know how/where you learned of these auto-refine options, and if you got a warning about their use. They can utterly break a model when someone attempts to edit it without the same auto-refine options enabled.

I lost valuable time on this. When asking for help here, you should ALWAYS mention that you are using auto-refine options so we don't get sidetracked and waste valuable time like I just did. :|
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Bug? Mysterious over zealous pad to face

Postby NormandC » Fri Jul 21, 2017 2:42 am

NormandC wrote:
Fri Jul 21, 2017 2:36 am
Main Body also had a failed feature (linear bearing hole Pocket).
This error remains, and it may be the cause of your problem. But I can't troubleshoot further because I'm running out of time tonight and I have other topics to read.
User avatar
Sam
Posts: 171
Joined: Sun Mar 20, 2016 6:19 pm

Re: Bug? Mysterious over zealous pad to face

Postby Sam » Fri Jul 21, 2017 3:02 am

I will get to the rest of your helpful message in a later post. Firstly:
NormandC wrote:
Fri Jul 21, 2017 2:36 am
I lost valuable time on this. When asking for help here, you should ALWAYS mention that you are using auto-refine options so we don't get sidetracked and waste valuable time like I just did. :|
I am very sorry you wasted your time NormandC. I know nothing of this auto-refine setting. I will learn about it as my next priority and if that jogs my memory I will explain about how it came to be set.

There is some chance that I fiddled with it in ignorance a year or two ago and proceeded to forget.

Sorry dude.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Bug? Mysterious over zealous pad to face

Postby NormandC » Fri Jul 21, 2017 3:11 am

Okay then, can you open your Preferences (Edit menu), then click on "Part Design" in the left column then keep the "General" tab.

I'm pretty sure that you'll see that both "Automatically refine model after boolean operation" and "Automatically refine model after sketch-based operation" are ticked. They are disabled by default.
User avatar
Sam
Posts: 171
Joined: Sun Mar 20, 2016 6:19 pm

Re: Bug? Mysterious over zealous pad to face

Postby Sam » Fri Jul 21, 2017 3:23 am

You were correct. This is no longer the case.

I found this explanation, for anyone who finds this thread: Getting rid of double/ overlapping polygons.
jmaustpc wrote:
Thu Jun 08, 2017 1:16 pm
please don't encourage people to use that option. Its dangerous. when opening models in different FreeCAD instances with that setting set differently will likely corrupt your model. Its better that people, in most cases, leave that at its default "do not automatically refine". If you want a "refine" then run one, usually as the last step, from OpenSCAD WB Refine ...or the non linked Part WB Refine, normally the OpenSCAD version is most convenient.

The issue is caused by the topological naming limitation.
Thanks again for you time. I will investigate and get to work on your other tips in a day or so.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Bug? Mysterious over zealous pad to face

Postby NormandC » Fri Jul 21, 2017 3:34 am

Sam wrote:
Fri Jul 21, 2017 3:23 am
You were correct. This is no longer the case.
I'm sorry, I should also have added: since they were enabled when you built your model, it's best to keep them enabled, at least when working with this specific FreeCAD document, otherwise you'll totally bork your model and fixing/rebuilding it will be a much more painful task.

I've long wished for some internal property in a FreeCAD document that overrides the end user's auto-refine settings so we don't get tripped with this... Hopefully in the future, this setting will be fully automatic and hidden from the user. FYI it was added because the CAD kernel (a third-party software library over which the FreeCAD dev team has no control) leaves residual edges after Boolean operations.

A refine operation can also be added manually, see OpenSCAD_RefineShapeFeature. Unfortunately it is not "compatible" with PartDesignNext, meaning that when creating such a feature, it leaves the Body. I've made a feature request: issue #2683.
Sam wrote:
Fri Jul 21, 2017 3:23 am
I will investigate and get to work on your other tips in a day or so.
Then I should have some time to look further into your model over the weekend.
User avatar
Sam
Posts: 171
Joined: Sun Mar 20, 2016 6:19 pm

Re: Bug? Mysterious over zealous pad to face

Postby Sam » Mon Jul 24, 2017 8:45 pm

Getting back to this after a couple of days. I'll work through your comments one by one.
NormandC wrote:
Fri Jul 21, 2017 2:36 am
O/T: regarding body visibility management; to hide a Body, don't hide its last feature (Main Body vs LinearPattern), hide the Body itself.
Sensible advice. I'll try to submit less obtuse examples in the future. excuse: I'm using a shitty laptop screen and with that branch of the tree expanded I can't see its body.
NormandC wrote:
Fri Jul 21, 2017 2:36 am
Your file seems corrupted. When I try to use the Std DependencyGraph, I get an error telling me Graphviz cannot generate an image. I've never seen that error before since the dependency graph was added to FreeCAD 4 years ago!
Interesting. I've seen it a few times. With experience I hope to avoid breaking stuff by doing unexpected things.

I have no idea if it's useful, but when I tried this dot crashed and left me a crash report. I won't attach the whole thing, but here are some clues:

Code: Select all

SourcePackage: graphviz
Title: dot crashed with SIGSEGV in Bezier()
StacktraceAddressSignature: /usr/bin/dot:11:/usr/lib/libgvc.so.6.0.0+5709d:/usr/lib/graphviz/libgvplugin_dot_layout.so.6.0.0+72c0:/usr/lib/graphviz ...

Disassembly:
 => 0x7fa516ef809d <Bezier+77>:	mov    %r9,-0x10(%rax,%r11,1)
    0x7fa516ef80a2 <Bezier+82>:	mov    %r10,-0x8(%rax,%r11,1)
    0x7fa516ef80a7 <Bezier+87>:	cmp    %r8,%rax
    0x7fa516ef80aa <Bezier+90>:	jne    0x7fa516ef8090 <Bezier+64>
    0x7fa516ef80ac <Bezier+92>:	test   %esi,%esi
    0x7fa516ef80ae <Bezier+94>:	jle    0x7fa516ef81f1 <Bezier+417>
    0x7fa516ef80b4 <Bezier+100>:	movsd  0x19fb4(%rip),%xmm2        # 0x7fa516f12070
    0x7fa516ef80bc <Bezier+108>:	lea    -0x1(%rsi),%r10d
    0x7fa516ef80c0 <Bezier+112>:	lea    0x60(%r11),%r9
    0x7fa516ef80c4 <Bezier+116>:	xor    %ebx,%ebx
    0x7fa516ef80c6 <Bezier+118>:	subsd  %xmm0,%xmm2
    0x7fa516ef80ca <Bezier+122>:	nopw   0x0(%rax,%rax,1)
    0x7fa516ef80d0 <Bezier+128>:	mov    %r10d,%edi
    0x7fa516ef80d3 <Bezier+131>:	lea    -0x58(%r9),%rax
    0x7fa516ef80d7 <Bezier+135>:	add    %rbx,%rdi
    0x7fa516ef80da <Bezier+138>:	shl    $0x4,%rdi
    
NormandC wrote:
Fri Jul 21, 2017 2:36 am
Next I set the document to recompute ...
OK. I see the same issues. If I had noticed these errors I would have tried to fix them before asking for help.

I acknowledge your warning about changing auto refine settings in a subsequent post, but I have unchecked those options anyway. You made it sound like that's likely to save everyone a PITA in the long run.

I will now work through the errors you pointed out before I move on to your next response. Thanks NormandC.
User avatar
Sam
Posts: 171
Joined: Sun Mar 20, 2016 6:19 pm

Re: Bug? Mysterious over zealous pad to face

Postby Sam » Tue Jul 25, 2017 12:31 am

As far as I can tell, I have fixed the issues you raised NormandC.

I have attached the result. I changed/re-did some things in body003 as I was messing around, but I think I see the same thing I described initially.

I will note, now, that I have certainly had those auto refine options enabled ever since I first installed FreeCAD some few years ago. I am not saying I didn't set them myself, but I have never seen my parts "overlap" like they do without the options. Just an idle observation to give you additional background.

Anyway, this is what I have tried, and what I experienced:

In body003, with sketch035 attached to either of the large flat faces of "pad matching lifter support"
Pad to dimension works as expected if "reversed"
Pad to selected, opposite, face gives an unexpected result. (Example attached)
Pad to first/last gives an error when clicking OK: "SketchBased: Up to face: No faces found in this direction"

By way of experiment, I tried to pocket the sketch. "Through all" looked correct, but other options ended badly.

:? If you take the time to come back for another look, I hope I haven't done anything else unexpected that makes you miserable.
Attachments
1x x-end-motor-remade.fcstd
(464.54 KiB) Downloaded 7 times
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Bug? Mysterious over zealous pad to face

Postby NormandC » Thu Jul 27, 2017 1:32 am

Hi,

Looks like the pad to face still has the bug. I think it might be a good idea to report it on the bug tracker.

I figured a workaround: create a datum plane attached to the bottom face of "pad matching lifter support" to use for the "to face" option.
  1. Right-click on "pad matching lifter support" and select "Set tip". This sets the tip of the Body to this feature, in effect rolling back its history before Pad004.
  2. Select the bottom face.
  3. Create a datum plane, default attachment mode will be "FlatFace". Click OK. The datum plane will be created before "pad matching lifter support" in the tree.
  4. Set the tip again to Pad004.
  5. Edit Pad004, change the selected face to the new datum plane.
  6. It works! :geek:
Attachments
1x x-end-motor-remade_normandc1.fcstd
(462.95 KiB) Downloaded 6 times