polygonDifference()

概要

poly2 の領域を削除したときに残る poly1 の領域を表すポリゴンの一覧を返します。

ポリゴンは、点の一覧によって「ライトウェイト」な方法で表現されます。同一直線上にない最初の 3 つのがポリゴンの「平面」を定義し、残りのは、その平面上に配置されていない場合でも、すべての計算でその平面に投影されます。

構文

polygonDifference ( poly1 As List, _
                    poly2 As List ) As List 
引数 [タイプ] 説明
poly1 [一覧] 元のポリゴンです。
poly2 [一覧] 削除するポリゴンです。

例 1

Intent >polygonDifference({point(0,0,0), Point(5,0,0), Point(5,5,0), Point(0,5,0)}, {Point(1,1,0), Point(6,1,0), Point(6,4,0), Point(1,4,0)}) 
--> {{Point_(1.0, 1.0, 0.0, WorldFrame()), Point_(1.0, 4.0, 0.0, WorldFrame()), Point_(5.0, 4.0, 0.0, WorldFrame()), Point_(5.0, 5.0, 0.0, WorldFrame()), Point_(0.0, 5.0, 0.0, WorldFrame()), Point_(0.0, 0.0, 0.0, WorldFrame()), Point_(5.0, 0.0, 0.0, WorldFrame()), Point_(5.0, 1.0, 0.0, WorldFrame())}} 

例 2

例 1 と同じポリゴンですが、逆の順序です。
Intent >polygonDifference({Point(1,1,0), Point(6,1,0), Point(6,4,0), Point(1,4,0)}, {point(0,0,0), Point(5,0,0), Point(5,5,0), Point(0,5,0)}) 
--> {{Point_(6.0, 1.0, 0.0, WorldFrame()), Point_(6.0, 4.0, 0.0, WorldFrame()), Point_(5.0, 4.0, 0.0, WorldFrame()), Point_(5.0, 1.0, 0.0, WorldFrame())}}