public GeomFill_Coons(TColgp_Array1OfPnt P1, TColgp_Array1OfPnt P2, TColgp_Array1OfPnt P3, TColgp_Array1OfPnt P4, TColStd_Array1OfReal W1, TColStd_Array1OfReal W2, TColStd_Array1OfReal W3, TColStd_Array1OfReal W4) : base() { throw new NotImplementedException(); }
public bool Section(Blend_Point P, TColgp_Array1OfPnt Poles, TColgp_Array1OfVec DPoles, TColgp_Array1OfVec D2Poles, TColgp_Array1OfPnt2d Poles2d, TColgp_Array1OfVec2d DPoles2d, TColgp_Array1OfVec2d D2Poles2d, TColStd_Array1OfReal Weigths, TColStd_Array1OfReal DWeigths, TColStd_Array1OfReal D2Weigths) { throw new NotImplementedException(); }
public bool RemoveKnot(int Index, int Mult, int Degree, bool Periodic, TColgp_Array1OfPnt Poles, TColStd_Array1OfReal Weights, TColStd_Array1OfReal Knots, TColStd_Array1OfInteger Mults, TColgp_Array1OfPnt NewPoles, TColStd_Array1OfReal NewWeights, TColStd_Array1OfReal NewKnots, TColStd_Array1OfInteger NewMults, double Tolerance) { throw new NotImplementedException(); }
public void IncreaseDegree(int Degree, int NewDegree, bool Periodic, TColgp_Array1OfPnt Poles, TColStd_Array1OfReal Weights, TColStd_Array1OfReal Knots, TColStd_Array1OfInteger Mults, TColgp_Array1OfPnt NewPoles, TColStd_Array1OfReal NewWeights, TColStd_Array1OfReal NewKnots, TColStd_Array1OfInteger NewMults) { throw new NotImplementedException(); }
/// <summary> /// generate the spline on which we will slide to compute our pipe /// </summary> /// <param name="L1">length between the origin and the most right part of the tube ( same for the top)</param> /// <param name="bendingRadius">radius of the pipe</param> /// <param name="wallThickness">thickness of the pipe</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>returns a set of points that can be used to generate a spline</returns> public TColgp_Array1OfPnt GenerateSpline(double L1, double bendingRadius, double wallThickness, double shift) { double angle = 2 * Math.PI; // Math.PI*1.5;// 360 * Math.PI / 180; int numberOfPoints = 36; TColgp_Array1OfPnt array = new TColgp_Array1OfPnt(0, numberOfPoints); double temp = L1 - bendingRadius; if (shift != 0) // internal part { double totalAngle = angle + 2 * shift; // calculate the total angle double pas = totalAngle / numberOfPoints; for (int i = 0; i <= numberOfPoints; i++) { //Pnt pt = new Pnt((temp - wallThickness) * (float)Math.Cos(i * pas - smallShift), (temp - wallThickness) * (float)Math.Sin(i * pas - smallShift), 0); //array.SetValue(i, pt.ToGp()); array.SetValue(i, new gp_Pnt((temp + wallThickness) * (float)Math.Cos(i * pas - shift), (temp + wallThickness) * (float)Math.Sin(i * pas - shift), 0)); } } else // external part { double totalAngle = angle; // calculate the total angle double pas = totalAngle / numberOfPoints; for (int i = 0; i <= numberOfPoints; i++) { //Pnt pt = new Pnt(temp * (float)Math.Cos(i * pas), temp * (float)Math.Sin(i * pas), 0); //array.SetValue(i, pt.ToGp()); array.SetValue(i, new gp_Pnt(temp * (float)Math.Cos(i * pas), temp * (float)Math.Sin(i * pas), 0)); } } return(array); }
public void InsertKnots(int Degree, bool Periodic, TColgp_Array1OfPnt Poles, TColStd_Array1OfReal Weights, TColStd_Array1OfReal Knots, TColStd_Array1OfInteger Mults, TColStd_Array1OfReal AddKnots, TColStd_Array1OfInteger AddMults, TColgp_Array1OfPnt NewPoles, TColStd_Array1OfReal NewWeights, TColStd_Array1OfReal NewKnots, TColStd_Array1OfInteger NewMults, double Epsilon) { throw new NotImplementedException(); }
public void Section(gp_Pnt FirstPnt, gp_Vec DFirstPnt, gp_Vec D2FirstPnt, gp_Pnt Center, gp_Vec DCenter, gp_Vec D2Center, gp_Vec Dir, gp_Vec DDir, gp_Vec D2Dir, double Angle, double DAngle, double D2Angle, TColgp_Array1OfPnt Poles, TColgp_Array1OfVec DPoles, TColgp_Array1OfVec D2Poles, TColStd_Array1OfReal Weights, TColStd_Array1OfReal DWeights, TColStd_Array1OfReal D2Weights) { throw new NotImplementedException(); }
public bool GetCircle(Convert_ParameterisationType TConv, gp_Vec ns1, gp_Vec ns2, gp_Vec dn1w, gp_Vec dn2w, gp_Vec nplan, gp_Vec dnplan, gp_Pnt pts1, gp_Pnt pts2, gp_Vec tang1, gp_Vec tang2, double Rayon, double DRayon, gp_Pnt Center, gp_Vec DCenter, TColgp_Array1OfPnt Poles, TColgp_Array1OfVec DPoles, TColStd_Array1OfReal Weigths, TColStd_Array1OfReal DWeigths) { throw new NotImplementedException(); }
public AppDef_MultiPointConstraint(TColgp_Array1OfPnt tabP, TColgp_Array1OfPnt2d tabP2d, TColgp_Array1OfVec tabVec, TColgp_Array1OfVec2d tabVec2d, TColgp_Array1OfVec tabCur, TColgp_Array1OfVec2d tabCur2d) : base() { throw new NotImplementedException(); }
public bool D2(double Param, double First, double Last, TColgp_Array1OfPnt Poles, TColgp_Array1OfVec DPoles, TColgp_Array1OfVec D2Poles, TColgp_Array1OfPnt2d Poles2d, TColgp_Array1OfVec2d DPoles2d, TColgp_Array1OfVec2d D2Poles2d, TColStd_Array1OfReal Weigths, TColStd_Array1OfReal DWeigths, TColStd_Array1OfReal D2Weigths) { throw new NotImplementedException(); }
public override void Build() { // convert values from UnitsNet double wallThick = wallThickness.Meters; double bendingRad = bendingRadius.Meters; double bendingA = bendingAngle.Degrees; double Len1 = firstEndAdditionalHeight.Meters; //double Len2 = L2.Meters; // not implemented yet // to calculate n double min = 20; double max = 50; double angleLimit = 15; double coef = (bendingA - angleLimit) * (max - min) / (180 - angleLimit) > 0 ? (bendingA - angleLimit) * (max - min) / (180 - angleLimit) : 0; double n = (int)(min + coef); // generate the POINTS for the spline double smallShift = Math.PI / 16; TColgp_Array1OfPnt array1 = GenerateSpline(Len1, bendingRad, wallThick, 0); TColgp_Array1OfPnt array2 = GenerateSpline(Len1, bendingRad, wallThick, smallShift); // create the SPLINE with the points GeomAPI_PointsToBSpline aSpline1 = new GeomAPI_PointsToBSpline(array1); GeomAPI_PointsToBSpline aSpline2 = new GeomAPI_PointsToBSpline(array2); Geom_BSplineCurve connectionSpline1 = aSpline1.Curve(); Geom_BSplineCurve connectionSpline2 = aSpline2.Curve(); // create EXTERNAL shape with spline TopoDS_Shape myBody3 = Build(connectionSpline1, bendingA, bendingRad, n, 0); // create INTERNAL shape with spline TopoDS_Shape myBody32 = Build(connectionSpline2, bendingA, bendingRad - wallThick, n, smallShift); // ______________ hollowing ______________ BOPAlgo_BOP cutter = new BOPAlgo_BOP(); cutter.AddArgument(myBody3); TopTools_ListOfShape LSC = new TopTools_ListOfShape(); LSC.Append(myBody32); cutter.SetTools(LSC); cutter.SetRunParallel(true); cutter.SetOperation(BOPAlgo_Operation.BOPAlgo_CUT); cutter.Perform(); myBody3 = cutter.Shape(); // ______________ triangulation ______________ SetMyFaces(Triangulation(myBody3, 0.7f));//*/ }
/// <summary> /// put in MyFaces all the faces that we compute. Note that L1 doesn't exist in BaseElement but i don't figure out on how we can modelize it without L1, there also could be a L2 /// </summary> /// <param name="L1">length between the origin and the most right part of the tube ( same for the top)</param> /// <param name="bendingRadius">radius of the pipe</param> /// <param name="wallThickness">thickness of the pipe</param> /// <param name="bendingAngle"> angle from 0*pi/180 to bendingAngle*pi/180</param> /// <param name="n">parameter that modifies the number of triangles</param> //public Elbow(double L1, double wallThickness, double bendingRadius, double bendingAngle) public Elbow(double wallThickness, double bendingRadius, double bendingAngle, double L1) { // to calculate n double min = 20; double max = 50; double angleLimit = 15; double coef = (bendingAngle - angleLimit) * (max - min) / (180 - angleLimit) > 0 ? (bendingAngle - angleLimit) * (max - min) / (180 - angleLimit) : 0; double n = (int)(min + coef); // generate the POINTS for the spline double smallShift = Math.PI / 16; TColgp_Array1OfPnt array1 = GenerateSpline(L1, bendingRadius, wallThickness, 0); TColgp_Array1OfPnt array2 = GenerateSpline(L1, bendingRadius, wallThickness, smallShift); // create the SPLINE with the points GeomAPI_PointsToBSpline aSpline1 = new GeomAPI_PointsToBSpline(array1); GeomAPI_PointsToBSpline aSpline2 = new GeomAPI_PointsToBSpline(array2); Geom_BSplineCurve connectionSpline1 = aSpline1.Curve(); Geom_BSplineCurve connectionSpline2 = aSpline2.Curve(); // create EXTERNAL shape with spline TopoDS_Shape myBody3 = Build(connectionSpline1, bendingAngle, bendingRadius, n, 0); // create INTERNAL shape with spline TopoDS_Shape myBody32 = Build(connectionSpline2, bendingAngle, bendingRadius - wallThickness, n, smallShift);//*/ // ______________ hollowing ______________ BOPAlgo_BOP cutter = new BOPAlgo_BOP(); cutter.AddArgument(myBody3); TopTools_ListOfShape LSC = new TopTools_ListOfShape(); LSC.Append(myBody32); cutter.SetTools(LSC); cutter.SetRunParallel(true); cutter.SetOperation(BOPAlgo_Operation.BOPAlgo_CUT); cutter.Perform(); myBody3 = cutter.Shape();//*/ // ______________ triangulation ______________ myFaces = Triangulation(myBody3, 0.7f); }
/// <summary> /// triangulate using the opencascade's triangulation /// </summary> /// <param name="shape">input shape</param> /// <param name="deflection">parameter to define the maximum angle</param> /// <returns>a list of faces</returns> public List <Face> Triangulation(TopoDS_Shape shape, double deflection) { List <Face> faces = new List <Face>(); BRepMesh.BRepMesh_IncrementalMesh im = new BRepMesh.BRepMesh_IncrementalMesh(shape, deflection); // 0.7 it controls the number of triangles im.Perform(); if (im.IsDone()) { for (TopExp_Explorer aFaceExplorer = new TopExp_Explorer(im.Shape(), TopAbs_ShapeEnum.TopAbs_FACE); aFaceExplorer.More(); aFaceExplorer.Next()) { TopoDS_Face face = TopoDS.TopoDS.ToFace(aFaceExplorer.Current()); TopLoc.TopLoc_Location L = new TopLoc.TopLoc_Location(); Poly_Triangulation tri = BRep.BRep_Tool.Triangulation(face, ref L); bool isDone = true; if (isDone) { Poly_Array1OfTriangle triangles = tri.Triangles(); TColgp_Array1OfPnt nodes = tri.Nodes(); for (int i = tri.Triangles().Lower(); i < tri.Triangles().Upper() + 1; i++) { Poly_Triangle triangle = triangles.Value(i); int node1 = 0, node2 = 0, node3 = 0; triangle.Get(ref node1, ref node2, ref node3); gp_Pnt v1 = nodes.Value(node1); gp_Pnt v2 = nodes.Value(node2); gp_Pnt v3 = nodes.Value(node3); // don't forget about face orientation :) Face f = new Face(new List <gp_Pnt> { v1, v2, v3 }) { orientation = face.Orientation() }; faces.Add(f); } } } } mesh = new MyMesh(faces); return(faces); }
public void Init(TColgp_Array1OfPnt P1, TColgp_Array1OfPnt P2, TColgp_Array1OfPnt P3, TColgp_Array1OfPnt P4) { throw new NotImplementedException(); }
public void Init(TColgp_Array1OfPnt P1, TColgp_Array1OfPnt P2, TColgp_Array1OfPnt P3, TColgp_Array1OfPnt P4, TColStd_Array1OfReal W1, TColStd_Array1OfReal W2, TColStd_Array1OfReal W3, TColStd_Array1OfReal W4) { throw new NotImplementedException(); }
public void Value(AppDef_MultiLine ML, int MPointIndex, TColgp_Array1OfPnt tabPt, TColgp_Array1OfPnt2d tabPt2d) { throw new NotImplementedException(); }
public BSplCLib_Cache(int theDegree, bool thePeriodic, TColStd_Array1OfReal theFlatKnots, TColgp_Array1OfPnt thePoles) : base() { throw new NotImplementedException(); }
public void Section(gp_Pnt FirstPnt, gp_Vec DFirstPnt, gp_Pnt Center, gp_Vec DCenter, gp_Vec Dir, gp_Vec DDir, double Angle, double DAngle, TColgp_Array1OfPnt Poles, TColgp_Array1OfVec DPoles) { throw new NotImplementedException(); }
public void Poles(int Index, TColgp_Array1OfPnt P) { throw new NotImplementedException(); }
public void Section(Blend_Point P, TColgp_Array1OfPnt Poles, TColgp_Array1OfPnt2d Poles2d, TColStd_Array1OfReal Weigths) { throw new NotImplementedException(); }
public void BuildCache(double theParameter, TColStd_Array1OfReal theFlatKnots, TColgp_Array1OfPnt thePoles) { throw new NotImplementedException(); }
public Geom_BSplineCurve(TColgp_Array1OfPnt Poles, TColStd_Array1OfReal Weights, TColStd_Array1OfReal Knots, TColStd_Array1OfInteger Multiplicities, int Degree) : base() { throw new NotImplementedException(); }
public void AxeOfInertia(TColgp_Array1OfPnt Points, gp_Ax2 Axe, ref bool IsSingular) { throw new NotImplementedException(); }
public bool D1(double Param, TColgp_Array1OfPnt Poles, TColgp_Array1OfVec DPoles, TColStd_Array1OfReal Weigths, TColStd_Array1OfReal DWeigths) { throw new NotImplementedException(); }
public AppDef_MultiPointConstraint(TColgp_Array1OfPnt tabP) : base() { throw new NotImplementedException(); }
public void Iso(double Param, bool IsU, TColgp_Array2OfPnt Poles, TColStd_Array2OfReal Weights, TColStd_Array1OfReal Knots, TColStd_Array1OfInteger Mults, int Degree, bool Periodic, TColgp_Array1OfPnt CPoles, TColStd_Array1OfReal CWeights) { throw new NotImplementedException(); }
public void Inertia(TColgp_Array1OfPnt Points, gp_Pnt Bary, gp_Dir XDir, gp_Dir YDir, ref double Xgap, ref double YGap, ref double ZGap) { throw new NotImplementedException(); }
public void SetPoleRow(int UIndex, TColgp_Array1OfPnt CPoles, TColStd_Array1OfReal CPoleWeights) { throw new NotImplementedException(); }
public bool Overlaps(TColgp_Array1OfPnt theArrayOfPts, int theSensType, SelectBasics_PickResult thePickResult) { throw new NotImplementedException(); }
public void SetPoleRow(int UIndex, TColgp_Array1OfPnt CPoles) { throw new NotImplementedException(); }