繁体   English   中英

圆锥和线相交的Graphics3D改进

[英]Graphics3D refinement for intersection of cone and line

这个问题的鼓励,我敢问类似的问题。

我正在尝试用mathematica绘制一条由一条线相交的圆锥。 线的起点在圆锥的侧面及其端点在圆锥内部。 只要直线的端点远离圆锥体的尖端,一切看起来就很好(例如在我的示例中使用endpointOfLine = 0.007)。 但是,如果端点接近尖端(在我的示例中,endpointOfLine <0.007),则似乎线的很大一部分将位于圆锥体的表面上。 当然,对于非常靠近圆锥体尖端的端点值,该线几乎与曲面平行,因此可能必须出现这种效果。 但是,如果端点距离锥尖不太近,也会出现这种效果。

这里的例子:

totalLength = 10^-2;(*length of the cone*)
theta = 17*10^-3;(*half opening angle of the cone*)
radius[theta_, l_] := Tan[theta]*l;(*radius of the cone as function of its length*)
endpointOfLine = 0.0015;(*endpoint of the test line, to be varied*)

testLine = Line[{{radius[theta, totalLength], 0, totalLength},{0, 0, endpointOfLine}}, 
                VertexColors -> {Orange, Orange}
           ];
Graphics3D[
  {
     {
       RevolutionPlot3D[{radius[theta, l], 0, l}, {l, 0, totalLength}, 
             Mesh -> None, 
             PlotStyle -> Directive[Opacity[0.5], Gray], 
             PlotPoints -> 60][[1]]
     }, 
     {testLine}
  }, 
  Boxed -> True,BoxRatios -> {1, 1, 3}, 
  Lighting -> None(*ugly, but makes the problem well visible*)
]

ConeAndLine

有什么办法可以减少这种影响? 将PlotPoints增加到60会稍微降低效果,但是如果我可以进一步降低效果,我会很高兴。 有任何想法吗?

尝试将端点靠近圆锥体的底部放置,但不要放置在半径上,例如:

testLine = 
  Line[{{0.97 radius[theta, totalLength], 0, totalLength}, {0, 0, endpointOfLine}}, 
      VertexColors -> {Orange, Orange}
  ];

在此处输入图片说明

我觉得这与您所指的问题根本没有不同。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM