Equally spaced structured Point Cloud Cuboid generation

Versión 1.0.0.0 (1,32 KB) por Jveer
Simple function to generate equally spaced point cloud forming a cuboid
1,1K descargas
Actualizado 4 abr 2009

Ver licencia

Inputs are vectors giving the x, y and z range. e.g x=1:100;y=40:70;z=80:250;

Apologies for lack of description but this submission is for a specific request. It is an extract from a much larger program.

% - B.I SOLID POINT CLOUD CUBOID
function [P]=Cuboid(x,y,z)
% - Generates coordinates for a solid cuboid composed of points

a=length(x);b=length(y);c=length(z); % assigning for coding simplicity
% B.I.1. Finding all x coordinates
xp=zeros(1,a*b*c); % preallocating
for nx=1:a
if nx==1,xp(1:c*b)=(repmat(x(nx),1,c*b));
else xp(((nx-1)*c*b)+1:nx*c*b)=repmat(x(nx),1,c*b);end
end
% B.I.2. Finding all y coordinates
yp=zeros(1,b*c); % preallocating
for ny=1:b
if ny==1,yp(1:c)=repmat(y(ny),1,c);
else yp(((ny-1)*c)+1:ny*c)=repmat(y(ny),1,c);
end
end
yp=repmat(yp,1,a);
% B.I.3. Finding all z coordinates
zp=repmat(z,1,b*a);
% B.I.4. Coordinates of the cuboid generated.
P=[xp;yp;zp];
end % To Optimize

Citar como

Jveer (2024). Equally spaced structured Point Cloud Cuboid generation (https://www.mathworks.com/matlabcentral/fileexchange/23551-equally-spaced-structured-point-cloud-cuboid-generation), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2007a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Point Cloud Processing en Help Center y MATLAB Answers.
Etiquetas Añadir etiquetas

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0