UniPlot:3DView

UniPlot:3DView is a program UniPlot uses to create plots of multiple 3D datasets in one diagram. (3D-Surface Plot, 3D-Scatter Plot, 3D Bar Plot, 3D Curves). The program uses OpenGL to calculate datasets and to display them in the diagram.

UniPlot:3DView uses an NC file with the extension .u3d as an input file and creates a bitmap (PNG format) as an output file. The PNG file is displayed in the UniPlot document.

Some examples

The following examples show the specific fuel consumption and the soot number. Soot data is displayed as the color on the surface.

../../_images/be-sz.png

The following figures show two surface plots:

../../_images/grid2.png ../../_images/grid2-2.png

Curve in 3D space with scatter plot:

../../_images/curve-marker.png

Two different maps as bar graphs. The red bars have an offset to their original x/y position:

../../_images/bar2.png

The following plot options are available:

  • Surface with color gradient, single color or fishnet.
  • Multiple surface plots in one diagram.
  • Surface plots with transparency.
  • Scatter plots of xyz datasets (cube or ball shape).
  • Bar Plots of multiple datasets with offset in x- and y-directions).
  • Curves in 3D space.
  • Interactively moving, zooming and rotating..

Creating U3D-Plot

  • Create an isoline or 3D plot with one or more datasets in UniPlot.

    ../../_images/vtk-iso.png
  • Right click on the diagram and select the command Diagram=>Create U3D Diagram to open the following dialog box:

    ../../_images/vtk-dialog.png

    Select a style for the grid element and click OK.

  • A new document with a copy of the page will be created. Instead of the original 3D diagram a U3D diagram will be displayed.

    ../../_images/vtk-vtk.png
  • To change the view, right click on U3D plot and select the U3D open command. The diagram will be opened in the UniPlot3DView program. Use the mouse to change the view:

    Rotating the diagram Click and hold down the left mouse button while moving the mouse pointer.
    Tilt the diagram Press and hold down the Ctrl key while moving the mouse pointer with the left button hold down.
    Zoom in/out Click and hold down the right mouse button while moving the mouse pointer up or down.
    Move the diagram Click and hold down the center mouse button while moving the mouse pointer. If your mouse does not have three buttons press and hold down the Shift key and hold down the left mouse button.

    When you close the U3D document the picture in the UniPlot document is updated.

    ../../_images/vtk-result.png

Modifying the Ini file

The Ini file is located in the UniPlot\template\u3d.ini. To open the file choose Tools=>U3D Diagram Configuration and click the edit button behind the configuration file name. The file will be opened and you will be able to edit the file after you close the dialog box. The INI file has the following sections:

[Diagram]
...

[Curve1]
...

[Bar1]
...

[Marker1]
...

[Grid1]
...

The Curve, Bar, Marker and Grid sections must be enumerated without a gap, e.g. Grid1, Grid 2, Grid3, etc. The number of elements is not limited. See the example file UniPlot\template\u3d.ini.

Diagram

Name Default Value Description
u3d_show_axis 1 0: Disable axes system, 1: enable axes system.
u3d_axes_len_factors 1.0, 1.0, 1.0 Numbers from 0.1 to 1.0, that indicate relative axis length. Example: if 0.5 is given as the third number the z-axis will appear halp as long as the x- and y-axes.
u3d_axes_xtitle "X" x-axis title
u3d_axes_ytitle "Y" y-axis title
u3d_axes_ztitle "Z" z-axis title
u3d_axes_font_factor 1.0 Font size factor for axis title (0.0 to 1.0).
u3d_axes_label_format %g" Format for axes labels. See UniScript’s printf function.
u3d_axes_label_count 8 Number of axis labels (2 to 20).
u3d_wc_system xmin, xmax, ymin, ymax, zmin, zmax Axes system range.
u3d_parallel_projection_on 0 0: perspective projection, 1: parallel projection.
u3d_backplanes_on 1  
u3d_backplane_color 0.8,0.8,0.8, 1.0  
u3d_camera_focal_point 0.6, 0.5, 0.5 Not supported.
u3d_camera_position -1.6, 3.5, 2.1 Not supported.
u3d_camera_view_up 0.2, -0.3, 0.9 Not supported.
u3d_scalebar_horz_on 0 Not supported.
u3d_scalebar_horz_datasource "grid1" Not supported.
u3d_scalebar_vert_on 0 Not supported.
u3d_scalebar_vert_datasource "grid1" Not supported.

Data Attributes

Name Default Value Description
u3d_type - 1: Grid (Surface Plot), 2: xyz-Triple (Scatter Plot).
u3d_scale xoffset, xscale, yoffset, yscale, zoffset, zscale This attribute is not entered in the U3D file, but is created in the _U3D_CreateU3DFileFromDiagramRun (see script\datasets\rs_u3d.ic) function.

Surface Plot (Grid)

The following attributes must be available if u3d_type == 1.

Name Default Value Description
u3d_grid_dimensions dim_y, dim_x Number of Columns (x) and Rows (y) of the grid, e.g.. 40,40
u3d_grid_type 1 1: Grid will be plotted, 0: Grid will not be plotted but will be used as a data source for another grid.
u3d_color_type 0 0: One Color, 1: gradient, 2: channel. If u3d_color_type is 0, the surface will be colored uniformly. It will use the color of the u3d_color_solid parameter. If u3d_color_type is 1, the surface will be filled with a color gradient. In this version the color gradient cannot be adjusted. If u3d_color_type is 2, the z-values of another channel will be used for the colorgradient.
u3d_smooth 0 0: No smoothing, 1: Smoothing. Smoothing will the colors a the facets edges.
u3d_color_solid 0,0,1,1 The first three values are the 3D surface colors if u3d_color_type == 0. The fourth value is the surface transparency.
u3d_color_datasource - Grid name to be used for shading, e.g. “Grid 2”.
u3d_wireframe_on 0 0: Surface will be plotted as a closed surface. 1: Surface will be plotted as a net.
u3d_wireframe_zpos 0 If the wire frame is plotted over the surface, the offset u3d_wireframe_zpos will be added to the z coordinates for the wire frame. The value 0.01 will shift up the wireframe by 1 percent. Valid Range: -0.1 to 0.1 (+- 10%).

Scatter Plot

The following attributes must be available if u3d_type == 2:

Name Default Value Description
u3d_scatter_type 1 Type of scatter plot. 1: Symbols, 2: Bars, 4: Curve.
u3d_marker_type 1 Symbol shape 1: Ball, 2: Cube
ud3_marker_color 0.8, 0.8, 0.8, 1.0 Symbol color.
u3d_marker_size 0.03 Relative symbol size. 0.03 means the diameter is approx. 3 % of the diagram size.
u3d_bar_type 1 1: Bar type. (Only square bars are supported).
ud3_bar_color 1.0, 0.0, 0.0, 1.0 Bar color and transparency.
u3d_bar_size 0.03 Bar size relative to diagram size.
u3d_bar_offset 0.0,0.0,0.0 x,y,z Offset: Offset relative to diagram size.
u3d_curve_type 1 1: Spline. Other types are not available.
u3d_curve_color 0.5, 0.5, 0.5, 1.0 Curve color and transparency.
u3d_curve_size 0.05 Curve width relöative to diagram size. If the number of data points is greater than 100 the curve will be plotted with line width 1.

Notes

Color derive from a vector of 4 numbers in the range of 0.0 to 1.0. The first three elements specify the red, green and blue parts of the color. The forth value specify the transparency.

Examples:

1.0, 0.0, 0.0, 1.0: Red, no transparency (opaque).

0.0, 0.0, 1.0, 0.9: Blue, small transparency.

0.0, 0.0, 0.0, 0.0: Black

UniPlot:3DView Bases

The application uses the OpenGL library. OpenGL is a three-dimensional (3-D) graphics library included with the Microsoft® Windows operating system.

The program uses the netCDF format as there input file format. The files have the extension .u3d. The output is saved as an bitmap file. The bitmap format is PNG. The bitmap size is 1632 by 1224 pixels. This resolution creates good quality results on laser printers.

UniPlot accesses the UniPlot:3DView program by using its COM interface.

U3D Input file format

The input file format is netCDF. The file has the extension .u3d. The file contains all information to create one diagram with multiple datasets. The diagram settings are saved in the global attributes. For each dataset either surface plot (grid data) or scatter plot (triple data) the file contains one data channel.

The grid data is saved in the following form: x-coordinates of the grid, followed by the y-coordinates of the grid, followed by the grid. The grid is saved column wise. The channel attributes contain the attribute u3d_grid_dimensions which specifies the number of columns and rows of the grid matrix.

The U3D file is saved with the PNG file in the UniPlot document.

The functions which creates the U3D file is located in the UniScript file rs_u3d.ic.

U3D Output file format

The output is saved as an PNG bitmap file with the resolution of 1632 by 1224 pixels. The file is saved in the UniPlot document.

id-1733677