본문 바로가기
MATLAB 코딩/STL파일 다루기

[Matlab으로 STL파일 다루기] 5. Remesh (refine mesh) , 화면분할 그래프

by bigpicture 2018. 11. 21.
반응형

STL 매쉬가 지저분해서 remesh를 해주었습니다. 매트랩에는 적당한 함수가 없어서(못찾았을 수도), 다른 프로그램을 이용해서 remesh를 했습니다. remesh 전과 후 STL을 첨부하겠습니다. 


remesh 전과 후의 stl을 모두 불러오고 그래프로 비교하는 코드입니다.


subplot이라는 함수를 이용했는데요. 아래와 같은 원리로 사용합니다. 


subplot(세로방향 화면분할 수, 가로방향화면분할 수, 몇번째인지)


아래는 전체 코드와 실행 결과입니다. 


fv1=stlread('hammer.stl');


fv2=stlread('hammer_remesh.stl');

  

subplot(1,2,1);

patch('Faces',fv1.faces,...

  'Vertices',fv1.vertices,...

  'FaceColor',[0.2 0.5 0.7]);

view(45,45);



subplot(1,2,2);

patch('Faces',fv2.faces,...

  'Vertices',fv2.vertices,...

  'FaceColor',[0.2 0.5 0.7]);

view(45,45);


hammer.stl

hammer_remesh.stl


반응형

댓글