Table of Contents

Class vdGroundSurface

Namespace
VectorDraw.Professional.vdFigures
Assembly
VectorDraw.Professional.dll

Represents a ground surface described by a set of 3D points and rendered using Delaunay triangulation. The class can render the surface as triangles, as a regular mesh, and/or compute contour curves.

public sealed class vdGroundSurface : vdFigure, IDisposable, IVDSerialise, IBaseObject
Inheritance
vdGroundSurface
Implements
Inherited Members

Examples

Creating a ground surface from a range of 3d points with contours for levels 10,20,30,40 and with triangle display mode

var ground = new vdGroundSurface(doc, new gPoints(new gPoint[]
{
    new gPoint(0,0,0),
    new gPoint(100,0,0),
    new gPoint(100,100,0),
    new gPoint(0,100,0),
    new gPoint(50,50,50)
}));
ground.ContourLevels = new DoubleArray(new double[] { 10, 20, 30, 40 });

ground.DispMode = vdGroundSurface.DisplayMode.Triangle | vdGroundSurface.DisplayMode.Contours;
doc.Model.Entities.AddItem(ground);

doc.CommandAction.View3D("VISE");

Remarks

The vdGroundSurface stores input vertices in world coordinates and performs Delaunay triangulation to produce gTriangles (accessible via the Triangles property). It supports:

  • Triangle rendering and conversion to a vdPolyface for display or export.
  • Regular mesh generation with adjustable MeshSize and base GroundLevel.
  • Contour level computation via ContourLevels and contour extraction as vdPolyCurves.
  • Gradient fills for contours and per-vertex gradient coloring through GradientColors.
  • Mapped images applied onto produced polyfaces via MappedImages.
  • Optionally locking user-supplied triangles using LockTriangles to prevent automatic re-triangulation.

Notes:

  • Many geometric results are lazily initialized (for example, Triangles, cached bounding box, VectorDraw.Professional.vdFigures.vdGroundSurface.Mesh and Contours). Call Update() after mutating geometry to refresh derived data. Setting properties such as Points will raise the document modification events.
  • The class integrates with the rendering pipeline and respects the owning vdDocument settings (for example smoothing via SmoothAngle when set to -1).

Constructors

vdGroundSurface()

Initializes the vdGroundSurface object.

vdGroundSurface(vdDocument)

Initializes a new instance of the vdGroundSurface object and registers it to the passed Document.

vdGroundSurface(vdDocument, gPoints)

Initializes a new instance of the vdGroundSurface object and registers it to the passed Document.

Properties

BoundingBox

Gets the Bounding Box of the vdGroundSurface object in WorldCoordinate System.

ContourLevels

Get/Set an array of doubles indicating the contours of the object.

Contours

Calculates the contours as vdPolyCurves.

DispMode

Get/Set the display mode for the vdGroundSurface object.

Draw3DFlag

overrides the Draw3DFlag

FitContours

Specifies if the contours will be drawn as Splines vdPolylines with flag SFlagFITTING.

GradientColors

Returns an ElevatedGradientColors collection with two elements. First element is the minimum Z of this BoundingBox with GradientMinimunColor color. Second element is the maximun Z of this BoundingBox with GradientMaximunColor color.

GradientFill

Specifies if the contours will be drawn as closed filled curves.

GradientMaximunColor

Specifies the color of the last level of contour curves

GradientMinimunColor

Specifies the color of the first level of contour curves

GroundLevel

Represents the Z value of the Ground used while calculating the Mesh of the vdGroundSurface.

LockTriangles

Enable/Disable the recalculation of triangulation after the Update method.

MappedImages

Get/Set the mapped images of the object.

MeshSize

Represents the size in drawing units of each mesh when the surface is drawn.

Points

Get/Set a collection of points needed to draw the surface.The points are given in World Coordinate System(WCS).

SectionClipCoverFacesColor

Get/Set color that used to fill the Section clip faces. Default value is Color.Empty in order the vdDocument.GlobalRenderProperties.SectionClipCoverFacesColor color to be used.

SmoothAngle

Get/Set the angle in degrees between 0 and 90 used to calculate normals for each vertex in each face when rendering a polyface object. Defines the maximun angle which is compared with the angles between the planes of neighboring faces in order to filter out the normals of the planes that will added in the average calculation.

Triangles

Triangulates the points of the object using Delaunay algorithm and creates triangles.

Methods

CalculateContourLevels(double, double, double)

Calculates contours from a minimum level to a maximum level using a predifined step.

CalculateContourLevels(int, double, double)

Calculate specified level count from a minimum to a maximum value.

CalculateContours(gPoint, Vector, ref vdPolyCurves)

Calculate the section of the triangles with a plane

DeSerialize(DeSerializer, string, object)

This Function is called foreach field name of the vdGroundSurface object when opening in vdml format.

Draw(vdRender)

Called in order to draw the object in a specified vdRender object.

Explode()

Explodes the vdGroundSurface object into vd3DFace objects.

GetCompareHash()

Returns a unique 32 bit integer value according to the object type and its properties values

GetGripPoints()

A function returning the grip points of the object.

GetMappedImageAt(int)

Returns the VectorDraw.Render.IBindMappedImage at the specified index.

GetMappedImages()

Returns an array of Images and their matrixes that applied over the Polyface object.

GetNumMappedImages()

Returns the Number of IBindMappedImage

GetTableDependecies(vdTableDependeciesArgs)

Fills the passed vdTableDependeciesArgs args with all the table references of this object (vdLayer, vdBlock, vdDimstyle, vdLineType, vdTextstyle, vdImageDef, vdHatchPattern etc).

GetValidGripPointsItems()

Returns the number of valid grip points of the object. Must return the same number of points as the GetGripPoints() method.

InitializeProperties()

Resets the properties of the vdGroundSurface object to the Default values.

InternalSetOwner(vdBaseObject)

Internally used only.

Set the object owner

MatchProperties(vdPrimary, vdDocument)

Matches all the common properties from an object and sets them to this object.

MaxLevel()

Get the maximum z value of all points of the surface.

MinLevel()

Get the minimum z value of all points of the surface.

MoveGripPointsAt(Int32Array, double, double, double)

This function is intended to be called during a grip edit of the object.

SelectUserTriangles(gTriangles)

Set new user defined triangles for the object.

Serialize(Serializer)

This Function is called when saving the vdGroundSurface object to vdml format.

SplitFaces(gPoints, ProgressMeter, double)

Split all the triangles, created using Delaunay algorythm by calling the Triangles property of this ground surface object, with the lines defined by the segments between the given points

ToMesh(int)

Converts the vdGroundSurface into a vdPolyface object.

ToString()

Gets a System.String that represents the type of the vdGroundSurface Object.

Transformby(Matrix)

Transforms all geometrical properties of this object by the specified Matrix.

Update()

Updates the object after change of properties.

getOsnapPoints(Matrix, OsnapMode, gPoint, gPoint, int, OsnapPoints)

Overrrides the getOsnapPoints(Matrix, OsnapMode, gPoint, gPoint, int, OsnapPoints).

See Also