Hi,
I'm having problems with generating the union of several cylinders. I create the cylinders with this code
pVec1 = {5., 0, 0};
pVec2 = 0.4 pVec1 + {0, 5., 0};
pVec3 = 0.4 (pVec2 + pVec1)/2 + {0, 0, 5.};
{posA, posB, posC} = {{0, 0, 0}, {-2., 4., 0},
RotationMatrix[-\[Pi]/2, pVec2] . {-2., 4., 0}};
len=1.; width = .2;
{upVec1, upVec2, upVec3} = Normalize@# & /@ {pVec1, pVec2, pVec3};
cylinders = {
Cylinder[{posB + pVec1 - len upVec1, posB + pVec1 + len upVec1},
width],
Cylinder[{posB - len upVec1, posB + len upVec1}, width],
Cylinder[{posA + pVec2 - len upVec2, posA + pVec2 + len upVec2},
width],
Cylinder[{posA - len upVec2, posA + len upVec2}, width],
Cylinder[{posC + pVec3 - len upVec3, posC + pVec3 + len upVec3},
width],
Cylinder[{posC - len upVec3, posC + len upVec3}, width]}
Which gives the expected shape if you run the following code:
Graphics3D[cylinders]
However, if I generate the union of the same cylinders, I get the following
Region[RegionUnion @@ cylinders]
The region is cropped. Any insight on this?
If I use just a subset of the cylinders (up to 3 or 4) I don't get the problem.
Thanks in advance, Marcelo