Example #1
0
        void IntersectPlaneWithLine(SnapItem Plane, SnapItem Line, LineType ViewLine)
        {
            double Lam    = -1;
            xyz    Result = new xyz(0, 0, 0);

            if (intersectPlaneWithLine(Plane, Line, Line.getxyzArray(), ref Lam, ref Result))
            {
                if (Result.dist(Plane.Point) <= SnapItem.Snapdist)
                {
                    Plane.Point   = Result;
                    Line.Point    = Plane.Point;
                    Line.Crossed  = true;
                    Plane.Crossed = true;
                }
            }
        }
Example #2
0
        public override void OnPaint()
        {
            base.OnPaint();

            if ((ShowSolids) && (Solids != null))
            {
                for (int i = 0; i < Solids.Count; i++)
                {
                    Solids[i].Paint(this);
                }
                return;
            }

            if (ShowAll)

            {
                ListBox LB = Form().lbSolids;
                for (int i = 0; i < LB.Items.Count; i++)
                {
                    Solid S = (LB.Items[i] as Solid);
                    S.Paint(this);
                }
                for (int i = 0; i < Trace.Count; i++)
                {
                    Emission = Color.Red;
                    PenWidth = 1;
                    xyz Old = new xyz();
                    for (int j = 0; j < Trace[i].Count; j++)
                    {
                        int n = j - 1;
                        if (n == -1)
                        {
                            n = Trace[i].Count - 1;
                        }

                        Old = Trace[i][n].B;
                        if (Old.dist(Trace[i][j].A) > 0.01)
                        {
                        }
                        drawLine(Trace[i][j].A, Trace[i][j].B);
                    }
                    Emission = Color.Black;
                }
            }
        }