2013年7月2日 星期二

<分享> 除去交集線(兩種版本) remove intersection line in grasshopper



檔案下載 :
https://dl.dropboxusercontent.com/u/29860061/remove%20intersection%20line-web.gh

因為目前有寫到需要處理交集線段的案子,所以使用grasshopper C#寫一個線段判斷與自身之外的所有線段做交集處理。

這邊提供兩個版本,RILn A 是線段頭尾交集就算交集並自動除去其中一條。RILn B 就算是線段頭尾交集程式也自動保留兩條曲線。

需要注意的是只能是線段data type - Line 不能是curve 否則內建的判斷程序會出錯。
因為我調用的功能是
Rhino.Geometry.Intersect.Intersection.LineLine(Line, Line, Double%, Double%, Double, Boolean);


操作前

操作後

其他線段測試