techninja / cncserver

A RESTful API server for driving serial based CNC devices
133 stars 39 forks source link

Render Pipeline #109

Open techninja opened 4 years ago

techninja commented 4 years ago

What's the problem?

Rendering a source image into its final form for preview is computationally expensive and though you can just redo everything over, this naive solution wastes both CPU and user time doing the same work over again.

What's the solution?

For every piece of source content, and for each render type (fill, stroke, text, vectorize), we place this content grouped under its hash identified content group, with a repeatable hash of the settings JSON used to generate it. We can now compare settings JSON data and see if its changed based on the hash, and if it has, the sub-object can be deleted and new content rendered into its place.

Implementation