64,666
社区成员
发帖
与我相关
我的任务
分享
//点
struct CPoint3D
{
double x;
double y;
double z;
}
//矩形
struct CRectange
{
CPoint3D pt1;
CPoint3D pt2;
CPoint3D pt3;
CPoint3D pt4;
CPoint3D pt5;
CPoint3D pt6;
CPoint3D pt7;
CPoint3D pt8;
}
//线段
struct CLine
{
double xPart;
double yPart;
double zPart;
}
//平面一般性方程式: Ax+By+Cz+D = 0;
CPlane{
double A;
double B;
double C;
double D;
}
//求取平面和线段的交点
CPoint3D GetInterectPointBetweenLineAndPlane(CLine& line, CPlane& plane);
//求取平面和矩形的所有交点
vector<CPoint3D> GetAllIntesectPoints(CRectangle& rectangle, CPlane& plane);
//根据所有交点位置,计算截面面积
double GetAreaOfIntesectPoints(vector<CPoint3D>& points);