Beispiel #1
0
        /// <summary>
        /// create a hollowed cone beheaded
        /// </summary>
        /// <param name="largeEndDiameter">diameter of the base</param>
        /// <param name="totalHeight">height of the cone</param>
        /// <param name="smallEndDiameter">radius of the top</param>
        /// <param name="wallThickness">thickness</param>
        public Cone(double wallThickness, double largeEndDiameter, double smallEndDiameter, double totalHeight, double useless1, double useless2, double useless3, double useless4, double useless5)
        {
            // external part
            BRepPrimAPI_MakeCone aMakeCone = new BRepPrimAPI_MakeCone(new gp_Ax2(new gp_Pnt(0, 0, 0), new gp_Dir(0, 0, 1)), largeEndDiameter / 2, smallEndDiameter / 2, totalHeight);
            TopoDS_Shape         myBody    = aMakeCone.Shape();
            TopoDS_Solid         mySolid   = aMakeCone.Solid();

            // internal part
            BRepPrimAPI_MakeCone aMakeHollowedPart = new BRepPrimAPI_MakeCone(new gp_Ax2(new gp_Pnt(0, 0, 0), new gp_Dir(0, 0, 1)), largeEndDiameter / 2 - wallThickness, smallEndDiameter / 2 - wallThickness, totalHeight);
            TopoDS_Shape         hollowedPart      = aMakeHollowedPart.Shape();

            // cut
            BOPAlgo_BOP test = new BOPAlgo_BOP();

            test.AddArgument(mySolid);
            TopTools_ListOfShape LS = new TopTools_ListOfShape();

            LS.Append(hollowedPart);
            test.SetTools(LS);
            test.SetRunParallel(true);
            test.SetOperation(BOPAlgo_Operation.BOPAlgo_CUT);
            test.Perform();
            myBody = test.Shape();

            // triangulation
            myFaces = Triangulation(myBody, 0.7f);
        }
Beispiel #2
0
        /// <summary>
        /// create a hollowed cone beheaded
        /// </summary>
        /// <param name="myRadius">radius of the base</param>
        /// <param name="myHeight">height of the cone</param>
        /// <param name="myHeadRadius">radius of the top</param>
        /// <param name="myThickness">thickness</param>
        public HollowedConeBeheaded(double baseDiameter, double myHeight, double headDiameter, double myThickness)
        {
            // external part
            BRepPrimAPI_MakeCone aMakeCone = new BRepPrimAPI_MakeCone(new gp_Ax2(new gp_Pnt(0, 0, 0), new gp_Dir(0, 0, 1)), baseDiameter / 2, headDiameter / 2, myHeight);
            TopoDS_Shape         myBody    = aMakeCone.Shape();
            TopoDS_Solid         mySolid   = aMakeCone.Solid();

            // internal part
            BRepPrimAPI_MakeCone aMakeHollowedPart = new BRepPrimAPI_MakeCone(new gp_Ax2(new gp_Pnt(0, 0, 0), new gp_Dir(0, 0, 1)), baseDiameter / 2 - myThickness, headDiameter / 2 - myThickness, myHeight);
            TopoDS_Shape         hollowedPart      = aMakeHollowedPart.Shape();

            // cut
            BOPAlgo_BOP test = new BOPAlgo_BOP();

            test.AddArgument(mySolid);
            TopTools_ListOfShape LS = new TopTools_ListOfShape();

            LS.Append(hollowedPart);
            test.SetTools(LS);
            test.SetRunParallel(true);
            test.SetOperation(BOPAlgo_Operation.BOPAlgo_CUT);
            test.Perform();
            myBody = test.Shape();

            // triangulation
            myFaces = Triangulation(myBody, 0.7f);
        }
Beispiel #3
0
        public override void Build()
        {
            // convert values from UnitsNet
            double wallThick    = wallThickness.Meters;
            double largeEndDiam = largeEndDiameter.Meters;
            double smallEndDiam = smallEndDiameter.Meters;
            double totalH       = totalHeight.Meters;
            double use1         = useless1.Degrees;
            double use2         = useless2.Meters;
            double use3         = useless3.Meters;
            double use4         = useless4.Meters;
            double use5         = useless5.Meters;



            // external part
            BRepPrimAPI_MakeCone aMakeCone = new BRepPrimAPI_MakeCone(new gp_Ax2(new gp_Pnt(0, 0, 0), new gp_Dir(0, 0, 1)), largeEndDiam / 2, smallEndDiam / 2, totalH);
            TopoDS_Shape         myBody    = aMakeCone.Shape();
            TopoDS_Solid         mySolid   = aMakeCone.Solid();

            // internal part
            BRepPrimAPI_MakeCone aMakeHollowedPart = new BRepPrimAPI_MakeCone(new gp_Ax2(new gp_Pnt(0, 0, 0), new gp_Dir(0, 0, 1)), largeEndDiam / 2 - wallThick, smallEndDiam / 2 - wallThick, totalH);
            TopoDS_Shape         hollowedPart      = aMakeHollowedPart.Shape();

            // cut
            BOPAlgo_BOP test = new BOPAlgo_BOP();

            test.AddArgument(mySolid);
            TopTools_ListOfShape LS = new TopTools_ListOfShape();

            LS.Append(hollowedPart);
            test.SetTools(LS);
            test.SetRunParallel(true);
            test.SetOperation(BOPAlgo_Operation.BOPAlgo_CUT);
            test.Perform();
            myBody = test.Shape();

            // triangulation
            SetMyFaces(Triangulation(myBody, 0.7f));
        }