Sheet Metal (base flange)

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

sheet.jpg

int thickness = 2;
int length = 120;
int heigth = 80;
int depth = 60;
int baseRadius = 5;
int bottomLength = 10;
int sideLength = 8;
int sideRadius = 3;
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));
sheet.AddFlange(edgeIndex, 0.5, bottomLength, Math.PI);

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

// front side flange
edgeIndex = sheet.GetStraightEdgeIndex(new Point3D(baseRadius + 1, 0, heigth - thickness));
sheet.AddFlange(edgeIndex, sideRadius, sideLength, Math.PI / 2);
edgeIndex = sheet.GetStraightEdgeIndex(new Point3D(baseRadius + 1, -sideRadius, heigth - (sideRadius + sideLength + 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, sideRadius, sideLength, Math.PI / 2);
edgeIndex = sheet.GetStraightEdgeIndex(new Point3D(baseRadius + 1, depth + sideRadius, heigth - (sideRadius + sideLength + 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);

model1.Entities.Add(sheet, Color.Gray);
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.