Page 1 of 1

PoissonRecon.exe to output density SF CC can use?

Posted: Wed Oct 28, 2020 10:08 pm
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 18128 times

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

Posted: Fri Oct 30, 2020 5:42 pm
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.

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

Posted: Fri Oct 30, 2020 11:41 pm
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 18085 times

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

Posted: Tue May 16, 2023 12:25 pm
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

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

Posted: Wed May 17, 2023 9:06 pm
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).

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

Posted: Thu May 18, 2023 5:23 am
by abhishek
Thank you so much for the response, let me try it out and will update here the results.

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

Posted: Mon May 22, 2023 7:38 am
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 !!!!!")
#####################################################################################################