nkmjg 发表于 2024-3-5 10:40:54

计算平面矩形点

//计算平面矩形点
void BuildRect( const AcGePoint3d& pt, double angle, double width, double height, AcGePoint3dArray& pts )
{
       AcGeVector3d v1( AcGeVector3d::kXAxis ), v2( AcGeVector3d::kXAxis );
       v1.rotateBy( angle, AcGeVector3d::kZAxis );
       v2.rotateBy( angle + CMGeometry::PI() / 2, AcGeVector3d::kZAxis );

       pts.append( CaclPt( pt, v1, width, v2, height ) );

       v1.rotateBy( CMGeometry::PI(), AcGeVector3d::kZAxis );
       pts.append( CaclPt( pt, v1, width, v2, height ) );

       v2.rotateBy( CMGeometry::PI(), AcGeVector3d::kZAxis );
       pts.append( CaclPt( pt, v1, width, v2, height ) );

       v1.rotateBy( CMGeometry::PI(), AcGeVector3d::kZAxis );
       pts.append( CaclPt( pt, v1, width, v2, height ) );
}
页: [1]
查看完整版本: 计算平面矩形点