Customized 3D vector representation

6 ビュー (過去 30 日間)
Roderick
Roderick 2024 年 2 月 6 日
コメント済み: Roderick 2024 年 2 月 6 日
Hello everyone
I was wondering if it would be possible to customize the way in which the directionality of a three-dimensional vector is represented in MatLab, in such a way that the arrow has volume and presents a sphere at half its length, as in this image, which is shown can be found in the paper Domain wall dynamics in two-dimensional van der Waals ferromagnets
and that if I recall correctly has been done with povray.

採用された回答

Matt J
Matt J 2024 年 2 月 6 日
編集済み: Matt J 2024 年 2 月 6 日
The graphical element you describe can be created from a combination of a cylinder (the shaft of the arrow), a cone (the head of the arrow) and a sphere. All 3 can be co-plotted using a very simple interface with this FEX package:
Below is an example specific to your goals. Note that once you have the vector H of graphics handles, you can use hgtransform to re-position, resize, and re-orient the arrow to your liking.
[shaftCenter,shaftRadius,shaftHeight]=...
deal([0 0 0], 0.2, 10); %Arrow shaft parameters
[headTip,headAngle,headHeight]=...
deal([1.1*shaftHeight/2,0,0], 30, shaftHeight/6); %Arrow head parameters
[sphereCenter,sphereRadius]=deal([0,0,0], shaftHeight/12); %Sphere parameters
Shaft=cylindricalFit.groundtruth([],shaftCenter,shaftRadius,shaftHeight,[0,0]); %Data-less ground truth objects
Head=rightcircularconeFit.groundtruth([],headTip,headAngle,headHeight,[180,0]);
Sphere=sphericalFit.groundtruth([], sphereCenter,sphereRadius);
figure
hold on
H(1)=plot(Shaft,{'FaceAlpha',1});
H(2)=plot(Head,{'FaceAlpha',1});
H(3)=plot(Sphere,{'FaceAlpha',1});
view(-50,30)
hold off
  1 件のコメント
Roderick
Roderick 2024 年 2 月 6 日
Hi @Matt J. Thank you very much for your answer! I will try what you suggest. I have found this interesting arrow format example: magnetic skyrmion visualization. Get rid off the sphere sounds reasonable, given the very good output.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by