プロダクト: | MicroStation | ||
バージョン: | CE update15 | ||
環境: | N/A | ||
エリア: | Programming | ||
サブエリア: | MDL |
CentroidNormalAndAreaを使用し閉図形からの中心位置と面積情報の取得例です。
dgnmodelrefパラメーターを明示的に指定する必要があります。
void polygonOpsTest()
{
bvector<DPoint3d> xyz{ {0,0,0}, {1110, 2280,0}, {2800, 1030, 0} };
DPoint3d centroid;
DVec3d normal;
double area;
PolygonOps::CentroidNormalAndArea(xyz, centroid, normal, area);
WPrintfString wStr(L"centroid=(%.2f, %.2f,%.2f), area=%.2f", centroid.x, centroid.y, centroid.z, area);
mdlDialog_dmsgsPrint(wStr);
}
複合図形に含まれる線や円弧など、より複雑な形状要素の場合、
図心、法線、面積を取得するCurveVector :: CentroidNormalArea関数がございます。
PolygonOps :: CentroidNormalAndArea より強力です。
Original Author: | Mikihiko Tabata |