try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()
points = {
1:[0,0,2],
10:[2.103215,2.103215,2],
11:[-7.55E-08,1.728084,2]
[...]
}
cm = [
[1,2,9],
[2,3,10],
[3,4,11],
[...]
]
for key, value in points.iteritems():
Sphere4 = Sphere()
Sphere4.Radius = 0.15
Sphere4.Center = value
Sphere4.PhiResolution = 20
Sphere4.ThetaResolution = 20
RenderView1 = GetRenderView()
DataRepresentation4 = Show()
DataRepresentation4.EdgeColor = [0.0, 0.0, 0.5000076295109483]
DataRepresentation4.SelectionPointFieldDataArrayName = 'Normals'
DataRepresentation4.AmbientColor = [0.0, 0.0, 0.0]
DataRepresentation4.CubeAxesColor = [0.0, 0.0, 0.0]
DataRepresentation4.ScaleFactor = 0.1
RenderView1.CameraPosition = [0.12249341845958465, 1.6783114555009098, -2.82751287919202]
RenderView1.CameraClippingRange = [1.8715334193481947, 5.084339235287565]
DataRepresentation4.DiffuseColor = [1.0, 0.0, 0.0]
Render()
for value in cm:
for i in range(1, len(value)):
Line2 = Line()
# toggle the 3D widget visibility.
active_objects.source.SMProxy.InvokeEvent('UserEvent', 'ShowWidget')
RenderView1 = GetRenderView()
RenderView1.CameraClippingRange = [0.04313226219643915, 43.13226219643914]
fromi = value[0]
toi = value[i]
frompt = points[fromi]
topt = points[toi]
Line2.Point1 = frompt
Line2.Point2 = topt
DataRepresentation2 = Show()
DataRepresentation2.EdgeColor = [0.0, 0.0, 0.5000076295109483]
DataRepresentation2.SelectionPointFieldDataArrayName = 'Texture Coordinates'
DataRepresentation2.AmbientColor = [0.0, 0.0, 0.0]
DataRepresentation2.CubeAxesColor = [0.0, 0.0, 0.0]
DataRepresentation2.ScaleFactor = 0.10752979516983033
DataRepresentation2.Representation = 'Wireframe'
DataRepresentation2.LineWidth = 2.0
Render()