怎样避免边界出现锯齿,又不至于采样太多点
mathematica吧
全部回复
仅看楼主
level 6
冉qx 楼主
\[ScriptCapitalD] = 2000.;
r = \[ScriptCapitalD]/2;
rc = 271.;
idealSurface =
Plot3D[(x^2 + y^2)/(4 f), {x, -r, r}, {y, -r, r},
RegionFunction -> (
#1^2 + #
2^2 <= r^2 &), BoxRatios -> Automatic,
Boxed -> False, Axes -> False, Mesh -> None,
PlotStyle -> {Green, Opacity[0.2]}(*,PlotPoints\[Rule]100*)]
如图,边界出现了锯齿,这是采样点不足造成的。每个方向采样一百个点可以避免这种情况,但又太耗资源。
怎样才能解决这个问题?
2021年08月13日 10点08分 1
吧务
level 15
1. rc的定义呢?
2. 直接上新增的区域语法就行,提前把区域离散化还能再快点:
region = ImplicitRegion[
#1^2 + #
2^2 <= r^2 &[x, y], {x, y}]// DiscretizeRegion(* ToElementMesh 应该也可以用,具体效率我没仔细比 *)
Plot3D[(x^2 + y^2)/(4 f), {x, y} \[Element] region, BoxRatios -> Automatic,
Boxed -> False, Axes -> False, Mesh -> None,
PlotStyle -> {Green, Opacity[0.2]}(*,PlotPoints\[Rule]100*)]
2021年09月04日 02点09分 2
1