nmwsharp / nmwsharp/polyscope

Issue with running on Google Colab

未关闭
#82 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C++
星标
2.2k
派生
242
平均合并
11 分钟
30 天内合并 PR
1

描述

Hi there.
I'm trying to use polyscope on Google Colab, but after installing with pip and running the following code:


import polyscope as ps

# Initialize polyscope
ps.init()

### Register a point cloud
# `my_points` is a Nx3 numpy array
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 list
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 face
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 UI
ps.show()

I just get the following error:


---------------------------------------------------------------------------

RuntimeError                              Traceback (most recent call last)

<ipython-input-36-bdac230fc77e> in <module>()
      2 
      3 # Initialize polyscope
----> 4 ps.init()
      5 
      6 ### Register a point cloud

/usr/local/lib/python3.6/dist-packages/polyscope/core.py in init(backend)
     10     cwd_before = os.getcwd() # see note below
     11 
---> 12     psb.init(backend)
     13 
     14     # NOTE: For some reason I do not understand, calling psb.init() changes the working directory, causing e.g. writes to relative file paths to write to unexpected locations afterwards.

RuntimeError: [polyscope] ERROR: Failed to initialize glfw

Any idea why is this happening?

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 polyscope/core.py 中的 init() 开始,然后跟踪报告“Failed to initialize glfw.”的 backend 初始化过程。在 Google Colab 中重现最小的 ps.init() 调用,并确定这是一个可修复的初始化问题,还是一个不受支持的环境;当该行为得到解决或该限制得到明确记录时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp, python
领域
cloud, computer-graphics
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。