Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing files using the Command Line Interface #139

Open
hvw-001 opened this issue Jan 8, 2025 · 1 comment
Open

Writing files using the Command Line Interface #139

hvw-001 opened this issue Jan 8, 2025 · 1 comment

Comments

@hvw-001
Copy link

hvw-001 commented Jan 8, 2025

Hey!
I'm trying use the Command Line Interface to interact with Cloudcompare. There is not much documentation, but I already figured out how to load files:

CC = pycc.GetCmdLineInstance()
gso = CC.GlobalShiftOptions()
CC.importFile(path, gso)
clouds = CC.clouds()  # CLCloudDescVector
cloudDesc = clouds[0]  # CLCloudDesc
pointcloud: pycc.ccPointCloud = cloudDesc.pc

Now, i'd like to put clouds into the list to save, but I have no real idea how. Following code does not work. Without the clouds.append(pycc.CLCloudDesc(pc)) line, it saves the files loaded from file earlier:

xs = np.arange(0.0, 5.0, 0.1, pycc.PointCoordinateType)
ys = np.ones(len(xs), pycc.PointCoordinateType) * 18.5
zs = np.ones(len(xs), pycc.PointCoordinateType) * 17.33
pc = pycc.ccPointCloud(xs, ys, zs) # build a point cloud
clouds.append(pycc.CLCloudDesc(pc)) #??? 
CC.saveCloud(".bin", True, outputpath)

>>>TypeError: pycc_runtime.CLCloudDesc: No constructor defined!

I tried looking in the code, but the PYBIND stuff is way beyond what I understand.
Is there a quick example somewhere I could look at?

Thanks!

@tmontaigu
Copy link
Owner

tmontaigu commented Jan 11, 2025

Hello, have you tried the SaveToFile method shown in this example ? https://tmontaigu.github.io/CloudCompare-PythonRuntime/examples.html?highlight=savetofile#loading-a-file

as workaround for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants