Equally spaced structured Point Cloud Cuboid generation

Version 1.0.0.0 (1,32 ko) par Jveer
Simple function to generate equally spaced point cloud forming a cuboid
1,1K téléchargements
Mise à jour 4 avr. 2009

Afficher la licence

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

Citation pour cette source

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. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2007a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Point Cloud Processing dans Help Center et MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.0.0.0