How to generate a path that I can envision but FreeCAT can not.

Here's the place for discussion related to CAM/CNC and the development of the Path module.
User avatar
PapaAtHome
Posts: 22
Joined: Mon Dec 31, 2018 6:45 pm

How to generate a path that I can envision but FreeCAT can not.

Postby PapaAtHome » Sat May 16, 2020 10:35 pm

Hi to you all,

I'm struggeling with path generation in FreeCAD for quite some time, since
v0.17, now with 0.18 and I'm also working with 0.19.
My problems are (I think) not version related and I'm strugling with it
long enough to ask you all for some advise. (And *yes* I did read help text,
viewed a lot of youtube and tried a lot myself).

Problem is that I can see a good (and simple) path but I do not know how to
create that path with FreeCAD. My feeling is that I have a lack of
understanding in what objects and object attributes are involved in
determening a path.
(Example: A simple concept like 'inside' or 'outside' becomes
strange when some actions do unexpected things. (And I think that there are
two kinds of 'outside', one 'outside of the surfaces of an object' and an
'OUTSIDE' of a selected boundary. And the two do not match with each other.)

Any clear guide on how to successfully create a path and taking in account
what is the process behind this would be welcome. What I have done so far is
very much 'trial and error' without knowing what I do. Most of the time I get
what I want but it is a furstrating and time consuming process. Sometimes
editing generated g-code by hand. (Call that 'optimising' the path.)



I have a simple test construct, you might know it as the Square-Circle-Diamond test.
For purpose of clarity, this is what I made and use for my test actions.
A square 140 by 140 mm, centered on (x, y) = (0, 0) and 3.5 mm high.
On top of that a circle, with a diameter of 140 mm, centered on (0, 0) and 2 mm high.
On top of that a diamond (45 deg rotated square) of 99 x 99 mm, centered on (0, 0) and 2 mm high.
This all is 'punctured' with another circle (hole) with a diameter of 80 mm, centered on (0, 0) all the way through.

In the combo view I have the following tree:

Code: Select all

  SCD
    Cut
      Fusion001
        Cube (length 140, width 140, height 3.5, placement(position x -70, position y -70))
        Fusion
          Cylinder (radius 70, height 5.5, placement(position x 0, position y 0))
          Cube (length 99, width 99, height 7.5, placement(angle 45 deg, position x 0, position y -70))
      Cylinder001 (radius 40, height 15, placement(position x 0, position y 0, position z -5))
No dificulties in constructing this.

The length, width and total height is not by coincidence.
I have a few pieces of mdf of 160x160x7.5 mm (laminate flooring parts, ideal for testing).

Creating a Job for this in the Path workbench is no problem.
I'm using stock measurements of 160x160x7.5 in the job.

What I will descripe next comes down to two problem area's.
It are two kinds of problem area's that I see frequently in other projects I do.
1 - How to efficently take out the center part.
2 - How to *completely* circumfence the diamond and cylinder outer shapes.
For the first I found something but I'm not happy with it.
The second is still an open problem for me, only manual intervention will give
me a result.



Problem 1. How to make the hole in the middle by just cutting it out not
reducing the whole pocket to dust?
I have found a way to do this but I feel uneasy about it.

It is easy to generate a pocket hole in the middle which leaves me with a lot of saw dust.
It is good enough for me just to circumfence the hole but what is the easy way of doing this?
I found one way but it feels a bit convoluted, as if forcing FreeCAD to do something with the wrong tool.
This is what I do.
Select the surface of the inner circle.
Select Pocket Shape. (losing my selection but reselecting it.)
(FreeCAD wants to make a hole but I only want to release the inner part of the hole from the surface)
Select Pattern=Spiral, Step Over Percent=1
Apply.
Notes:
- Any other pattern will result in a complete milling of the whole area of
the pocket.
- The Spiral pattern is the only one that does not mill the whole area but it
is making two turns where one is enough. Setting the step over percentage
to 1% is fooling myself, it still makes two almost identical turns.

My first approach was to use a 'Facing operation' on the surface of the inner
circle, assuming that the operation is tide to the surface only.
While I have selected the surface of the inner circle, FreeCAD still handles
it as a pocket operation, also the Spiral operation (!!).
This raises the question 'is the method I found/use a bug?'

Still left with an uneasy feeling. What is the correct way for working only on
the surface of the inner circle and leaving the rest of the 'pocket' for what
it is.



Problem 2a. How to work the top surface of the big circle (for all the bits
that are exposed, without removing the diamond shape).
I have no way to do this, only found some 'almost done' solutions.
Any suggestion is welcome.

This is (among the may things) what I tried.
First try:
Select all the exposed parts of the circle top surface.
Select 'Facing operation' (and reselect all the visible parts again.)
boundary shape=Perimeter:
Anything I do is creating a path that will do 95% of the job but not all.
boudary shape= (anything but Perimeter:
Anything I do will take away the diamond shape that is raised above the
circle.

The 'problem' to me is that FreeCAD will *always* stay within the boundary
shape and I can see why. I don't want the diamond shape damaged.
But at the four points where the outer square, the circle and the diamond all
meet this approach is too safe.
With perimeter boundaries the curring path is 'interupted', FreeCAD raises the
spindle and hops to the other side, leaving some material that should be gone.
The ammount of material depending on the size of the bit.

It is safe to go outside of the boundaries in places where no material is
planned but FreeCAD can't handle this. Os there a way to take away this last
bit of material? (I know, take a chisel and do it yourself. But that is
beyond the point. What if I'm milling some steel?)

While my first try takes away almost everything it is not good enouth. And I do
accept the fact that in sharp corners you're always left with some material
but this is not such a case. Is it possible to improve in this case?


Problem 2b, take away the last bits.
First try:
What if I try a 'Facing operation' on the side of the diamond shape?
Select the four sides of the diamond shape. With many thanks to the
person(s) that came up with the 'close loop' button. That makes life
easier!
Select 'Facing operation' (yeah, reselected the facing again.)
With Boundary shape = perimeter, this operation just takes away the diamond
shape, from top to bottom. (Why?? What is happening here?))
On any other boundary shape it takes away *all* material.
Not a usefull action. And I realy do not understand what is going on.
(can somebody explain why FreeCAD wants to mill away *everyting*?)

Using I spiral pattern would work, *if* I could specify that it should be
done on the outside, not on the inside.
But what is 'outside' for boundary shape perimeter?

Second try:
Select the four sides of the diamond shape.
Select 'Profile Selected Faces'.
Cut side=outside
No path.

Try #3: By now I'm just (systematicly) trying different options, but not
understanding what I'm doing. Just see if it will work or not with 'best guess:
this will not work. See what I can make from the results.' :-(
Select the top edge of the diamond shape.
Select 'Profile Selected Edges'.
Cut side=outside
I got a path, but it is around the whole of the original diamond shape,
cutting through lower circle and square. Somehow this result make sense.
But it is not a usefull result.

Strange thing, selecting the edges does give me some result but selecting
faces does not (but see try #4). That does not make sense to me.

Try #4:
Select the edge where the diamond shape meets the larger circle.
Note: The close loop button does not work on one (or two) of these edges.
Which again, make some sense. The top edges is an edge from a primary
object while this edge is the result of an 'OR' (or merge) operation.
Select 'Profile Selected Edges'.
Cut side=outside.
A convoluted path. It goes around the big square but with some funny jumps
at several places and, halfway at one side (at the corner of the diamond
shape) to the oposite side (to the other corner of the diamond shape) but
at a lower level. A slanted cutting action. Stange. And not usefull.

Try #4:
Selected the top visible surface of the diamond shape.
Select 'Profile Selected Surface'.
Same result as Try #3.

Doing this on circle edges/surfaces will get similar results.

Try #5:
Selected the top edge of the diamond shape.
Selecting the top visible surface or sides of the diamond shape give the same result.
Selected Path Helix, start from outside.
Path: removing the whole of the inner circle (what was removed in problem 1)
Make sence, but is not what I'm looking for.

Kind regards.
Kind regards, Andre.
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: How to generate a path that I can envision but FreeCAT can not.

Postby chrisb » Sat May 16, 2020 10:48 pm

Please upload the file.
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: How to generate a path that I can envision but FreeCAT can not.

Postby chrisb » Sat May 16, 2020 10:51 pm

PapaAtHome wrote:
Sat May 16, 2020 10:35 pm
Problem 1. How to make the hole in the middle by just cutting it out not
reducing the whole pocket to dust?
Did you try the Profile operation?
User avatar
PapaAtHome
Posts: 22
Joined: Mon Dec 31, 2018 6:45 pm

Re: How to generate a path that I can envision but FreeCAT can not.

Postby PapaAtHome » Sat May 16, 2020 11:05 pm

chrisb wrote:
Sat May 16, 2020 10:48 pm
Please upload the file.
See attachement.

Note: No paths are included, the job is.
Attachments
Square-Circle-Diamond-fixed 140.v0.19.FCStd
(41.81 KiB) Downloaded 6 times
Kind regards, Andre.
User avatar
PapaAtHome
Posts: 22
Joined: Mon Dec 31, 2018 6:45 pm

Re: How to generate a path that I can envision but FreeCAT can not.

Postby PapaAtHome » Sat May 16, 2020 11:13 pm

chrisb wrote:
Sat May 16, 2020 10:51 pm
PapaAtHome wrote:
Sat May 16, 2020 10:35 pm
Problem 1. How to make the hole in the middle by just cutting it out not
reducing the whole pocket to dust?
Did you try the Profile operation?
I tried about every button that is available in the Path workbench, just to see what it does and how to use it.
I tried the Profile operation, both on the object as a whole by selecting nothing or on some object by selecting a surface. (As described with the second 'problem').

The profile operation on the object in total will circumfence the main square object but not the part of the circle (or diamond) that is sticking out.

The profile operation while selecting a surface of (for instance) the diamond will circumfence the diamond but also cut through the cirle and square base. That is what I found.

Profiling will get the pocket in the middle done, but only by reducing the whole area to dust. Is there a way to just cut out a circle?

Kind regareds.
Kind regards, Andre.
User avatar
PapaAtHome
Posts: 22
Joined: Mon Dec 31, 2018 6:45 pm

Re: How to generate a path that I can envision but FreeCAT can not.

Postby PapaAtHome » Sat May 16, 2020 11:15 pm

PapaAtHome wrote:
Sat May 16, 2020 11:05 pm
chrisb wrote:
Sat May 16, 2020 10:48 pm
Please upload the file.
See attachement.

Note: No paths are included, the job is.

Edit: if required, I can uplode the file with path(s) and a detailed description on how I got to that point.
Kind regards, Andre.
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: How to generate a path that I can envision but FreeCAT can not.

Postby chrisb » Sat May 16, 2020 11:23 pm

Moved to Path forum.
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: How to generate a path that I can envision but FreeCAT can not.

Postby chrisb » Sat May 16, 2020 11:35 pm

PapaAtHome wrote:
Sat May 16, 2020 11:13 pm
I tried about every button that is available in the Path workbench, just to see what it does and how to use it.
...
The profile operation on the object in total will circumfence the main square object but not the part of the circle (or diamond) that is sticking out.
You should have tried any combination of options as well :mrgreen: .

Cut the inner hole:
- Select the diamond,
- Profile from face
- Check Process circles

As your post is very lengthy (to be honest, I prefer short posts, and not all problems you ever encountered in one post) it is difficult to keep up with your questions; I will reply in several posts.
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: How to generate a path that I can envision but FreeCAT can not.

Postby chrisb » Sun May 17, 2020 12:22 am

PapaAtHome wrote:
Sat May 16, 2020 10:35 pm
2 - How to *completely* circumfence the diamond and cylinder outer shapes.
This is difficult, as you have experienced, even more so, as the diamond is slightly bigger than the cylinder:
Snip macro screenshot-58bbb6.png
Snip macro screenshot-58bbb6.png (4.08 KiB) Viewed 236 times
This is as much as the pocket can do:
- select the four quarter moons
- create a pocket
- set all extensions
- The more you increase the Extension length, the closer you get, but a gep persists
- Apply
However, one of the four corners is not processed correctly:
Snip macro screenshot-958dfd.png
Snip macro screenshot-958dfd.png (41 KiB) Viewed 236 times
So I would create another job for this operation using only the fusion and adapt the depth of the contour operation.
Snip macro screenshot-d790bd.png
Snip macro screenshot-d790bd.png (21.15 KiB) Viewed 236 times
You will have to set the precision values appropriately to get the diamond's extensions processed properly.
User avatar
PapaAtHome
Posts: 22
Joined: Mon Dec 31, 2018 6:45 pm

Re: How to generate a path that I can envision but FreeCAT can not.

Postby PapaAtHome » Sun May 17, 2020 9:14 am

chrisb wrote:
Sat May 16, 2020 11:35 pm
As your post is very lengthy (to be honest, I prefer short posts, and not all problems you ever encountered in one post) it is difficult to keep up with your questions; I will reply in several posts.
Point taken. :oops:
chrisb wrote:
Sun May 17, 2020 12:22 am
PapaAtHome wrote:
Sat May 16, 2020 10:35 pm
2 - How to *completely* circumfence the diamond and cylinder outer shapes.
This is difficult, as you have experienced, even more so, as the diamond is slightly bigger than the cylinder:
...
Thanks for the clear reply.

My original design was parametised and I can just specify the length of the base square and all other lengths and positions are derived from that.
To exclude the posibility that there is something wrong with this version I decided to use a new design with a fixed size of 140 mm. Got the numbers from the parameterised version, did put together the fixed one and I never cheked for overlap, another oops! :oops:

It is great to see what you have done, a picture does tell more than words.
My next step is to apply your comments on the parameterised version I have an see what my result are. This will take me some time.

If I have questions after that I will reply here with short messages indluding a) the file, and b) pictures.
So now,... I've work to do. :P

Kind regards.
Kind regards, Andre.