Skip to content

PointClouds present in scene but not showing up #229

@DamienGilliard

Description

@DamienGilliard

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:

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:

Image

If you bump down the version of compas_viewer to 1.3.2, it does show up:

Image

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:

    // 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...) :

Image

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 ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions