openmc-dev / plotter

Native plotting GUI for model design and verification
MIT License
43 stars 17 forks source link

Allow adding surface number labels to plot #145

Open MicahGale opened 3 weeks ago

MicahGale commented 3 weeks ago

Sometimes it's useful to see which surface is which and enabling the surface IDs to be printed can help this.

Has this been considered before and rejected? Basically, am I too MCNP-brained right now?

paulromano commented 3 weeks ago

That would be a really nice feature. It's never been rejected but it would be rather complicated to implement given that we generate plots via rasterization (picking a bunch of points and doing "find cell").

shimwell commented 3 weeks ago

Would this have to involve some Ray firing from one of the perimeter edges of the plotted area across the plot? The distance to each surface could be calculated and then we would have the information for the location of the surfaces on the raster plot.

I guess the surface distance cpp methods don't have a python binding.

| ---------x---‐---------------x---------> | ------------x‐----------x--------------> | ------------‐-----x-------------------> | ------------‐-x-----------------------> | ----------x--‐------------------------> | ------x------‐------------------------> | ---x---------‐------------------------> | ------------‐------------------------> | ------------‐------------------------>

MicahGale commented 3 weeks ago

Which if I understand correctly that's how MCNP implements their plotter. This be a significant change to the rendering engine. I think for now I want to keep this open to discuss how this could one day be implemented.

One thought I had: there is support for drawing the outline. I was wondering: if you change the surface equations to be a parametric form could you do a find the intersection of the surfaces in the region with the outline and identify them that way? It would be a bit more complicated. But overall I think this might be easier to implement in @gridley's work.

pshriwise commented 2 weeks ago

That's how I understand it as well, @MicahGale, the MCNP plots are ray traced along each pixel row. And, were we to ray trace the pixel rows, that's how I'd prefer to do the outline, yes. The way we do it now is a little hacky, but effective. I was thinking that @gridley's work would be useful here as well (both in changing between plotting modes and to provide 3D renderings of models).