필터 지우기
필터 지우기

How to visualise 10000 cell volume

조회 수: 1 (최근 30일)
Pierre Lebel
Pierre Lebel 2019년 9월 25일
댓글: Pierre Lebel 2019년 10월 11일
I have tried to view this system in 3D using patch. It is very slow. I've seen other software do this much much faster, even with transparency. What am i missing?
  댓글 수: 2
Fabio Freschi
Fabio Freschi 2019년 9월 25일
Any data? I visualize easily millions of patches but it is difficult to help without a simple example of the data
Jan
Jan 2019년 9월 25일
Please explain any details. How are the "10000 cell volume" represented? If you post code and data, it is likely, that the speed can be improved.

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

채택된 답변

Fabio Freschi
Fabio Freschi 2019년 9월 25일
Load nodes and faces in a unique structure and plot all patches in a single command
tic
nodes = []; faces = [];
for i = 1:length(PatchWork)
faces = [faces; PatchWork{i}.FaceVertices+size(nodes,1)];
nodes = [nodes; PatchWork{i}.VertexXYZs.'];
end
figure
patch('Faces',double(faces),'Vertices',nodes,'FaceColor','red');
view([1 1 1]);
toc
>> Elapsed time is 1.018881 seconds.
  댓글 수: 11
Fabio Freschi
Fabio Freschi 2019년 10월 11일
The point is: if there are duplicated nodes, so that each face has its own set of nodes, so you won't have problems in using 'FaceVertexAlphaData'.
There is still the fact that you must address the specific property to the right node. and this may not be simple if your data are generated by an unknown software/function (like an independent mesh generator). I actually haven't check your data in details, but you may know what you really have as input.
I usually work with non-duplicated nodes, like in finite element meshes. In this case, for example, one of your corner nodes is hsared by three faces. Suppose that this corner node is the first node for all 3 faces: so you cannod specify different transparencies for these faces.
Pierre Lebel
Pierre Lebel 2019년 10월 11일
Thanks again,
Those are several good points.
  • The first is that in my case, there are 10000 cells each with eight vertices and six faces. Vertices are [80000x3 double] and so, are independent for each cell. Faces are [60000x4] and point to the vertices. Each vertex is used three times (3-faces) and only in one cell.
  • Color and transparency are both assigned by face. The colors appear to be assigned correctly.
  • Your last point is good, but because I use duplicated nodes, not really applicable.
I think I should ask Mathworks about the 'FaceVertexAlphaData' feature, but your approach (above) will certainly work, although not quite as elegant or versatile as I would like.

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

추가 답변 (1개)

Pierre Lebel
Pierre Lebel 2019년 9월 25일
variable "PatchWork" attached,
code as follows:
for ib = 1:10000
zz(ib) = patch( app.UIAxes2 ...
, 'Faces',PatchWork{ib}.FaceVertices ...
, 'Vertices',PatchWork{ib}.VertexXYZs' ...
, 'FaceVertexCData', rand() ...
, 'FaceColor','flat');
end

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by