# Sheet Metal (base flange)

This article explains how to model a sheet metal starting from a LinearPath object.

``````int thickness = 2;
int length = 120;
int heigth = 80;
int depth = 60;
int bottomLength = 10;
int sideLength = 8;
LinearPath lp = new LinearPath(new Point3D[]
{
new Point3D(0, 0, 0),
new Point3D(0, 0, heigth),
new Point3D(length, 0, heigth),
new Point3D(length, 0, 0),
});

// base flange
Brep sheet = lp.ExtrudeAsBrep(new Interval(0, depth), baseRadius, thickness);

// left bottom flange
int edgeIndex = sheet.GetStraightEdgeIndex(new Point3D(thickness, 1, 0));

//right bottom flange
edgeIndex = sheet.GetStraightEdgeIndex(new Point3D(length - thickness, 1, 0));

// front side flange
edgeIndex = sheet.GetStraightEdgeIndex(new Point3D(baseRadius + 1, 0, heigth - thickness));
sheet.AddFlange(edgeIndex, 1, 5, Math.PI / 2);

// rear side flange
edgeIndex = sheet.GetStraightEdgeIndex(new Point3D(baseRadius + 1, depth, heigth - thickness));
sheet.AddFlange(edgeIndex, 1, 5, Math.PI / 2);

// Arc crossing hole
CompositeCurve cc = new CompositeCurve(new List()
{
new Line(new Point3D(-5, 10, -10),new Point3D(-5,10, heigth - 30)),
new Arc(new Plane(new Point3D(-5,0,0),Plane.YZ.AxisZ), new Point2D(depth/2, heigth-30), 20, 0, Math.PI),
new Line(new Point3D(-5,depth/2 + 20, heigth - 30),new Point3D(-5,depth/2 + 20,-10)),
});
sheet.ExtrudeRemove(new Region(cc), -150);