Rendering powierzchni NURBS w ParaView
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
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() |
