Z surface bending

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!
Post Reply
User avatar
Gegsite
Posts: 11
Joined: Mon Jun 16, 2014 6:21 am
Location: Hungary
Contact:

Z surface bending

Post by Gegsite »

Hello!

Just wanted to make an engraving a text on a cylinder (mounted in a vice) and I have run into a problem that Freecad cannot make it.

The part I wanted to make is too big for the 4th axis.
There is a dress-up made by Brad (sliptonic) but it lacks the manual data input option.
https://www.youtube.com/watch?v=dY8SIL1cdmA

So it would be nice to be able to give the radius or the tilting of the Z to compensate the path.
(now it uses a probe-head to scan the surface and have to save the file of point and load it.)

I had a rectangle shape part with round ends (about 6") and I needed to engrave to the round surface.

Hope it is clear what I want.
Sorry for my English.

Bye,
Gergő
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Z surface bending

Post by sliptonic »

This should be pretty easy to implement. The way the dressup works is to take the probe input data, construct a surface and then use the surface to bilinear interpolate the gcode points.

It should be easy to just make the dressup take an existing surface and use that instead. So you could model the cylinder or other surface however you want and then select it as the shape to interpolate against.

I'll take a look at it.
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Z surface bending

Post by sliptonic »

I sent a PR https://github.com/FreeCAD/FreeCAD/pull/3687.

If you don't want to wait for it to get merged, it's a simple one-line change that just un-hides the interpsurface property.

To use it, you'll need to somehow model the curve you want. I get weird results with a complete cylinder but something like this works:
2020-07-09_16-04.png
2020-07-09_16-04.png (16.16 KiB) Viewed 829 times
Add the dressup to an existing path. Use the interpsurface property in the treeview to select the face and recompute the dressup.
2020-07-09_16-05.png
2020-07-09_16-05.png (8.59 KiB) Viewed 829 times
User avatar
Gegsite
Posts: 11
Joined: Mon Jun 16, 2014 6:21 am
Location: Hungary
Contact:

Re: Z surface bending

Post by Gegsite »

Hello!

Wow, it was pretty fast solving issue than.
I will try it out.

Hope this dress-up will be useful in other path/CAM works too.
I think this stuff is really helpful on datum-plane and rounded part engraving and slot making. Also could be used it in making lithography / Lithophane.

Thanks again!
User avatar
freman
Veteran
Posts: 2200
Joined: Tue Nov 27, 2018 10:30 pm

Re: Z surface bending

Post by freman »

That's cool, I hadn't seen the Z correction dress-up.

I was intending to add this to GRBL at some stage but if I can do it in FC, it may save the effort.

You will probably find that Catmull-Rom interpolation gives a smoother result, if you are ever interested. That would not be that relevant to bed correction but examples like the rounded lump of wood in the video would probably gain accuracy. I just mention that in case it is of interest. I guess you could always just increase the density of sampling with the current code until the error is small enough.

Catmull-Rom is used a lot in image processing for up-scaling or resampling. It is a four point spline fit. The algo is fairly simple and computation light enough to do on megapixel images.

Widely used in games also. IIRC it is often included in GPU instructions, it is that widely used.

That reminds me I do need to spend some time adjusting the bed of my CNC.
Post Reply