Line up with different thickness

I would like to build a line in 3D with different thicknesses using Matlab. Is it possible to do this (for example, one line)? So far I can build a line in 3D with a fixed thickness, for example:

 path_width = 5;
 plot3(path(:,1), path(:,2), path(:,3), '-', 'LineWidth', path_width);

Ideally, I would like the thickness of the line to change as it is drawn. I have a vector ( path_widths) containing the thickness that I would like to display for each point of the line. Any suggestions are welcome.

+4
source share
1 answer

This is not ideal, but what about this:

hold on
for k = 1:size(path,1)
    plot3(path(k,1), path(k,2), path(k,3), 'o', 'LineWidth', path_widths(k));
end

Or maybe,

hold on
for k = 1:size(path,1)-1
    plot3(path(k:k+1,1), path(k:k+1,2), path(k:k+1,3), '-', 'LineWidth', path_widths(k));
end
+1
source

Source: https://habr.com/ru/post/1524045/


All Articles