private void AddEdge(Point3D p1, Point3D p5) { var fv = new PipeVisual3D(); fv.Diameter = Diameter; fv.ThetaDiv = 10; fv.Fill = new SolidColorBrush(Colors.Yellow); fv.Point1 = p1; fv.Point2 = p5; Children.Add(fv); }
private void AddBases(ModelVisual3D model, int number, double turns, double length) { double b = turns*2*Math.PI; double l = length; double p1 = 0; double p2 = 3.14; for (int i = 0; i < number; i++) { double u = (double) i/(number - 1); double x1 = Math.Cos(b*u + p1) + Math.Cos(b*u + p1); double y1 = Math.Sin(b*u + p1) + Math.Sin(b*u + p1); double z = u*l; double x2 = Math.Cos(b*u + p2) + Math.Cos(b*u + p2); double y2 = Math.Sin(b*u + p2) + Math.Sin(b*u + p2); var pt1 = new Point3D(x1, y1, z); var pt2 = new Point3D(x2, y2, z); var pt3 = new Point3D(0, 0, z); int j = r.Next(4); Brush brush1 = baseBrush1[j]; Brush brush2 = baseBrush2[j]; var ts = new PipeVisual3D { Point1 = pt1, Point2 = pt3, Diameter = 0.4, Material = MaterialHelper.CreateMaterial(brush1) }; model.Children.Add(ts); var ts2 = new PipeVisual3D { Point1 = pt3, Point2 = pt2, Diameter = 0.4, Material = MaterialHelper.CreateMaterial(brush2) }; model.Children.Add(ts2); } }