13
$\begingroup$

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

$\endgroup$
13
  • $\begingroup$ Looks like a bug, it's not there in V9. I suggest you contact support. $\endgroup$ Sep 25, 2014 at 16:58
  • $\begingroup$ I get a rounded end on a straight, segmented tube, too: Tube[{{0, 0, 0}, {800, 0, 0}, {1000, 0, 0}}, 30] $\endgroup$
    – Michael E2
    Sep 25, 2014 at 17:01
  • $\begingroup$ In version 8 the ends are flat in both examples, too. So definitely a bug. $\endgroup$
    – Jens
    Sep 25, 2014 at 17:34
  • 1
    $\begingroup$ @Mr.Wizard Yes, it is/was in 10.0.0 (also last beta). $\endgroup$
    – Michael E2
    Oct 3, 2014 at 20:29
  • $\begingroup$ gets worse: try Tube[Reverse@{{0, 300, 0}, {1000, 300, 0}, {1000, 300, 100}}, 30]. $\endgroup$
    – kglr
    Oct 4, 2014 at 1:19

2 Answers 2

4
$\begingroup$

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

$\endgroup$
2
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.