PoissonRecon.exe to output density SF CC can use?

For any question about plugins!
Post Reply
Laserbrain
Posts: 51
Joined: Tue Sep 30, 2014 6:13 pm

PoissonRecon.exe to output density SF CC can use?

Post by Laserbrain »

I've been dabbling with the poissonrecon.exe to mesh PLY files exported from CC.

However it does not seem that the --density parameter of poissonrecon.exe is outputting values that CC can use to edit the scalar field. See attached image.

Should this work?

Does the library CC uses for poisson reconstruction work differently than the .exe?

Here is the cmd line parameters I'm using:

Code: Select all

PoissonRecon.exe --in test.ply --out meshed_test.ply --depth 11 --normals --pointWeight 1 --density --samplesPerNode 5 --bType 3
Screenshot 2020-10-28 150651.jpg
Screenshot 2020-10-28 150651.jpg (298.25 KiB) Viewed 18307 times
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: PoissonRecon.exe to output density SF CC can use?

Post by daniel »

I don't know very well the executable version of PoissonRecon. But yes, it's probably different from the plugin as they both use the same library underneath, but they don't expose the same features.

Maybe someone else who knows the executable version better might help.
Daniel, CloudCompare admin
jedfrechette
Posts: 46
Joined: Mon Jan 20, 2014 6:31 pm
Location: Albuquerque, NM
Contact:

Re: PoissonRecon.exe to output density SF CC can use?

Post by jedfrechette »

You're using the `--density` flag correctly. When you do so it adds a vertex attribute named `value`. Just make sure you select that attribute as a scalar field, see below, when you import the resulting ply in to CloudCompare.

psr_ply_open.JPG
psr_ply_open.JPG (51.63 KiB) Viewed 18264 times
Jed
abhishek
Posts: 4
Joined: Tue May 16, 2023 12:18 pm

Re: PoissonRecon.exe to output density SF CC can use?

Post by abhishek »

jedfrechette wrote: Fri Oct 30, 2020 11:41 pm You're using the `--density` flag correctly. When you do so it adds a vertex attribute named `value`. Just make sure you select that attribute as a scalar field, see below, when you import the resulting ply in to CloudCompare.


psr_ply_open.JPG
Hi,

Is it possible to Load the Mesh(PLY File) via CLI specifying Scalar field with vertex-Value??
As mentioned above i am able to load the Mesh File by specifying the Scalar field as shown using UI but i am unable to implement it via CLI, kindly help.

Thanks
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: PoissonRecon.exe to output density SF CC can use?

Post by daniel »

Right now, with CLI, the only way for CC to recognize a PLY filed as being a scalar field is that the field name starts with 'scalar'. You can manually add a 'scalar_' prefix to any PLY file with a text editor such as Notepad++ or with a small script (PLY files header is always in text/ASCII mode).
Daniel, CloudCompare admin
abhishek
Posts: 4
Joined: Tue May 16, 2023 12:18 pm

Re: PoissonRecon.exe to output density SF CC can use?

Post by abhishek »

Thank you so much for the response, let me try it out and will update here the results.
abhishek
Posts: 4
Joined: Tue May 16, 2023 12:18 pm

Re: PoissonRecon.exe to output density SF CC can use?

Post by abhishek »

It's working, modified the PLY file as mentioned and able to achieve the result. I am adding script here which I used to implement the same:

import plyfile
from plyfile import PlyProperty, PlyListProperty
################################# PLY file Manupulation #############################################
#Convert File format using https://github.com/dranjan/python-plyfile
#Modify Header to read Scalar Density parameter
#Update Ply Header: Modify ----->> "property float scalar_value" from "property float value"
print("Please Wait!!! Transforming File ----->")
file = plyfile.PlyData.read("FILEPATH\\Poisson.ply")
file.text = True

file.elements[0].properties = ()
file.elements[0].data.dtype.names = ['x', 'y', 'z', 'scalar_value']
file.elements[0].properties = (PlyProperty('x', 'float'),PlyProperty('y', 'float'),PlyProperty('z', 'float'),PlyProperty('scalar_value', 'float'))

file.write("FILEPATH\\Poisson_C.ply")
print("File Modified !!!!!")
#####################################################################################################
Post Reply