ACAPI_3D_GetCutPolygonInfo
바디를 평면으로 절단하고 절단하는 표면 및 넓이를 리턴합니다.
GSErrCode ACAPI_3D_GetCutPolygonInfo (
Int32 bodyIndex,
const API_Plane3D& cutPlane,
GS::Array<Geometry::MultiPolygon2D>* resPolygons = NULL,
double* area = NULL
);
파라미터
- bodyIndex
- [in] 절단하고자 하는 바디의 인덱스입니다.
- cutPlane
- [in] 절단하는 평면입니다.
- resPolygons
- [out] 절단하는 표면의 폴리곤들입니다. (선택적인 파라미터)
- area
- [out] 절단하는 표면의 넓이입니다. (선택적인 파라미터)
리턴 값
NoError- 함수가 성공적으로 완료되었습니다.
APIERR_BADPARS- 전달된 출력 파라미터 둘 다
NULL입니다. (resPolygons와area) APIERR_REFUSEDCMD- 3D 모델을 현재 컨텍스트에서 이용할 수 없습니다. 또는
- 바디가 직접 쿼리를 받을 수 없습니다; 활성 바디 없음
APIERR_BADINDEX- bodyIndex가 범위 밖입니다.
다른 공통 API 오류들에 대해서는 API 오류 문서를 보십시오.
설명
이 함수는 절단하는 평면으로 주어진 바디를 절단하고 절단하는 표면을 가져오는 데 사용합니다.
절단하는 표면의 폴리곤들을 가져오려면 resPolygons 파라미터를 전달하십시오.
절단하는 표면의 넓이만 가져오려면 area 파라미터를 세트하십시오.
출력 파라미터들 (resPolygons와 area) 중 하나는 NULL이 되어서는 안 됩니다.
예제
Int32 nBody, i, j;
API_Plane3D cutPlane;
double area;
GS::Array<Geometry::MultiPolygon2D> resPolygons;
cutPlane.basePoint.x = 0.0; cutPlane.basePoint.y = 0.0; cutPlane.basePoint.z = 1.0;
cutPlane.axisX.x = 1.0; cutPlane.axisX.y = 0.0; cutPlane.axisX.z = 0.0;
cutPlane.axisY.x = 0.0; cutPlane.axisY.y = 1.0; cutPlane.axisY.z = 0.0;
cutPlane.axisZ.x = 0.0; cutPlane.axisZ.y = 0.0; cutPlane.axisZ.z = 1.0;
err = ACAPI_3D_GetNum (API_BodyID, &nBody);
for (i = 1; i <= nBody && err == NoError; i++) {
err = ACAPI_3D_GetCutPolygonInfo (i, cutPlane, &resPolygons, &area);
if (err == NoError) {
for (j = 0; j <= resPolygons.GetSize (); j++) {
double areaOfThisPolygon = resPolygons[j].CalcArea ();
}
}
}
요구사항
- 버전: API 17 또는 이후
- 헤더: ACAPinc.h