public BRepOffsetAPI_MakeEvolved(TopoDS_Shape theSpine, TopoDS_Wire theProfile, GeomAbs_JoinType theJoinType,
                                  bool theIsAxeProf, bool theIsSolid, bool theIsProfOnSpine, double theTol, bool theIsVolume,
                                  bool theRunInParallel)
     : base()
 {
     throw new NotImplementedException();
 }
Beispiel #2
0
        /// <summary>
        /// create the face to be slided
        /// </summary>
        /// <param name="r">the radius of the circular face</param>
        /// <returns>a wire that is our face to be slided</returns>
        private TopoDS_Wire MakeCircularHollowedWire(double r)
        {
            /*gp_Circ2d cir1 = new gp_Circ2d(new gp_Ax2d(new gp_Pnt2d(new gp_XY(0f, 0f)), new gp_Dir2d(1, 0)), r);
             *
             * BRepBuilderAPI_MakeEdge2d mee1 = new BRepBuilderAPI_MakeEdge2d(cir1);
             * TopoDS_Edge e1 = mee1.Edge();
             *
             * BRepBuilderAPI_MakeWire aMakeWire1 = new BRepBuilderAPI_MakeWire(e1);
             * TopoDS_Wire W = aMakeWire1.Wire();//*/


            gp_Circ cir1 = new gp_Circ(new gp_Ax2(new gp_Pnt(0, 0, 0), new gp_Dir(1, 0, 0)), r);
            BRepBuilderAPI_MakeEdge aMakeEdge  = new BRepBuilderAPI_MakeEdge(cir1);
            BRepBuilderAPI_MakeWire aMakeWire1 = new BRepBuilderAPI_MakeWire(aMakeEdge.Edge());
            TopoDS_Wire             W          = aMakeWire1.Wire();

            return(W);
        }
Beispiel #3
0
        /// <summary>
        /// build the shape of the elbow (internal or external) by building the sliding face and building the wire with the given spline
        /// </summary>
        /// <param name="connectionSpline"> the spline to slide on</param>
        /// <param name="bendingAngle">the angle of our future elbow</param>
        /// <param name="bendingRadius"> the radius of the elbow</param>
        /// <param name="n">modifies the number of triangles</param>
        /// <param name="shift">makes the shape begin before 0*pi/180 and end after bendingAngle, we use it to hollow correctly the shape (put 0 for the external part, and something like pi/16 for the internal part)</param>
        /// <returns>the shape of the elbow (external or internal part)</returns>
        public TopoDS_Shape Build(Geom_BSplineCurve connectionSpline, double bendingAngle, double bendingRadius, double n, double shift)
        {
            bool firstIteration = true;                                        // check if it is the first iteration
            BRepBuilderAPI_MakeWire aMakeWire = new BRepBuilderAPI_MakeWire(); // initialize our wire
            gp_Pnt lastPnt = new gp_Pnt();                                     // initialize our last point

            double angle      = bendingAngle * Math.PI / 180;                  // our angle in radian
            double lp         = connectionSpline.LastParameter();              // often 1
            double fp         = connectionSpline.FirstParameter();             // often 0
            double percentage = (angle + 2 * shift) / (2 * Math.PI);           // percentage of the spline to get ( because our spline goes from 0 to 2pi, but we dont want all)
            double pas        = (lp * percentage - fp) / n;                    // the step for the iteration on the spline

            for (double i = fp; i < lp * percentage; i = i + pas)              // fp already includes the small shift if it got any
            {
                if (firstIteration)
                { // we get our first point
                    lastPnt        = connectionSpline.Value(i);
                    firstIteration = false;
                }
                else
                { // and now we add a new edge(last point, current point) on our wire
                    aMakeWire.Add(new BRepBuilderAPI_MakeEdge(lastPnt, connectionSpline.Value(i)).Edge());
                    lastPnt = connectionSpline.Value(i);
                }
            }

            // create the pipe with the spline and the section
            TopoDS_Wire W = MakeWire(bendingRadius);                                                 // the face to be slided
            BRepOffsetAPI_MakePipeShell   piper = new BRepOffsetAPI_MakePipeShell(aMakeWire.Wire()); // initialize with the wire to slide on
            BRepBuilderAPI_TransitionMode Mode  = new BRepBuilderAPI_TransitionMode();

            Mode = BRepBuilderAPI_TransitionMode.BRepBuilderAPI_RoundCorner;
            piper.SetTransitionMode(Mode); // to have a curved shape
            piper.Add(W, true, true);      // first= true to get a pipe and not something else really weird
            piper.Build();                 // create the shape
            piper.MakeSolid();             //*/
            return(piper.Shape());
        }
Beispiel #4
0
 public void Init(TopoDS_Wire W, TopoDS_Face F)
 {
     throw new NotImplementedException();
 }
Beispiel #5
0
 public void Load(TopoDS_Wire wire)
 {
     throw new NotImplementedException();
 }
Beispiel #6
0
 public bool CheckSmallArea(TopoDS_Wire theWire)
 {
     throw new NotImplementedException();
 }
 public void SetMode(TopoDS_Wire AuxiliarySpine, bool CurvilinearEquivalence)
 {
     throw new NotImplementedException();
 }
 public BRepOffsetAPI_MakePipeShell(TopoDS_Wire Spine)
     : base()
 {
     throw new NotImplementedException();
 }
Beispiel #9
0
 public BRepLib_MakeFace(TopoDS_Face F, TopoDS_Wire W)
     : base()
 {
     throw new NotImplementedException();
 }
Beispiel #10
0
 public TopoDS_Edge ConcatenateWireC0(TopoDS_Wire Wire)
 {
     throw new NotImplementedException();
 }
Beispiel #11
0
 public TopoDS_Wire ConcatenateWire(TopoDS_Wire Wire, GeomAbs_Shape Option)
 {
     throw new NotImplementedException();
 }
Beispiel #12
0
 public TopoDS_Wire ConcatenateWire(TopoDS_Wire Wire, GeomAbs_Shape Option, double AngularTolerance)
 {
     throw new NotImplementedException();
 }
Beispiel #13
0
        /// <summary>
        /// create a screw
        /// </summary>
        /// <param name="widthBase">length of the base</param>
        /// <param name="diameter">diameter of the screwed part</param>
        /// <param name="lengthVis">length of the screwed part</param>
        /// <param name="pas">distance travelled by the helicoidal part after 2*pi</param>
        /// <param name="heightBase">height of the base</param>
        /// <param name="profondeurSillon">depth of the screw</param>
        /// <param name="longueurSillon">length of the helicoidal part</param>
        public Vis(double widthBase, double diameter, double lengthVis, double pas, double heightBase, double profondeurSillon, double longueurSillon)
        {                                                     // it was hard to parameterize it "correctly", consider taking a screenshot before having fun in modifying it
            double param6  = 2;                               // pas / (2 * Math.PI); // pas trop grand please
            double param10 = pas / (Math.PI / 3);             // c'est pour definir le pas
            double param9  = 0;                               // -param10/2; // position de la vis ?
            double param1  = lengthVis - longueurSillon / 2;  // position du centre de la partie helicoidale par rapport au bout pointu de la vis

            double aMinor = 0.05;                             // epaisseur de la rainure
            double aMajor = (longueurSillon / pas) * Math.PI; // un pi par tour donc 2*pi = 2 tours

            // Base

            /*Cylinder myBase = new Cylinder(widthBase / 2, heightBase);
             * myBase.Translate(new Pnt(0, 0, -heightBase));//*/
            BRepPrimAPI_MakeCylinder aMakeCylinder = new BRepPrimAPI_MakeCylinder(new gp_Ax2(new gp_Pnt(0, 0, -heightBase), new gp_Dir(0, 0, 1)), widthBase / 2, heightBase);
            TopoDS_Shape             myBase        = aMakeCylinder.Shape();

            // helicoidal part
            //Cylinder neck = new Cylinder(diameter / 2, lengthVis);
            BRepPrimAPI_MakeCylinder aMakeCylinder2 = new BRepPrimAPI_MakeCylinder(new gp_Ax2(new gp_Pnt(0, 0, 0), new gp_Dir(0, 0, 1)), diameter / 2, lengthVis);
            TopoDS_Shape             neck           = aMakeCylinder2.Shape();

            //threading: define 2d curves
            double   depart = param1;
            gp_Pnt2d aPnt   = new gp_Pnt2d(2 * Math.PI, param9);
            gp_Dir2d aDir   = new gp_Dir2d(2 * Math.PI, param10);
            gp_Ax2d  anAx2d = new gp_Ax2d(aPnt, aDir);

            //double aMinor = longueurSillon/5; // epaisseur de la rainure
            Geom2d.Geom2d_Ellipse      anEllipse1 = new Geom2d.Geom2d_Ellipse(anAx2d, aMajor, aMinor);
            Geom2d.Geom2d_Ellipse      anEllipse2 = new Geom2d.Geom2d_Ellipse(anAx2d, aMajor, aMinor / param6);
            Geom2d.Geom2d_TrimmedCurve anArc1     = new Geom2d.Geom2d_TrimmedCurve(anEllipse1, 0, Math.PI);
            Geom2d.Geom2d_TrimmedCurve anArc2     = new Geom2d.Geom2d_TrimmedCurve(anEllipse2, 0, Math.PI);
            gp_Pnt2d          anEllipsePnt1       = anEllipse1.Value(0);
            gp_Pnt2d          anEllipsePnt2       = anEllipse1.Value(Math.PI);
            GCE2d_MakeSegment aMakeSegment        = new GCE2d_MakeSegment(anEllipsePnt1, anEllipsePnt2);

            Geom2d.Geom2d_TrimmedCurve aSegment = aMakeSegment.Value();
            //threading: build edges and wires
            Geom_CylindricalSurface aCyl1 = new Geom_CylindricalSurface(new gp_Ax3(new gp_Ax2(new gp_Pnt(0, 0, depart), new gp_Dir(0, 0, 1))), (diameter / 2) * 0.99);
            Geom_CylindricalSurface aCyl2 = new Geom_CylindricalSurface(new gp_Ax3(new gp_Ax2(new gp_Pnt(0, 0, depart), new gp_Dir(0, 0, 1))), (diameter / 2) * (0.99 + profondeurSillon));
            //
            BRepBuilderAPI_MakeEdge aMakeEdge = new BRepBuilderAPI_MakeEdge(anArc1, aCyl1);

            aMakeEdge.Build();
            TopoDS_Edge anEdge1OnSurf1 = aMakeEdge.Edge();

            //
            aMakeEdge = new BRepBuilderAPI_MakeEdge(aSegment, aCyl1);
            aMakeEdge.Build();
            TopoDS_Edge anEdge2OnSurf1 = aMakeEdge.Edge();

            //
            aMakeEdge = new BRepBuilderAPI_MakeEdge(anArc2, aCyl2);
            aMakeEdge.Build();
            TopoDS_Edge anEdge1OnSurf2 = aMakeEdge.Edge();

            //
            aMakeEdge = new BRepBuilderAPI_MakeEdge(aSegment, aCyl2);
            aMakeEdge.Build();
            TopoDS_Edge anEdge2OnSurf2 = aMakeEdge.Edge();
            //
            BRepBuilderAPI_MakeWire aMakeWire = new BRepBuilderAPI_MakeWire(anEdge1OnSurf1, anEdge2OnSurf1);

            aMakeWire.Build();
            TopoDS_Wire threadingWire1 = aMakeWire.Wire();

            aMakeWire = new BRepBuilderAPI_MakeWire(anEdge1OnSurf2, anEdge2OnSurf2);
            aMakeWire.Build();
            TopoDS_Wire threadingWire2 = aMakeWire.Wire();

            BRepLib.BRepLib.BuildCurves3d(threadingWire1);
            BRepLib.BRepLib.BuildCurves3d(threadingWire2);
            //create threading
            BRepOffsetAPI_ThruSections aTool = new BRepOffsetAPI_ThruSections(true);

            aTool.AddWire(threadingWire1);
            aTool.AddWire(threadingWire2);
            aTool.CheckCompatibility(false);
            TopoDS_Shape myThreading = aTool.Shape();


            // _______fuse_______
            BOPAlgo_BOP adder = new BOPAlgo_BOP();

            adder.AddArgument(myBase);
            TopTools_ListOfShape LSA = new TopTools_ListOfShape();

            LSA.Append(neck);
            adder.SetTools(LSA);
            adder.SetRunParallel(true);
            adder.SetOperation(BOPAlgo_Operation.BOPAlgo_FUSE);
            adder.Perform();
            TopoDS_Shape myBody = adder.Shape();

            // _______fuse_______
            BOPAlgo_BOP adder2 = new BOPAlgo_BOP();

            adder2.AddArgument(myBody);
            TopTools_ListOfShape LSA2 = new TopTools_ListOfShape();

            LSA2.Append(myThreading);
            adder2.SetTools(LSA2);
            adder2.SetRunParallel(true);
            adder2.SetOperation(BOPAlgo_Operation.BOPAlgo_FUSE);
            adder2.Perform();
            myBody = adder2.Shape();

            // _______triangulation_______
            myFaces = Triangulation(myBody, 0.007f);
        }
Beispiel #14
0
        public override void Build()
        {
            double wallThick = wallThickness.Meters;
            double diam      = diameter.Meters;
            double crownRad  = crownRadius.Meters;
            double knucleRad = knucleRadius.Meters;
            double totalH    = totalHeight.Meters;
            double use1      = useless1.Meters;
            double use2      = useless2.Bars;
            string use3      = useless3;

            //  can't work if P == O
            if (crownRadius == knucleRadius)
            {
                return;
            }

            // _____________curved part_____________
            // on va définir un certain nombre de points
            // certains avec des intersections de cercles, donc va y avoir un peu de calculs...
            gp_Pnt A = new gp_Pnt(wallThick, 0, 0);                                                                                                            // point à droite de la base
            gp_Pnt B = new gp_Pnt(0, 0, 0);                                                                                                                    // point à gauche de la base
            gp_Pnt C = new gp_Pnt(0, totalH, 0);                                                                                                               // debut de l'arc exterieur
            gp_Pnt H = new gp_Pnt(wallThick, totalH, 0);                                                                                                       // debut de l'arc intérieur
            gp_Pnt P = new gp_Pnt(wallThick + crownRad, totalH, 0);                                                                                            // centre du petit cercle formant l'arc
            gp_Pnt O = new gp_Pnt(wallThick + knucleRad, totalH, 0);                                                                                           // centre du grand cercle formant le capot

            gp_Pnt a1 = new gp_Pnt(crownRad * Math.Cos(3 * Math.PI / 4) + P.X(), crownRad * Math.Sin(3 * Math.PI / 4) + P.Y(), 0);                             // point de l'arc de cercle intérieur
            gp_Pnt a2 = new gp_Pnt((crownRad + wallThick) * Math.Cos(3 * Math.PI / 4) + P.X(), (crownRad + wallThick) * Math.Sin(3 * Math.PI / 4) + P.Y(), 0); // point de l'arc de cercle extérieur
            // pour a3 et a4 c'est compliqué, je crois que je dois choisir un angle au hasard et que potentiellement ça peut tout niquer (si R2 trop petit comparé à R1)
            //gp_Pnt a3 = new gp_Pnt(-radius2 * Math.Cos(3 * Math.PI / 4) + thickness + radius2, radius2* Math.Sin(3 * Math.PI / 4)+ totalHeight - thickness - radius2, 0); // point de l'arc du capot intérieur
            //gp_Pnt a4 = new gp_Pnt(-(radius2 + thickness) * Math.Cos(3 * Math.PI / 4) + thickness + radius2, (radius2 + thickness) * Math.Sin(3 * Math.PI / 4) + totalHeight - thickness - radius2, 0); // point de l'arc du capot extérieur
            gp_Pnt E = new gp_Pnt(O.X(), O.Y() + knucleRad + wallThick, 0); // haut du capot
            gp_Pnt F = new gp_Pnt(O.X(), O.Y() + knucleRad, 0);             // haut du capot mais côté intérieur
            // maintenant il faut définir les intersections des arcs de cercle et du capot
            // soit l'intersection du cercle de rayon myRadius1(R1) et de centre P (que l'on va abréger P(R1) ) avec O(R2)
            // et également (myThickness=T) P(R1+T) avec O(R2+T)



            gp_Pnt G = new gp_Pnt(P.X(), P.Y() + crownRad, 0);             // point de l'arc de cercle intérieur
            gp_Pnt D = new gp_Pnt(P.X(), P.Y() + crownRad + wallThick, 0); // point de l'arc de cercle extérieur


            // maintenant qu'on a tous nos points faut les relier ;)
            TopoDS_Edge AB = new BRepBuilderAPI_MakeEdge(A, B).Edge();
            TopoDS_Edge BC = new BRepBuilderAPI_MakeEdge(B, C).Edge();

            GC_MakeArcOfCircle      Ca2D   = new GC_MakeArcOfCircle(C, a2, D);
            BRepBuilderAPI_MakeEdge meCa2D = new BRepBuilderAPI_MakeEdge(Ca2D.Value());
            TopoDS_Edge             CD     = meCa2D.Edge();

            TopoDS_Edge DE = new BRepBuilderAPI_MakeEdge(D, E).Edge();
            TopoDS_Edge EF = new BRepBuilderAPI_MakeEdge(E, F).Edge();
            TopoDS_Edge FG = new BRepBuilderAPI_MakeEdge(F, G).Edge();

            GC_MakeArcOfCircle      Ga1H   = new GC_MakeArcOfCircle(G, a1, H);
            BRepBuilderAPI_MakeEdge meGa1H = new BRepBuilderAPI_MakeEdge(Ga1H.Value());
            TopoDS_Edge             GH     = meGa1H.Edge();

            TopoDS_Edge HA = new BRepBuilderAPI_MakeEdge(H, A).Edge();


            // creating the wire
            BRepBuilderAPI_MakeWire aMakeWire = new BRepBuilderAPI_MakeWire(AB, BC, CD, DE);
            TopoDS_Wire             aWire     = aMakeWire.Wire();

            aMakeWire = new BRepBuilderAPI_MakeWire(aWire, EF);
            aWire     = aMakeWire.Wire();
            aMakeWire = new BRepBuilderAPI_MakeWire(aWire, FG);
            aWire     = aMakeWire.Wire();
            aMakeWire = new BRepBuilderAPI_MakeWire(aWire, GH);
            aWire     = aMakeWire.Wire();
            aMakeWire = new BRepBuilderAPI_MakeWire(aWire, HA);
            aWire     = aMakeWire.Wire();//*/


            // rotation du wire
            gp_Ax1 Axis = new gp_Ax1(new gp_Pnt(wallThick + knucleRad, 0, 0), new gp_Dir(0, 1, 0)); // origine 0,0,0 avec dir 0,1,0
            BRepBuilderAPI_MakeFace aMakeFace  = new BRepBuilderAPI_MakeFace(aWire);
            TopoDS_Face             face       = aMakeFace.Face();
            BRepPrimAPI_MakeRevol   aMakeRevol = new BRepPrimAPI_MakeRevol(face, Axis, 2 * Math.PI);

            aMakeRevol.Build();
            TopoDS_Shape aRotatedShape = aMakeRevol.Shape();


            // _____________triangulation_____________
            SetMyFaces(Triangulation(aRotatedShape, 0.007f));
            //*/
        }
 public void LinkToWire(TopoDS_Wire W, BRepMAT2d_Explorer Explo, int IndexContour, BRepMAT2d_BisectingLocus BiLo)
 {
     throw new NotImplementedException();
 }
Beispiel #16
0
 public BRepLib_MakeFace(gp_Torus C, TopoDS_Wire W, bool Inside)
     : base()
 {
     throw new NotImplementedException();
 }
Beispiel #17
0
 public BRepLib_MakeFace(Geom_Surface S, TopoDS_Wire W)
     : base()
 {
     throw new NotImplementedException();
 }
 public TopTools_ListOfShape LeftOf(TopoDS_Wire W, TopoDS_Face F)
 {
     throw new NotImplementedException();
 }
Beispiel #19
0
 public void Add(TopoDS_Wire W)
 {
     throw new NotImplementedException();
 }
 public bool AddClosedWire(TopoDS_Wire W, TopoDS_Face F)
 {
     throw new NotImplementedException();
 }
 public void SetMode(TopoDS_Wire AuxiliarySpine, bool CurvilinearEquivalence, BRepFill_TypeOfContact KeepContact)
 {
     throw new NotImplementedException();
 }
Beispiel #22
0
 public void UVBounds(TopoDS_Face F, TopoDS_Wire W, ref double UMin, ref double UMax, ref double VMin,
                      ref double VMax)
 {
     throw new NotImplementedException();
 }
Beispiel #23
0
 public ShapeAnalysis_Wire(TopoDS_Wire wire, TopoDS_Face face, double prec_ision)
     : base()
 {
     throw new NotImplementedException();
 }
Beispiel #24
0
 public void AddUVBounds(TopoDS_Face F, TopoDS_Wire W, Bnd_Box2d B)
 {
     throw new NotImplementedException();
 }
Beispiel #25
0
 public void Init(TopoDS_Wire wire, TopoDS_Face face, double prec_ision)
 {
     throw new NotImplementedException();
 }
 public ShapeFix_Wire(TopoDS_Wire wire, TopoDS_Face face, double prec)
     : base()
 {
     throw new NotImplementedException();
 }
Beispiel #27
0
 public BRepTools_WireExplorer(TopoDS_Wire W, TopoDS_Face F)
     : base()
 {
     throw new NotImplementedException();
 }
Beispiel #28
0
 public BRepLib_MakeFace(TopoDS_Wire W, bool OnlyPlane)
     : base()
 {
     throw new NotImplementedException();
 }
Beispiel #29
0
 public void Init(TopoDS_Wire W, TopoDS_Face F, double UMin, double UMax, double VMin, double VMax)
 {
     throw new NotImplementedException();
 }
Beispiel #30
0
 public BRepLib_MakeFace(gp_Cylinder C, TopoDS_Wire W)
     : base()
 {
     throw new NotImplementedException();
 }