import os
import random
import struct
from OCC.Core.Graphic3d import Graphic3d_ArrayOfPoints
from OCC.Core.AIS import AIS_PointCloud
from OCC.Core.Quantity import Quantity_Color, Quantity_TOC_RGB
from OCC.Core.gp import gp_Pnt
import math
from OCC.Display.SimpleGui import init_display
display, start_display, add_menu, add_function_to_menu = init_display()from math import sin,cos
defrandom_points(event=None):
n_points =500# first, create a set of 1000 points
points_3d = Graphic3d_ArrayOfPoints(n_points)for idx inrange(n_points):
x =2*sin(idx+2)
y = sin(2*idx)
z = random.uniform(-50,50)
points_3d.AddVertex(x, y, z)# then build the point cloud
point_cloud = AIS_PointCloud()
point_cloud.SetPoints(points_3d)# display
ais_context = display.GetContext()
ais_context.Display(point_cloud,True)
display.View_Iso()
display.FitAll()