It's me or atan2. is buggy ? // solved it is me

From what I see antan2 in owl return a value in the first half (0, PI) and not over the full circle (-pi,pi) as expected

look at this fragment and the result :

Pos = Pos - cen;
hPos = dot(Pos,axis)*axis;      // projection on axis
mPos = Pos-hPos;                // projection on plane normal to axis
radius = length(mPos);
mPos = mPos / radius;           // normalized

mX = dot(mPos,pol_orig);        // projection on polar origin
mY = length(mPos-mX*pol_orig);

tile_val = (tile_freq)*(atan2(mY,mX)/M_2PI+M_PI);
if (tile_val<0)
    tile_val=0;


tile_val is fed as hue value of an hsv node
Should have given the full HSV circle and not half of it mirrored, no?

unfortunately osl language spec is unclear on the domain

Sorry. it is me, using length instead of mY = dot(mPos-mX*pol_orig,cross(axis,pol_orig));

found the bug 3mn after posting :frowning: