| Author |
Comment/Response |
David Ng
|
11/25/05 11:00pm
Hi can anybody help me with this problem. I am trying to convert a 2d polygon into a 3d polygon. The 2d polygon looks exactly like how I wanted it, but when I tried to plot it in 3d, there is this weird effect where the polygon fills out weirdly. Here is the code. Thanks.
curve[x_] = (1 - 0.2Sin[x]) (2 - 0.3Cos[-4]);
g = Plot[{curve[x], curve[x] - 0.5}, {x, -2, 2}];
pt2d = Join[
g[[1, 1, 1, 1, 1]], Reverse[g[[1, 2, 1, 1, 1]]]];
pt3d = Insert[#, -2, 2] & /@ Join[g[[1,
1, 1, 1, 1]], Reverse[g[[1, 2, 1, 1, 1]]]];
Show[Graphics[Polygon[
pt2d]]]
Show[Graphics3D[Polygon[
pt3d]]]
URL: , |
|