CloudComPy icon indicating copy to clipboard operation
CloudComPy copied to clipboard

How to access cloud compare cli functions/plugins in cloudComPy?

Open Nabeel07925 opened this issue 2 years ago • 14 comments

Hi Paul.

Hope you're doing fine. I am trying to use CloudComPy for a research project in which I want to access some functions like ransac, raster, c2m, and cut etc. Previously it's done with command line and I can see its documentation here. Since it's mentioned on Github that all cli functions are also available in CloudCompy, could you please point me toward the right way of accessing these functions / documentation, if it's possible? I can't find them in python docs.

Best Regards Nabeel

Nabeel07925 avatar Mar 16 '22 11:03 Nabeel07925

Hello, CloudComPy does not yet cover all the functions of the command mode, but that is the goal! In particular, many plugins are still missing, like Ransac. There are already functions like computeCloud2MeshDistances (c2m, see also #26), various raster functions (look for raster in the doc), with examples of use in doc/PythonAPI_test (a coverage table of functions is missing).

Can you list the commands/functions you use or want to use, I will add them in my todo list! Regards, Paul

prascle avatar Mar 16 '22 15:03 prascle

+1 for Ransac!

xiangtaoxu avatar Mar 16 '22 16:03 xiangtaoxu

Hi Paul. Thanks a lot for the prompt response. :) For now I need the functions listed above, but there are some more as well. I will compile a list and share here.

Nabeel07925 avatar Mar 16 '22 19:03 Nabeel07925

Hi Paul! Hope you're doing fine. Here is the list of functions I need:

  • Ransac
  • cut
  • best_fit_plane
  • pcv As a side note, if you could give me access to the Python code, that would be perfect. I can assist with the development of further tools, that way. Looking forward to your kind response. :)

Best Regards Nabeel

Nabeel07925 avatar Mar 17 '22 18:03 Nabeel07925

Hello, I will add this to my TODO list.

  • I have problems with the Ransac plugin on Linux, I will try to fix it.

  • When you say "cut", could you be more precise? What GUI functions do you have in mind? Do you mean the segmentation functions? They are in CloudComPy, see "crop2D".

  • There is also a fit function in cloudComPy.ccPlane to fit a plane on a cloud (see test012.py). Is there anything else needed?

  • PCV plugin is available in the latest version (from today).

If you want to contribute, your proposals are welcome. You can already clone the git repository for your personal needs, and if you want to propose an evolution, the easiest way is to follow what GitHub proposes: fork, merge request...

If you want to make a significant contribution, it supposes to make it compile under Linux and Windows, and that all the tests pass... (see the README for instructions). I have not organized myself to receive contributions, and I have not defined any programming rules, even if I have some implicit ones. The reference repository is on https://github.com/CloudCompare/CloudComPy, I work on a fork, more up to date: https://github.com/prascle/CloudComPy.

Regards, Paul

prascle avatar Mar 21 '22 13:03 prascle

Hi Paul,

As part of a passion project our client has dabbled with the CLI version of CloudCompare in an attempt to automate a lot of his most common practices. The major drawback of this way of working however is the fact that several of his most used functions replace the point cloud that was loaded into memory by the result of said function (e.g. FILTER_SF: input clouds are now replaced by their filtered version (since version 2.6.1)).

As such we are looking into CloudComPy as an alternative to circumvent this issue. The following 10 functions (which are currently being used in the CLI version of CloudCompare) are a must-have for our application:

  • ransac
  • cross_section
  • rasterize
  • best_fit_plane
  • c2m_dist
  • filter_sf
  • feature
  • ss
  • pcv
  • apply_trans

Are these functions (or similar functions) available in the current version of CloudComPy or is there any way we can extend the current list of functions?

Kr, Jim

jimdb95 avatar Mar 30 '22 08:03 jimdb95

Hi Jim,

Several functions are already available in CloudComPy, one is under development, one is missing and I am adding it to my todo list.

  • ransac: under development
  • cross_section: missing, on the todo list
  • rasterize: available, see example in test025.py
  • best_fit_plane: available, see example in test014.py
  • c2m_dist: available, see example in test009.py test022.py
  • filter_sf: available, see example in test003.py test019.py
  • feature: available, see example in test024.py
  • ss: available, see example in test015.py test019.py
  • pcv: available, see example in test032.py
  • apply_trans: available, see example in test010.py, test012.py, test026.py, test027.py

However, there may be missing options in the already implemented functions. Do not hesitate to tell us if you notice this.

Regards, Paul

prascle avatar Mar 30 '22 21:03 prascle

Hi Paul,

Thanks for the prompt reply! We will test the available functions and check the availability of any and all options. Regarding the 2 missing functions however, could you give an estimate for the timing in which you think these will become available as well?

Thanks in advance, Jim

jimdb95 avatar Mar 31 '22 13:03 jimdb95

Hi Jim, To finish Ransac it should be fast (2 or 3 days) except unforeseen difficulty. For cross-section, I had a look, there is potentially a lot of C++ to rewrite to be able to do a Python wrapping. If I don't encounter major difficulties, we can aim at a new release with the two plugins at the end of next week, but without any guarantee. Regards, Paul

prascle avatar Mar 31 '22 14:03 prascle

@prascle Just follow this conversation. Another functionality we use often is "Extract Connected Components". Is this something on your agenda?

xiangtaoxu avatar Apr 05 '22 15:04 xiangtaoxu

Hello, I have published a new release with Ransac_sd, cross-section, and also Extract Connected Components. Sorry @xiangtaoxu, I didn't answer your last question about extracting connected components, I wasn't sure if I could do it quickly. In fact, it was not a problem. Regards, Paul

prascle avatar Apr 09 '22 16:04 prascle

@prascle , Thanks so much! Just got time to quickly test the new release! It is working great! One question though is that for RANSAC_SD. How can I only enable fitting certain shapes? There is a function setPrimEnabled but not sure how to use it.

xiangtaoxu avatar Apr 16 '22 03:04 xiangtaoxu

Hello, I realize that the documentation is incomplete, about RANSAC_PRIMITIVE_TYPES. It is the first argument of the methods setPrimEnabled and getPrimEnabled. RANSAC_PRIMITIVE_TYPES is an enum whose values are cc.CC_TYPES.PLANE, cc.CC_TYPES.SPHERE, cc.CC_TYPES.CYLINDER, cc.CC_TYPES.CONE, cc.CC_TYPES.TORUS. The methods allow to selectively enable or disable each shape, or to check whether a given shape is enabled or not.

Paul

prascle avatar Apr 16 '22 18:04 prascle

@prascle Hello,

I would like to request a new feature in cloudcompy - the ability to "extract sections" (https://www.cloudcompare.org/doc/wiki/index.php/Extract_Sections).

Currently, there is no easy way to do this in cloudcompy, and I believe that adding an "extract section" feature would greatly improve the efficiency and user experience of the platform. Ideally, this feature would allow users to select a section of their document or code and extract it to a new document or file, while preserving any necessary formatting, links, or other metadata.

I believe that many other users would also benefit from this feature, and I hope you will consider adding it to cloudcompy in the near future. Thank you for your continued work on this great platform!

Xu-Huitong avatar Apr 22 '23 04:04 Xu-Huitong