How to efficiently draw a large number of points?

We currently use TextDot, but there are performance issues, we probably need to display thousands of dots.

  1. Do not need to appear as a spherical point
  2. Need this point to control size and color
  3. The point should appear as a circle, but set it to always face the camera so it looks like a sphere
  4. This point can be used as a Grip point (can not be)

Is there currently such a class that can fulfill this requirement?

Well, it does seem like blank text dots are the best solution… what display problems are you having?

Otherwise, if you don’t need to move the points relative to each other, maybe a pointcloud with a custom display mode with a larger point size. Don’t know if that would display better though.

Using TextDot will cause the mouse to freeze very much when rotating, similar to the effect of losing keyframes when playing online games.
Probably PointCloud would be a better choice, however, I didn’t find a way to specify the size of the Point

I would suggest to use PointClouds. In the Options menu, you can specify the appearance of a PointCloud (size,shape etc.). PointClouds are designed for this. I am not sure, if you can construct a pointCloud within native Rhino, but you could use Grasshopper for this kind of things.

Greetings,
Bumaye

I got curious about this so I did a couple of experiments. First I made a normal dot with just “0” as the text and a height of 50 (I guess that’s pixels?) then arrayed that 100 x 100 to have 10K dots. That tumbles crazy fast on my machine (OK, I have an RTX 3060 with 12Gb). And no matter if I changed the text from “0” to “Hello Rhino”, or to “.”, it was just as fast.

I then made the same test using a blank dot. That completely killed the display; even only 1000 blank dots was very slow, it only worked reasonably up to about 400 or so.

My conclusion is that Rhino is doing something odd display-wise with ‘blank’ dots that it does not do with text dots that contain text. The dot size doesn’t seem to matter in this case either.

@jeff @stevebaer any comments on this rather funny outcome?

There are DisplayPipeline methods in RhinoCommon to draw a PointCloud with specific sized points, but that requires fairly advanced programming. Otherwise, it’s easy enough to create a custom display mode that has the point size you want and invoke it when it’s needed. Note however that different from text dots, points in a pointcloud will change display size when you zoom in and out, whereas dots do not.

Not true.

Yes, of course, sorry for the incorrect info - don’t know why that popped into my head at that moment…

When a great expert makes harmless mistake, everyone laughs, including the expert. :rofl: :crazy_face:

what about a custom display-mode ?

more a workaround but might suit.
set pointstyle / size for points or pointclouds
?

Hi Mitch -

Thanks - I’ve put this on the list as RH-68135.
-wim

Yep, just an oversight on my part. I just pushed a fix for this so performance should improve with empty text dots in the next Rhino 7 service release.

Hi Ken - if it works with your workflow to use pointclouds, that would help. You can even play with testPointCloudStyle which may ort may not be useful here.

-Pascal

:+1:

PointCloud solves the problem to a certain extent, however, we still have some needs

  1. We hope that the size of the point is relative size, which can become smaller according to the distance of the lens
  2. We want to be able to decide the size of some points according to the needs, not every point has the same size

Currently TextDot almost perfectly meets the needs, except for performance issues and the second point mentioned above.
It’s true that if I randomly display some characters on the TextDot, the performance problem disappears, but we still hope to provide a solution to this problem.

var perspectiveView = RhinoDoc.ActiveDoc.Views.Find("Perspective", true);
            if (perspectiveView != null)
            {
                perspectiveView.DisplayPipeline.DisplayPipelineAttributes.PointRadius = 60;
                perspectiveView.DisplayPipeline.DisplayPipelineAttributes.PointStyle = PointStyle.Heart;
            }

Why is this code modified successfully but the UI in Rhino settings has not changed, and the size of the rendered point has not changed?

RH-68135 is fixed in Rhino 7 Service Release 18