MATLAB: Constructing an Offset-Curve

curveCurve Fitting ToolboxMATLABoffset

Probably this question has already been posted several times, however I was not able to find an answer.
I have a smooth curve given as a set of X and Y data points and I am trying to constrcut an offset curve. Bascially my strategie was to search for the perpendicular direction at each point of the given [X,Y] data set and then follow this direction according to the desired offset. This works well for convex curves. However for concave curves, there will be a setback at certain points.
This is actually a very common problem in CNC programming. Commercial CAD and CAM software packages mostly offer a solution to this problem. Unfortunately I was not able to find a solution in matlab. Maybe I am looking in the wrong place…
I would be glad if someone could share their knowledge.
Thanks in advance! Ben

Best Answer

The subject is not trivial, a nice description can be found in the Patrikalakis et al. ebook, Offset curves and surfaces. They also speak about the particular problems of CNC.