MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Projection of curley 3D curves to represent a cylindrical surface

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99143] Re: Projection of curley 3D curves to represent a cylindrical surface
  • From: dh <dh at metrohm.com>
  • Date: Tue, 28 Apr 2009 04:46:04 -0400 (EDT)
  • References: <gt3f26$ibr$1@smc.vnet.net> <gt3tq8$nt5$1@smc.vnet.net>


There is a typo in my last mail:



t1 = Cases[t // Normal, Line[___], Infinity];

should read:

t1 = Cases[t1 // Normal, Line[___], Infinity];



Daniel



dh wrote:

> Hi Bill,

> 

> this gets a bit complicated because you have the bounding curves only 

> 

> implicitly. Therefore, we first make a contour plot to get the implicite 

> 

> curve. Then we extract the actual lines from the resulting graphics. 

> 

> Then we change the lines to rectangles giving the "walls" of the 

> 

> cylindrical object we are searching:

> 

> ========================================

> 

> Clear[T, pnt, M, g1, g2];

> 

> T[t_] := {t^2, t, 1};

> 

> pnt = {{{0, 0, 0}, {1, 0, 0}, {2, 0, 0}}, {{0, 1, 0}, {1, 1, 1}, {2,

> 

>       1, -0.5}}, {{0, 2, 0}, {1, 2, 0}, {2, 2, 0}}};

> 

> M = {{2, -4, 2}, {-3, 4, -1}, {1, 0, 0}};

> 

> pts = Graphics3D[{AbsolutePointSize[5],

> 

>      Table[Point[pnt[[i, j]]], {i, 1, 3}, {j, 1, 3}]}];

> 

> comb[i_] := (T[u].M.pnt)[[i]] (Transpose[M].T[w])[[i]];

> 

> surf = ParametricPlot3D[

> 

>      comb[1] + comb[2] + comb[3], {u, 0, 1}, {w, 0, 1}, Mesh -> False,

> 

>      BoundaryStyle -> Directive[Magenta, Thickness[0.005]],

> 

>      PlotPoints -> 100,

> 

>      RegionFunction -> (1/16 +

> 

>           1/32 Sin[

> 

>             10 ArcTan[#4 - 1/2, #5 - 1/2]] < (#4 - 1/2)^2 + (#5 -

> 

>              1/2)^2 < 1/8 + 1/32 Sin[10 ArcTan[#4 - 1/2, #5 - 1/2]] &),

> 

>       Axes -> True] // Quiet;

> 

> 

> 

> t1 = ContourPlot[

> 

>     Evaluate[{(1/16 +

> 

>            1/32 Sin[

> 

>              10 ArcTan[#1 - 1/2, #2 - 1/2]] == (#1 - 1/2)^2 + (#2 -

> 

>               1/2)^2 ), (#1 - 1/2)^2 + (#2 - 1/2)^2 ==

> 

>          1/8 + 1/32 Sin[10 ArcTan[#1 - 1/2, #2 - 1/2]]} &[u, w]], {u,

> 

>      0, 1}, {w, 0, 1}];

> 

> t1 = Cases[t // Normal, Line[___], Infinity];

> 

> t1 = t1 /. {u_?NumericQ,

> 

>       w_?NumericQ} -> (comb[1] + comb[2] + comb[3])  ;

> 

> t1 = t1 /.

> 

>     Line[x_] :> {EdgeForm[], Partition[Riffle[x, RotateLeft[x]], 2]};

> 

> t1 = t1 /. {{x1_, x2_, x3_}, {y1_, y2_, y3_}} ->

> 

>      Polygon[{{x1, x2, x3}, {y1, y2, y3}, {y1, y2, 0}, {x1, x2, 0}}];

> 

> 

> 

> cyl = Graphics3D[t1];

> 

> 

> 

> pic1 = Show[{surf, cyl}, ViewPoint -> {0, 0, 2},

> 

>    BaseStyle -> {10, FontFamily -> "cmr10"},

> 

>    AxesLabel -> {"x", "y", "z"}, ImageSize -> 500]

> 

> ========================================

> 

> 

> 

> Bill wrote:

> 

>> Hi:

> 

> 

>> I have the following plot in 3D:

> 

> 

>> Clear[T,pnt,M,g1,g2];

> 

>> T[t_]:={t^2,t,1};

> 

>> pnt={{{0,0,0},{1,0,0},{2,0,0}},{{0,1,0},{1,1,1},

> 

>> {2,1,-0.5}},{{0,2,0},{1,2,0},{2,2,0}}};

> 

>> M={{2,-4,2},{-3,4,-1},{1,0,0}};

> 

>> pts=Graphics3D[{AbsolutePointSize[5],

> 

>> Table[Point[pnt[[i,j]]],{i,1,3},{j,1,3}]}];

> 

>> comb[i_]:=(T[u].M.pnt)[[i]] (Transpose[M].T[w])[[i]];

> 

>> surf=ParametricPlot3D[comb[1]+comb[2]+comb[3],{u,0,1},{w,0,1},

> 

>> Mesh->False,BoundaryStyle->Directive[Magenta,Thickness[0.005]],

> 

>> PlotPoints->100,RegionFunction->(1/16+1/32 Sin[10 

> 

>> ArcTan[#4-1/2,#5-1/2]]

> 

>> <(#4-1/2)^2+(#5-1/2)^2<1/8+1/32 Sin[10 ArcTan[#4-1/2,

> 

>> #5-1/2]]&),

> 

>> Axes->True]//Quiet;

> 

>> pic1=Show[surf,ViewPoint->{0,0,2},BaseStyle->{10,FontFamily->"cmr10"},

> 

>> AxesLabel->{"x","y","z"},ImageSize->500]

> 

> 

>> I'd like to project the magenta colored curves from their z coordinate positions down to the x-y=0 plane, creating cylindrical walls that match the curves. Perhaps the plot and code that I've given above can be converted to 3D Graphics,and the function "Scale" could be used to do this. I've tried to do this but haven't had any success. However, I'm not sure that this is the right approach.

> 

> 

>> As an end result, I'd like to show the above plot with the cylindrical surfaces in one 3D plot.

> 

> 

>> Suggestions and Mathematica 6.0.1 code would be greatly appreciated.

> 

> 

> 

>> Thanks,

> 

> 

>> Bill

> 

> 

> 

> 




  • Prev by Date: Re: Buttons to interactively restart/finish a program
  • Next by Date: Re: Mathematica crashed -- where did my notebook go?
  • Previous by thread: Projection of curley 3D curves to represent a cylindrical surface
  • Next by thread: Mathematica crashed -- where did my notebook go?