Filter löschen
Filter löschen

Voronoi polygon patching without looping

3 Ansichten (letzte 30 Tage)
YT
YT am 17 Okt. 2018
I recently learned that you can patch delaunay triangles easily in one go by using the options `Faces` and `Vertices`, but for the voronoi polygons it isn't that straightforward because they have a variable amount of vertices/faces (stored in a cell array `c`).
So now I don't know if it's even possible, but can you patch all voronoi polygons without looping? And if so, is it more efficient (time) compared to looping?
[v,c] = voronoin(X)
for i = 1:length(c)
if all(c{i}~=1)
patch(v(c{i},1),v(c{i},2),RGB2(i,:)/256,'EdgeColor','none');
end
end

Antworten (0)

Kategorien

Mehr zu Voronoi Diagram finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by