Adding the stl file to the Matlab simulation
조회 수: 4 (최근 30일)
이전 댓글 표시
I created a simulation in Matlab, but the satellite in the simulation looks like a normal rectangle. I want to replace that satellite with a satellite with a stl file. How can I write a code to add the stl file to the simulation?
When I run this code with the relevant places, I get the satellite output in the comments. But as I said, I want to replace it with stl file, how can I do it?
mass_spcrft = 2.6; %[kg] *Range: mass_spcrft > 0.0
dimnsnsX_spcrft = 0.1; %[m] *Range: dimnsnsX_spcrft > 0.0
dimnsnsY_spcrft = 0.1; %[m] *Range: dimnsnsY_spcrft > 0.0
dimnsnsZ_spcrft = 0.2; %[m] *Range: dimnsnsZ_spcrft > 0.0
inrtaTnsr_spcrft = [0.0108, 0, 0;
0, 0.0108, 0;
0, 0, 0.0043];
dimnsns_spcrft(1) = dimnsnsX_spcrft;
dimnsns_spcrft(2) = dimnsnsY_spcrft;
dimnsns_spcrft(3) = dimnsnsZ_spcrft;
clear dimnsnsX_spcrft;
clear dimnsnsY_spcrft;
clear dimnsnsZ_spcrft;
plot3([0, max(dimnsns_spcrft / 2) + 0.05], [0, 0], [0, 0], 'Color', 'w', 'LineWidth', 2, 'Clipping', 'off');
plot3([0, 0], [0, max(dimnsns_spcrft / 2) + 0.05], [0, 0], 'Color', 'w', 'LineWidth', 2, 'Clipping', 'off');
plot3([0, 0], [0, 0], [0, max(dimnsns_spcrft / 2) + 0.05], 'Color', 'w', 'LineWidth', 2, 'Clipping', 'off');
text(max(dimnsns_spcrft / 2) + 0.1, 0, 0, 'X_I', 'Color', 'w');
text(0, max(dimnsns_spcrft / 2) + 0.1, 0, 'Y_I', 'Color', 'w');
text(0, 0, max(dimnsns_spcrft / 2) + 0.1, 'Z_I', 'Color', 'w');
spcrftTrnsfrm = hgtransform;
set(spcrft(dimnsns_spcrft, true), 'Parent', spcrftTrnsfrm);
답변 (1개)
Star Strider
2024년 1월 16일
댓글 수: 2
Star Strider
2024년 1월 29일
I cannot help with that because I do not have the .stl fille.
If you want to post it, use the zip function and then upload the .zip file here. If I do not see it posted in a few hours, I will delete my Answer.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!