Article | 70000597 |
Type | Wish |
Product | Engine |
Version | 7005 |
Date Added | 10/12/2015 12:00:00 AM |
Fixed | 7.7006.0.5 (10/13/2015 12:00:00 AM) |
Submitted by | Stathis Tsoumas |
Summary
Generate3dPathSection to work with vdPolyHatch
Solution
Two new overloads of Generate3dPathSection() method were added in vdraw. Using those the user can create 3D constructions using vdPolyHatches. This gives the capability to create constructions with complex cap layouts. For example a tube object can be created with multiple holes of different shapes.
Example
Using the following code we'll create a small tube-like object with a circular hole through it.
//create a vdPolyhatch section object
vdPolyhatch rcSection = new vdPolyhatch(doc);
//add a rect in polyhatch curves
rcSection.PolyCurves.Add(new vdCurves(new vdCurve[] { new vdRect(doc, new gPoint(), 0.1, 0.1, 0.0) }));
//add a circle inside the rect
rcSection.PolyCurves.Add(new vdCurves(new vdCurve[] { new vdCircle(doc, new gPoint(0.05, 0.05), 0.03) }));
//set polyhatch fill on in order start and end caps of the path to be filled.
rcSection.HatchProperties = new vdHatchProperties(VdConstFill.VdFillModeSolid);
//doc.Model.Entities.AddItem(rcSection);
//return;
//create the path where the section will be applied
vdPolyline rcPath = new vdPolyline(doc, new gPoints(new gPoint[] { new gPoint(0, 0), new gPoint(1.2, 0), new gPoint(1.2, 2.1), new gPoint(0, 2.1) }));
//create and display the result Frame Rectangle as a PolyFace object.
vdPolyface face = new vdPolyface();
face.SetUnRegisterDocument(doc);
face.setDocumentDefaults();
bool suc = face.Generate3dPathSection(rcPath, rcSection, new gPoint(), 0, 1.0d, null, null);//new Vector(1, 0, 0), new Vector(1, 0, 0));
if (suc)
{
doc.Model.Entities.AddItem(face);
face.Invalidate();
}
vdPolyHatch to be used as section |
Polyline to be used as path |
![]() |
![]() |
The result polyface |
The circular hole going through the polyface |
![]() |
![]() |