锥体与线相交的 Graphics3D 细化

发布于 2024-12-17 19:58:34 字数 1323 浏览 3 评论 0原文

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

我正在尝试用 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 会稍微降低效果,但如果可以减少更多,我会很高兴。有什么想法吗?

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. 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 e.g. endpointOfLine = 0.007 in my example). 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.
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. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

摘星┃星的人 2024-12-24 19:58:34

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

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

在此处输入图像描述

我觉得这样这与您所提到的问题没有根本上的不同。

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}
  ];

enter image description here

I feel this is not a problem fundamentally different from the one you were referring to.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文