Equally spaced structured Point Cloud Cuboid generation

버전 1.0.0.0 (1.32 KB) 작성자: Jveer
Simple function to generate equally spaced point cloud forming a cuboid
다운로드 수: 1.1K
업데이트 날짜: 2009/4/4

라이선스 보기

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

인용 양식

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. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2007a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Point Cloud Processing에 대해 자세히 알아보기
태그 태그 추가

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0