Mirror along plane, weird behaviour

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!
naasking
Posts: 28
Joined: Tue Sep 28, 2021 12:28 pm

Mirror along plane, weird behaviour

Post by naasking »

I'm using:
OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/Canada (en_CA)

I have a sketch like so:
sketch.png
sketch.png (4.28 KiB) Viewed 1886 times

Then I pad it as normal, and I select mirror along the highlighted face:
pad and mirror.png
pad and mirror.png (8.02 KiB) Viewed 1886 times

That looks perfect. I then go to sketch on one of the faces:
sketch on face.png
sketch on face.png (17.7 KiB) Viewed 1886 times

As soon as I click "create sketch", this monstrosity is created:
weirdness.png
weirdness.png (21.72 KiB) Viewed 1886 times

Basically the same thing happens if I try to do anything, like create an additive box:
create additive box.png
create additive box.png (27.32 KiB) Viewed 1886 times

Not really sure what's going on here, so any clues would be appreciated. I can provide the file if that would be helpful.
chrisb
Veteran
Posts: 54303
Joined: Tue Mar 17, 2015 9:14 am

Re: Mirror along plane, weird behaviour

Post by chrisb »

Hi and welcome to the forum!

Please upload the file. Maybe you have a cyclic dependency.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
naasking
Posts: 28
Joined: Tue Sep 28, 2021 12:28 pm

Re: Mirror along plane, weird behaviour

Post by naasking »

Drawing attached. I don't get any errors at this point, but if I follow the steps I outlined or try to create an additive box, I do see these messages like this in the report view:

Code: Select all

10:46:37  126.801 <App> Document.cpp(3172): The graph must be a DAG.
10:46:39  128.933 <App> Document.cpp(3527): Modular_Drawers#Mirrored still touched after recompute
10:46:39  128.933 <App> Document.cpp(3527): Modular_Drawers#Pad still touched after recompute
I'm just not clear on what's circular. The mirror is defined on a reference plane that is a padded line from a sketch, so it seems like it should be a DAG, but maybe I'm just not clear on how FreeCAD tracks these. These errors don't happen if I choose a surface that's on the sketch plane.

Thanks for the help!
Attachments
Modular Drawers.FCStd
(43.32 KiB) Downloaded 33 times
User avatar
Willem
Veteran
Posts: 1854
Joined: Fri Aug 12, 2016 3:27 pm
Location: Lisse, The Netherlands

Re: Mirror along plane, weird behaviour

Post by Willem »

Unfortunately I can not reproduce the mess I see in your image. The weakest point in your approach is that you mirror on a face. The model is more stable when you mirror to X, Y or Z axis. The sketch can in that case be more simple. Here is my revised file
Attachments
Modular Drawers-Willem.FCStd
(44.34 KiB) Downloaded 30 times
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Mirror along plane, weird behaviour

Post by GeneFC »

I am not sure what steps you are taking. I tried your file in both the release version 0.19 and a very recent version 0.20. I had no problem creating a sketch on the existing object and padding it.

Worked fine with no error messages. (Not recommended to sketch directly on an existing face, but I did so because it appeared that was your method.)

If you could explain step-by-step what you are doing it may clear up the mystery.

Gene
naasking
Posts: 28
Joined: Tue Sep 28, 2021 12:28 pm

Re: Mirror along plane, weird behaviour

Post by naasking »

Willem wrote: Tue Sep 28, 2021 3:12 pm Unfortunately I can not reproduce the mess I see in your image. The weakest point in your approach is that you mirror on a face. The model is more stable when you mirror to X, Y or Z axis. The sketch can in that case be more simple. Here is my revised file
Unfortunately your file does not match the desired output model. The mirroring has to take place along a diagonal plane orthogonal to the sketch surface for the interlocking to work as desired. Compare the position of the pockets and the pillars in my image and your model. See my upcoming reply to GeneFC to reproduce the messy image I posted about.
naasking
Posts: 28
Joined: Tue Sep 28, 2021 12:28 pm

Re: Mirror along plane, weird behaviour

Post by naasking »

GeneFC wrote: Tue Sep 28, 2021 3:14 pm I am not sure what steps you are taking. I tried your file in both the release version 0.19 and a very recent version 0.20. I had no problem creating a sketch on the existing object and padding it.
I tried this on another Windows 10 computer with FreeCAD 0.19, and I still see the problem [1]. I'll try explaining steps again to reproduce:

1. Open FreeCAD file
2. Switch to Part Design
3. Select the face that's highlighted here and select "Map sketch to face":
step1.png
step1.png (16.66 KiB) Viewed 1695 times
4. "TopLeft" should be selected, click OK.
5. "FlatFace (current)(suggested)" should be selected, click OK.
6. Click "Create a new sketch". Bizarreness ensues. Sometimes you have to click "close" to see the weirdness, but not always.
7. If you undo the creation of that sketch, then even adding an additive box or cylinder creates bizarre results, almost like FreeCAD or the model is now in an invalid state.

Hopefully that's clear enough.

[1] OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/Canada (en_CA)
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Mirror along plane, weird behaviour

Post by TheMarkster »

Rather than select a generated face add a construction line to your sketch and use Construction Line 1 as the reference.
Snip macro screenshot-6c31bd.png
Snip macro screenshot-6c31bd.png (110.32 KiB) Viewed 1677 times
Snip macro screenshot-01ec1e.png
Snip macro screenshot-01ec1e.png (76.14 KiB) Viewed 1677 times
This will protect you from topological naming issues, at least somewhat. It could be what is happening with your model is the face you used as the mirror reference is getting renamed and now the mirror is happening on a different plane. That construction line will never get renamed as long as you don't add another construction line to that sketch, and if you do you can always select a new reference for the mirror.

Another tip: try to avoid 0 length constraints if possible.
naasking
Posts: 28
Joined: Tue Sep 28, 2021 12:28 pm

Re: Mirror along plane, weird behaviour

Post by naasking »

TheMarkster wrote: Tue Sep 28, 2021 3:53 pm Rather than select a generated face add a construction line to your sketch and use Construction Line 1 as the reference.
Thanks, that does the trick!
Another tip: try to avoid 0 length constraints if possible.
What's best practice for specifying that a point should fall on the x or y axis?
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Mirror along plane, weird behaviour

Post by TheMarkster »

I would use point on edge constraint or sometimes select the point and the origin and apply a horizontal/vertical constraint to both of them.
Post Reply