simitin kontrol ağı

Oct 27 2020

Bir simitin tam kontrol ağını yapmak istiyorum. Ancak ağ kapanmadı. Bu sorunu kimse çözebilir mi?

pts6 = Table[{(2 + 1 Cos [s])*Cos [t], (2 + 1 Cos [s])*Sin[t], 1 Sin[s]},
  {s, -Pi, Pi}, {t, -Pi, Pi}];
f = BSplineFunction[pts6, SplineClosed -> {True, True}];
Show[
  Graphics3D[{PointSize[Large], Black, Map[Point, pts6]}],
  Graphics3D[{Gray, Line[pts6], Gray, Line[Transpose[pts6]]}],
  ParametricPlot3D[f[s, t], {s, 0, 1}, {t, 0, 1}, AxesLabel -> Automatic]]

] 1

Yanıtlar

2 creidhne Nov 04 2020 at 00:27

Ulrich'in çözümü soruyu tam olarak yanıtlıyor, ancak oluşturduğu yüzeyde bir sorun var BSpliceFunction. Yüzeyin simit olmadığına ve iç yarıçapta bir kırılma olduğuna dikkat edin (düz olması gereken keskin bir gölge vardır). Kullanım pts6Ulrich'in çözeltisinden ve fsorudan.

pts6 = Table[{(2 + Cos[t])*Cos[s], (2 + Cos[t])*Sin[s], Sin[t]}, {s, 
    Subdivide[-Pi, Pi, 6]}, {t, Subdivide[-Pi, Pi, 6]}];
f = BSplineFunction[pts6, SplineClosed -> {True, True}];
g1 = Show[Graphics3D[{PointSize[Large], Black, Map[Point, pts6]}],
  Graphics3D[{Thick, Gray, Line[pts6], Line[Transpose[pts6]]}],
  ParametricPlot3D[f[s, t], {s, 0, 1}, {t, 0, 1}]]

Yukarıdan görünüm, ağın eşit olmayan aralıklarla yerleştirildiğini ve yüzeyin simit olmadığını göstermektedir. Kesit dairesel değildir.

ParametricPlot3D[f[s, t], {s, 0, 1}, {t, 0, 1}, 
  ViewPoint -> {0, 0, \[Infinity]}, 
  PlotLabel -> "non-toroidal surface"]

ParametricPlot3D[f[s, t], {s, 0, 1}, {t, 0, 1},
 RegionFunction -> Function[{x, y, z, u, v}, 0 <= y <= 2],
 BoundaryStyle -> Black, Axes -> True, 
 PlotLabel -> "non-circular cross-section"]

Seçeneğini BSplineFunctionile birlikte kullandığımızda SplineClosedkontrol noktaları kapatılmamalıdır. BSpineFunctionsınırları birleştirerek yüzeyi tamamlar. f2Gereksiz uç noktaları kaldıracak şekilde spline işlevini yeniden tanımlayarak sorunu çözün. Sonuç bir simittir.

f2 = BSplineFunction[Most[pts6][[All, ;; -2]], SplineClosed -> {True, True}];
ParametricPlot3D[f2[s, t], {s, 0, 1}, {t, 0, 1}, ViewPoint -> {0, 0, \[Infinity]}

Orijinal grafiğe kıyasla simit ile kontrol noktalarının düzeltilmiş görünümü burada.

g2 = Show[Graphics3D[{PointSize[Large], Black, Map[Point, Most@pts6]}],
  Graphics3D[{Thick, Gray, Line[pts6], Line[Transpose[pts6]]}],
  ParametricPlot3D[f2[s, t], {s, 0, 1}, {t, 0, 1}]]

1 UlrichNeumann Oct 27 2020 at 18:08

Kontrol noktalarının tanımı yanlış. {s,-Pi,Pi}Tablekısım {_pi,-Pi+1,-Pi+2,...}, son noktayı içermeyen bir s-grid oluşturur Pi.

Kontrol noktalarını yeniden tanımlayın

pts6 = Table[{(2 + 1 Cos[s])*Cos[t], (2 + 1 Cos[s])*Sin[t],1 Sin[s]}, {s, Subdivide[-Pi, Pi, 10]}, {t,Subdivide[-Pi, Pi, 10]}]