ASE Home Page Products Download Purchase Support About ASE
ChartDirector General
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Support of 3D slice charts!
Posted by Adil on Sep-10-2022 22:29
Attachments:
Hi,

Are there any future plans to support contour plots parallel to XZ and YZ planes in 3D space? See the figure below for an example.

This is quite frequent in all types of engineering apps. This is extremely useful for the analysis of 3D applications.

This is somewhat a generalization of the CD's surface chart.

Regards,
Adil
slices.png

  Re: Support of 3D slice charts!
Posted by Peter Kwan on Sep-12-2022 19:03
Hi Adil,

This is the first time we see this kind of visualization, so we have not got any plan yet.

The nearest visualization that is achievable now with ChartDirector would be something analogous to the "Contour Plot Cross Section" sample code in ChartDirector 7:

https://www.advsofteng.com/doc/cdnet.htm#contourcrosssection.htm

In the cross section sample code, the user can drag the crosshair in the center chart, and it will display the projections as two separate charts on the left and bottom.

For your case, the left and bottom charts will also be a contour chart. The center chart can be a contour chart or it can be a surface chart. If it is a surface chart, it should still be possible for the user to drag the crosshair on the chart. (This part would need to be written with your own code, but ChartDirector can provide enough information so your code can know where is the mouse on the surface.) Alternatively, you can use other user interface (such as scrollbars) to allow the user to move the crosshair.

Best Regards
Peter Kwan

  Re: Support of 3D slice charts!
Posted by Adil on Sep-13-2022 00:24
Hi Peter,

The example provided here (https://www.advsofteng.com/doc/cdnet.htm#contourcrosssection.htm) by CD7 assumes a 2D contour chart and therefore the slices shown on the right and bottom are essentially 1D plots.

Meanwhile, in the above-posted figure, the YZ and XZ cross-sections are slices extracted from a 3D dataset such as 3D scatter points or just a 3D grid of points.

What users of CD can expect is not the process of extracting the data as they can do it in their application, but rather visualization of the data given along predefined YZ and XZ planes.

I think this is not too much difficult to implement in CD's source code as the library already supports that for XY using surface charts.

While one creates a surface chart and attaches X and Y data to it like this:

SurfaceChart* c = new SurfaceChart(600, 600);
c->setData(dataX, dataY, dataVar);
...

If we describe one slice by a new SliceChart class, we would expect something like;
SliceChart* c = new SliceChart(600, 600);
c->setDirection("Y");   // XZ slice normal to "Y"-axis
c->setData(dataX, dataZ, dataVar);
...

CD needs to draw in the XZ plane instead of an XY plane. That's it.

If a user needs many slices like in the above figure he can consider an array of pointers to such objects such as std::vector<SliceChart*>.

Regards,
Adil

  Re: Support of 3D slice charts!
Posted by Peter Kwan on Sep-13-2022 15:53
Hi Adil,

One thing that the ChartDirector graphics engine cannot do is to draw mutually overlapping surfaces or penetrating surfaces. For this type of surfaces, we cannot draw the surfaces one by one as each surface can be in front of another surface. (For example, surface A covers part of surface B. Surface B covers part of surface A.) Some 3D graphics algorithms have to be used, which is not currently implemented in ChartDirector.

For your chart, the YZ and XZ surfaces are in fact penetrating. So we cannot draw this kind of charts yet.

The best ChartDirector can do is to draw the surfaces individually as contour charts, and then another software is needed to draw the 3D part using these surfaces as textures.

Best Regards
Peter Kwan