Prod.: Engine, ver.: 6012, ID: 60000327, Wish : Volume calculation of vdGroundSurface object

Wish : Volume calculation of vdGroundSurface object

Article60000327
TypeWish
ProductEngine
Version6012
Date Added11/23/2007
FixedYes [5/29/2008]
Submitted byGeorge Siarov
Keywords

Subject

Volume calculation of vdGroundSurface object

Summary

Volume calculation of vdGroundSurface object

Solution

Added in 6013.

New method added in VectorDraw.Geometry.gTriangles object named Volume with the following syntax:

/// <summary>
/// Calculate the volume of the collection sliced portion, using a plane from the passed parameters.
/// </summary>
/// <param name="origin">A point needed to determine the slice plane.</param>
/// <param name="direction">A Vector that is perpendicular to the plane and specifies the direction of the visible portion of the gTriangles.</param>
/// <returns>The volume of the sliced collection portion.</returns>
public double Volume(gPoint origin, Vector direction)

and can be used as following to a vdGroundSurface object :

vdGroundSurface
gsurf = new vdGroundSurface();
gsurf.SetUnRegisterDocument(vdFramedControl.BaseControl.ActiveDocument);
gsurf.setDocumentDefaults();
//Fill Points Here
gsurf.Triangles.Volume(new gPoint(0, 0, 0), new Vector());

In the following picture in order to compute the volume above the blue plane we simply call the Volume method of the vdGroundSurface's triangles passing a point and a Vector that determine this Blue plane.