Hammer

2019-07-02_16-35-29.png

//Main Box
devDept.Eyeshot.Entities.Region rectReg1 = devDept.Eyeshot.Entities.Region.CreateRectangle(150, 60, true);
Brep ext1 = rectReg1.ExtrudeAsBrep(70);
ext1.Translate(-75, 0, -25);

//LowerCutArc
Plane pln1 = (Plane)Plane.XZ.Clone();
pln1.Translate(0, -50, -25);

devDept.Eyeshot.Entities.Region circReg1 = devDept.Eyeshot.Entities.Region.CreateCircle(pln1, new Point2D(-90, -Math.Sqrt(100 * 100 - 60 * 60)), 100);
ext1.ExtrudeRemove(circReg1, -100);

//SliceCut
devDept.Eyeshot.Entities.Region rectReg2 = devDept.Eyeshot.Entities.Region.CreateRectangle(Plane.XZ, 100, 100);
rectReg2.Translate(-170, 0, -40);
ext1.RevolveRemove(rectReg2, Utility.DegToRad(-15), Utility.DegToRad(30), Vector3D.AxisZ, new Point3D(-70, 0));

//UpperTorusCut
devDept.Eyeshot.Entities.Region circReg2 = devDept.Eyeshot.Entities.Region.CreateCircle(Plane.YZ, 60);
circReg2.Rotate(Math.PI / 2, Vector3D.AxisX);
circReg2.Translate(-50, 0, -25);

Brep torus1 = circReg2.RevolveAsBrep(Utility.TWO_PI, Vector3D.AxisY, new Point3D(-50, 0, -175));
Brep int1 = Brep.Intersection(ext1, torus1)[0];
model1.Entities.Add(int1, Color.DeepSkyBlue);

//Knob
Line line1 = new Line(0, -15, 20, -15);
Line line2 = new Line(20, -15, 20, -25);
Line line3 = new Line(20, -25, 50, -25);
Line line4 = new Line(40, 0, 40, -30);

Curve.Fillet(line3, line4, 5, true, false, true, true, out Arc fillet1);
CompositeCurve cc1 = new CompositeCurve(line1, line2, line3, fillet1, line4);

int1.RevolveAdd(new devDept.Eyeshot.Entities.Region(cc1, Plane.XY, false), Utility.TWO_PI, Vector3D.AxisX, Point3D.Origin);
model1.Entities.Regen();
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.