svxPoint P1 = { 10,0,0 };
svxPoint P2 = { 20,0,0 };
svxPoint P3 = { 20,10,0 };
svxPoint P4 = { 10,10,0 };
int L1;
cvxPartLine2pt(&P1, &P2, &L1);
int L2;
cvxPartLine2pt(&P2, &P3, &L2);
int L3;
cvxPartLine2pt(&P3, &P4, &L3);
int L4;
cvxPartLine2pt(&P4, &P1, &L4);
int countCrv = 4;
int* idCrvList = new int[countCrv];
idCrvList[0] = L1;
idCrvList[1] = L2;
idCrvList[2] = L3;
idCrvList[3] = L4;
int idList = 0;
cvxPartCrvList(countCrv, idCrvList, &idList);
svxRevolveData revolve;
cvxPartRevolveInit(&revolve);
revolve.idProfile= idList;
revolve.Axis.Pnt = {0.0,0.0,0.0};
revolve.Axis.Dir = {0.0,1.0,0.0};
revolve.Combine = VX_BOOL_NONE;
revolve.StartType = VX_INPU_VALUE;
revolve.Start=0.0;
revolve.EndType = VX_INPU_VALUE;
revolve.End=180;
revolve.OffsetTyp = VX_OFFSET_NONE;
int idShape1 = 0;
cvxPartRevolve(&revolve, &idShape1);
double Density = 1.0;
svxMassProp Prop;
cvxPartInqShapeMass(idShape1, Density, &Prop);
char msg[256];
sprintf(msg, "密度:%f", Prop.Density);
cvxMsgDisp(msg);
sprintf(msg, "面积:%f", Prop.Area);
cvxMsgDisp(msg);
sprintf(msg, "体积:%f", Prop.Volume);
cvxMsgDisp(msg);
sprintf(msg, "质量:%f", Prop.Mass);
cvxMsgDisp(msg);
svxPoint CE = Prop.Center;
int idxpoint = 0;
cvxPartPnt(&CE, &idxpoint);
int Count;
int* Faces;
cvxPartInqShapeFaces(idShape1, &Count, &Faces);
sprintf(msg, "面的数量:%d", Count);
cvxMsgDisp(msg);
标签:ZW3D,0.0,Prop,int,二次开发,revolve,idCrvList,cvxPartInqShapeMass,msg
From: https://blog.csdn.net/qq_32460115/article/details/139547059