Use step library calc result by python

Currently I am testing a project that uses step library calc results by python. I want to get point cloud and point cloud with normal from mech vision to use in the python environment and in python I will process it to produce a poselist and then return it to mech vision. Can you give me a solution or sample so I can solve this problem? Thank you

Please use this python file as an example and let us know if any further questions.
compare_value.py (822 Bytes)

Also, please refer to Calc Results by Python for detailed instructions.

In your code, there is only the part that returns poselist to mech-vision, but I haven’t found the part that gets point cloud and point cloud and point cloud normal. Is it possible to reselect a model in which point cloud and normal point cloud can be taken from mech-vision and return poselist to mech-vision. Thank you

As introduced in the Calc Results by Python documentation, we support the third-party library for this Step, so you can use a third-party library for you needs, and please note that the third-party library should be installed under the python folder of Mech-Center:

And for the point cloud and normal point cloud from Mech-Vision, here’re some examples for your codes:

If so, you have to load a .ply file into python to use, not get the point cloud directly from the step library capture image from camera, right?

It is best to set a point cloud input port on Step “Calc Results by Python” and get the point cloud there. Otherwise the project logic may easily get corrupted.

But in python how can I get the point cloud from that input. Can you give me a sample?

Since you’ve set the Cloud(XYZ) and Cloud(XYZ-Normal) as the input port types for this Step, and connected the input ports to the output ports of the Capture Images from Camera Step and the Point Cloud Preprocessing Step, you’ve already obtained the point cloud from Mech-Vision. The input data types of this Step will be passed to the called function as parameters in the cooresponding order, in other words, the point clouds obtained and processed in Mech-Vision have been sent to the Calc Results by Python Step and are ready for your script.

We have an application example for using this Step to process point clouds in our Docs: Generate Pseudo Colored Point Cloud Based on Z Values of the Input Point Cloud. In this example program, you can see that you don’t need to write additional statements to get point clouds from Mech-Vision.