Angular Bracket

// Extruded L shape
CompositeCurve cc1 = new CompositeCurve(new ICurve[]{
        new Line(Plane.XZ, 0, 0, 50, 0),
        new Line(Plane.XZ, 50, 0, 50, -10),
        new Line(Plane.XZ, 50, - 10, -5, -10),
        new Arc(Plane.XZ, new Point2D(-5, -5), new Point2D(-10, -5), new Point2D(-5, -10)),
        new Line(Plane.XZ, -10, -5 , - 10, 20),
        new Line(Plane.XZ, -10, 20, 0, 20),
        new Line(Plane.XZ, 0, 20, 0, 0)
});

devDept.Eyeshot.Entities.Region r1 = new devDept.Eyeshot.Entities.Region(cc1, Plane.XZ, true);
r1.Translate(0, 20);
Brep ext1 = r1.ExtrudeAsBrep(40);

devDept.Eyeshot.Entities.Region r2 = devDept.Eyeshot.Entities.Region.CreateSlot(15, -10, 20, 5, 0, false);
ext1.ExtrudeRemove(r2, -10);

devDept.Eyeshot.Entities.Region r3 = devDept.Eyeshot.Entities.Region.CreateSlot(15, 10, 20, 5, 0, false);
ext1.ExtrudeRemove(r3, -10);

devDept.Eyeshot.Entities.Region r4 = devDept.Eyeshot.Entities.Region.CreateRectangle(10, 15, true);
r4.Translate(-5, 0, 20);
ext1.ExtrudeRemove(r4, -15);

// Extruded bend
Plane pln = new Plane(new Point3D(50, 0), Vector3D.AxisX, Vector3D.AxisY);
pln.Rotate(Math.PI / 6, Vector3D.AxisY, new Point3D(50, 0));

CompositeCurve cc2 = new CompositeCurve(new ICurve[]{
        new Line(pln, 0, 20, 30, 20),
        new Arc(pln, new Point2D(30, 0), 20, -Math.PI/2, Math.PI/2),
        new Line(pln, 30, -20, 0, -20),
        new Line(pln, 0, -20, 0, 20)
});
devDept.Eyeshot.Entities.Region r5 = new devDept.Eyeshot.Entities.Region(cc2, pln, true);
ext1.ExtrudeAdd(r5, -10);

devDept.Eyeshot.Entities.Region r6 = devDept.Eyeshot.Entities.Region.CreateCircle(pln, 30, 0, 25 / 2);
ext1.ExtrudeRemove(r6, -10);

// Linear edge search
for (int i = 0; i < ext1.Edges.Length; i++)
{
    Brep.Edge edge = ext1.Edges[i];
    if (edge.Curve is Line ln)
    {
        if (Vector3D.AreOpposite(ln.StartTangent, Vector3D.AxisY))
        {
            if (ln.StartPoint.Z == 0 && ln.StartPoint.X > 0)
            {
                ext1.Fillet(i, 5);
            }
        }
    }
}

// Rectangular cut
devDept.Eyeshot.Entities.Region r7 = devDept.Eyeshot.Entities.Region.CreateRectangle(pln, 45, 0, 30, 5, 0, true);
r7.Rotate(Math.PI / 4, pln.AxisZ, pln.PointAt(30, 0));
ext1.ExtrudeRemove(r7, -10);

ext1.MergeFaces();
design1.Entities.Add(ext1, Color.Gray);

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.

Articles in this section

See more