Filtering entries by size

Chris Smith
5/10/2019 1:19 AM

Hi All,

I'm having an issue where, when we render a PNG from a DxfModel, a significant proportion of the time taken is in rendering text.

It seems the problem is that one of the blocks that is inserted several hundred times has various attributes on it and rendering the attributes is the issue.

In this particular case the PNG is fairly small (256 x 256) and view is quite zoomed out so the attributes are minuscule and can't actually be seen anyway.

Can anyone suggest how we might be able to detect that attributes will not be visible and delete them / make them invisible?

We know the bounds of the "world" coordinates and of the "view" and the size of the png up front however various scale factors and etc may change the size of the blocks / attributes.

My thought was to construct the DxfModel with everything in it and then run a pass just before we turn it into a PNG to filter out anything that won't be visible but I guess I would need some method I can call against each attribute to determine what its extent would be. Or even better to ask what its pixel size would be in a given view.

Any help would be great!


5/10/2019 5:26 PM

Hi Chris,

It's indeed a shortcoming of the current rendering pipeline. I need to work on a more sophisticated one to handle this, but it'll be quite a bit of work. I will start on it this month, but I don't expect it to be finished any time soon.

- Wout