Simulink Mask Support for SVG images - doesn't work fully

6 ビュー (過去 30 日間)
Aditya
Aditya 2017 年 1 月 27 日
コメント済み: Saurabh Gupta 2017 年 2 月 10 日
I have seen the use of svg (scalable vector graphics) images in new Simulink blocks (for e.g. the Hydraulics fluid block in Simscape Fluids).
In 2013a release notes for Simulink, it states that svg support has been added to Simulink masks using the "image" command.
So in 2016b, I started with the svg file for the Hydraulics Fluid block and then opened it up in Inkscape (open source svg editor) and edited it and then saved it again. Now the mask display is not working properly. The preview appears correctly in the mask editor but not in the actual Simulink canvas.
I noticed in 2016b documentation on the "Draw Mask Icon" page that: "Images in formats .cur, .hdf4, .ico, .pcx, .ras, .xwd, .svg (full version) cannot be used as block mask images. However, you can use images in these formats if you wrap the file name in the imread() function and use the RGB triplet. Using the imread() function is not efficient. However, it is still supported for backward compatibility."
I am unable to use imread with the svg file either. Is there some kind of limitation with svg support, especially those generated from external tools (like Inkscape)?
Thanks.

採用された回答

Saurabh Gupta
Saurabh Gupta 2017 年 1 月 30 日
Hi Aditya,
I was able to reproduce the issues you mentioned with both 'image' and 'imread' functions using SVG image files. I have forwarded the details to the concerned development team at MathWorks. Please feel free to contact MathWorks Technical Support if you need further assistance or information regarding this.
Thanks!
  2 件のコメント
Aditya
Aditya 2017 年 2 月 7 日
Hello Saurabh, Thanks for the prompt response - I did not get an email notification and so it took me some time before I remembered to check this page.
Do you have any recommendation for a workaround on how best to modify svg images? In my case, I want to make a small modification to an existing svg image and just add some text to customize it.
If necessary, I can create a support ticket for this.
Thanks, Aditya
Saurabh Gupta
Saurabh Gupta 2017 年 2 月 10 日
I would recommend not using SVG file for drawing mask icon, but as a (trivial) workaround, you can convert the updated SVG image to JPEG or PNG format and use the resultant file to draw the mask.
If it doesn't work for some reason, it may be best to contact MathWorks Technical Support to work out a specific workaround for your case.
Best, Saurabh

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeUpgrading Hydraulic Models to Use Isothermal Liquid Blocks についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by