Shaver

2019-07-03_8-46-18.png

model1.Units = linearUnitsType.Inches;

Plane right = Plane.YZ;
Plane pln1 = (Plane)right.Clone();
pln1.Rotate(Utility.DegToRad(40), Vector3D.AxisY);

Plane pln2 = (Plane)right.Clone();
pln2.Rotate(Utility.DegToRad(25), Vector3D.AxisY);

Plane pln3 = pln2.Offset(-.5);
Plane pln4 = (Plane)right.Clone();
pln4.Rotate(Utility.DegToRad(-30), Vector3D.AxisY);

Plane pln5 = pln1.Offset(1);
Plane pln6 = (Plane)right.Clone();
pln6.Rotate(Utility.DegToRad(-34), Vector3D.AxisY);

Plane pln7 = pln6.Offset(0.55);

Circle sketch3 = new Circle(right, new Point2D(0, 3.9), 1.5 / 2);
sketch3.Rotate(Utility.DegToRad(-90), sketch3.Plane.AxisZ, sketch3.Plane.Origin);

Circle sketch4 = new Circle(pln3, new Point2D(0, 3.5), 1.8 / 2);
sketch4.Rotate(Utility.DegToRad(-90), sketch4.Plane.AxisZ, sketch4.Plane.Origin);

Ellipse sketch5 = new Ellipse(pln4, new Point2D(0, 6), 4.0 / 2, 2.0 / 2);
sketch5.Rotate(Utility.DegToRad(-90), sketch5.Plane.AxisZ, sketch5.Plane.Origin);

Circle sketch6 = new Circle(pln5, new Point2D(0, 3.7), 0.6 / 2);
sketch6.Rotate(Utility.DegToRad(-90), sketch6.Plane.AxisZ, sketch6.Plane.Origin);

Brep loft1 = Brep.Loft(new ICurve[] { sketch6, sketch4, sketch3, sketch5 }, 2);

devDept.Eyeshot.Entities.Region cr = devDept.Eyeshot.Entities.Region.CreateCircle(right, new Point2D(0, 2.5), 5.6 / 2);
devDept.Eyeshot.Entities.Region rr = devDept.Eyeshot.Entities.Region.CreateRectangle(right, -2, 2.5, 4, 5);
devDept.Eyeshot.Entities.Region sketch2 = devDept.Eyeshot.Entities.Region.Difference(rr, cr)[0];
loft1.ExtrudeRemove(sketch2, -5);
loft1.SplitBy(pln7, out Brep[] split1, out Brep[] split2);

Brep body = split2[0];
Brep cap = split1[0];

devDept.Eyeshot.Entities.Region rr1 = devDept.Eyeshot.Entities.Region.CreateRectangle(.05, .05, true);
rr1.Translate(0, -1, 0);
rr1.Rotate(Utility.DegToRad(-30), Vector3D.AxisY, Point3D.Origin);
cap.ExtrudeRemovePattern(rr1, 10, Plane.XY, 1, 1, 0.1, 21);

model1.Entities.Add(body, model1.Layers[0].Name, Color.DodgerBlue);
model1.Entities.Add(cap, model1.Layers[0].Name, Color.Gray);

Previous versions of this article: Eyeshot 10

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.