image thumbnail

stlGeneralAccess

version 6.1.2 (149 KB) by Jeff Zhang
stlGeneralAccess for both binary STL and ascii STL. It returns the coordinates of vertexes, including boundary nodes and interior nodes.

65 Downloads

Updated 19 Aug 2020

From GitHub

View license on GitHub

This function reads an STL file in binary format or ascii format.
It returns the coordinates of both boundary nodes and interior nodes
of the 3D polyhedron.

partial REFs:
1. stlread() by Doron Harlev for binary STL file via mathswork.com
2. https://wrf.ecse.rpi.edu//Research/Short_Notes/pnpoly.html

Examples:
close all
clear all
clc

[x, y, z, bdNodes, inNodes] = stlGeneralAccess('./Region1.stl');
if 0
patch(x, y, z);
else
scatter3(bdNodes(:,1), bdNodes(:,2), bdNodes(:,3), 'MarkerFaceColor',[.75 .75 .0]);
hold on
scatter3(inNodes(:,1), inNodes(:,2), inNodes(:,3),'MarkerFaceColor',[.5 .0 .0]);
end

Where
filename --- Full path of the input STL file.
dimSize --- [3*1]. The dimSize of coordinate, covering the 3D polyhedron.
x --- [3*numFacet]. X Position of three points in a triangular facet.
y --- [3*numFacet]. Y Position of three points in a triangular facet.
z --- [3*numFacet]. Z Position of three points in a triangular facet.
bdNodes --- [num_bdNodes*3]. The coordinates of boundary nodes.
inNodes --- [num_inNodes*3]. The coordinates of interior nodes.

FUNCTION stlGeneralAccess. Version 6.1 Written by JeffZhang. AUG,2020.
E-mail: jfsufeng@gmail.com || jfzhang2018@zju.edu.cn

Cite As

Jeff Zhang (2021). stlGeneralAccess (https://github.com/JeffJFZ/stlGeneralAccess/releases/tag/6.1.2), GitHub. Retrieved .

1. stlread() by Doron Harlev for binary STL file via mathswork.com 2. https://wrf.ecse.rpi.edu//Research/Short_Notes/pnpoly.html

MATLAB Release Compatibility
Created with R2019a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.