CloudCompare / CloudComPy

Python wrapper for CloudCompare
Other
265 stars 38 forks source link

color scale #170

Closed kaiyuanxuexizhe closed 1 month ago

kaiyuanxuexizhe commented 1 month ago

Hello,

I'm currently working with CloudComPy and need some guidance on setting the color scale for a scalar field programmatically. I've been able to manually adjust the color scale in the GUI, but I would like to replicate this process in my script. Specifically, I'm interested in defining a custom color scale and applying it to a scalar field, then using convertCurrentScalarFieldToColors() to permanently apply this color mapping to my data.

From the GUI, it's clear that color scales can be saved and applied, but I'm struggling to find the equivalent commands in CloudComPy. Here’s what I'm trying to achieve programmatically:

Set a custom color scale for a scalar field. 2024-05-13_15-30

Use convertCurrentScalarFieldToColors() to apply this scale and record the resulting colors.

Is there a specific method or sequence of commands in CloudComPy that would allow me to accomplish this? Any examples or documentation on this would be extremely helpful.

Thank you for your assistance!

prascle commented 1 month ago

Hello, It's not yet possible to select a color scale in CloudComPy, I'll try to add this in the next version. However, there are plenty of methods to wrap if you want to get the full CloudCompare interface: selecting a color scale from a list, editing a new color scale. I'll start with the list of predefined scales and analyze the editing part: it may take a bit of work to design a good Python interface. Best regards, Paul

kaiyuanxuexizhe commented 1 month ago

Got it, thanks for the response.