Node UDF
Hi to everybody,
i want to know if it possible to read nodes coordinate once a time. this is part of my udf code: ---------------------------------------------------------------------------------------------------------------- fprintf(fout,"thread id %d\n", id); begin_f_loop(f,t) { f_node_loop(f,t,n) { v = F_NODE(f,t,n);} } end_f_loop(f,t) fprintf(fout, "\n"); ---------------------------------------------------------------------------------------------------------------- in this way i have obtained the same nodes more than one time, due to the nodes on the same faces. Can somebody help me? Thank's in advance |
Quote:
/* Initalize all node marks on the thread to 0 */ begin_f_loop(f, t) { f_node_loop(f, t, n) { v=F_NODE(f,t,n); NODE_MARK(v) = 0; } } end_f_loop(f, t); begin_f_loop(f, t) { f_node_loop(f, t, n) { v = F_NODE(f,t,n); pos_x = NODE_X(v); pos_y = NODE_Y(v); if(NODE_MARK(v) == 0) /* if not already visited */ fprintf(fout, "f%d %g %g\n", v, pos_x, pos_y); NODE_MARK(v) = 1; } } end_f_loop(f, t); fclose(fout); |
Thank you GearBoy ,
it works fine. I want to underline that to use the macro NODE_MARK(), the udf must be compiled and not interpreted... where i can find some reference on this and other similar macro? in the UDF ug there aren't info... |
Quote:
Hi GearBoy! I followed your code as shown as above. It works very well. I succeeded to output node data. However, I faced some problem. Could you help me? I tested DEFINE_CG_MOTION macro with a rotation of a box about x-axis according to "cos(x)" function . I exported several node in this box. When I checked output data from selected node, I compare it to my "cos(x)" function value. I realized that there are slightly different between them. I really appreciate your help. Best regards |
All times are GMT -4. The time now is 16:43. |