亚洲免费在线视频-亚洲啊v-久久免费精品视频-国产精品va-看片地址-成人在线视频网

您的位置:首頁技術文章
文章詳情頁

詳解python polyscope庫的安裝和例程

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

安裝就可以在環境配置好的情況下使用pip安裝:

pip install polyscope

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

詳解python polyscope庫的安裝和例程

但是裝好之后我們運行一個網上的例程:

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,我的解決辦法是在這個目錄下面還應該有一個這個文件:

詳解python polyscope庫的安裝和例程

把他的名字改成polyscope_bindings.pyd就可以解決,庫就可以跑通了。但是原例程因為沒有給數組所有還有邏輯錯誤,隨便給幾個就可以運行了:

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庫的安裝和例程

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

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 一级做a毛片免费视频 | 亚洲天堂免费视频 | 91玖玖 | 天天综合色一区二区三区 | 欧美一级毛片特黄黄 | 免费人成黄页在线观看视频国产 | 午夜限制r级噜噜片一区二区 | 欧美xxxx成人免费网站 | 亚洲欧美中文日韩在线v日本 | 一级全黄毛片 | 91精品国产高清久久久久久io | 小泽玛利亚的一级毛片的 | 日本三级香港三级妇三 | 91精品成人 | 全部免费国产潢色一级 | 一级做a爱片特黄在线观看免费看 | 国产大片线上免费观看 | 欧美一区二区三区视视频 | 国产一线视频在线观看高清 | 国产精品福利午夜h视频 | 在线亚洲精品国产成人二区 | 成人免费xxx色视频 成人免费大片a毛片 | 欧美日韩视频在线 | 亚州免费| 国产一区二区影院 | 国产一级二级三级毛片 | 国产欧美在线观看不卡 | 国产精品亚洲精品日韩已方 | 欧美性色黄大片www 欧美性色黄大片一级毛片视频 | 国产成人精品日本亚洲网址 | 亚洲精品中文一区不卡 | 自拍视频网 | 能看毛片的网址 | 欧美一级大片在线观看 | 成人午夜亚洲影视在线观看 | 高清一区二区在线观看 | 黑人巨大videos极度另类 | 亚洲国产精品一区二区不卡 | 一区在线观看 | 在线播放高清国语自产拍免费 | 最新欧美精品一区二区三区不卡 |