compas-dev / compas-dev/compas_viewer
PointClouds present in scene but not showing up
- Dominant language
- Python
- Stars
- 12
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
I tried to visualize a point cloud in compas_viewer 2.0.1, but the point cloud did not show up, even though it is present in the list of object tab.
**To Reproduce**
Steps to reproduce the behavior:
using compas_viewer 2.0.1 and python 3.9, run the following script:
```py
from compas.colors import Color
from compas.geometry import Pointcloud
from compas_viewer import Viewer
viewer = Viewer()
pointcloud = Pointcloud.from_bounds(10, 10, 10, 10)
viewer.scene.add(pointcloud, pointcolor=Color(1.0,0.0,0.0), pointsize=10)
viewer.show()
```
**Expected behavior**
you should get a scene with no point cloud but a point cloud in the geometry table:
If you bump down the version of compas_viewer to 1.3.2, it does show up:
**Desktop (please complete the following information):**
- OS: Fedora 43
- Python version: 3.9
- Python package manager: uv
I compared the versions 1.3.2 and 1.4.0 (when the visualisation was broken) and I saw that the model.frag in compas_viewer.renderer.shaders had a suspicious `if` statement:
```frag
// Draw circular points
if (element_type == 0) {
vec2 center = gl_PointCoord - vec2(0.5);
if (length(center) > 0.5) {
discard;
}
```
sure enough, when simply deleting it, the point cloud did show up (with square points...) :
## Next step
I started using compas_viewer yesterday so I am not familiar with how it works yet (especially the opengl & qt side of things) so maybe I won't make a PR immediately to fix this, unless you tell me the exact nail to hit, then I'll gladly do it ;)
Contributor guide
Assessment
This issue has not been assessed yet.