Ejemplo n.º 1
0
        /// <summary>
        ///   Builds a dimension on an edge of type Line
        /// </summary>
        private static AISInteractiveObject BuildLineDimension(TopoDSEdge edge, gpPnt textLocation,
                                                               GeomPlane dimensionPlane, DsgPrsArrowSide arrowType, bool isOffset, gpPnt offset)
        {
            var curve = new BRepAdaptorCurve(edge);

            if (curve.GetType != GeomAbsCurveType.GeomAbs_Line)
            {
                return(null);
            }

            // For a line use a length dimension
            var line = curve.Line;

            if (line.Distance(textLocation) < Precision.Confusion)
            {
                textLocation.X = (textLocation.X + 0.01);
            }
            var firstPoint = curve.Value(curve.FirstParameter);
            var lastPoint  = curve.Value(curve.LastParameter);
            var plane      = dimensionPlane;

            if (plane == null)
            {
                var mkPlane = new GCMakePlane(firstPoint, lastPoint, textLocation);
                plane = mkPlane.Value;
            }
            var length = firstPoint.Distance(lastPoint);

            return(length < 1e-12
                       ? null
                       : GeomUtils.BuildLengthDimension(firstPoint, lastPoint, plane, textLocation,
                                                        arrowType, ArrowSize, 0.2, isOffset, offset));
        }
        public SolverParallelAxis(TopoDSEdge edge)
        {
            Point3D?firstPoint, lastPoint;

            GeomUtils.EdgeRange(edge, out firstPoint, out lastPoint);
            if (firstPoint == null || lastPoint == null)
            {
                return;
            }
            var first = (Point3D)firstPoint;
            var last  = (Point3D)lastPoint;

            Vector = new gpVec(first.GpPnt, last.GpPnt);
        }
Ejemplo n.º 3
0
        public static bool DrawMarkerEdge(TopoDSEdge edge, Document document, Color color)
        {
            Point3D?firstPoint;
            Point3D?lastPoint;

            GeomUtils.EdgeRange(edge, out firstPoint, out lastPoint);
            if (firstPoint == null || lastPoint == null)
            {
                return(false);
            }
            var first = (Point3D)firstPoint;
            var last  = (Point3D)lastPoint;

            return(DrawMarkerEdge(document, first, last, color));
        }
Ejemplo n.º 4
0
        private static bool EdgesAreIdentical(TopoDSEdge edge1, TopoDSEdge edge2)
        {
            var pointsEdge1 = GeomUtils.ExtractVertexes(edge1);
            var pointsEdge2 = GeomUtils.ExtractVertexes(edge2);

            if (pointsEdge1.Count != 2 || pointsEdge2.Count != 2)
            {
                return(false);
            }
            var p11 = new Point3D(BRepTool.Pnt(pointsEdge1[0]));
            var p12 = new Point3D(BRepTool.Pnt(pointsEdge1[1]));
            var p21 = new Point3D(BRepTool.Pnt(pointsEdge2[0]));
            var p22 = new Point3D(BRepTool.Pnt(pointsEdge2[1]));

            if (p11.IsEqual(p21) && p12.IsEqual(p22))
            {
                return(true);
            }
            if (p12.IsEqual(p21) && p11.IsEqual(p22))
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 5
0
 public static void Update(TopoDSEdge E)
 {
     BRepTools_Update24263856(E.Instance);
 }
Ejemplo n.º 6
0
 public static void UVBounds(TopoDSFace F, TopoDSEdge E, ref double UMin, ref double UMax, ref double VMin, ref double VMax)
 {
     BRepTools_UVBounds5F413ED6(F.Instance, E.Instance, ref UMin, ref UMax, ref VMin, ref VMax);
 }
Ejemplo n.º 7
0
 public static bool Compare(TopoDSEdge E1, TopoDSEdge E2)
 {
     return(BRepTools_Compare4DFF7017(E1.Instance, E2.Instance));
 }
Ejemplo n.º 8
0
 public static void Vertices(TopoDSEdge E, TopoDSVertex Vfirst, TopoDSVertex Vlast, bool CumOri)
 {
     TopExp_VerticesCB378621(E.Instance, Vfirst.Instance, Vlast.Instance, CumOri);
 }
Ejemplo n.º 9
0
 public void Perform(TopoDSEdge E1)
 {
     BRepExtrema_ExtCC_Perform24263856(Instance, E1.Instance);
 }
Ejemplo n.º 10
0
 public BRepExtremaExtCC(TopoDSEdge E1, TopoDSEdge E2)
     :
     base(BRepExtrema_ExtCC_Ctor4DFF7017(E1.Instance, E2.Instance))
 {
 }
Ejemplo n.º 11
0
 public void SameParameter(TopoDSEdge E, bool S)
 {
     BRep_Builder_SameParameter7F8C607A(Instance, E.Instance, S);
 }
Ejemplo n.º 12
0
 public void Continuity(TopoDSEdge E, GeomSurface S1, GeomSurface S2, TopLocLocation L1, TopLocLocation L2, GeomAbsShape C)
 {
     BRep_Builder_ContinuityBD255723(Instance, E.Instance, S1.Instance, S2.Instance, L1.Instance, L2.Instance, (int)C);
 }
Ejemplo n.º 13
0
 public void Continuity(TopoDSEdge E, TopoDSFace F1, TopoDSFace F2, GeomAbsShape C)
 {
     BRep_Builder_ContinuityD6A3B177(Instance, E.Instance, F1.Instance, F2.Instance, (int)C);
 }
Ejemplo n.º 14
0
 public void MakeEdge(TopoDSEdge E, GeomCurve C, TopLocLocation L, double Tol)
 {
     BRep_Builder_MakeEdge686D1199(Instance, E.Instance, C.Instance, L.Instance, Tol);
 }
Ejemplo n.º 15
0
 public void MakeEdge(TopoDSEdge E, GeomCurve C, double Tol)
 {
     BRep_Builder_MakeEdgeE5AE3CE7(Instance, E.Instance, C.Instance, Tol);
 }
Ejemplo n.º 16
0
 public SolverEdge(TopoDSEdge edge, GeometryType type)
 {
     Edge         = edge;
     GeometryType = type;
 }
Ejemplo n.º 17
0
 public SolverEdge(TopoDSEdge edge, GeometryType type, Node parent)
 {
     Edge         = edge;
     GeometryType = type;
     ParentIndex  = parent.Index;
 }
Ejemplo n.º 18
0
 public void SameRange(TopoDSEdge E, bool S)
 {
     BRep_Builder_SameRange7F8C607A(Instance, E.Instance, S);
 }
Ejemplo n.º 19
0
 public void Initialize(TopoDSEdge E2)
 {
     BRepExtrema_ExtCC_Initialize24263856(Instance, E2.Instance);
 }
Ejemplo n.º 20
0
 public void Degenerated(TopoDSEdge E, bool D)
 {
     BRep_Builder_Degenerated7F8C607A(Instance, E.Instance, D);
 }
Ejemplo n.º 21
0
 public static TopoDSVertex LastVertex(TopoDSEdge E, bool CumOri)
 {
     return(new TopoDSVertex(TopExp_LastVertex7F8C607A(E.Instance, CumOri)));
 }
Ejemplo n.º 22
0
 public void Range(TopoDSEdge E, double First, double Last, bool Only3d)
 {
     BRep_Builder_Range7522FA9B(Instance, E.Instance, First, Last, Only3d);
 }
Ejemplo n.º 23
0
 public static bool CommonVertex(TopoDSEdge E1, TopoDSEdge E2, TopoDSVertex V)
 {
     return(TopExp_CommonVertexE5EE178A(E1.Instance, E2.Instance, V.Instance));
 }
 public int ComputeVE(TopoDSVertex aV, TopoDSEdge aE, ref double aT)
 {
     return(IntTools_Context_ComputeVE644637E6(Instance, aV.Instance, aE.Instance, ref aT));
 }
Ejemplo n.º 25
0
 public static bool IsReallyClosed(TopoDSEdge E, TopoDSFace F)
 {
     return(BRepTools_IsReallyClosed65EC701C(E.Instance, F.Instance));
 }
 public int ComputeVE(TopoDSVertex aV, TopoDSEdge aE, ref double aT, ref bool bToUpdateVertex, ref double aDist)
 {
     return(IntTools_Context_ComputeVE14B7C63A(Instance, aV.Instance, aE.Instance, ref aT, ref bToUpdateVertex, ref aDist));
 }
Ejemplo n.º 27
0
 public static void AddUVBounds(TopoDSFace F, TopoDSEdge E, BndBox2d B)
 {
     BRepTools_AddUVBounds5756543C(F.Instance, E.Instance, B.Instance);
 }
 public bool ProjectPointOnEdge(gpPnt aP, TopoDSEdge aE, ref double aT)
 {
     return(IntTools_Context_ProjectPointOnEdge31FF11E7(Instance, aP.Instance, aE.Instance, ref aT));
 }
Ejemplo n.º 29
0
        private static void BuildMidPointVertex(SolverGeometricObject solverObject, int edgeIndex, TopoDSEdge edge)
        {
            Point3D?first, last;

            GeomUtils.EdgeRange(edge, out first, out last);
            if (first == null || last == null)
            {
                return;
            }
            var firstPoint = (Point3D)first;
            var lastPoint  = (Point3D)last;
            var midPoint   = new Point3D((firstPoint.X + lastPoint.X) / 2,
                                         (firstPoint.Y + lastPoint.Y) / 2,
                                         (firstPoint.Z + lastPoint.Z) / 2);

            solverObject.Points.Add(new SolverDataPoint(midPoint)
            {
                GeometryType = GeometryType.MidPoint
            });
        }
Ejemplo n.º 30
0
 public SolverEdge(TopoDSEdge edge)
 {
     Edge         = edge;
     GeometryType = GeometryType.None;
 }