> Also ich habe mir die Sache so vorgestellt, das ich mir im
> dreidimensionalen einen Stahlträger bestehend aus 2 Flanschblechen und
> einem Steg (Ausrundungsradien sind bestimmt zu schwer) darstelle. Zudem
> möchte ich diesen soweit variabel halten, dass ich dem Träger auch
> Verformungsfiguren zuweisen kann (z.B. Durchbiegungen oder Spannungen).
> Wichtig wäre mir auch, dass die gewählten Abmessungen des Querschnitts,
> insbesondere die Stirnflächen der Einzelbleche dargestellt werden. Ich
> muss gestehen, dass ich mich dem Vorhaben wohl hilflos übernommen habe.
Sowas kann man mit Mma schon zeichnen, fragt sich nur, ob
nicht andere Programm das mit weniger Aufwand hinkriegen.
Wie auch immer: man muß sich mit Graphics3D-Primitiven das
Objekt zusammenbasteln und verwendet dann Show, Display
oder Export, um es zu projizieren.
In einem Anfall von Besessenheit habe ich sowas mal für ein
Übungsblatt in der Mechanik programmiert. Code hängt an,
ist leider etwas komplex, habe jetzt aber keine Zeit, daraus
das Wesentliche zu extrahieren.
Gruß,
Thomas
<< Arrow3D.m
SetOptions[ Graphics3D,
LightSources -> {
{{1., 0., 1.}, RGBColor[1, 0, 0]},
{{1., 1., 1.}, RGBColor[0, 1, 0]},
{{0., 1., 1.}, RGBColor[0, 0, 1]},
{{-1., 0., 0.}, RGBColor[.8, .8, .4]}
}
]
R1[a_] = {{1, 0, 0}, {0, Cos[a], -Sin[a]}, {0, Sin[a], Cos[a]}}
R3[a_] = {{Cos[a], -Sin[a], 0}, {Sin[a], Cos[a], 0}, {0, 0, 1}}
Geodesic[theta_, phi_, {from_, to_, step_:Pi/50.}, r_:1.] :=
Block[ {a, stp = (to - from)/Round[(to - from)/step]},
Line[
Table[R3[phi] . R1[theta] . {r Cos[a], r Sin[a], 0},
{a, from, to, stp}]
]
]
Len[x_] := Sqrt[x . x]
AddArrows[ Line[{p1_, p2_, r___, q2_, q1_}], dir_ ] :=
{ SurfaceColor[RGBColor[0,0,0]],
Polygon[{p1, p1 + (p2 - p1) + .5 Len[p1 - p2] dir,
p1 + (p2 - p1) - .5 Len[p1 - p2] dir}],
Line[{p1, p2, r, q2, q1}],
Polygon[{q1, q1 + (q2 - q1) + .5 Len[q1 - q2] dir,
q1 + (q2 - q1) - .5 Len[q1 - q2] dir}] }
AddArrows[ vec_, {var_, from_, to_, step_:.03}, dir_ ] :=
AddArrows[
Line[{vec /. var -> from, vec /. var -> from + step,
vec /. var -> to - step, vec /. var -> to}], dir ]
Arc3D[p_, {from_, to_, step_:Pi/50.}, r_:1.] :=
Block[ {stp = (to - from)/Round[(to - from)/step]},
Line[Table[{r Cos[fi], r Sin[fi], 0} + p,
{fi, from - viewfi, to - viewfi, stp}]]
]
Circle3D[p_] :=
Sequence[
Arc3D[p, {-corr, Pi + corr}],
{inside, Arc3D[p, {Pi + corr, 2 Pi - corr}]} ]
PolarVector[theta_, fi_, r_:1.] :=
{r Cos[fi] Sin[theta], r Sin[fi] Sin[theta], r Cos[theta]}
CylVector[a_, h_, r_:1.] := {r Cos[a], r Sin[a], h}
xaxis = {1, 0, 0};
yaxis = {0, 1, 0};
zaxis = {0, 0, 1};
origin = {0, 0, 0};
fi = 60 Degree;
dfi = 15 Degree;
fi2 = fi + dfi;
theta = 40 Degree;
dtheta = 10 Degree;
theta2 = theta + dtheta;
r = .7;
dr = .2;
r2 = r + dr;
eps = Pi/70.
inside = GrayLevel[.6]
view = {1.6, 1.6, 1.}
viewr = Sqrt[view . view];
viewtheta = ArcCos[view[[3]]/viewr];
viewfi = ArcCos[view[[1]]/viewr/Sin[viewtheta]];
corr = -.1
pkugel = Graphics3D[
{
{inside, Geodesic[0, viewfi + Pi/2, {corr, Pi - corr}]},
Geodesic[0, viewfi + Pi/2, {Pi - corr, 2 Pi + corr}],
Geodesic[viewtheta, viewfi + Pi/2, {0, 2 Pi}, 1.015],
AddArrows[
Geodesic[0, 0, {eps, .97 fi, Pi/100.}, 1.05],
{0, 0, 1}],
Text["f", PolarVector[Pi/2 + .27, fi/2, .8]],
AddArrows[
Geodesic[0, 0, {fi, .965 fi2, Pi/100.}, 1.05],
{0, 0, 1}],
Text["df", PolarVector[Pi/2 + .33, fi + dfi/2 + .2, .8]],
AddArrows[
Geodesic[Pi/2, fi2, {Pi/2 - theta, Pi/2 - 2 eps, Pi/100.}, 1.05],
{-Sin[fi2], Cos[fi2], 0}],
Text["t", PolarVector[.7 theta, fi2 + .1, 1.1]],
AddArrows[
Geodesic[Pi/2, fi2,
{Pi/2 - theta2, Pi/2 - theta - eps/2., Pi/100.}, 1.05],
{-Sin[fi2], Cos[fi2], 0}],
Text["dt", PolarVector[theta + dtheta/2 + .05, fi2 + .12, 1.1]],
{ Thickness[.004],
{inside, Line[{origin, xaxis}]},
Arrow3D[xaxis, .3 xaxis],
Text["x", 1.4 xaxis],
{inside, Line[{origin, yaxis}]},
Arrow3D[yaxis, .3 yaxis],
Text["y", 1.4 yaxis],
Arrow3D[zaxis, .3 zaxis],
Text["z", 1.4 zaxis]
},
{inside,
Map[(# + {0, 0, r Cos[theta]}) &,
Geodesic[0, viewfi + Pi/2, {0, 2 Pi}, r Sin[theta]],
{2}]},
AddArrows[
{Cos[-viewfi] x, Sin[-viewfi] x, r Cos[theta]},
{x, .015, .97 r Sin[theta], .035},
{0, 0, 1}],
Text["xx", {Cos[-viewfi] r Sin[theta]/2,
Sin[-viewfi] r Sin[theta]/2, r Cos[theta] + .06}],
{ RGBColor[1,0,0],
Polygon[{
PolarVector[theta, fi, r], PolarVector[theta2, fi, r],
PolarVector[theta2, fi, r2], PolarVector[theta, fi, r2] }],
Polygon[{
PolarVector[theta2, fi, r], PolarVector[theta2, fi2, r],
PolarVector[theta2, fi2, r2], PolarVector[theta2, fi, r2] }],
Polygon[{
PolarVector[theta, fi, r2], PolarVector[theta2, fi, r2],
PolarVector[theta2, fi2, r2], PolarVector[theta, fi2, r2] }],
Line[Join[
Geodesic[Pi/2, fi, {-Pi/2, Pi/2}][[1]],
Geodesic[Pi/2, fi2, {-Pi/2, Pi/2}][[1]],
{-zaxis} ]] },
{ RGBColor[1,0,0],
Line[{origin, PolarVector[theta, fi],
PolarVector[theta, fi2], origin}],
Line[{origin, PolarVector[theta2, fi],
PolarVector[theta2, fi2], origin}]
},
AddArrows[
PolarVector[theta, fi, x] + .05 {-Cos[fi], -Sin[fi], 0},
{x, 0, .96 r, 1/30.},
{-Sin[fi], Cos[fi], 0} ],
Text["r", PolarVector[theta, fi - .5, .2 r] + {0, 0, .15}],
AddArrows[
PolarVector[theta, fi, x] + .05 {-Cos[fi], -Sin[fi], 0},
{x, r, .99 r2, 1/30.},
{-Sin[fi], Cos[fi], 0} ],
Text["dr", PolarVector[theta, fi - .05, r + dr/2] + {0, 0, .1}]
},
AspectRatio -> 1.,
Boxed -> False,
Axes -> False,
AxesLabel -> {"x", "y", "z"},
ViewPoint -> view
];
Show[pkugel]
Display["volkugel.eps", pkugel, "EPS"]
pkugela = Graphics3D[
{
{inside, Geodesic[0, viewfi + Pi/2, {corr, Pi - corr}]},
Geodesic[0, viewfi + Pi/2, {Pi - corr, 2 Pi + corr}],
Geodesic[viewtheta, viewfi + Pi/2, {0, 2 Pi}, 1.015],
{ Thickness[.004],
{inside, Line[{origin, xaxis}]},
Arrow3D[xaxis, .3 xaxis],
Text["x", 1.4 xaxis],
{inside, Line[{origin, yaxis}]},
Arrow3D[yaxis, .3 yaxis],
Text["y", 1.4 yaxis],
Arrow3D[zaxis, .3 zaxis],
Text["z", 1.4 zaxis]
},
{ RGBColor[1,0,0],
Line[Join[
Geodesic[Pi/2, fi, {-Pi/2, Pi/2}][[1]],
Geodesic[Pi/2, fi2, {-Pi/2, Pi/2}][[1]],
{-zaxis} ]]
},
Polygon[{origin, PolarVector[theta2, fi2],
PolarVector[theta2, fi], origin}],
Polygon[{origin, PolarVector[theta2, fi],
PolarVector[theta, fi], origin}],
Polygon[{PolarVector[theta2, fi], PolarVector[theta2, fi2],
PolarVector[theta, fi2], PolarVector[theta, fi]}]
},
AspectRatio -> 1.,
Boxed -> False,
Axes -> False,
AxesLabel -> {"x", "y", "z"},
ViewPoint -> view
];
Show[pkugela]
Display["volkugela.eps", pkugela, "EPS"]
pkugelb = Graphics3D[
{
{inside, Geodesic[0, viewfi + Pi/2, {corr, Pi - corr}]},
Geodesic[0, viewfi + Pi/2, {Pi - corr, Pi + viewfi + fi, Pi/60.}],
Geodesic[0, viewfi + Pi/2, {Pi + viewfi + fi2, 2 Pi + corr}],
Geodesic[viewtheta, viewfi + Pi/2, {0, 2 Pi}, 1.015],
{ Thickness[.004],
{inside, Line[{origin, xaxis}]},
Arrow3D[xaxis, .3 xaxis],
Text["x", 1.4 xaxis],
{inside, Line[{origin, yaxis}]},
Arrow3D[yaxis, .3 yaxis],
Text["y", 1.4 yaxis],
Arrow3D[zaxis, .3 zaxis],
Text["z", 1.4 zaxis]
},
{ EdgeForm[],
Apply[ Polygon[{#1[[1]], #2[[1]], #2[[2]], #1[[2]]}]&,
Partition[
Transpose[
{Geodesic[Pi/2, fi2, {-Pi/2, Pi/2}][[1]],
Geodesic[Pi/2, fi, {-Pi/2, Pi/2}][[1]]} ],
2, 1],
1 ]
},
Polygon@@ Geodesic[Pi/2, fi, {-Pi/2, Pi/2}],
Line[{-zaxis, zaxis}],
Geodesic[Pi/2, fi, {-Pi/2, Pi/2}],
Geodesic[Pi/2, fi2, {-Pi/2, Pi/2}]
},
AspectRatio -> 1.,
Boxed -> False,
Axes -> False,
AxesLabel -> {"x", "y", "z"},
ViewPoint -> view
];
Show[pkugelb]
Display["volkugelb.eps", pkugelb, "EPS"]
height = 1.5;
h = .65;
dh = .2;
h2 = h + dh;
pzylinder = Graphics3D[
{
Arc3D[height zaxis, {0, 2 Pi}],
Circle3D[origin],
Polygon[{
CylVector[fi, h, r], CylVector[fi, h, r2],
CylVector[fi, h2, r2], CylVector[fi, h2, r] }],
Polygon[{
CylVector[fi, h2, r], CylVector[fi, h2, r2],
CylVector[fi2, h2, r2], CylVector[fi2, h2, r] }],
Polygon[{
CylVector[fi, h, r2], CylVector[fi2, h, r2],
CylVector[fi2, h2, r2], CylVector[fi, h2, r2] }],
{ RGBColor[1, 0, 0],
Arc3D[{0, 0, h}, {0, 2 Pi}],
Arc3D[{0, 0, h2}, {0, 2 Pi}],
Line[{
{0, 0, h}, CylVector[fi, h], CylVector[fi, h2], {0, 0, h2},
{0, 0, h}, CylVector[fi2, h], CylVector[fi2, h2], {0, 0, h2} }],
{ Dashing[{.01, .01}],
Line[{origin, CylVector[fi, 0]}],
Line[{origin, CylVector[fi2, 0]}] }
},
AddArrows[
Arc3D[origin, {eps + viewfi, .98 fi + viewfi, Pi/100.}, 1.05],
{0, 0, 1}],
Text["f", CylVector[fi/2, -.06, 1.05]],
AddArrows[
Arc3D[origin, {fi + viewfi, fi2 - eps/2. + viewfi, Pi/100.}, 1.05],
{0, 0, 1}],
Text["df", CylVector[fi + dfi/2, -.08, 1.05]],
AddArrows[
CylVector[fi2, h2 + .03, x], {x, .03, .99 r, .033}, {0, 0, 1}],
Text["r", CylVector[fi2, h2 + .12, .7 r]],
AddArrows[
CylVector[fi2, h2 + .03, x], {x, 1.03 r, r2, .033}, {0, 0, 1}],
Text["dr", CylVector[fi2, h2 + .15, r + dr/2 + .1]],
AddArrows[{.02, -.02, x}, {x, .01, .98 h, .02}, {1, -1, 0}],
Text["z", {.07, -.05, h/2 + .1}],
AddArrows[{.02, -.02, x}, {x, 1.01 h, h2, .02}, {1, -1, 0}],
Text["dz", {.075, -.055, h + dh/2 + .03}],
{ Thickness[.004],
{inside, Line[{origin, xaxis}]},
Arrow3D[xaxis, .3 xaxis],
Text["x", 1.4 xaxis],
{inside, Line[{origin, yaxis}]},
Arrow3D[yaxis, .3 yaxis],
Text["y", 1.4 yaxis],
{inside, Line[{origin, {0, 0, h}}],
Line[{{0, 0, h2}, height zaxis}]},
Arrow3D[height zaxis, .4 zaxis],
Text["z", (height + .5) zaxis]
},
Line[{CylVector[-viewfi - 2 corr, height],
CylVector[-viewfi - 2 corr, 0]}],
Line[{CylVector[Pi - viewfi + 2 corr, height],
CylVector[Pi - viewfi + 2 corr, 0]}]
},
AspectRatio -> 1.,
Boxed -> False,
Axes -> False,
AxesLabel -> {"x", "y", "z"},
ViewPoint -> view
];
Show[pzylinder]
Display["volzylinder.eps", pzylinder, "EPS"]
pzylindera = Graphics3D[
{
Arc3D[height zaxis, {0, 2 Pi}],
Circle3D[origin],
{ EdgeForm[],
Polygon[{
{0, 0, h2}, CylVector[fi, h2], CylVector[fi2, h2], {0, 0, h2} }],
Polygon[{
CylVector[fi, h], CylVector[fi2, h],
CylVector[fi2, h2], CylVector[fi, h2] }],
Polygon[{
{0, 0, h}, CylVector[fi, h], CylVector[fi, h2], {0, 0, h2} }] },
Line[{CylVector[fi2, h], CylVector[fi2, h2], {0, 0, h2},
CylVector[fi, h2], CylVector[fi, h], {0, 0, h}, {0, 0, h2}}],
{ RGBColor[1, 0, 0],
Arc3D[{0, 0, h}, {0, 2 Pi}],
Arc3D[{0, 0, h2}, {0, 2 Pi}]
},
{ Thickness[.004],
{inside, Line[{origin, xaxis}]},
Arrow3D[xaxis, .3 xaxis],
Text["x", 1.4 xaxis],
{inside, Line[{origin, yaxis}]},
Arrow3D[yaxis, .3 yaxis],
Text["y", 1.4 yaxis],
{inside, Line[{origin, {0, 0, h}}],
Line[{{0, 0, h2}, height zaxis}]},
Arrow3D[height zaxis, .4 zaxis],
Text["z", (height + .5) zaxis]
},
Line[{CylVector[-viewfi - 2 corr, height],
CylVector[-viewfi - 2 corr, 0]}],
Line[{CylVector[Pi - viewfi + 2 corr, height],
CylVector[Pi - viewfi + 2 corr, 0]}]
},
AspectRatio -> 1.,
Boxed -> False,
Axes -> False,
AxesLabel -> {"x", "y", "z"},
ViewPoint -> view
];
Show[pzylindera]
Display["volzylindera.eps", pzylindera, "EPS"]
pzylinderb = Graphics3D[
{
Arc3D[height zaxis, {0, 2 Pi}],
Circle3D[origin],
Polygon@@ Arc3D[{0, 0, h2}, {0, 2 Pi}],
{ EdgeForm[],
Apply[ Polygon[{#1[[1]], #2[[1]], #2[[2]], #1[[2]]}]&,
Partition[
Transpose[
{Arc3D[{0, 0, h2}, {0, Pi}][[1]],
Arc3D[{0, 0, h}, {0, Pi}][[1]]} ],
2, 1],
1 ]
},
Arc3D[{0, 0, h}, {0, 2 Pi}],
Arc3D[{0, 0, h2}, {0, 2 Pi}],
{ Thickness[.004],
{inside, Line[{origin, xaxis}]},
Arrow3D[xaxis, .3 xaxis],
Text["x", 1.4 xaxis],
{inside, Line[{origin, yaxis}]},
Arrow3D[yaxis, .3 yaxis],
Text["y", 1.4 yaxis],
{inside, Line[{origin, {0, 0, h}}],
Line[{{0, 0, h2 + .01}, height zaxis}]},
Line[{{0, 0, h2}, {0, 0, h2 + .01}}],
Arrow3D[height zaxis, .4 zaxis],
Text["z", (height + .5) zaxis]
},
Line[{CylVector[-viewfi - 2 corr, height],
CylVector[-viewfi - 2 corr, 0]}],
Line[{CylVector[Pi - viewfi + 2 corr, height],
CylVector[Pi - viewfi + 2 corr, 0]}]
},
AspectRatio -> 1.,
Boxed -> False,
Axes -> False,
AxesLabel -> {"x", "y", "z"},
ViewPoint -> view
];
Show[pzylinderb]
Display["volzylinderb.eps", pzylinderb, "EPS"]
zz = .3;
dzz = .15;
zz2 = zz + dzz;
xx = .35;
dxx = dzz;
xx2 = xx + dxx;
yy = .49;
dyy = dzz;
yy2 = yy + dyy;
pquader = Graphics3D[
{
Line[{{1, 0, 1}, {1, 0, zz2}}],
Line[{{1, 0, zz}, {1, 0, 0}, {1, 1, 0}, {1, 1, zz}}],
Line[{{1, 1, zz2}, {1, 1, 1}, {1, 0, 1}, {0, 0, 1},
{0, 1, 1}, {1, 1, 1}}],
Line[{{0, 1, 1}, {0, 1, zz2}}],
Line[{{0, 1, zz}, {0, 1, 0}, {1, 1, 0}}],
Polygon[{{xx2, yy, zz}, {xx2, yy2, zz},
{xx2, yy2, zz2}, {xx2, yy, zz2}}],
Polygon[{{xx2, yy2, zz}, {xx, yy2, zz},
{xx, yy2, zz2}, {xx2, yy2, zz2}}],
Polygon[{{xx2, yy, zz2}, {xx2, yy2, zz2},
{xx, yy2, zz2}, {xx, yy, zz2}}],
{ RGBColor[1, 0, 0],
Line[{{1, 0, zz2}, {1, 0, zz}, {1, 1, zz}, {1, 1, zz2},
{1, 0, zz2}, {0, 0, zz2}, {0, 0, zz}, {1, 0, zz}}],
Line[{{0, 0, zz2}, {0, 1, zz2}, {0, 1, zz}, {0, 0, zz}}],
Line[{{1, 1, zz2}, {0, 1, zz2}}],
Line[{{1, 1, zz}, {0, 1, zz}}],
Line[{{0, yy, zz}, {1, yy, zz},
{1, yy, zz2}, {0, yy, zz2}, {0, yy, zz}}],
Line[{{0, yy2, zz}, {1, yy2, zz},
{1, yy2, zz2}, {0, yy2, zz2}, {0, yy2, zz}}]
},
AddArrows[{x, yy2 + .03, zz}, {x, .015, .98 xx, .02}, {0, 1, 0}],
Text["x", {xx/2, yy2 + .08, zz}],
AddArrows[{x, yy2 + .03, zz}, {x, 1.01 xx, xx2, .02}, {0, 1, 0}],
Text["dx", {xx + dxx/2 + .04, yy2 + .09, zz}],
AddArrows[{0, x, zz2 + .02}, {x, .015, .98 yy, .02}, {0, 0, 1}],
Text["y", {0, yy2/2, zz2 + .08}],
AddArrows[{0, x, zz2 + .02}, {x, 1.01 yy, yy2, .02}, {0, 0, 1}],
Text["dy", {0, yy + dyy/2 + .03, zz2 + .08}],
AddArrows[{0, 1.02, x}, {x, .015, .98 zz, .02}, {0, 1, 0}],
Text["z", {0, 1.06, zz/2 + .03}],
AddArrows[{0, 1.02, x}, {x, 1.01 zz, zz2, .02}, {0, 1, 0}],
Text["dz", {0, 1.09, zz + dzz/2 + .03}],
{ Thickness[.004],
{inside, Line[{origin, xaxis}]},
Arrow3D[xaxis, .3 xaxis],
Text["x", 1.4 xaxis],
{inside, Line[{origin, yaxis}]},
Arrow3D[yaxis, .3 yaxis],
Text["y", 1.4 yaxis],
{inside, Line[{origin, {0, 0, zz}}],
Line[{{0, 0, zz2}, zaxis}]},
Arrow3D[zaxis, .3 zaxis],
Text["z", 1.4 zaxis]
}
},
AspectRatio -> 1.,
Boxed -> False,
Axes -> False,
AxesLabel -> {"x", "y", "z"},
ViewPoint -> view + {0, .15, 0}
];
Show[pquader]
Display["volquader.eps", pquader, "EPS"]
pquadera = Graphics3D[
{
Line[{{1, 0, 1}, {1, 0, zz2}}],
Line[{{1, 0, zz}, {1, 0, 0}, {1, 1, 0}, {1, 1, zz}}],
Line[{{1, 1, zz2}, {1, 1, 1}, {1, 0, 1}, {0, 0, 1},
{0, 1, 1}, {1, 1, 1}}],
Line[{{0, 1, 1}, {0, 1, zz2}}],
Line[{{0, 1, zz}, {0, 1, 0}, {1, 1, 0}}],
Polygon[{{1, yy, zz}, {1, yy2, zz},
{1, yy2, zz2}, {1, yy, zz2}}],
Polygon[{{1, yy2, zz}, {0, yy2, zz},
{0, yy2, zz2}, {1, yy2, zz2}}],
Polygon[{{1, yy, zz2}, {1, yy2, zz2},
{0, yy2, zz2}, {0, yy, zz2}}],
{ RGBColor[1, 0, 0],
Line[{{1, 0, zz2}, {1, 0, zz}, {1, 1, zz}, {1, 1, zz2},
{1, 0, zz2}, {0, 0, zz2}, {0, 0, zz}, {1, 0, zz}}],
Line[{{0, 0, zz2}, {0, 1, zz2}, {0, 1, zz}, {0, 0, zz}}],
Line[{{1, 1, zz2}, {0, 1, zz2}}],
Line[{{1, 1, zz}, {0, 1, zz}}]
},
{ Thickness[.004],
{inside, Line[{origin, xaxis}]},
Arrow3D[xaxis, .3 xaxis],
Text["x", 1.4 xaxis],
{inside, Line[{origin, yaxis}]},
Arrow3D[yaxis, .3 yaxis],
Text["y", 1.4 yaxis],
{inside, Line[{origin, {0, 0, zz}}],
Line[{{0, 0, zz2}, zaxis}]},
Arrow3D[zaxis, .3 zaxis],
Text["z", 1.4 zaxis]
}
},
AspectRatio -> 1.,
Boxed -> False,
Axes -> False,
AxesLabel -> {"x", "y", "z"},
ViewPoint -> view + {0, .15, 0}
];
Show[pquadera]
Display["volquadera.eps", pquadera, "EPS"]
pquaderb = Graphics3D[
{
Line[{{1, 0, 1}, {1, 0, zz2}}],
Line[{{1, 0, zz}, {1, 0, 0}, {1, 1, 0}, {1, 1, zz}}],
Line[{{1, 1, zz2}, {1, 1, 1}, {1, 0, 1}, {0, 0, 1},
{0, 1, 1}, {1, 1, 1}}],
Line[{{0, 1, 1}, {0, 1, zz2}}],
Line[{{0, 1, zz}, {0, 1, 0}, {1, 1, 0}}],
Polygon[{{1, 0, zz}, {1, 1, zz},
{1, 1, zz2}, {1, 0, zz2}}],
Polygon[{{1, 1, zz}, {0, 1, zz},
{0, 1, zz2}, {1, 1, zz2}}],
Polygon[{{1, 0, zz2}, {1, 1, zz2},
{0, 1, zz2}, {0, 0, zz2}}],
{ Thickness[.004],
{inside, Line[{origin, xaxis}]},
Arrow3D[xaxis, .3 xaxis],
Text["x", 1.4 xaxis],
{inside, Line[{origin, yaxis}]},
Arrow3D[yaxis, .3 yaxis],
Text["y", 1.4 yaxis],
{inside, Line[{origin, {0, 0, zz}}],
Line[{{0, 0, zz2}, zaxis}]},
Arrow3D[zaxis, .3 zaxis],
Text["z", 1.4 zaxis]
}
},
AspectRatio -> 1.,
Boxed -> False,
Axes -> False,
AxesLabel -> {"x", "y", "z"},
ViewPoint -> view + {0, .15, 0}
];
Show[pquaderb]
Display["volquaderb.eps", pquaderb, "EPS"]
height = 1.5;
alpha = ArcTan[1/height];
rad[z_] := (height - z) Tan[alpha];
r = .4;
dr = .15;
r2 = r + dr;
h = .3;
dh = .15;
h2 = h + dh;
fi = 70 Degree;
dfi = 15 Degree;
fi2 = fi + dfi;
corr = Tan[alpha] Cos[viewtheta];
pkegel = Graphics3D[
{
Circle3D[origin],
Polygon[{
CylVector[fi, h, r], CylVector[fi, h, r2],
CylVector[fi, h2, r2], CylVector[fi, h2, r] }],
Polygon[{
CylVector[fi, h2, r], CylVector[fi, h2, r2],
CylVector[fi2, h2, r2], CylVector[fi2, h2, r] }],
Polygon[{
CylVector[fi, h, r2], CylVector[fi2, h, r2],
CylVector[fi2, h2, r2], CylVector[fi, h2, r2] }],
{ RGBColor[1, 0, 0],
Arc3D[{0, 0, h}, {0, 2 Pi}, rad[h]],
Arc3D[{0, 0, h2}, {0, 2 Pi}, rad[h2]],
Line[{
{0, 0, h}, CylVector[fi, h, rad[h]],
CylVector[fi, h2, rad[h2]], {0, 0, h2},
{0, 0, h}, CylVector[fi2, h, rad[h]],
CylVector[fi2, h2, rad[h2]], {0, 0, h2} }],
{ Dashing[{.01, .01}],
Line[{origin, CylVector[fi, 0]}],
Line[{origin, CylVector[fi2, 0]}] }
},
AddArrows[
Line[Table[
height zaxis - PolarVector[-x, Pi - viewfi, .35],
{x, .05, .97 alpha, Pi/37.}]],
{0, 0, 1} ],
Text["a", height zaxis - PolarVector[-.52 alpha, Pi - viewfi, .25]],
AddArrows[
Arc3D[origin, {eps + viewfi, .98 fi + viewfi, Pi/100.}, 1.05],
{0, 0, 1}],
Text["f", CylVector[fi/2, -.06, 1.05]],
AddArrows[
Arc3D[origin, {fi + viewfi, fi2 - eps/2. + viewfi, Pi/100.}, 1.05],
{0, 0, 1}],
Text["df", CylVector[fi + dfi/2 + .05, -.08, 1.05]],
AddArrows[
CylVector[fi2, h2 + .03, x], {x, .03, .99 r, .033}, {0, 0, 1}],
Text["r", CylVector[fi2, h2 + .12, .75 r]],
AddArrows[
CylVector[fi2, h2 + .03, x], {x, 1.03 r, r2, .033}, {0, 0, 1}],
Text["dr", CylVector[fi2, h2 + .15, r + dr/2 + .1]],
AddArrows[{.02, -.02, x}, {x, .01, .98 h, .02}, {1, -1, 0}],
Text["z", {.07, -.05, h/2 + .1}],
AddArrows[{.02, -.02, x}, {x, 1.02 h, h2, .02}, {1, -1, 0}],
Text["dz", {.075, -.055, h + dh/2 + .03}],
{ Thickness[.004],
{inside, Line[{origin, xaxis}]},
Arrow3D[xaxis, .3 xaxis],
Text["x", 1.4 xaxis],
{inside, Line[{origin, yaxis}]},
Arrow3D[yaxis, .3 yaxis],
Text["y", 1.4 yaxis],
{inside, Line[{origin, {0, 0, h}}],
Line[{{0, 0, h2}, height zaxis}]},
Arrow3D[height zaxis, .4 zaxis],
Text["z", (height + .5) zaxis]
},
Line[{height zaxis, CylVector[-viewfi - corr, 0]}],
Line[{height zaxis, CylVector[Pi - viewfi + corr, 0]}]
},
AspectRatio -> 1.,
PlotRange -> All,
Boxed -> False,
Axes -> False,
AxesLabel -> {"x", "y", "z"},
ViewPoint -> view
];
Show[pkegel]
Display["volkegel.eps", pkegel, "EPS"]
pkegela = Graphics3D[
{
Circle3D[origin],
{ EdgeForm[],
Polygon[{
CylVector[fi, h, 0], CylVector[fi, h, rad[h]],
CylVector[fi, h2, rad[h2]], CylVector[fi, h2, 0] }],
Polygon[{
CylVector[fi, h2, 0], CylVector[fi, h2, rad[h2]],
CylVector[fi2, h2, rad[h2]], CylVector[fi2, h2, 0] }],
Polygon[{
CylVector[fi, h, rad[h]], CylVector[fi2, h, rad[h]],
CylVector[fi2, h2, rad[h2]], CylVector[fi, h2, rad[h2]] }] },
Line[{
{0, 0, h}, CylVector[fi, h, rad[h]],
CylVector[fi, h2, rad[h2]], {0, 0, h2},
{0, 0, h}, CylVector[fi2, h, rad[h]],
CylVector[fi2, h2, rad[h2]], {0, 0, h2} }],
{ RGBColor[1, 0, 0],
Arc3D[{0, 0, h}, {0, 2 Pi}, rad[h]],
Arc3D[{0, 0, h2}, {0, 2 Pi}, rad[h2]]
},
{ Thickness[.004],
{inside, Line[{origin, xaxis}]},
Arrow3D[xaxis, .3 xaxis],
Text["x", 1.4 xaxis],
{inside, Line[{origin, yaxis}]},
Arrow3D[yaxis, .3 yaxis],
Text["y", 1.4 yaxis],
{inside, Line[{origin, {0, 0, h}}],
Line[{{0, 0, h2}, height zaxis}]},
Arrow3D[height zaxis, .4 zaxis],
Text["z", (height + .5) zaxis]
},
Line[{height zaxis, CylVector[-viewfi - corr, 0]}],
Line[{height zaxis, CylVector[Pi - viewfi + corr, 0]}]
},
AspectRatio -> 1.,
PlotRange -> All,
Boxed -> False,
Axes -> False,
AxesLabel -> {"x", "y", "z"},
ViewPoint -> view
];
Show[pkegela]
Display["volkegela.eps", pkegela, "EPS"]
pkegelb = Graphics3D[
{
Circle3D[origin],
Polygon@@ Arc3D[{0, 0, h2}, {0, 2 Pi}, rad[h2]],
{ EdgeForm[],
Apply[ Polygon[{#1[[1]], #2[[1]], #2[[2]], #1[[2]]}]&,
Partition[
Transpose[
{Arc3D[{0, 0, h2}, {0, Pi}, rad[h2]][[1]],
Arc3D[{0, 0, h}, {0, Pi}, rad[h]][[1]]} ],
2, 1],
1 ]
},
Arc3D[{0, 0, h}, {0, 2 Pi}, rad[h]],
Arc3D[{0, 0, h2}, {0, 2 Pi}, rad[h2]],
{ Thickness[.004],
{inside, Line[{origin, xaxis}]},
Arrow3D[xaxis, .3 xaxis],
Text["x", 1.4 xaxis],
{inside, Line[{origin, yaxis}]},
Arrow3D[yaxis, .3 yaxis],
Text["y", 1.4 yaxis],
{inside, Line[{origin, {0, 0, h}}],
Line[{{0, 0, h2 + .01}, height zaxis}]},
Line[{{0, 0, h2}, {0, 0, h2 + .01}}],
Arrow3D[height zaxis, .4 zaxis],
Text["z", (height + .5) zaxis]
},
Line[{height zaxis, CylVector[-viewfi - corr, 0]}],
Line[{height zaxis, CylVector[Pi - viewfi + corr, 0]}]
},
AspectRatio -> 1.,
PlotRange -> All,
Boxed -> False,
Axes -> False,
AxesLabel -> {"x", "y", "z"},
ViewPoint -> view
];
Show[pkegelb]
Display["volkegelb.eps", pkegelb, "EPS"]
(* taken from PlotField3D *)
mag[a_] := Sqrt[a . a]
Arrow3D[ point:{x_, y_, z_}, grad:{dx_, dy_, dz_}, arrowscale_:1. ] :=
Block[{endpoint, perp, perpm, offsetPoint,
arrowA, arrowB, arrowC, arrowD},
endpoint = point + grad;
perp = Cross[grad, {0,0,1}];
perpm = mag[perp];
If[perpm == 0,
perp = Cross[grad, {0,1,0}];
perpm = mag[perp]
];
perp = perp mag[grad]/(9 perpm);
offsetPoint = endpoint - .2 arrowscale grad;
arrowA = offsetPoint + arrowscale perp;
perp = Cross[grad, perp];
perp = perp mag[grad]/(9 mag[perp]);
arrowB = offsetPoint + arrowscale perp;
perp = Cross[grad, perp];
perp = perp mag[grad]/(9 mag[perp]);
arrowC = offsetPoint + arrowscale perp;
perp = Cross[grad, perp];
perp = perp mag[grad]/(9 mag[perp]);
arrowD = offsetPoint + arrowscale perp;
{Line[{point, endpoint}], (* 3D arrow shaft *)
Polygon[{arrowA, arrowB, endpoint}],
Polygon[{arrowB, arrowC, endpoint}],
Polygon[{arrowC, arrowD, endpoint}],
Polygon[{arrowD, arrowA, endpoint}]
}
]