🌶️ 3D-DP949

// Main polygon
devDept.Eyeshot.Entities.Region cir1 = devDept.Eyeshot.Entities.Region.CreateCircle(Plane.YZ, 0, 76, 20);
Line lR = UtilityEx.GetLinesTangentToCircleFromPoint((Circle)cir1.ContourList[0], new Point3D(0, -32, 20))[1];       
Line lL = UtilityEx.GetLinesTangentToCircleFromPoint((Circle)cir1.ContourList[0], new Point3D(0, 32, 20))[0];         
Arc arc = new Arc(Plane.YZ, new Point2D(0, 76), 20, devDept.Geometry.Utility.DegToRad(0), devDept.Geometry.Utility.DegToRad(180));
arc.TrimBy(lL.EndPoint, true);
arc.TrimBy(lR.EndPoint, false);

CompositeCurve cc1 = new CompositeCurve(
  lR,
  arc,
  lL,
  new Line(Plane.YZ, 32, 20, 32, 0),
  new Line(Plane.YX, 32, 0, -32, 0),
  new Line(Plane.YZ, -32, 0, -32, 20));

devDept.Eyeshot.Entities.Region reg1 = new devDept.Eyeshot.Entities.Region(cc1);
Brep ext1 = reg1.ExtrudeAsBrep(new Interval(-136, -6));

// Remove operations
devDept.Eyeshot.Entities.Region rem1 = devDept.Eyeshot.Entities.Region.CreateRectangle(Plane.XZ, 33, 0, 55, 8, 0, false);
ext1.ExtrudeRemove(rem1, new Interval(-32, 32));

devDept.Eyeshot.Entities.Region rem2 = devDept.Eyeshot.Entities.Region.CreateRectangle(Plane.XZ, 20, 20, 50, 76, 0, false);
ext1.ExtrudeRemove(rem2, new Interval(-32, 32));

devDept.Eyeshot.Entities.Region rem3 = devDept.Eyeshot.Entities.Region.CreateRectangle(Plane.XZ, 84, 20, 52, 76, 0, false);
ext1.ExtrudeRemove(rem3, new Interval(-32, 32));

// Extrude add circles
devDept.Eyeshot.Entities.Region cir2 = devDept.Eyeshot.Entities.Region.CreateCircle(Plane.YZ, 0, 76, 20);
ext1.ExtrudeAdd(cir2, new Interval(0, 6));

devDept.Eyeshot.Entities.Region cir3 = devDept.Eyeshot.Entities.Region.CreateCircle(Plane.YZ, 0, 76, 20);          
ext1.ExtrudeAdd(cir3, new Interval(84, 90));

// Central hole
devDept.Eyeshot.Entities.Region rem4 = devDept.Eyeshot.Entities.Region.CreateCircle(Plane.YZ, 0, 76, 10);          
ext1.ExtrudeRemove(rem4, new Interval(0, 90));


// Triangular rib
devDept.Eyeshot.Entities.Region reg3 = devDept.Eyeshot.Entities.Region.CreatePolygon(Plane.XZ, new Point2D[]{
    new Point2D(84, 20),
    new Point2D(134, 20),
    new Point2D(84, 48)
});
ext1.ExtrudeAdd(reg3, new Interval(-4, 4));


// Rectangular rib
devDept.Eyeshot.Entities.Region reg4 = devDept.Eyeshot.Entities.Region.CreateRectangle(Plane.XZ, 20, 20, 50, 28, 0, false);
ext1.ExtrudeAdd(reg4, new Interval(-4, 4));

// Holes
devDept.Eyeshot.Entities.Region cir4 = devDept.Eyeshot.Entities.Region.CreateCircle(Plane.XY, 114, 18, 6);
ext1.ExtrudeRemovePattern(cir4, new Interval(0, 20), -59.3, 2, -36, 2);


design1.Entities.Add(ext1, design1.Layers[0].Name, Color.Khaki);

image

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.

Articles in this section

See more