i like to know about the algorithm used in gcode generation?

i like to know about the algorithm used in gcode generation?

Probably

Source is available for the popular gcode generators (slic3r and cura to name the two I use). Reviewing those codebases would be a good start. After you’re familiar, you may be able to ask the lead developers questions directly.

I would advice against reading any slicer’s source code as a first step (I know parts of CuraEngine), it’s not an easy read, only worth the effort if you actually want to contribute changes or if you want to check some details. But writing your own gcode generator for a simple geometric object (e.g. a simple tube, not slicing a STL file) is not too hard and can be fun. It’s the easier way to get a feeling for what slicers are doing. But if you want source: https://github.com/Ultimaker/CuraEngine/blob/master/src/fffProcessor.h#L158