Could osl shader draw outside mesh?

I’m currently developing a toon shader, I do know how to detect mesh edge, but all approaches I know can only draw things inside mesh, which is not really the edge effect I want to achieve.

So is it possible to draw outside mesh, even I can only put a lot of dots of different size along the edge

(Actually I’m trying to make an osl version of Arnold’s aiToon and possibly make some improvements)

This is not possible. A shader needs some geometry to shade - you cannot shade points outside the geometry with OSL. You would need to either add geometry or use the compositor to extend the edge outside the rendered geometry.