简体   繁体   English

圆锥和线相交的Graphics3D改进

[英]Graphics3D refinement for intersection of cone and line

Encouraged by this question , I dare to ask something similar. 这个问题的鼓励,我敢问类似的问题。

I am trying to plot with mathematica a cone which is intersected by a line. 我正在尝试用mathematica绘制一条由一条线相交的圆锥。 The start point of the line is on the lateral surface of the cone and its endpoint inside of the cone. 线的起点在圆锥的侧面及其端点在圆锥内部。 As long as the endpoint of the line is far away from the tip of the cone, everything looks quite nice (use eg endpointOfLine = 0.007 in my example). 只要直线的端点远离圆锥体的尖端,一切看起来就很好(例如在我的示例中使用endpointOfLine = 0.007)。 But if the endpoint approaches the tip (endpointOfLine < 0.007 in my example), it seems that a big part of the line would be on the surface of the cone. 但是,如果端点接近尖端(在我的示例中,endpointOfLine <0.007),则似乎线的很大一部分将位于圆锥体的表面上。 Sure, for endpoint values which are very close to the cone tip, the line is almost parallel to the surface so that this effect has probably to appear. 当然,对于非常靠近圆锥体尖端的端点值,该线几乎与曲面平行,因此可能必须出现这种效果。 But the effect appears also if the endpoint is not so close to cone tip. 但是,如果端点距离锥尖不太近,也会出现这种效果。

Here the example: 这里的例子:

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

Is there any way to reduce this effect? 有什么办法可以减少这种影响? Increasing the PlotPoints to 60 has reduced the effect a bit, but I would be happy if I could reduce it more. 将PlotPoints增加到60会稍微降低效果,但是如果我可以进一步降低效果,我会很高兴。 Any ideas? 有任何想法吗?

Try to place the endpoint at the base of the cone close but not on the radius like: 尝试将端点靠近圆锥体的底部放置,但不要放置在半径上,例如:

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

在此处输入图片说明

I feel this is not a problem fundamentally different from the one you were referring to. 我觉得这与您所指的问题根本没有不同。

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

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