Mounting Bracket

Plane pln1 = new Plane(Point3D.Origin, -1 * Vector3D.AxisZ, Vector3D.AxisY);

Region reg1 = Region.CreatePolygon(Plane.XY, new Point2D[]
 {
    new Point2D(0, 41),
    new Point2D(9, 41),
    new Point2D(40.09, 25),
    new Point2D(49, 25),
    new Point2D(49, 7),
    new Point2D(42, 7),
    new Point2D(42, 0),
    new Point2D(0, 0)
 });

Brep ext1 = reg1.ExtrudeAsBrep(-56);

Region reg2 = Region.CreatePolygon(pln1, new Point2D[]
{
    new Point2D(0, 0),
    new Point2D(0, 30.5),
    new Point2D(2, 30.5),
    new Point2D(2, 32.5),
    new Point2D(9.81, 32.5),
    new Point2D(9.81, 30.5),
    new Point2D(16.5, 30.5),
    new Point2D(16.5, 36),
    new Point2D(39.5, 36),
    new Point2D(39.5, 30.5),
    new Point2D(45, 30.5),
    new Point2D(45, 32.5),
    new Point2D(54, 32.5),
    new Point2D(54, 30.5),
    new Point2D(56, 30.5),
    new Point2D(56, 0)
});

ext1.RevolveRemove(reg2, -Math.PI / 2, Vector3D.AxisZ, Point3D.Origin);            

Region reg3 = Region.CreateSlot(Plane.ZX,-14, 49, 14, 7.5, Math.PI/2, true);
reg3.Translate(0, 20.5, 0);
ext1.ExtrudeRemovePattern(reg3, 10, pln1, 30, 2, 0, 1);

Region c1 = Region.CreateCircle(Plane.ZX, -13, 42, 4.5);
ext1.ExtrudeRemovePattern(c1, 20.5, pln1, 30, 2, 0, 1);

int[] faces = { 0, 3, 4, 7, 8, 9, 13, 15, 16, 21, 22, 23, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 };
foreach (var item in faces)
{
    ext1.Faces[item].Color = Color.Gray;
}

Mirror mirr1 = new Mirror(pln1);
Brep copy = (Brep)ext1.Clone();
copy.TransformBy(mirr1);

ext1 = Brep.Union(ext1, copy)[0];

model.Entities.Add(ext1, Color.Green);
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

1 comment
  • Hi,

    is it possible to get all the needed using in the code.

    I'm looking for Brep and I cannot find it.

    Regards Jürgen

Please sign in to leave a comment.