13

EDIT

Bug still present in version 13.0 when number of coordinates is large. See answer below by kglr.

Original Post

I am using version 10 to draw tubes. With the CapForm set as Butt the first pipe is as expected but the bent pipe has one rounded end. Is this a bug? How can I fix this? Thanks

Graphics3D[{CapForm["Butt"], Tube[{{0, 0, 0}, {1000, 0, 0}}, 30], 
Tube[{{0, 300, 0}, {1000, 300, 0}, {1000, 300, 100}}, 30]}, 
 Boxed -> False, PlotRange -> All]

Mathematica graphics

kglr
  • 394,356
  • 18
  • 477
  • 896
Hugh
  • 16,387
  • 3
  • 31
  • 83
  • Looks like a bug, it's not there in V9. I suggest you contact support. – Sjoerd C. de Vries Sep 25 '14 at 16:58
  • I get a rounded end on a straight, segmented tube, too: Tube[{{0, 0, 0}, {800, 0, 0}, {1000, 0, 0}}, 30] – Michael E2 Sep 25 '14 at 17:01
  • In version 8 the ends are flat in both examples, too. So definitely a bug. – Jens Sep 25 '14 at 17:34
  • 1
    @Mr.Wizard Yes, it is/was in 10.0.0 (also last beta). – Michael E2 Oct 03 '14 at 20:29
  • gets worse: try Tube[Reverse@{{0, 300, 0}, {1000, 300, 0}, {1000, 300, 100}}, 30]. – kglr Oct 04 '14 at 01:19
  • @kguler Yes it does get worse -both ends rounded and the bend broken. I have not yet had a reply from Wolfram. – Hugh Oct 04 '14 at 09:25
  • Hugh, have received a response from WRI re this bug yet? Looks like it is still there in v12. – kglr Jul 21 '19 at 06:00
  • @kglr I have checked my email and have not had a response to say the bug is fixed. It is CASE:1665254. Shame it is back. – Hugh Jul 21 '19 at 17:38
  • Hugh, maybe we should remove "fixed in version .."? – kglr Jul 21 '19 at 17:50
  • @kglr I have tried my original problem in V12. It worked correctly. I was also able to check it in V11.2 where it worked correctly. I can't check older versions. Are we sure this is the problem? – Hugh Jul 21 '19 at 19:17
  • Hugh, there is no problem with the example in your question. But with more points in the first argument of Tube the issue comes back. Try for example coords1 or coords2 in my answer. – kglr Jul 21 '19 at 19:24
  • @kglr Just tried it. Yes you are correct. The problem returns. Shall I reset the bug statement? Not done this before do we record this elsewhere? – Hugh Jul 21 '19 at 19:31
  • I think just removing the first line in the post would suffice. – kglr Jul 21 '19 at 19:40

2 Answers2

4

Fixed in 10.0.2 . On windows 7, 64 bits

Mathematica graphics

Graphics3D[{CapForm["Butt"], Tube[{{0, 0, 0}, {1000, 0, 0}}, 30], 
 Tube[{{0, 300, 0}, {1000, 300, 0}, {1000, 300, 100}}, 30]}, 
 Boxed -> False, PlotRange -> All]

Mathematica graphics

Nasser
  • 143,286
  • 11
  • 154
  • 359
2

Looks like the issue is still there as of version 13.

For example, adding more points in the example in OP:

coords1 = Table[{i, 0, 0}, {i, 0, 1000, 20}];
coords2 = Join[Table[{i, 400, 0}, {i, 0, 1000, 20}], 
    Table[{1000, 400, i}, {i, 0, 200, 10}]];

$Version

"12.0.0 for Linux x86 (64-bit) (April 7, 2019)"

Graphics3D[{CapForm["Butt"], Red, Tube[coords1, 100], 
  Blue, Tube[coords2, 100]},  Boxed -> False]

enter image description here

A work-around (no idea why/how it works) is to add the directive Opacity[.9999]:

Graphics3D[{Opacity[.9999], CapForm["Butt"], Red, Tube[coords1, 100], 
  Blue, Tube[coords2, 100]},  Boxed -> False]

enter image description here

Note: Bumped into this issue and the mysterious work-around while answering this question.

Update: Much less mysterious workaround: set a large enough value for the Method supoption "TubePoints":

Graphics3D[{CapForm["Butt"], Red, Tube[coords1,100], Blue, Tube[coords2, 100]},  
   Boxed -> False, 
   Method -> {"TubePoints" -> 50}]

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896