Hi everybody,
I am new to using FreeCAD and so far I love it.
I installed it in order to model a cabinet. Since I didn't know the final dimensions yet, I made heavy use of the constraints. The problem I stumbled upon when I was done, was that when I tried to adjust the size, the parts didn't behave like I expected. While describing all that went wrong in this particular model would be too much, I want to demonstrate what my problem is with a smaller example (see attached file if you want to try for youselfes):
So lets assume I have a baseplate of a furniture piece with a variable width/depth and I want to place some feet such that they have some offset from the edges.
Here is what it would look like in the sketcher:
Now if I want to change the dimensions of the baseplate from 200mm to 100mm I would expect the result to look like this:
But instead it results in this:
Funny enough, if I change the size incrementally from 200 to 150 then 100 I get the correct result.
So after looking in the issue tracker i found a similar problem: http://www.freecadweb.org/tracker/view.php?id=1519.
Apparently, the solver can have multiple solutions and looking at my example I can also see why this is the case:
The distance constraint works in both directions.
Now my question is how then would I be able to model an offset like I wanted to do in this simple example and make sure the feet stay within the baseplate? Is there something like a directed distance modifier?
I would also like to know how the distance modifier is supposed to be working exactly. For example if I put negative offsets in the example above it will put the foot outside (to the left/top) of the plate as expected. So it seems the distance has some notion of direction and I would expect it to stay the same when changeing the size of the board. And if there is no direction then it doesn't seem to make sense to me why a negative distance would move the foot outside and how the sketch would be fully constraint then.
Hope somebody can give me some answer as to how I would achieve the offset constraints and maybe some insight into how the distance modifier is supposed to work.
Kind regards,
Ben
OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.Unknown
Build type: Release
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1
How to model offset constraints.
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
How to model offset constraints.
- Attachments
-
- offset-test.fcstd
- (3.32 KiB) Downloaded 18 times
Re: How to model offset constraints.
Ben,
Instead of relying on the solver you can force the parts to move as required by using construction lines.
I edited your sketch and replaced the offset dimensions to the edge of the platform with two construction lines and linked the length of these lines to the spreadsheet offset variable. Now you can edit the spreadsheet as you like.
OS: Ubuntu 16.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6703 (Git)
Build type: None
Branch: releases/FreeCAD-0-16
Hash: 2ce5c8d2e3020d05005ed71f710e09e9aa561f40
Python version: 2.7.11+
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Instead of relying on the solver you can force the parts to move as required by using construction lines.
I edited your sketch and replaced the offset dimensions to the edge of the platform with two construction lines and linked the length of these lines to the spreadsheet offset variable. Now you can edit the spreadsheet as you like.
OS: Ubuntu 16.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6703 (Git)
Build type: None
Branch: releases/FreeCAD-0-16
Hash: 2ce5c8d2e3020d05005ed71f710e09e9aa561f40
Python version: 2.7.11+
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
- Attachments
-
- offset-test_mod.fcstd
- (6.58 KiB) Downloaded 20 times
Re: How to model offset constraints.
The order in which you first select the two points on which you will apply the distance constraint is important, in the sketcher's decision over where to place the geometry considering positive and negative direction. There has been subtle changes to this behaviour at different times in FreeCAD's development. Basically I think you have selected first a point on the small square then a point on the outer larger rectangle, the distance you are trying to set would in that case be "-10mm" but you are entering "+10mm", so the solver moves the point such that it is +10mm from the second selected point rather than -10mm.benngiro wrote: Hope somebody can give me some answer as to how I would achieve the offset constraints
Re: How to model offset constraints.
Hi,
thanks a lot for the replies.
Salp's answer was exactly what I was looking for and solves my problems. Although I still think the solver behaviour with the distances is unintuitive.
Thanks a lot,
Ben
thanks a lot for the replies.
Yes I figured that out but as described, the direction might change if the new solution is "closer" to the original as described above.The order in which you first select the two points on which you will apply the distance constraint is important, in the sketcher's decision over where to place the geometry considering positive and negative direction
Salp's answer was exactly what I was looking for and solves my problems. Although I still think the solver behaviour with the distances is unintuitive.
Thanks a lot,
Ben
Re: How to model offset constraints.
Hi Ben,
You might find this of use: Sketcher_Tutorial
For my work, I use everyday a mature commercial CAD system (which has benefited from years of development by a full-time team), and its sketch solver can do unexpected things like that too.
You might find this of use: Sketcher_Tutorial
The tutorial goes over this. To be honest, it would be very difficult or impossible to program the sketcher solver to what amounts to guessing the end user's intent.benngiro wrote:I still think the solver behaviour with the distances is unintuitive.
For my work, I use everyday a mature commercial CAD system (which has benefited from years of development by a full-time team), and its sketch solver can do unexpected things like that too.
Re: How to model offset constraints.
Yes the tutorial explains the issue well and using the construction lines should provide a way to overcome this issue.
But I still have to figure out how I would exactly solve the problem with the offset.
After playing around a bit I realized that while salp's solution works for changing from a size of 200 to 100 it still results in the same thing when I scale it from 1000 to 50 (a bigger jump still gives unwanted results).
Adding more constraints (e.g. more construction lines) could easily solve it but then it's over constraint. So I still have to figure out a way to get this offset thing done with the right combination of constraints.
Kind regards,
Ben
But I still have to figure out how I would exactly solve the problem with the offset.
After playing around a bit I realized that while salp's solution works for changing from a size of 200 to 100 it still results in the same thing when I scale it from 1000 to 50 (a bigger jump still gives unwanted results).
Adding more constraints (e.g. more construction lines) could easily solve it but then it's over constraint. So I still have to figure out a way to get this offset thing done with the right combination of constraints.
Kind regards,
Ben