绘制2D隐标量场的异行 [英] Drawing an iso line of a 2D implicit scalar field

查看:219
本文介绍了绘制2D隐标量场的异行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在2D定义一个隐含的标量场,在2D的每一个点,我可以让它计算出一个精确的标值,但它是一个比较复杂的计算。
我想画一个异行面,说0值的行。函数本身是连续的,但在0异线可以具有多个连续实例,它不能保证所有的人都连接。
计算每个像素的值是不是一种选择,因为这将花费太多的时间 - 在几秒钟的次序,这需要是作为实时尽可能

I have an implicit scalar field defined in 2D, for every point in 2D I can make it compute an exact scalar value but its a somewhat complex computation.
I would like to draw an iso-line of that surface, say the line of the '0' value. The function itself is continuous but the '0' iso-line can have multiple continuous instances and it is not guaranteed that all of them are connected.
Calculating the value for each pixel is not an option because that would take too much time - in the order of a few seconds and this needs to be as real time as possible.

什么我目前使用的是一种空间递归划分,可以被看作是一种四树。我乘坐空间的初始,很粗的采样,如果我发现其中包含从正到负的值转换为正方形,我递归地将其划分为4个小方格,并再次检查,停在像素级别。正负转换是通过在其4个角进行取样sqaure检测。 这项工作相当不错,除非它没有。其有时绘制的异线得到削减因为过渡检测失败的跃迁而发生在边缘的一个小区域,并且不跨越一个正方形的角

What I'm currently using is a recursive division of space which can be thought of as a kind of quad-tree. I take an initial, very coarse sampling of the space and if I find a square which contains a transition from positive to negative values, I recursively divide it to 4 smaller squares and checks again, stopping at the pixel level. The positive-negative transition is detected by sampling a sqaure in its 4 corners. This work fairly well, except when it doesn't. The iso-lines which are drawn sometimes get cut because the transition detection fails for transitions which happen in a small area of an edge and that don't cross a corner of a square.

有没有更好的办法做到异线在此设置绘图?

Is there a better way to do iso-line drawing in this settings?

推荐答案

我已经有很多成功的在这里描述的算法<一href="http://web.archive.org/web/20140718130446/http://members.bellatlantic.net/~vze2vrva/thesis.html" rel="nofollow">http://web.archive.org/web/20140718130446/http://members.bellatlantic.net/~vze2vrva/thesis.html 其中讨论了自适应轮廓(类似于你描述),也有一些其他的问题,与一般的轮廓绘制。

I've had a lot of success with the algorithms described here http://web.archive.org/web/20140718130446/http://members.bellatlantic.net/~vze2vrva/thesis.html which discuss adaptive contouring (similar to that which you describe), and also some other issues with contour plotting in general.

有保证查找函数的所有轮廓,而不看每个像素没有一般的方式。有可能是一个非常小的封闭轮廓,其中只有约一个象素的尺寸,其中该函数是正的,在一个区域中的功能是通常负区域。除非你品尝精细不够,你把样品正值区域里面,有知道它的存在不一般的方式。

There is no general way to guarantee finding all the contours of a function, without looking at every pixel. There could be a very small closed contour, where a region only about the size of a pixel where the function is positive, in a region where the function is generally negative. Unless you sample finely enough that you place a sample inside the positive region, there is no general way of knowing that it is there.

如果你的函数是光滑的话,你也许能猜出这么小的封闭轮廓撒谎,因为函数的系数变小,他们周围的区域。采样然后可以在精制仅这些区域。

If your function is smooth enough, you may be able to guess where such small closed contours lie, because the modulus of the function gets small in a region surrounding them. The sampling could then be refined in these regions only.

这篇关于绘制2D隐标量场的异行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆