不連続チューブの視覚化



Discontinuous Tube Visualization



解決:

アップデート: あなたはあなたの機能を使うことができますTRとRegionFunction:

a = 2; h = 0.4 a; thmax = 10; ParametricPlot3D [{a Cos [th]、Sin [th]、h th /(2 Pi)}、{th、0、thmax}、PlotStyle-> {Red、Tube [.2]}、Axes-> False、ボックス化-> False、PlotRange-> All、RegionFunction->(TR [#4] == .2&)]

ここに画像の説明を入力してください



または、ConditionalExpression(または区分的)の最初の引数を変更するにはParametricPlot3D:

ParametricPlot3D [ConditionalExpression [{a Cos [th]、a Sin [th]、h th /(2 Pi)}、TR [th] ==。2]、{th、0、thmax}、PlotStyle-> {Red、 Tube [.2]}、Axes-> False、Boxed-> False、PlotRange-> All] 

同じ写真



元の答え:

使用するMeshFunctions +メッシュ+MeshShading:

n = 1000; ParametricPlot3D [{Cos [th]、Sin [th]、th / 5}、{th、0、thmax}、PlotStyle-> Yellow、Axes-> False、Boxed-> False、PlotRange-> All、BaseStyle-> Directive [CapForm ['Butt']、JoinForm ['Round']]、MeshFunctions-> {#4&}、Mesh-> {Subdivide [0、thmax、n]}、MeshStyle-> Opacity [0]、MeshShading-> {赤、なし}] /。行->(チューブ[#、。 18]&)

ここに画像の説明を入力してください



きちんとした例:

の組み合わせで遊ぶCapForm ['Butt'] /CapForm [なし]およびMeshShading-> {赤、なし} /MeshShading-> Dynamic @ {RandomColor []、None}は、次のような優れた効果を取得します。

ここに画像の説明を入力してください

n = 500、置換ルールを次のように変更します

行->(Dynamic [Tube [#、RandomReal [{。05、.3}]]]&)

チューブの半径をランダムにして、次のような効果を得るには:

ここに画像の説明を入力してください

ノート: MichaelE2は、バージョン12で、上記のコードがこのような丸いキャップを持つチューブセグメントを生成することに気づきました。

変化MeshShading to

MeshShading-> {不透明度[.99999、赤]、なし}

または後処理ルールをに変更します

{行->(チューブ[#、。 18]&)、r_RGBColor:>不透明度[.999、r]}

またはに

Line->(Tube [#、. 18]&/ @ Partition [#、2、1]&)

この問題を修正します(理由/方法はわかりませんが)。おそらく、このq / aで報告された問題は、v10.2で修正されるはずです。

さらに別の修正は、オプションを追加することです

メソッド-> {'TubePoints'-> 50}

ParametricPlot3D。


あなたがもっと追加すればそれは私のために働きますPlotPointsand letMaxRecursionwild

ParametricPlot3D [{Cos [th]、Sin [th]、th / 5}、{th、0、thmax}、PlotStyle-> {Red、Tube [TR [th]]}、Axes-> False、Boxed-> False 、PlotRange-> All、PlotPoints-> 5000、MaxRecursion-> Infinity]

ここに画像の説明を入力してください

ここに画像の説明を入力してください