#include #include __declspec(dllexport) void TRMODMENUITEM(int*,char *); __declspec(dllexport) void TRMODMODWORK(double*,double*,double*,int*,int*, float*,unsigned char*,int*,int*); void TRMODMENUITEM(int *lang, //[I -] 言語環境 (=0:日本語 =1:他言語) char *item) //[- O] メニュー表示部の文字列 { if( *lang ) { strcpy(item,"Cylinder(&U)"); } else { strcpy(item,"円柱作成(&U)"); } } void TRMODMODWORK(double *pmax, //[I -] ワークの最大値XY double *pmin, //[I -] ワークの最小値XY double *wpitch, //[I -] ワークのピッチ(精度) int *xmax, //[I -] X方向格子数 int *ymax, //[I -] Y方向格子数 float *top, //[I O] Z値列(X*Y個)の先頭アドレス unsigned char *topc, //[I O] 属性(PENKI,PENなど)の先頭アドレス int *topn, //[I O] 切削ブロック番号の先頭アドレス int *irc) //[- O] Return Code(=0:FALSE =1:TRUE) { int i,j; double dx,dy,cr,midx,midy; midx=(pmax[0]+pmin[0])/2.0; midy=(pmax[1]+pmin[1])/2.0; cr=min((pmax[0]-pmin[0])/2.0,(pmax[1]-pmin[1])/2.0); for(j=0;j<*ymax;j++) { dy=fabs(pmin[1]+(*wpitch)*j-midy); for(i=0;i<*xmax;i++) { dx=fabs(pmin[0]+(*wpitch)*i-midx); if(sqrt(dx*dx+dy*dy) > cr ) *(top+(*xmax)*j+i)=pmin[2]; } } *irc=TRUE; }