- UID
- 1
- 积分
- 16111
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-3
- 最后登录
- 1970-1-1
|
发表于 2005-4-29 14:19:09
|
显示全部楼层
Re: [求助]:如何求得一个PLine线所围成的平面的中点
最初由 lgxqf 发布
[B]我用程序画了一个PLINE线,而且是闭合的。
现在我想求所画得的面的中心点,该怎么做呀?
请各位过路高手多多指教,谢 谢 [/B]
先用:
[php]
AcDbRegion::createFromCurves Function static Acad::ErrorStatus
createFromCurves(
const AcDbVoidPtrArray& curveSegments,
AcDbVoidPtrArray& regions);
curveSegments Input array of pointers to curve entities used to define the
region's perimeter(s)
regions Returns containing pointers to the AcDbRegion objects created
[/php]
生成AcDbRegion对象
然后用:
[php]
AcDbRegion::getAreaProp Function virtual Acad::ErrorStatus
getAreaProp(
const AcGePoint3d& origin,
const AcGeVector3d& xAxis,
const AcGeVector3d& yAxis,
double& perimeter,
double& area,
AcGePoint2d& centroid,
double momInertia[2],
double& prodInertia,
double prinMoments[2],
AcGeVector2d prinAxes[2],
double radiiGyration[2],
AcGePoint2d& extentsLow,
AcGePoint2d& extentsHigh) const;
origin Input origin of the region
xAxis Input X axis of the region
yAxis Input Y axis of the region
perimeter Returns perimeter of the region
area Returns area of the region
centroid Returns centroid of the region
momInertia[2] Returns moment of inertia of the region
prodInertia Returns product of inertia of the region
prinMoments[2] Returns principal moments of the region
prinAxes[2] Returns principle axes of the region
radiiGyration[2] Returns radii of gyration of the region
extentsLow Returns minimum extents point of the region
extentsHigh Returns maximum extents point of the region
[/php]
其中AcGePoint2d& centroid 就是型心。 |
|