外贸网站怎么做seo优化营销型网站建设需要懂什么软件
外贸网站怎么做seo优化,营销型网站建设需要懂什么软件,大型网站建设规范,怎们自己做网站一#xff1a;主要的知识点
1、说明
本文只是教程内容的一小段#xff0c;因博客字数限制#xff0c;故进行拆分。主教程链接#xff1a;vtk教程——逐行解析官网所有Python示例-CSDN博客
2、知识点纪要
本段代码主要涉及的有①三维体素数据的填充 二#xff1a;代码及…一主要的知识点1、说明本文只是教程内容的一小段因博客字数限制故进行拆分。主教程链接vtk教程——逐行解析官网所有Python示例-CSDN博客2、知识点纪要本段代码主要涉及的有①三维体素数据的填充二代码及注释import vtkmodules.vtkRenderingOpenGL2 from vtkmodules.vtkCommonColor import vtkNamedColors from vtkmodules.vtkCommonCore import vtkMinimalStandardRandomSequence, vtkShortArray from vtkmodules.vtkCommonDataModel import vtkStructuredPoints from vtkmodules.vtkFiltersCore import vtkContourFilter from vtkmodules.vtkRenderingCore import ( vtkActor, vtkPolyDataMapper, vtkRenderWindow, vtkRenderWindowInteractor, vtkRenderer ) def main(): colors vtkNamedColors() Pr 10.0 # The Lorenz parameters b 2.667 r 28.0 h 0.01 # integration step size resolution 200 # slice resolution iterations 10000000 # number of iterations xmin -30.0 # x, y, z range for voxels xmax 30.0 ymin -30.0 ymax 30.0 zmin -10.0 zmax 60.0 # Take a stab at an integration step size. xIncr resolution / (xmax - xmin) yIncr resolution / (ymax - ymin) zIncr resolution / (zmax - zmin) randomSequence vtkMinimalStandardRandomSequence() randomSequence.SetSeed(8775070) x randomSequence.GetRangeValue(xmin, xmax) randomSequence.Next() y randomSequence.GetRangeValue(ymin, ymax) randomSequence.Next() z randomSequence.GetRangeValue(zmin, zmax) randomSequence.Next() # allocate memory for the slices sliceSize resolution * resolution numPts sliceSize * resolution scalars vtkShortArray() for i in range(0, numPts): scalars.InsertTuple1(i, 0) for j in range(0, iterations): # Integrate to the next time step. xx x h * Pr * (y - x) yy y h * (x * (r - z) - y) zz z h * (x * y - (b * z)) x xx y yy z zz # Calculate the voxel index. if xmax x xmin and ymax y ymin and zmax z zmin: xxx int(float(xx - xmin) * xIncr) yyy int(float(yy - ymin) * yIncr) zzz int(float(zz - zmin) * zIncr) index xxx yyy * resolution zzz * sliceSize scalars.SetTuple1(index, scalars.GetTuple1(index) 1) 使用**vtkStructuredPoints类来创建一个三维体数据volume data对象 并用之前模拟洛伦兹吸引子轨迹得到的标量数据**填充它 volume vtkStructuredPoints() volume.GetPointData().SetScalars(scalars) volume.SetDimensions(resolution, resolution, resolution) volume.SetOrigin(xmin, ymin, zmin) volume.SetSpacing((xmax - xmin) / resolution, (ymax - ymin) / resolution, (zmax - zmin) / resolution) # Create iso-surface contour vtkContourFilter() contour.SetInputData(volume) contour.SetValue(0, 50) # Create mapper. mapper vtkPolyDataMapper() mapper.SetInputConnection(contour.GetOutputPort()) mapper.ScalarVisibilityOff() # Create actor. actor vtkActor() actor.SetMapper(mapper) actor.GetProperty().SetColor(colors.GetColor3d(DodgerBlue)) renderer vtkRenderer() renWin vtkRenderWindow() renWin.AddRenderer(renderer) iren vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) renderer.AddActor(actor) renderer.SetBackground(colors.GetColor3d(PaleGoldenrod)) renWin.SetSize(640, 480) # interact with data renWin.Render() renWin.SetWindowName(Lorenz) camera renderer.GetActiveCamera() camera.SetPosition(-67.645167, -25.714343, 63.483516) camera.SetFocalPoint(3.224902, -4.398594, 29.552112) camera.SetViewUp(-0.232264, 0.965078, 0.121151) camera.SetDistance(81.414176) camera.SetClippingRange(18.428905, 160.896031) iren.Start() if __name__ __main__: main()