Constructing an Offset-Curve

40 ビュー (過去 30 日間)
Ben
Ben 2014 年 12 月 2 日
回答済み: alper yeldan 2021 年 12 月 8 日
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
  2 件のコメント
Will Walton
Will Walton 2015 年 3 月 27 日
Ben, I was wondering what kind of progress you've made on this. I'm working on a similar issue, trying to compare the profile of a machined part using a CMM with a nominal profile. The algorithms in Mohammad's paper make sense in an abstract way, but actually implementing them in Matlab seems difficult.
Andries Paula
Andries Paula 2017 年 2 月 23 日
Hey. Did you managed to find out what approche is the best ?

サインインしてコメントする。

採用された回答

Unai San Miguel
Unai San Miguel 2017 年 4 月 28 日
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.
  1 件のコメント
Ben
Ben 2017 年 4 月 28 日
I agree, it is not a trivial task! Thank you for your input, this looks very informative.

サインインしてコメントする。

その他の回答 (2 件)

Matt J
Matt J 2014 年 12 月 2 日
You haven't said what properties your "offset curve" must satisfy, so this is just a shot in the dark. However, what you could do is create a binary image that is white in the region above or below the given curve. Then apply imerode(). Then, find the boundary of the eroded region using bwboundaries. Then, do a curve fit to the boundary points and call that your final offset curve.
  5 件のコメント
Mohammad Abouali
Mohammad Abouali 2014 年 12 月 2 日
Matt, a simple translation of all points doesn't work. It is more complicated than just a simple translation of points.
And the goal is not just to keep the red and blue line parallel to each other. But also a t a certain distance from each other. So, depending on the curves and the distance they gradually actually reshape and change their form.
This is very common in CAD softwares. AutoCAD had it as long as I remember.
Matt J
Matt J 2014 年 12 月 2 日
Guys, you're missing my point. Of course I know there must be more constraints. My point is that the discussion can't go forward without us being told what they are!!

サインインしてコメントする。


alper yeldan
alper yeldan 2021 年 12 月 8 日
It is an old question but I think I can explain a bit more. You shoul check this. If you know the equation of your function can express in x = [x(t), y(t)]. Parallel curve with a distance d can be expressed in Cartesian coordinates as:
x_d(t) = x(t) + d*dy(t) / sqrt(dx(t)^2 + dy(t)^2);
y_d(t) = y(t) - d*dx(t)/sqrt(dx(t)^2 + dy(t)^2);
From here you can easily plot the parallel curves in MATLAB, but it might not be possible in CAD programs, because these lines are generally NOT polynomial. If you want to see more examples check this link too.

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by