COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### 3d Rectangualr Grid

• Email
• Follow

```Anyone have idea how to do this in Matlab?
```
 0

See related articles to this posting

```"Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn\$rab\$1@fred.mathworks.com>...
> Anyone have idea how to do this in Matlab?

try:
help ndgrid

/Per
```
 0

```"Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmk4v\$hdp\$1@fred.mathworks.com>...
> "Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn\$rab\$1@fred.mathworks.com>...
> > Anyone have idea how to do this in Matlab?
>
> try:
> help ndgrid
>
> /Per

Thanks for command but for a learner it is not enough. I need a close cylinder with 3d rectangular grid for flow analysis using finite volume method.
```
 0

```"Priya " <priya.biomath@gmail.com> wrote in message <hjml2v\$h9n\$1@fred.mathworks.com>...
> "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmk4v\$hdp\$1@fred.mathworks.com>...
> > "Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn\$rab\$1@fred.mathworks.com>...
> > > Anyone have idea how to do this in Matlab?
> >
> > try:
> > help ndgrid
> >
> > /Per
>
> Thanks for command but for a learner it is not enough. I need a close cylinder with 3d rectangular grid for flow analysis using finite volume method.

xmin=0;xmax=1;Nx=10;
xvec=linspace(xmin,xmax,Nx);
yvec=xvec;zvec=5*xvec; %change here
[x,y,z] = ndgrid(xvec,yvec,zvec);
plot3(x(:),y(:),z(:),'.');axis equal;

x(2,3,5)
```
 0

```"Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmq0h\$6tg\$1@fred.mathworks.com>...
> "Priya " <priya.biomath@gmail.com> wrote in message <hjml2v\$h9n\$1@fred.mathworks.com>...
> > "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmk4v\$hdp\$1@fred.mathworks.com>...
> > > "Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn\$rab\$1@fred.mathworks.com>...
> > > > Anyone have idea how to do this in Matlab?
> > >
> > > try:
> > > help ndgrid
> > >
> > > /Per
> >
> > Thanks for command but for a learner it is not enough. I need a close cylinder with 3d rectangular grid for flow analysis using finite volume method.
>
>
> xmin=0;xmax=1;Nx=10;
> xvec=linspace(xmin,xmax,Nx);
> yvec=xvec;zvec=5*xvec; %change here
> [x,y,z] = ndgrid(xvec,yvec,zvec);
> plot3(x(:),y(:),z(:),'.');axis equal;
>
> x(2,3,5)

It looks nice but not like cylinder
```
 0

```"Priya " <priya.biomath@gmail.com> wrote in message <hjmvmc\$kbd\$1@fred.mathworks.com>...
> "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmq0h\$6tg\$1@fred.mathworks.com>...
> > "Priya " <priya.biomath@gmail.com> wrote in message <hjml2v\$h9n\$1@fred.mathworks.com>...
> > > "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmk4v\$hdp\$1@fred.mathworks.com>...
> > > > "Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn\$rab\$1@fred.mathworks.com>...
> > > > > Anyone have idea how to do this in Matlab?
> > > >
> > > > try:
> > > > help ndgrid
> > > >
> > > > /Per
> > >
> > > Thanks for command but for a learner it is not enough. I need a close cylinder with 3d rectangular grid for flow analysis using finite volume method.
> >
> >
> > xmin=0;xmax=1;Nx=10;
> > xvec=linspace(xmin,xmax,Nx);
> > yvec=xvec;zvec=5*xvec; %change here
> > [x,y,z] = ndgrid(xvec,yvec,zvec);
> > plot3(x(:),y(:),z(:),'.');axis equal;
> >
> > x(2,3,5)
>
> It looks nice but not like cylinder

You said rectangular grid. A cylinder is a body with fixed cross-section elongated along ,lets say the z-direction. Do you want this cross section to be both a circle and rectangular? You have to approximate the circle into rectangles that fits within the radii then?
```
 0

```"Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjn0ie\$j0t\$1@fred.mathworks.com>...
> "Priya " <priya.biomath@gmail.com> wrote in message <hjmvmc\$kbd\$1@fred.mathworks.com>...
> > "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmq0h\$6tg\$1@fred.mathworks.com>...
> > > "Priya " <priya.biomath@gmail.com> wrote in message <hjml2v\$h9n\$1@fred.mathworks.com>...
> > > > "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmk4v\$hdp\$1@fred.mathworks.com>...
> > > > > "Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn\$rab\$1@fred.mathworks.com>...
> > > > > > Anyone have idea how to do this in Matlab?
> > > > >
> > > > > try:
> > > > > help ndgrid
> > > > >
> > > > > /Per
> > > >
> > > > Thanks for command but for a learner it is not enough. I need a close cylinder with 3d rectangular grid for flow analysis using finite volume method.
> > >
> > >
> > > xmin=0;xmax=1;Nx=10;
> > > xvec=linspace(xmin,xmax,Nx);
> > > yvec=xvec;zvec=5*xvec; %change here
> > > [x,y,z] = ndgrid(xvec,yvec,zvec);
> > > plot3(x(:),y(:),z(:),'.');axis equal;
> > >
> > > x(2,3,5)
> >
> > It looks nice but not like cylinder
>
> You said rectangular grid. A cylinder is a body with fixed cross-section elongated along ,lets say the z-direction. Do you want this cross section to be both a circle and rectangular? You have to approximate the circle into rectangles that fits within the radii then?

what do you mean by "You have to approximate the circle into rectangles that fits within the radii then? "
can you write me little more about such things.
```
 0

```"Priya " <priya.biomath@gmail.com> wrote in message <hjn0rr\$8kh\$1@fred.mathworks.com>...
> "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjn0ie\$j0t\$1@fred.mathworks.com>...
> > "Priya " <priya.biomath@gmail.com> wrote in message <hjmvmc\$kbd\$1@fred.mathworks.com>...
> > > "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmq0h\$6tg\$1@fred.mathworks.com>...
> > > > "Priya " <priya.biomath@gmail.com> wrote in message <hjml2v\$h9n\$1@fred.mathworks.com>...
> > > > > "Per Sundqvist" <per.sundqvist@live.com> wrote in message <hjmk4v\$hdp\$1@fred.mathworks.com>...
> > > > > > "Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn\$rab\$1@fred.mathworks.com>...
> > > > > > > Anyone have idea how to do this in Matlab?
> > > > > >
> > > > > > try:
> > > > > > help ndgrid
> > > > > >
> > > > > > /Per
> > > > >
> > > > > Thanks for command but for a learner it is not enough. I need a close cylinder with 3d rectangular grid for flow analysis using finite volume method.
> > > >
> > > > What about:
> > > >
> > > > xmin=0;xmax=1;Nx=10;
> > > > xvec=linspace(xmin,xmax,Nx);
> > > > yvec=xvec;zvec=5*xvec; %change here
> > > > [x,y,z] = ndgrid(xvec,yvec,zvec);
> > > > plot3(x(:),y(:),z(:),'.');axis equal;
> > > >
> > > > x(2,3,5)
> > >
> > > It looks nice but not like cylinder
> >
> > You said rectangular grid. A cylinder is a body with fixed cross-section elongated along ,lets say the z-direction. Do you want this cross section to be both a circle and rectangular? You have to approximate the circle into rectangles that fits within the radii then?
>
> what do you mean by "You have to approximate the circle into rectangles that fits within the radii then? "
> can you write me little more about such things.

n=20;
x=linspace(-1,1,n);
[X,Y]=meshgrid(x,x);
r0=1.01;
ix=find(X.^2+Y.^2<r0^2);
X=X(ix);Y=Y(ix);
plot(X(:),Y(:),'.');axis equal;

I'm not sure it help you. You need to know nearest neighbour index as well, right?
```
 0

```"Piya " <priya.biomath@gmail.com> wrote in message <hjmdmn\$rab\$1@fred.mathworks.com>...
> Anyone have idea how to do this in Matlab?

I need implementation like that on a bottom close cylinder

http://portal.acm.org/citation.cfm?id=1461512

Regards
```
 0

``` n=20;
x=linspace(-1,1,n);
[X,Y,Z]=meshgrid(x,x,x);
r0=1.01;
ix=find(X.^2+Y.^2+Z.^2<r0^2);
X=X(ix);Y=2*Y(ix);Z=Z(ix);
plot3(X(:),Y(:),Z(:),'.');axis equal;
>> n=20;
x=linspace(-1,1,n);
[X,Y,Z]=meshgrid(x,x,x);
r0=1.01;
ix=find(X.^2+Y.^2+Z.^2<r0^2);
X=X(ix);Y=Y(ix);Z=2*Z(ix);
plot3(X(:),Y(:),Z(:),'.');axis equal;

not working !!
```
 0

```
n=40;
x=linspace(-1,1,n);
[X,Y,Z]=meshgrid(x,x,x);
r0=1.0;
ix=find(X.^2+Y.^2<r0^2);
X=X(ix);Y=Y(ix);Z=2*Z(ix);
plot3(X(:),Y(:),Z(:),'.');axis equal;

I do not know this is really what i want.
```
 0

```"mat001 " <dres01@lycos.com> wrote in message <hod7fp\$c0v\$1@fred.mathworks.com>...
>
>
> n=40;
> x=linspace(-1,1,n);
> [X,Y,Z]=meshgrid(x,x,x);
> r0=1.0;
> ix=find(X.^2+Y.^2<r0^2);
> X=X(ix);Y=Y(ix);Z=2*Z(ix);
> plot3(X(:),Y(:),Z(:),'.');axis equal;
>
>
> I do not know this is really what i want.
```
 0

11 Replies
372 Views

Similar Articles

12/6/2013 8:24:32 PM
[PageSpeed]

Similar Artilces:

3d morphing
hi, does anyone know about a matlab implemenation for this ? thanks mat

3d wavelets
hi all, anybody can help me find some notes on 3d wavelets or if how to implement 3d wavelets. a 3d algorithm would be handy to find. thanks, anil

ginput in 3D?
Hi Matlabers I'm working with a large dataset composed of triangles in 3D space. For further processing, I'd need to be able to isolate a single element(triangle or point) by mouseclick. My best idea until now is to allow the user to freely rotate the display and when he signals that he wants to pick an object (signal by pushbutton or something), project the whole display onto a plane that's orthagonal to the current view direction. Plot this in a new window, and get the 2D coordinates via ginput. Returning to 3D with these coordinates, I'd have a line that intersects the selected object (and unfortunately possibly several others as well). I could then assume that the desired object is the first along the line. However, this is very messy, and I would appreciate a push in the right direction if it's feasible in a simpler way. Best Regards Ralph Ralph Mettier wrote: > Hi Matlabers > > I'm working with a large dataset composed of triangles in 3D space. > For further processing, I'd need to be able to isolate a single > element(triangle or point) by mouseclick. > My best idea until now is to allow the user to freely rotate the >

Ruby 3D
Hi, i'm looking for a Ruby extension to create/manipulate 3d environment and generate 2d image from it. Thanks all. Luca Zufynet wrote: > Hi, > > i'm looking for a Ruby extension to create/manipulate 3d environment and > generate 2d image from it. There's a binding to SDL here: http://www.kmc.gr.jp/~ohai/rubysdl.en.html The SDL GL interface is pretty easy to get your head around. Is that what you were looking for? -- Alex On 8/8/07, Alex Young <alex@blackkettle.org> wrote: > Zufynet wrote: > > Hi, > > > > i'm looking for a Ruby extension to create/manipulate 3d environment and > > generate 2d image from it. > There's a binding to SDL here: http://www.kmc.gr.jp/~ohai/rubysdl.en.html > > The SDL GL interface is pretty easy to get your head around. Is that > what you were looking for? > > -- > Alex Installing SDL is bothersome. At least with the one-click installer, you can use OpenGL directly. There are examples with the installation. Aur SonOfLilit ha scritto: > On 8/8/07, Alex Young <alex@blackkettle.org> wrote: >> Zufynet wrote: >>> Hi, >>>

3D modelling
Hello All, I use RiscCAD (a lot) to generate 2D drawings etc of building designs. Historically (RO v3.7) I used TopModel2 (v2.07)to create moderately useful 3D glimpses of my work. We were wavering as to whether or not to depart the RO world as RiscCAD etc. was no longer being developed; BUT, now that David Buck has thrown his lot back in and performed a terrific amount of development on RiscCAD, we're now determined to stick with the OS. Having switched over to RO 4.02 sometime ago, I found the GUI menus/toolboxes on TM2 to be next to useless as they were being washed over by the pinboard. So I used the app less and less. I really need a 3D app that allows me to generate very simple block 3D views from a DXF or Draw file. (RiscCAD now exports a better !Draw). Q. Is there a fix that resolves the corrupted toolbox in TM2? Q. Does anyone have a copy of ArchiTech or Da Vinci or even Euclid (or similar) that they could let me road test to see how compatible/useful it'd be. I've emailed Aspex Software to see if they can help also, but their website seems to have all but forgotten RO. Any other ideas most welcome, thank you. regards Peter pja@pja-arch.demon.co.uk

3d surface from 3d points
I have hand-segmented points from a CT scan, delineating an object. 3d plot shows the slices nicely, but the mesh and surf (after using meshgrid etc) functions interpolated across the data set -- I want to maintain the *surface* of the data. I should be able to display this as a tube. I have also converted the data into a volume -- a binary volume, with a 1 at these points, but the point set is then too sparse to generate the surface. Thanks suguna i have the same problem if any one has something please reply thanks, anil S pappu wrote: > > > I have hand-segmented points from a CT scan, > delineating an object. 3d plot shows the slices nicely, but the > mesh > and surf (after using meshgrid etc) functions interpolated across > the > data set -- I want to maintain the *surface* of the data. I should > be > able to display this as a tube. > > I have also converted the data into a volume -- a binary volume, > with > a 1 at these points, but the point set is then too sparse to > generate > the surface. > > Thanks > > suguna

3d model of hand | 3d model of hasp | 3d model of hms surprise
>>> http://www.econoshock.com/?ss=3d_model_of_hand >>> http://www.econoshock.com/?ss=3d_model_of_hasp >>> http://www.destroymidtown.com/?ss=3d_model_of_nude_little_girl >>> http://www.destroymidtown.com/?ss=3d_model_of_potassium >>> http://www.destroymidtown.com/?ss=3d_model_of_male_human_figure >>> http://www.destroymidtown.com/?ss=3d_model_of_map >>> http://www.destroymidtown.com/?ss=3d_model_of_male_human_figure 3d model of hand 3d model of hasp 3d model of hms surprise 3d model of hoist trolley 3d model of house 3d model of human anatomy 3d model of human head 3d model of humvee 3d model of hyundai 3d model of hyundai tucson 3d model of igloo 3d model of indicator 3d model of internal organs 3d model of labrynth 3d model of learning education 3d model of lift hook 3d model of little girl 3d model of lovejoy coupling 3d model of male human figure 3d model of manganese 3d model of map 3d model of medusa 3d model of molecular ribose 3d model of mount rainier 3d model of my body measurement 3d model of my body measurements 3d model of nitrogen 3d model of nitrogen cycle 3d model

generating 3d matrix in loop
Hey all, I have such a problem: I want to add new values to my 3d matrix in such a loop y=[1 2 3 4 5 6 7 8 9 10]' for j=4:length(y) X=zeros(10,3,length(y)); X(:,2,j)=18; %I just used 18 for simplicity (in original code i have here a 2nd loop defining X values but it works ok) end so for each j value I want to have a specified values in my final matrix. but at the end in the matrix there are saved values only for j=length(y) but not for other j values... why it overwrites the values for earlier j values? any ideas how to fix this? "Kara " <pink03@o2.pl> wrote in message news:i0atbk\$830\$1@fred.mathworks.com... > Hey all, > I have such a problem: > I want to add new values to my 3d matrix in such a loop > y=[1 2 3 4 5 6 7 8 9 10]' > for j=4:length(y) > X=zeros(10,3,length(y)); Note that at each iteration, this overwrites the existing contents of X with all zeros. Move this to immediately before you enter the FOR loop. *snip* -- Steve Lord slord@mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us

3D patches on a map
Hello I'm having a problem using the Mapping Toolbox. I want to create a map axis which includes items at various points in the air (at various heights). The objects themselves I can generate using plot3m. However, I also wish to plot a shaded 3D area to designate certain sections of the map, based on the lat/lon/h coordinates of the vertices. For a simple example, let's say I want to plot a cube in a normal axes. calculate the coordinates of the vertices, and then plot them (and fill the area between them - with the patch function. However, as far as I can tell, the equivalent functions in the Mapping Toolbox do not allow the same sort of plotting. While they are similiar in 2D, each patch would have a fixed height - that is, it is parallel to the map. In the case of the cube, that means I could draw the top and bottom faces, but not the other faces (in practise, I need somewhat more complicated patches - slanted flat surfaces and full or partial spheres). So far, the only solution I have been able to find is to use plot3m to create a sort of "wiresketch" version, which isn't really what I'd prefer (especially because it would be difficult

3D Models of all Motors
3D Motor Models for all existing Motors will be available on our site within 4 weeks. You will be able to find the motor you need based on NEMA frame and IEC Frame All types of enclosures, AC and DC. Hope this is useful info. www.baren-boym.com ALL motors? Mabuchi? Leshi? Muggs "Baren-Boym Company" <olga@baren-boym.com> wrote in message news:Qzw4e.1104\$26.417@chiapp18.algx.net... > > 3D Motor Models for all existing Motors will be available on our site > within > 4 weeks. > You will be able to find the motor you need based on NEMA frame and IEC > Frame > All types of enclosures, AC and DC. > > Hope this is useful info. > > www.baren-boym.com > > > All Motors are based on NEMA or IEC Frames. The size of the motor and the mounting and shaft does not depend on the company where it is made. Michael "Muggs" <Muggs828@home.net> wrote in message news:3_Odnaz5LOv-B8_fRVn-2Q@comcast.com... > ALL motors? Mabuchi? Leshi? > > Muggs > > "Baren-Boym Company" <olga@baren-boym.com> wrote in message > news:Qzw4e.1104\$26.417@chiapp18.algx.net... > > > > 3D