Has MATLAB implemented a polygon offset function?

22 visualizzazioni (ultimi 30 giorni)
Hi! I have 2D CMM data mapping the inside of a pipe at a plane of interest prior to coating and coating thickness measurements at various points inside the pipe. I want to plot the CMM data, offset each wall of the pipe by its corresponding thickness, and use the offset data to calculate the coated cross-sectional area of the pipe (see diagram below). Is there a simple way to do this? If not, does MATLAB have a built-in function to offset the data by a uniform thickness (similarly to CAD software)?
Thanks!

Risposte (1)

Matt J
Matt J il 8 Gen 2021
Modificato: Matt J il 8 Gen 2021
  2 Commenti
Stephanie Farney
Stephanie Farney il 13 Gen 2021
Thank you, that got me on the right track. However, I'm still unable to offset the data by a uniform amount. If it helps, my code resembles the following:
bound = boundary(data.X,data.Y);
contour = polyshape(data.X(bound),data.Y(bound));
coatedContour = polybuffer(contour,avgThickness);
When I plot contour and coatContour, the coating thickness on the top and bottom walls is significantly thicker than the coating on the side walls. As a note, using the boundary gets me an area that better matches the uncoated area calculated by the supplier, but I still have the same problem when I exclude it.
Do you know what might cause this issue?
Thanks again!
Steven Lord
Steven Lord il 13 Gen 2021
Can you share a small sample of data with which you can reproduce this behavior? Please include either a data set that's small enough to include as text in a comment or a small MAT-file as an attachment to a comment.

Accedi per commentare.

Categorie

Scopri di più su Elementary Polygons in Help Center e File Exchange

Prodotti


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by