亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術(shù)文章
文章詳情頁

詳解python polyscope庫的安裝和例程

瀏覽:6日期:2022-07-05 14:53:51

安裝就可以在環(huán)境配置好的情況下使用pip安裝:

pip install polyscope

如果提示找不到庫文件,no moudle的話可以試著把安裝下來的polyscope文件夾放在和想要運(yùn)行的py文件的同一目錄下。而我們安裝下來的polyscope文件夾在哪里呢?它們應(yīng)該位于安裝目錄中的'Lib/site-packages'中,我的如下圖所示:

詳解python polyscope庫的安裝和例程

但是裝好之后我們運(yùn)行一個網(wǎng)上的例程:

import polyscope as ps# Initialize polyscopeps.init()### Register a point cloud# `my_points` is a Nx3 numpy arrayps.register_point_cloud('my points', my_points)### Register a mesh# `verts` is a Nx3 numpy array of vertex positions# `faces` is a Fx3 array of indices, or a nested listps.register_surface_mesh('my mesh', verts, faces, smooth_shade=True)# Add a scalar function and a vector function defined on the mesh# vertex_scalar is a length V numpy array of values# face_vectors is an Fx3 array of vectors per faceps.get_surface_mesh('my mesh').add_scalar_quantity('my_scalar', vertex_scalar, defined_on=’vertices’, cmap=’blues’)ps.get_surface_mesh('my mesh').add_vector_quantity('my_vector', face_vectors, defined_on=’faces’, color=(0.2, 0.5, 0.5))# View the point cloud and mesh we just registered in the 3D UIps.show()

還是有錯誤,找不到polyscope_bindings,我的解決辦法是在這個目錄下面還應(yīng)該有一個這個文件:

詳解python polyscope庫的安裝和例程

把他的名字改成polyscope_bindings.pyd就可以解決,庫就可以跑通了。但是原例程因?yàn)闆]有給數(shù)組所有還有邏輯錯誤,隨便給幾個就可以運(yùn)行了:

import polyscope as psimport numpy as np# Initialize polyscopeps.init()### Register a point cloud# `my_points` is a Nx3 numpy arraymy_points=np.array([[1,1,1],[1,2,3],[1,2,4],[2,5,3],[2,2,2]])ps.register_point_cloud('my points', my_points)### Register a mesh# `verts` is a Nx3 numpy array of vertex positions# `faces` is a Fx3 array of indices, or a nested listverts=np.array([[1,1,1],[1,2,3],[1,2,4],[2,5,3],[2,2,2]])faces=np.array([[1,1,1],[1,2,3],[1,2,4],[2,4,3],[2,2,2]])ps.register_surface_mesh('my mesh', verts, faces, smooth_shade=True)# Add a scalar function and a vector function defined on the mesh# vertex_scalar is a length V numpy array of values# face_vectors is an Fx3 array of vectors per facevertex_scalar = np.array([1,2,3,4,5])face_vectors=np.array([[1,1,1],[1,2,3],[1,2,4],[2,5,3],[2,2,2]])ps.get_surface_mesh('my mesh').add_scalar_quantity('my_scalar', vertex_scalar, defined_on=’vertices’, cmap=’blues’)ps.get_surface_mesh('my mesh').add_vector_quantity('my_vector', face_vectors, defined_on=’faces’, color=(0.2, 0.5, 0.5))# View the point cloud and mesh we just registered in the 3D UIps.show()

這就可以成功使用了

詳解python polyscope庫的安裝和例程

到此這篇關(guān)于python polyscope庫的安裝和例程的文章就介紹到這了,更多相關(guān)python polyscope庫內(nèi)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!

標(biāo)簽: Python 編程
相關(guān)文章:
主站蜘蛛池模板: 樱花aⅴ一区二区三区四区 樱花草在线社区www韩国 | 日本一二三四区免费视频 | 成人一区视频 | 神马午夜51 | 综合激情婷婷 | 国产 欧美 日产久久 | 在线精品自拍 | 成人黄色小视频 | 欧美夜夜精品一级爽 | 亚洲xx在线 | 国产成人综合视频 | 国产精品免费大片 | 国产99在线播放免费 | 玖玖精品视频在线观看 | 黄色片网址在线观看 | 国产福利小视频在线播放观看 | 嫩草成人国产精品 | 欧美一二三区在线 | 国产一级淫片a视频免费观看 | 日本热久久| 国产精品资源手机在线播放 | 毛片免费全部完整播放 | 亚洲国产精品网站久久 | 免费国产97久久青草 | 男人看片网站 | 一区二区在线不卡 | 亚洲欧美黄| 黄色大片免费在线观看 | 欧美在线观看免费一区视频 | 免费观看a级完整视频 | chinese国产在线视频 | 亚洲综合性 | 一级毛片特级毛片国产 | 小泽玛利亚在线精品一区二区 | a级情欲视频免费观看 | 黄色一级一毛片 | 亚洲国产婷婷俺也色综合 | 亚洲免费视频观看 | 亚洲综合狠狠99婷婷 | 18岁黄色 | 91国视频在线 |