delaunay function on raspberry pi?

1 view (last 30 days)
Sebastian
Sebastian on 16 Aug 2024
Answered: Saurabh on 26 Aug 2024
Hello all,
I am trying to convert my code so it can run on a raspberry pi. However, part of my code is a map generator which uses the delaunay function to create a triangulation as follows:
(...)
x = x(:);
y = y(:);
z = z(:);
faces = delaunay(x, y);
randomMap = triangulation(faces, x, y, z);
end
Matlab Coder says it cannot convert the delaunay function. Is there any other function I can use to port this? I have already tried using 'delaunayTriangulation' or 'alphashape' instead, and tried to directly call 'qhull', but neither of these work. And since the delaunay function is built-in, I cannot look at the source code to fix this issue either and I do not know enough about the implementation to implement it from scratch.
Any help is appreciated!
  2 Comments
Umar
Umar on 18 Aug 2024
Hi @Sebastian,
Is it possible for you to post your code along with any data that you are using in order for us to resolve your issue.
Walter Roberson
Walter Roberson on 18 Aug 2024
Sample code:
function test
N = 50;
x = rand(N,1);
y = rand(N,1);
z = rand(N,1);
x = x(:);
y = y(:);
z = z(:);
faces = delaunay(x, y);
randomMap = triangulation(faces, x, y, z);
end
MATLAB Coder will be unable to compile this.

Sign in to comment.

Answers (1)

Saurabh
Saurabh on 26 Aug 2024
Hi Sebastian,
According to my understanding, you are trying to do code generation for your code, which uses the “delaunay” function to run it on the Raspberry Pi, but MATLAB says it cannot convert the “delaunay” function.
Going through the release notes found that from R2020a MathWorks has supported Computational Geometry function “delaunayn” for code generation, “delaunayncan construct Delaunay Triangulation in any n dimensional space. You can explore this function instead of delaunay / delaunayTriangulation.
Refer to this documentation to get to know more about the “delaunayn” function:
I Hope this was helpful.

Categories

Find more on Delaunay Triangulation in Help Center and File Exchange

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!