tmontaigu / CloudCompare-PythonRuntime

Python plugin for CloudCompare
54 stars 15 forks source link

polyline how to setColor #117

Closed eglrp closed 1 week ago

eglrp commented 4 weeks ago

I want to draw polyline with color,but how to setColor

import pycc
import numpy as np

CC = pycc.GetInstance()
VERTICES = np.array([
    [-0.5, -0.5, 0],
    [1, 1, 0],
[2, 2, 0]
])
vertices = pycc.ccPointCloud(VERTICES[:, 0], VERTICES[:, 1], VERTICES[:, 2])
polyline = pycc.ccPolyline(vertices)
polyline.setColor()
polyline.setClosed(False)
# This is important, otherwise the polyline would have a size of 0
polyline.addPointIndex(0, 3)
CC.addToDB(polyline)
CC.updateUI()

image

tmontaigu commented 3 weeks ago

the setColor is not completely functional yet, it will be when I re generate the installer

tmontaigu commented 2 weeks ago

The new installer is up and contains the appropriate things

polyline.setColor(pycc.Rgb(255, 0, 0)) # set the color to red

eglrp commented 1 week ago

good