필터 지우기
필터 지우기

Cannot add 'custom' model with addMesh() as the only two options are 'polygon' and 'cylinder'

조회 수: 2 (최근 30일)
Hi,
for my dissertation I need to place custom models in a uav scenario to collect LIDAR data. In the documentation it says that it is possible to add custom models by supplying the vertice list and the vertice connectivity list using addMesh(scene,'custom',{vertices,faces}) but when running the code an error pops up saying
Expected type to match one of these values:
'polygon', 'cylinder'
The input, 'custom', did not match any of the valid values.
Does the package not support custom models anymore? I checked the code and it only includes the two options mentioned above, is there a way to get an older version of the code that allows custom models?
Thank you.
  댓글 수: 2
Jianxin Sun
Jianxin Sun 2021년 12월 2일
Hi, Gianluca,
What MATLAB version are you using? "custom" option is added in R2021a.
Thanks,
Jianxin
Gianluca Traversa
Gianluca Traversa 2021년 12월 4일
Hi Jianxin,
Thanks for the speedy reply, issue solved. I would like to suggest adding support to simply provide a .stl file in the addMesh() instead of having to extract the vertices and connectivity list for easier use using custom models. I am assuming this is easier when using the Simulink Unreal Engine simulation but for mac users unfortunately this is not an option.
Thank you,
Gianluca

댓글을 달려면 로그인하십시오.

채택된 답변

Jianxin Sun
Jianxin Sun 2023년 4월 3일
Starting from R2021a, user can use stlread to import stl files into MATLAB and use addMesh custom option to add the model into uavScenario. See code sample below:
scene = uavScenario;
stltri = stlread("multirotor.stl");
addMesh(scene, "custom", {stltri.Points, stltri.ConnectivityList}, [1, 0, 0]);
show3D(scene)

추가 답변 (0개)

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by