Tuesday, November 4, 2014

Graphics: Marching Squares - Javascript implementation



Last post of this series dedicated to Contoured Lines with the whole Javascript implementation of the Marching Squares algorithm described here [Link] and there [Link]...


1. Adding a GUI

Compared to the previous posts, I just added a small GUI to set the Threshold, the square Size, the interpolation mode ...

Fig.1: Small GUI to set threshold value, square size, and interpolation mode.

and the filename of the OBJ output file...

Fig.2: Dialog box to set a filename.


The corresponding lines of code are in the function dialog()

2. The script

Here is the whole script...

+++ Javascript:marchingSquare.js +++
+++ End of Script: marchingSquare.js +++


Hope that helps.

<<  Previous: the Implementation Next: Improved version >>

3. Other crazybiocomputing posts

Further readings are available in ...
  • Computer Graphics Series  [Link]
  • Image Processing TOC [Link]

No comments:

Post a Comment