I'm experiencing some strange behavior when using Export and Printout3D on the entire object created below. Exporting each part individually or using Printout3D work just fine. Also, for some reason it appears that the initial cylinder has a flaw of some kind since I get an error saying the model needs repaired and automatic repairing deletes just those two initial cylinders. The annulus code was taken from Thick annulus (ring) in 3D.
Here's the code:
r = .1;(* cylinder diameter *)
\[Phi] = 30; (* angle of cylinders to xy-plane *)
S = 4; (* 1/2 length of dynamic line *)
Subscript[x, o] = .5;(* x translation *)
Subscript[y, o] = .5;(* y translation *)
a = Sqrt[Subscript[x, o]^2 + Subscript[y, o]^2]; (* vertices *)
numsticks = 10; (* half the number of cylinders *)
(* this makes the ruled surface of the hyperboloid *)
frameL = {Blue, Cylinder[{{0, 0 , -S}, {0 , 0 , S}}, r]};
frameR = {Red, Cylinder[{{0, 0 , S}, {0 , 0 , -S}}, r]};
frameRT = Table[Rotate[Rotate[
Translate[frameR, {Subscript[x, o], Subscript[y, o],
0}], (180 - \[Phi]) Degree, {1, 1, 0}], (180 - ra) Degree , {0,
0, 1} , {0, 0, 0}], {ra, 0, 360, 360/numsticks}];
frameLT = Table[Rotate[Rotate[
Translate[frameL, {Subscript[x, o], Subscript[y, o],
0}], \[Phi] Degree, {1, 1, 0}],
ra Degree , {0, 0, 1} , {0, 0, 0}], {ra, 0, 360, 360/numsticks}];
(* this generates the top and bottom annulus *)
tup = TranslationTransform[{0, 0, .98 S*Cos[\[Phi] Degree]}];
tdwn = TranslationTransform[{0, 0, -1.02 S*Cos[\[Phi] Degree]}];
annulus =
With[{c = {0, 0}, r1 = 1.9, r2 = 2.25, h = 0.2},
RegionProduct[BoundaryDiscretizeRegion[Annulus[c, {r1, r2}]],
MeshRegion[{{0}, {h}}, Line[{1, 2}]]]];
annulus1 = tdwn[annulus];
annulus2 = tup[annulus];
(* final outputs *)
sticks = Graphics3D[{frameRT, frameLT}];
output = Show[sticks, annulus1, annulus2]
Both of the following result in an STL file containing only the cylinders (with a model error that deletes the initial cylinders upon success). If I ignore the errors, the STL file slices properly.
Export["output.stl",output]
Printout3D[output]
However, this is successful (also with the model error).
Map[Printout3D,{sticks,annulus1,annulus2}]
Perhaps there is a more efficient way to get the same object.
Why can't I get the entire model out at the same time? How can I fix the model error?
BooleanRegion
which is inside anyRegionProduct
and similar functions. You can also make annulus asRegionDifference[Cylinder[{{x,y,z},{X,Y,Z}},R1],Cylinder[{{x,y,z},{X,Y,Z}},R2]]
, where R2<R1. $\endgroup$Region[...]
or the same as you did byShow[...]
$\endgroup$