Shaver

viewportLayout1.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);

devDept.Eyeshot.Entities.Ellipse sketch5 = new devDept.Eyeshot.Entities.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);

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

Region cr = new CircularRegion(right, new Point2D(0, 2.5), 5.6 / 2);

Region rr = new RectangularRegion(right, -2, 2.5, 4, 5);

Region sketch2 = Region.Difference(rr, cr)[0];

loft1.ExtrudeRemove(sketch2, -5);

Solid3D[] split1, split2;
loft1.SplitBy(pln7, out split1, out split2);

Solid3D body = split2[0];
viewportLayout1.Entities.Add(body, 0, System.Drawing.Color.DodgerBlue);
Solid3D cap = split1[0];
viewportLayout1.Entities.Add(cap, 0, System.Drawing.Color.Gray);

RectangularRegion rr1 = new RectangularRegion(.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);

viewportLayout1.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.