The following lines allow you to draw this model in the above picture from scratch:
// Body
CompositeCurve bodyProfile = new CompositeCurve(
new Line(-92, 0, -10, 0),
new Arc(-10, 10, 0, 10, Math.PI * 1.5, Math.PI * 2),
new Line(0, 10, 0, 77),
new Arc(-10, 77, 0, 10, 0, Math.PI / 2),
new Line(-10, 87, -92, 87),
new Line(-92, 87, -92, 75),
new Line(-92, 75, -22, 75),
new Arc(-22, 65, 0, 10, 0, Math.PI / 2),
new Line(-12, 65, -12, 22),
new Arc(-22, 22, 0, 10, Math.PI * 1.5, Math.PI * 2),
new Line(-22, 12, -92, 12),
new Line(-92, 12, -92, 0)
);
Region bodyRegion = new Region(bodyProfile);
bodyRegion.Rotate(Math.PI / 2, Vector3D.AxisX);
Brep body = bodyRegion.ExtrudeAsBrep(74);
// Vertical Holes
Region
verticalHoleA = new Region(new Circle(-77, -37, 0, 7.5)),
verticalHoleB = new Region(new Circle(-32, -37, 75, 7.5));
// Curvy side
Region curvyRemovalRegion = new Region(new ICurve[]{
new Circle(new Point3D(37, -37, 87), 200),
new Circle(new Point3D(37, -37, 87), 90)
});
body.ExtrudeRemove(curvyRemovalRegion, -12);
body.ExtrudeRemove(verticalHoleA, 12);
body.ExtrudeRemove(verticalHoleB, 12);
// Horn
CompositeCurve hornProfile = new CompositeCurve(
new Line(0, 50.75, 65, 50.75),
new Line(65, 50.75, 65, 63),
new Line(65, 63, 63.5, 64.5),
new Line(63.5, 64.5, 5, 64.5),
new Arc(5, 69.5, 0, 5, Math.PI, Math.PI * 1.5),
new Line(0, 69.5, 0, 47)
);
Region hornRegion = new Region(hornProfile);
hornRegion.Rotate(Math.PI / 2, Vector3D.AxisX);
hornRegion.Translate(new Vector3D(0, -37, 0));
body.RevolveAdd(hornRegion, Math.PI * 2, Vector3D.AxisX, new Point3D(0, -37, 47));
design1.Entities.Add(body, Color.DarkOrange);
design1.SetView(viewType.Trimetric);
design1.ZoomFit();
Now then, let us generate the corresponding STL file:
WriteSTL ws = new WriteSTL(design1, "drawings_125.stl");
ws.DoWork();
Comments
Please sign in to leave a comment.