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

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

詳解python polyscope庫的安裝和例程

瀏覽:10日期: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极品视频 | 在线日韩一区 | 日韩欧美特级毛片 | 国产成人精品日本亚洲专一区 | 欧美毛片a级毛片免费观 | 中文字幕国产在线 | 一级片免费网址 | 特黄毛片| 人妖另类xx00视频 | 农村寡妇一级毛片免费播放 | 久青草免费视频手机在线观看 | 国产乱码一区二区三区四区 | 一级毛片影院 | 久久草在线 | 国产高清美女一级a毛片久久w | 国产午夜毛片一区二区三区 | 亚洲日韩视频免费观看 | 久久精品免观看国产成人 | 日本wwwwwxxxxx| 精子网久久国产精品 | 日本无卡码免费一区二区三区 | 亚洲视频在线不卡 | 2021国产精品一区二区在线 | 国产欧美日韩不卡一区二区三区 | 国产免费精彩视频 | 中文字幕欧美日韩一 | 在线播放一区 | 免黄网站 | julia一区二区三区中文字幕 | 欧美一区二区三区在线观看 | 免费看一级毛片 | 在线亚洲欧美日韩 | 久久爱影视i | 网红主播vip福利视频 | 成年女人a毛片免费视频 | 综合色综合 | 国产乱码精品一区二区三区卡 | 性a爱片免费视频性 |