通过UF_MODL_create_cyl1自动设计阶梯轴
double Ttotal = 260;
double L1 = 21.00;
double L2 = 12.00;
double L3 = 57.00;
double L4 = 36.00;
double L6 = 67.00;
double L5 = Ttotal - (L1 + L2 + L3 + L4 + L6);
double d1 = 55.00;
double d2 = 65.00;
double d3 = 58.00;
double d4 = 55.00;
double d5 = 52.00;
double d6 = 45.00;
double L[7] = { 0.0,L1,L2,L3,L4,L5,L6 };
double d[6] = { d1,d2,d3,d4,d5,d6 };
double direction[3] = { 1.0,0.0,0.0 };
UF_FEATURE_SIGN sign = UF_NULLSIGN;
UF_FEATURE_SIGN sign1 = UF_POSITIVE;
for (int i = 1; i < 7; i++)
{
double total2 = std::accumulate(L, L+i, 0);
double cylinder_orig[3] = { total2, 0.0,0.0 };
char height1[256];
sprintf(height1, "%f",L[i]);
char* height = height1;
char diam1[256];
sprintf(diam1, "%f", d[i-1]);
char* diam = diam1;
tag_t cyl_obj_id1;
if (i == 1)
{
UF_MODL_create_cyl1(sign, cylinder_orig, height, diam, direction, &cyl_obj_id1);
}
else
{
UF_MODL_create_cyl1(sign1, cylinder_orig, height, diam, direction, &cyl_obj_id1);
}
}
标签:cyl1,0.0,create,char,double,UF,MODL
From: https://blog.csdn.net/qq_32460115/article/details/137395915