I am using Cylinder
to produce wide flat disks (in Mathematica 8). This works just fine except that the circular base of such a cylinder turns out to be really just a 40-gon which is simply too coarse an approximation to a circle for what I have in mind. Is there a way to convince Mathematica to use say a 200-gon as a circular base for a cylinder?
Here is an example of the kind of picture that I am trying to create. Zoom in to see how coarse the cylinders' curved surfaces pan out.
Graphics3D[{Cylinder[{{0, 0, 0}, 0.0011 {0.`, 0.`, -0.9510565162951536`}}, .1],
Cylinder[{{0, 0, 0}, 0.0011 {0.`, 0.`, 0.9510565162951536`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.85065080835204`, 0.`, -0.42532540417601994`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.85065080835204`, 0.`, 0.42532540417601994`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.6881909602355868`, -0.5`, -0.42532540417601994`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.6881909602355868`, 0.5`, -0.42532540417601994`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.6881909602355868`, -0.5`, 0.42532540417601994`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.6881909602355868`, 0.5`, 0.42532540417601994`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.2628655560595668`, -0.8090169943749475`, \
-0.42532540417601994`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.2628655560595668`,
0.8090169943749475`, -0.42532540417601994`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.2628655560595668`, -0.8090169943749475`,
0.42532540417601994`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.2628655560595668`, 0.8090169943749475`,
0.42532540417601994`}}, .1],
Cylinder[{{0, 0, 0}, 0.0011 {0.`, 0.`, 0.`}}, .1],
Cylinder[{{0, 0, 0}, 0.0011 {0.`, 0.`, 1.`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.42532540417602`, 0.3090169943749474`,
0.8506508083520399`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.7236067977499789`, 0.5257311121191336`,
0.4472135954999579`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.16245984811645317`, 0.5`, 0.8506508083520399`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.2628655560595668`, 0.8090169943749473`,
0.5257311121191336`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.27639320225002106`, 0.8506508083520399`,
0.4472135954999579`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.42532540417602`, -0.3090169943749474`,
0.8506508083520399`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.7236067977499789`, -0.5257311121191336`,
0.4472135954999579`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.85065080835204`, 0.`, 0.5257311121191336`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.16245984811645317`, -0.5`, 0.8506508083520399`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.27639320225002106`, -0.8506508083520399`,
0.4472135954999579`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.2628655560595668`, -0.8090169943749473`,
0.5257311121191336`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.5257311121191336`, 0.`, 0.8506508083520399`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.8944271909999159`, 0.`, 0.4472135954999579`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.6881909602355868`, -0.5`, 0.5257311121191336`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.6881909602355868`, 0.5`, 0.5257311121191336`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.7236067977499789`, -0.5257311121191336`, \
-0.4472135954999579`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.42532540417602`, -0.3090169943749474`, \
-0.8506508083520399`}}, .1],
Cylinder[{{0, 0, 0}, 0.0011 {0.`, 0.`, -1.`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.2628655560595668`, -0.8090169943749473`, \
-0.5257311121191336`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.16245984811645317`, -0.5`, -0.8506508083520399`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.27639320225002106`, -0.8506508083520399`, \
-0.4472135954999579`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.7236067977499789`,
0.5257311121191336`, -0.4472135954999579`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.42532540417602`,
0.3090169943749474`, -0.8506508083520399`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.85065080835204`, 0.`, -0.5257311121191336`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.27639320225002106`,
0.8506508083520399`, -0.4472135954999579`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.16245984811645317`, 0.5`, -0.8506508083520399`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.2628655560595668`,
0.8090169943749473`, -0.5257311121191336`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.8944271909999159`, 0.`, -0.4472135954999579`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.5257311121191336`, 0.`, -0.8506508083520399`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.6881909602355868`, 0.5`, -0.5257311121191336`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.6881909602355868`, -0.5`, -0.5257311121191336`}}, .1],
Cylinder[{{0, 0, 0}, 0.0011 {0.`, 1.`, 0.`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.5877852522924731`, 0.8090169943749473`, 0.`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.9510565162951535`, 0.3090169943749474`, 0.`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.9510565162951535`, -0.3090169943749474`, 0.`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {-0.5877852522924731`, -0.8090169943749473`, 0.`}}, .1],
Cylinder[{{0, 0, 0}, 0.0011 {0.`, -1.`, 0.`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.5877852522924731`, -0.8090169943749473`, 0.`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.9510565162951535`, -0.3090169943749474`, 0.`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.9510565162951535`, 0.3090169943749474`, 0.`}}, .1],
Cylinder[{{0, 0, 0},
0.0011 {0.5877852522924731`, 0.8090169943749473`, 0.`}}, .1]}]
Answer
You can fix this problem by using the following Option in Graphics3D
:
Method -> {"CylinderPoints" -> {200, 1}}
Adjust 200
to match your requirements. (Indeed the default is 40
.)
Edit: I don't know exactly what the second parameter does, but using the single parameter form shown in the documentation linked below results in a big slow-down. I could guess that it is points in the other direction but that doesn't seem to make sense. Anyway I can't tell the visual difference between {200, 1}
and {200, 200}
but the former is much faster than the latter. ("CylinderPoints" -> 200
is apparently equivalent to "CylinderPoints" -> {200, 200}
.)
You can make the change permanent with the Option Inspector by changing this value in the Graphics3DBoxOptions
:
From Three-Dimensional Graphics Primitives:
Even though
Cone
,Cylinder
,Sphere
, andTube
produce high-quality renderings, their usage is scalable. A single image can contain thousands of these primitives. When rendering so many primitives, you can increase the efficiency of rendering by using special options to change the number of points used by default to renderCone
,Cylinder
,Sphere
, andTube
. The"ConePoints"
Method
option toGraphics3D
is used to reduce the rendering quality of each individual cone. Cylinder, sphere, and tube quality can be similarly adjusted using"CylinderPoints"
,"SpherePoints"
, and"TubePoints"
, respectively.
40 points:
200 points:
Comments
Post a Comment