AB4D Forum

Full Version: XYZ Line chart
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I'm really impressed about the program.
Is it possible to generate 3D survey plots (see attached example).
Best regards, Thomas
[Image: http://bendzko.net/img/alm1.png]
I think that creating 3D plots should be quite easy.

First:
To create a 3D line through various points, you can use the following code:

Code:
var polyLine = new PolyLineVisual3D()
{
    Positions = allPositions,
    LineThickness = 2,
    LineColor = Colors.Blue,
    IsClosed = false,
    StartLineCap = LineCap.Flat,
    EndLineCap = LineCap.Flat
};

Than just add the polyLine to the Viewport3D.Children. The line positions are defined in the allPositions (as Point3DCollection).

If you would like to have a 3D curve through the positions, you can add the following code to create the positions on the curve:

Code:
BezierCurve bezierCurve = Ab3d.Utilities.BezierCurve.CreateFromCurvePositions(allPositions);
Point3DCollection curvePoints = bezierCurve.CreateBezierCurve(positionsPerSegment: 10); // How many points between each defined position in the curve

This will convert the allPositions into curvePoints that will have 10 times more positions and will go smoothly through allPositions.

You can then use the curvePoints to create PolyLineVisual3D as before.

You can also easily mark individual positions with creating a SphereVisual3D at each point.

Second:
Now comes a little more tricky part - adding the 3D axis. For that you can reuse the existing plot axes from the "3D Plot" sample that comes with the library. The code to create the axes is all there so you can change it if you want.

If you will have any problems with using 3D axes code or would like to show some other form of 3D data, please post that to forum and I will help you achieve what you want.