Table of Contents

Class vdPolyhatch

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

Represents a hatch composed of one or more curve groups (vdPolyCurves) that define filled regions and optional boundary outlines.

public class vdPolyhatch : vdFigure, IDisposable, IVDSerialise, IvdHatchFigure, IBaseObject
Inheritance
vdPolyhatch
Implements
Inherited Members

Examples

// Example: create a square with a circular hole and add it to a document's entities

vdRect rect = new vdRect(doc, new gPoint(0.0, 0.0, 0.0), 10.0, 10.0, 0.0);
vdCurves outers = new vdCurves();
outers.AddItem(rect);
outers.Operation = VectorDraw.Geometry.GpcWrapper.ClippingOperation.Union;

vdCircle ci = new vdCircle(doc, new gPoint(5.0, 5.0, 0.0), 3.0);
vdCurves innerholes = new vdCurves();
innerholes.AddItem(ci);
innerholes.Operation = VectorDraw.Geometry.GpcWrapper.ClippingOperation.Difference;

// Create a vdPolyhatch and select the curves for the hatch pattern
var hatch = new vdPolyhatch(doc);
hatch.PolyCurves.AddItem(outers);
hatch.PolyCurves.AddItem(innerholes);

// Configure hatch appearance
hatch.HatchProperties = new vdHatchProperties(VdConstFill.VdFillModeSolid);
hatch.HatchProperties.DrawBoundary = true;
// Optionally set HatchProperties.FillColor or HatchProperties.HatchScale here
hatch.HatchProperties.FillColor = new vdColor(Color.Red);
// Add to a document (replace 'doc' with your vdDocument instance)
doc.Model.Entities.AddItem(hatch);
doc.ZoomExtents();
doc.Redraw(false);

Remarks

A vdPolyhatch stores geometric boundary data in vdPolyCurves
and visual filling properties in vdHatchProperties.
All curves that form the hatch are expected to lie in the same plane.
The object supports extrusion via ExtrusionVector and thickness via Thickness, and can be converted to a mesh using ToMesh(int) for rendering or export.

Constructors

vdPolyhatch()

Initializes the vdPolyhatch object.

vdPolyhatch(vdDocument)

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

vdPolyhatch(vdDocument, vdPolyCurves, vdColor, bool)

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

Properties

BoundingBox

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

ECSMatrix

Gets the transformation Matrix that converts coordinates from the object's local coordinate system (object coordinate system, OCS) to the World Coordinate System (WCS).

ExtrusionVector

Get/Set the 3D vector extrusion direction for the object.

HatchProperties

Get/Set the hatch properties of the vdPolyhatch object.

PolyCurves

Gets the collection of curve groups that make up this hatch.

Thickness

Get/Set the object's thickness in Drawing Units.

Methods

ApplyAutoNormal()

Change the ExtrusionVector according the PolyCurves points in case all of them are in the same plane

CreateHatchedPolyline(Vertexes)

Create a vdPolyhatch object having one vdPolyline object created from the given points.

DeSerialize(DeSerializer, string, object)

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

Draw(vdRender)

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

Explode()

Explodes each vdCurve object.

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.

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 vdPolyhatch object to the Default values.

InternalSetOwner(vdBaseObject)

Internally used only.

Set the object owner

IntersectWith(vdFigure, VdConstInters, gPoints)

Finds the intersection points of an vdPolyhatch object with another object.

MatchProperties(vdPrimary, vdDocument)

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

MoveGripPointsAt(Int32Array, double, double, double)

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

Serialize(Serializer)

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

ToMesh(int)

Converts the vdPolyface into a vdPolyface object.

ToString()

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

Transformby(Matrix)

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

Update()

Updates the object after change of properties.

See Also