3d plot of cubes

3d plot of cubes

Hello sir.

I am very much new to this software

In my application i have to plot the elements which are 3d cubes.

Please can you provide me the basic steps to follow.

my application is on fortran77

i am using intel visual fortran

11 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.


That sounds interesting... can you provide some more details?

1. Are the cubes conjoined or just floating around independtly?

2. Are they really cubes or rectangular prisms? i.e. does length = width = height

3. Do they have the same orientation? i.e. are they rotated w/ respect to each other?

4. Do you want the color of the cube to convey some information? Will each face have a different color?

If you could describe how your data is orgainized, that might be some help as well.


Hello sir

this is the sample plot

I am having the data of mid points of all the cubes.

in the next iteration i have to redraw the figure with deformed shape.

for this i have the coordinates of the deformed x, y and z(i.e midpoints)

and also the rotation of the the cubes w.r.t x ,y and z axis

Sounds like an interesting problem. I downloaded your attachment but could not open it with wordpad and could not view it as an .h5 image. What type of file is the attachement?
I am guessing that it is some sort of finite element model or something similar where you subject these elemental cubes to a load or temperature or movement...hard to say on such little information.

Hello sir,
i think you can open as image file(windows picture or fax viewer).
it is 3d fem modelling.
please tell me the basic steps how to start with plotting

1. Take a look at the images of the torus using QuadMesh, eg. Quadmesh2.h5 etc.
2. The code written in javascript (.js) for drawing a quadmesh is also helpful, dont worry about all the
extra capabilities, just look at the way the data array of vertexes is built
3. Think of your cubes as being "wrapped" in a mesh of quadrangles like wrapping paper with a quadrille
pattern on it. You will "wrap" your solid with a 3D quad map
4. Compute vertexes of all your elements by combining the centroid information with the element dimensions. Depending on the FE code you may be able to get this information more directly than the centroids and side dimensions. Anyway, you will have to lay out the vertexes of your elements as if you were wrapping them in paper.
5. The array of vertexes created in step 4, are placed into an array like the table values shown in the 3D quadmesh plolts you examined in step 1.
6. I would start with a very simple example, like a cube (eight vertexes) or two cubes side-by-side (12 vertexes). You might need to do two cubes so that you know which plotted direction(x,y,or z)corresponds to rows and which directionto columns. Once you have mastered this, its just a matter of growing the data array to fit your model
Good luck!

Turns out I cant even follow my own advice!!
I tried to make a simple example of my suggestion above and could not implement it in Fortran. Setting up the data structures with x, y,z values in each cell was very difficult and I could not find any programming examples to follow that used C or Fortran calls. The jscript could structure the data more easily than Fortran.
Any help for a green-belt stuck in the mud would be appreciated.

I have tried without success to pass data, via Fortran, to a Quad Mesh. I can only conclude that there is a magical sequence of commands to create a compound data set, like the QuadMesh data examples (.h5 files). Unfortunately, Use of the avSetVertex commands have no logical Fortran calling sequence, nor does the compound property generation for datasets. I have tried perhaps 50 different combinations of calling sequences without luck, perhaps there lurks a 51st (I hope)

So the 51st time did work!!
See the post linked below


There are still issues for your applicaton, specifically how to "unfold" the surfaces and which surface to unfold. Each cube has six surfaces, two cubes side by side have 10 surfaces (two are adjacent and hidden). Do you want just the outer surfaces or inner and outer surfaces...if you are doing 3D analysis and want to "see into" the solids you may want to think about an approach like the astrojet.h5 data sample.


Probably what's really needed is a new plot type that takes a true mesh... i.e. the vertices of the mesh are defined by a 3d array.John

I would agree since this is a very useful idea. One would think that finite element programs have this ability already and most of them do. The problem arises when you want to do something a little different. I have a program that analyzes 3D torsion in a cylinder. I want to look at radial and tangential deformation but the program only dispalys x,y,z deformation for 3D.
One tricky aspect deals with indexing vertices and elements. Whether you want to view all the data on all the faces of every cube or just the outside of the assembly of cubes etc, as well as looking at element vs nodal data. The element data is typically computed at the Gauss points, nodal data at the nodes.
I have a fortran90 source that demonstrates a very simple approach to just get the data on the screen. I will post it when I'm done.

Leave a Comment

Please sign in to add a comment. Not a member? Join today