public SceneObject AddGregoryPatfch(BezierSurfaceC0 surfA, BezierSurfaceC0 surfB, BezierSurfaceC0 surfC) { var verts = BezierSurfaceC0.CheckGregory(surfA, surfB, surfC); if (verts == null) { return(null); } var data = new List <GregoryEdgeData>(); data.Add(new GregoryEdgeData() { Surface = surfA, A = verts[0], B = verts[1] }); data.Add(new GregoryEdgeData() { Surface = surfB, A = verts[2], B = verts[3] }); data.Add(new GregoryEdgeData() { Surface = surfC, A = verts[4], B = verts[5] }); var greg = new GregoryPatch(data); greg.SetParent(this); return(greg); }
private void Link_click(object sender, RoutedEventArgs e) { var objs = Engine.Scene.Cursor.HeldObjects; if (objs.Count != 2) { return; } if (!(objs.ToList()[0] is Vertex vertA) || !(objs.ToList()[1] is Vertex vertB)) { return; } BezierSurfaceC0.LinkVertices(vertA, vertB); }
public void LoadModel(string[] data) { for (int i = 0; i < data.Length; i++) { string[] header = data[i].Split(' '); string elementName = header[0]; int n = int.Parse(header[1]); for (int j = 0; j < n; j++) { i += 1; SceneObject obj = null; //var d = data[i + j]; var d = data[i + j].Replace('.', ','); switch (elementName) { case "curveC0": obj = new BezierCurveC0(RayCaster, d); break; case "curveC2": obj = new BezierCurveC2(RayCaster, d); break; case "curveInt": obj = new InterpolatingCurve(RayCaster, d); break; case "surfaceC0": obj = new BezierSurfaceC0(RayCaster, d); break; case "surfaceC2": obj = new BezierSurfaceC2(RayCaster, d); break; case "tubeC0": obj = new BezierCylinderC0(RayCaster, d); break; case "tubeC2": obj = new BezierCylinderC2(RayCaster, d); break; case "point": obj = new Vertex(d); break; default: break; } if (obj != null) { obj.SetParent(this); } } } }