"""Colorize a large cloud of points by passingcolors and transparencies in the format (R,G,B,A)"""print(__doc__)from vtkplotter import Pointsimport numpy as npimport timeN = 1000000pts = np.random.rand(N, 3)RGB = pts * 255Alpha = pts[:, 2] * 255RGBA = np.c_[RGB, Alpha] # concatenateprint("clock starts")t0 = time.time()# passing c in format (R,G,B,A) is ~50x fasterpts = Points(pts, r=2, c=RGBA) #fast#pts = Points(pts, r=2, c=pts, alpha=pts[:, 2]) #slowt1 = time.time()print("----> elapsed time:", t1-t0, "seconds for N:", N)pts.show(bg="white", axes=True)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。