// "L" profile
devDept.Eyeshot.Entities.Region r1 = devDept.Eyeshot.Entities.Region.CreatePolygon(Plane.YZ, new Point2D[]{
new Point2D(0, 0),
new Point2D(30, 0),
new Point2D(30, 10),
new Point2D(7, 10),
new Point2D(7, 55),
new Point2D(13, 55),
new Point2D(13, 75),
new Point2D(0, 75)
});
Brep ext1 = r1.ExtrudeAsBrep(-35);
// Remove Slot
devDept.Eyeshot.Entities.Region r3 = devDept.Eyeshot.Entities.Region.CreateSlot(Plane.XZ, 11, 5);
r3.Translate(-23, 0, 65);
ext1.ExtrudeRemove(r3,-13);
// Hollow circle
devDept.Eyeshot.Entities.Region c1 = devDept.Eyeshot.Entities.Region.CreateCircle(Plane.XZ, -17.5, 30, 13.5);
c1.Translate(0, 7, 0);
c1.Translate(0, 8, 0);
ext1.ExtrudeAdd(c1, 8);
devDept.Eyeshot.Entities.Region c2 = devDept.Eyeshot.Entities.Region.CreateCircle(Plane.XZ, -17.5, 30, 8);
c2.Translate(0, 7);
c2.Translate(0, 8);
ext1.ExtrudeRemove(c2, 8+7);
devDept.Eyeshot.Entities.Region r4 = devDept.Eyeshot.Entities.Region.CreateRectangle(Plane.XZ, 6, 10);
r4.Translate(-20.5, 7, 10);
r4.Translate(0, 8, 0);
ext1.ExtrudeRemove(r4, 8);
ext1.ExtrudeAdd(r4, 8);
// Remove two circles
devDept.Eyeshot.Entities.Region c3 = devDept.Eyeshot.Entities.Region.CreateCircle(Plane.XY, -7, 22, 5);
devDept.Eyeshot.Entities.Region c4 = devDept.Eyeshot.Entities.Region.CreateCircle(Plane.XY, -28, 22, 5);
ext1.ExtrudeRemove(c3, 10);
ext1.ExtrudeRemove(c4, 10);
// Fillet
// PrintEdgeIndices(ext1);
const double fRadius = 5;
ext1.Fillet(28, fRadius);
ext1.Fillet(29, fRadius);
design1.Entities.Add(ext1, Color.CornflowerBlue);
Utility method to enumerate the Brep indices:
void PrintEdgeIndices(Brep brep)
{
for (int i = 0; i < brep.Edges.Length; i++)
{
var curve = brep.Edges[i].Curve;
devDept.Eyeshot.Entities.Text tx = new devDept.Eyeshot.Entities.Text(curve.PointAt(curve.Domain.ParameterAt(0.5)), i.ToString(), 2, devDept.Eyeshot.Entities.Text.alignmentType.MiddleCenter)
{
Billboard = true
};
design1.Entities.Add(tx);
}
}
Comments
Please sign in to leave a comment.