To save the matrix listed as fread as stl file?

3 ビュー (過去 30 日間)
Jungwu Kim
Jungwu Kim 2020 年 12 月 16 日
コメント済み: Jungwu Kim 2020 年 12 月 17 日
I changed the stl file of the triangulation to the decimal form through the spread, is there a separate way to change the decimal form back to the stl file?
here my code.
r = fopen('Mesh_04.stl');
A=fread(r);
fclose(r);
whos A
Name Size Bytes Class Attributes
A 137784x1 1102272 double
I want to know how to convert decimal form(A) back to stl file.
And I tried to use the function of the site below, but frankly, I have difficulty setting the variable.
Can you help me if you know?

採用された回答

Walter Roberson
Walter Roberson 2020 年 12 月 16 日
fid = fopen('New_Mesh_04.stl', 'w');
fwrite(fid, A, 'uint8');
fclose(fid)
  3 件のコメント
Walter Roberson
Walter Roberson 2020 年 12 月 17 日
Please check your typing. The command works.
A = randi([0 255], 512, 1);
fid = fopen('New_Mesh_04.stl', 'w');
fwrite(fid, A, 'uint8');
fclose(fid)
ans = 0
!ls -l New_Mesh_04.stl
-rw-r--r-- 1 mluser worker 512 Dec 17 03:52 New_Mesh_04.stl
In particular, check in case you accidentally used unit8 instead of uint8
Jungwu Kim
Jungwu Kim 2020 年 12 月 17 日
thank you! I think I misused your point.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSTL (STereoLithography) についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by