Converting a 3D logical array into an STL surface mesh

버전 1.6.0.0 (74.1 KB) 작성자: Adam A
Conversion of a voxelised object contained within a 3D logical array into an STL surface mesh.
다운로드 수: 5.4K
업데이트 날짜: 2012/7/9

라이선스 보기

Converting a 3D logical array into an STL surface mesh
======================================================

Adam H. Aitkenhead
adam.aitkenhead@christie.nhs.uk
The Christie NHS Foundation Trust
24th May 2010


USAGE
=====

>> CONVERT_voxels_to_stl(STLname,gridDATA,gridX,gridY,gridZ,'ascii')
..or..
>> [faces,vertices] = CONVERT_voxels_to_stl(STLname,gridDATA,gridX,gridY,gridZ,STLformat)

converts the voxelised object contained within the 3D logical array <gridINPUT> into an STL surface mesh, which is saved to the ascii file <STLin>. The x,y,z axes for <gridINPUT> are defined by <gridX>, <gridY> and <gridZ>. The (faces,vertices) data are optional outputs.


INPUTS
======

STLname - string - Filename of the STL file.
gridINPUT - 3D logical array of size (P,Q,R) - The voxelised object (1 => Inside the object, 0 => Outside the object)
gridX - A 1xP array - List of the X axis coordinates.
gridY - A 1xQ array - List of the Y axis coordinates.
gridZ - A 1xR array - List of the Z axis coordinates.
STLformat - string (optional) - STL file format: 'binary' or 'ascii'.


OUTPUTS
=======

faces - Nx3 array - A list of the vertices used in each facet of the mesh, identified using the row number in the array vertices.
vertices - Nx3 array - A list of the x,y,z coordinates of each vertex in the mesh.


EXAMPLE
=======

For an example, run the following script:
>> CONVERT_voxels_to_stl_example


NOTES
=====

- This code does not apply any smoothing. The stl mesh will be exactly the same geometry as the original voxelised object.

인용 양식

Adam A (2024). Converting a 3D logical array into an STL surface mesh (https://www.mathworks.com/matlabcentral/fileexchange/27733-converting-a-3d-logical-array-into-an-stl-surface-mesh), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2010a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
도움

줌: Export Voxel Data

Community Treasure Hunt

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

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

Now optionally output the mesh (Faces,Vertices) data

1.5.0.0

Allow the STL to be written in either binary or ascii format.

1.4.0.0

Improved documentation

1.3.0.0

Major speed improvement

1.2.0.0

Improved speed.

1.1.0.0

Improved memory usage.

1.0.0.0