New Chamfer op

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

New Chamfer op

Post by mlampert »

If you have the experimental features enabled there is now an additional op called Chamfer. It allows you to select edges and/or faces and the op creates a chamfer Path for them, taking the tool shape into account. Currently Endmill (square) and Engraver (v-bit) are supported.

As an embarrassing detail, the op currently does not support selecting modeled chamfers for processing. If you add a face to the op it will chamfer all Edges of that face. Detection of modeled chamfer faces is an improvement still to come.

As always feedback is welcome, let me know what works and what doesn't.
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: New Chamfer op

Post by sliptonic »

Awesome feature! Great job.
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

Re: New Chamfer op

Post by roivai »

This is good addition!

Are inside edges supposed to be supported? At least on my first trial, this came out:
2018-07-09-081605_1920x1080_scrot.png
2018-07-09-081605_1920x1080_scrot.png (87.2 KiB) Viewed 2170 times

On the other hand, when selecting a face with both inside and outside features, both came out right. But, like you say, adding the chamfer to a face adds the cut on all edges, even the ones that are inside corners of a pocket, so selecting the face cannot be used in this case:
2018-07-09-081943_1920x1080_scrot.png
2018-07-09-081943_1920x1080_scrot.png (93.71 KiB) Viewed 2170 times
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: New Chamfer op

Post by mlampert »

roivai wrote: Mon Jul 09, 2018 5:26 am Are inside edges supposed to be supported? At least on my first trial, this came out:
Absolutely! I'm not sure what I'm looking at here, could you post your file?
roivai
Posts: 117
Joined: Thu Feb 02, 2017 5:29 pm
Location: Oulu, Finland

Re: New Chamfer op

Post by roivai »

Absolutely! For clarity, I removed other ops, only chamfers are there.
Attachments
mastbox.fcstd
(854.41 KiB) Downloaded 51 times
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: New Chamfer op

Post by mlampert »

roivai wrote: Mon Jul 09, 2018 6:21 am Absolutely! For clarity, I removed other ops, only chamfers are there.
Horray - and after all that testing the first try finds a bug! :mrgreen:
I shall figure out how your model outsmarts my nifty algorithm and tricks it into believing your hole was a perimeter
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: New Chamfer op

Post by mlampert »

Oh boy, I just figured it out - the problem is that offsetting to the outside produces at least some paths that are not "inside the model" - specifically the two edges in Y direction so the algorithm considers it a valid solution. I guess it has to get smarter than that. If your short edges were sharp as well, there would be no overlap of the offset path with the model's solid.

This is a great test case - I'll add something like it to the unit tests!
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: New Chamfer op

Post by mlampert »

I was thinking about this a bit and was wondering what ppl think how the op should behave in a situation like this.

The op was asked to create a chamfer of 1mm - but two 2 of the 4 selected edges are not backed by enough material to support such a chamfer. In layman terms, the model isn't even 1mm thick.

I can see three options
1.) do as you're told and create the full path - which in this case would mean inside (more on that below)
2.) not generate any path if there isn't enough material for the requested chamfer
3.) only generate a path for edges backed by enough material to support a chamfer

About the inside vs. outside. I had always assumed it would be clear what is inside and what is outside, but clearly my mental model was to simplistic. Looking at roivai's model it is clear that the user could want a chamfer path on the inside OR on the outside of those selected edges. Only modifying the model slightly (reducing the width of the ridge at the top and bottom to 0 - same as the side walls) - and both sides make equal sense - or are equally likely to be intended.

So it seems if 1) is the way to go the op needs a "inside vs. outside" selector for the user to choose (which I was trying to avoid).

OTOH, if 2) or 3) are the way to go, one would not be able to use the Chamfer op to machine the slope, even if one had a tool bit with exactly that curved shape.

Thoughts? Opinions?
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: New Chamfer op

Post by GeneFC »

I don't know how difficult it would be to figure out if the chamfer would be strange. If that can be done then I would suggest Option 4.) "I cannot do what you asked me to do. Choose Option 1, 2, or 3."

It is impossible for FreeCAD to know what the user wants to do. Any pre-determined solution will be "wrong" for some people.

Gene
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: New Chamfer op

Post by chrisb »

On first sight of roivai's model I was intrigued to say that 2 is the way to go. But it's allways similar with these auto thingies: In most cases they do what you need, but if not you simply cannot get around it. So I would vote for Gene's version 4, it's the luxury model, where you can e.g. select all edges and let them be chamfered, the system will ask back if there are problems.

If that's not an option I would vote for version 1: If the user doesn't want to chamfer a certain edge he simply deselcts it, so no restrictions from that side: it is possible to "not chamfer".

Here is a simple model showing that it can well be sensible to chamfer, even if there is not enough material. Furthermore it shows that it might be difficult to decide if there is enough material after all.

I have modeled the chamfer to better show what happens:
Attachments
chamfer.png
chamfer.png (12.63 KiB) Viewed 2094 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply