资源简介
把点云数据输入matlab,利用此算法,生成三维模型,并输出stl文件
代码片段和文件信息
function stlwrite(filename varargin)
%STLWRITE Write STL file from patch or surface data.
%
% STLWRITE(FILE FV) writes a stereolithography (STL) file to FILE for a
% triangulated patch defined by FV (a structure with fields ‘vertices‘
% and ‘faces‘).
%
% STLWRITE(FILE FACES VERTICES) takes faces and vertices separately
% rather than in an FV struct
%
% STLWRITE(FILE X Y Z) creates an STL file from surface data in X Y
% and Z. STLWRITE triangulates this gridded data into a triangulated
% surface using triangulation options specified below. X Y and Z can be
% two-dimensional arrays with the same size. If X and Y are vectors with
% length equal to SIZE(Z2) and SIZE(Z1) respectively they are passed
% through MESHGRID to create gridded data. If X or Y are scalar values
% they are used to specify the X and Y spacing between grid points.
%
% STLWRITE(...‘PropertyName‘VALUE‘PropertyName‘VALUE...) writes an
% STL file using the following property values:
%
% MODE - File is written using ‘binary‘ (default) or ‘ascii‘.
%
% title - Header text (max 80 chars) written to the STL file.
%
% TRIANGULATION - When used with gridded data TRIANGULATION is either:
% ‘delaunay‘ - (default) Delaunay triangulation of X Y
% ‘f‘ - Forward slash division of grid quads
% ‘b‘ - Back slash division of quadrilaterals
% ‘x‘ - Cross division of quadrilaterals
% Note that ‘f‘ ‘b‘ or ‘t‘ triangulations now use an
% inbuilt version of FEX entry 28327 “mesh2tri“.
%
% FACECOLOR - Single colour (1-by-3) or one-colour-per-face (N-by-3)
% vector of RGB colours for face/vertex input. RGB range
% is 5 bits (0:31) stored in VisCAM/SolidView format
% (http://en.wikipedia.org/wiki/STL_(file_format)#Color_in_binary_STL)
%
% Example 1:
% % Write binary STL from face/vertex data
% tmpvol = zeros(202020); % Empty voxel volume
% tmpvol(8:128:125:15) = 1; % Turn some voxels on
% fv = isosurface(tmpvol 0.99); % Create the patch object
% stlwrite(‘test.stl‘fv) % Save to binary .stl
%
% Example 2:
% % Write ascii STL from gridded data
% [XY] = deal(1:40); % Create grid reference
% Z = peaks(40); % Create grid height
% stlwrite(‘test.stl‘XYZ‘mode‘‘ascii‘)
% Original idea adapted from surf2stl by Bill McDonald. Huge speed
% improvements implemented by Oliver Woodford. Non-Delaunay triangulation
% of quadrilateral surface courtesy of Kevin Moerman. FaceColor
% implementation by Grant Lohsen.
%
% Author: Sven Holcombe 11-24-11
% Check valid filename path
path = fileparts(filename);
if ~isempty(path) && ~exist(path‘dir‘)
erro
相关资源
- 系数绝对值最大 图像融合MATLAB算法
- 用MATLAB-DFT2D DCT2D
- Matlab delta机器人的空间仿真程式
- 扑克牌数字花色识别Matlab
- MATLAB多聚焦图像融合将两张到六张不
- sutton强化学习随书MATLAB代码
- ROC曲线 matlab实现
- 无控纵向导弹弹道计算
- 层次分析法的matlab程序
- MATLAB烟花算法源代码
- OFDM通信系统matlab实现
- MATLAB的S-Function编写指导
- matlab实现对两幅图像的叠加
- 织物密度测量MATLAB实现
- pca源码matlab
- lvq学习算法源码matlab
- FBMC OQAM matlab code
- 基于matlab的判决反馈的均衡器
- 泊松过程的模拟及检验 matlab程序
- 小卫星多普勒频偏MATLAB仿真程序及参
- MATLAB R2007基础教程刘慧颖 编著--源代
- EMD 算法MATLAB 程序
- 基于颜色的聚类分割matlab
- MATLAB电机仿真精华50例
- MATLAB电机仿真精华50例PDF+源码
- 基于Matlab的OFDM系统仿真的设计
- 用于研究非线性系统matlab模块
- 世上最牛的23个图像跟踪算法MATLAB程序
- 压缩鬼成像matlab代码
- HHT变换的三种方法 Matlab,包含CMD分解
评论
共有 条评论