Why is there no effect of flipping the normals using poisson in pc2surfacemesh?

7 ビュー (過去 30 日間)
Lars Urban
Lars Urban 2024 年 7 月 18 日
コメント済み: Lars Urban 2024 年 7 月 19 日
I am using following code to reconstruct a surface with poisson using pc2surfacemesh. I have reconstructed the surface twice, once with normal looking into the inside of the model. The second time mirrored so pointing outwards. There was no difference between the two mesh. I don't know where to look at the code to determine the reconstruction. My question is does the function correct the normal when calculating.
ptcloud = pcread('Auto_Filter_35.ply');
pcshow(ptcloud)
% flip normals
ptcloud.Normal = -ptcloud.Normal;
% Subsampling of ptCloud because of runtime
gridstep = 0.007;
ptCloudDownSampled = pcdownsample(ptcloud,"gridAverage",gridstep);
%% Construct surface mesh from the point cloud data using the Poisson method, and display the surface mesh.
tic
depth = 12;
mesh = pc2surfacemesh(ptCloudDownSampled,"poisson",depth);
surfaceMeshShow(mesh)
toc
writeSurfaceMesh(mesh,"AutoMesh35_flipedNormal.ply")

回答 (1 件)

Shishir Reddy
Shishir Reddy 2024 年 7 月 19 日
Hi Lars
I see that you are trying to flip the normal using the statement ptcloud.Normal = -ptcloud.Normal but you are noticing that there was no difference observed between the two mesh .
This is because MATLAB's ‘pcread’ function does not automatically compute normals when loading a point cloud from a file. So, before manipulating or visualising, normals must be computed manually.
This can be done by using the ‘pcnormals’ function.
ptcloud = pcread('Auto_Filter_35.ply');
ptcloud.Normal = pcnormals(ptCloud);
Now, as the normals are computed, you can flip them and proceed with the surface reconstruction.
For more understanding, kindly refer to the example which is explained in the following documentation :
I hope this helps.
  1 件のコメント
Lars Urban
Lars Urban 2024 年 7 月 19 日
Thanks for the respond. Sorry i forgot to add that the pointcloud that i use has already computed normals.

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

カテゴリ

Help Center および File ExchangePreprocessing についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by