// TODO : Tie up the loose ends (Hole loop) public Face Do(Vertex startV, Vertex endV, Edge prevLE, Edge prevRE, Edge nextLE, Edge nextRE, out Edge newE, out Loop oldL, out Loop newL) { newE = null; oldL = newL = null; // 分離可能なループを探す var separableL = FindSeparableLoop(prevLE, prevRE, nextLE, nextRE); if (separableL == null) { throw new System.Exception("[MEF.cs/Do] 分離可能なループが見つかりませんでした"); } oldL = separableL; var hostShell = separableL.Host.Host; newE = Archetype.NewEdge(); newE.ConnectStart(startV); newE.ConnectEnd(endV); var newF = Archetype.NewFace(); newL = Archetype.NewLoop(); // Link hostShell.Connect(newF); newF.ConnectFrame(newL); // ハーフエッジの Link を編集 EditLinksOfHalfEdges(newE, prevLE, prevRE, nextLE, nextRE); // ループの更新 (Left を新規にする) newE.Left.HostLoop = newL; newE.Right.HostLoop = separableL; UpdateNewLoopLinks(newE.Left, newL); // ホールがある場合はホールループの振分けを幾何演算を使って行う //... return(newF); }
public Shell Do(Vector3d position, out Vertex newVertex, out Loop newLoop, out Face newFace) { // インスタンス生成 var newShell = Archetype.NewShell(); newFace = Archetype.NewFace(); newLoop = Archetype.NewLoop(); newVertex = Archetype.NewVertex(); // 座標設定 newVertex.Position = position; // リンク newShell.Connect(newFace); newFace.ConnectFrame(newLoop); newLoop.Isolated = newVertex; newVertex.Isolated = newLoop; return(newShell); }