Wolfram Language

Convert Regions to Images

Regions can be converted to images using the RegionImage function. This example shows how a mesh region representing a snowflake shape can be smoothed by converting it to an image and applying the curvature flow filter. This will simulate a snowflake "melting" effect.

Use a Koch curve of order 4 to generate a snowflake.

Use translations and rotations of the curve to generate the 2D region.

show complete Wolfram Language input

Convert the region into an image.

Smooth the contour via a curvature flow filter.

Convert the resulting image back into a region using ImageMesh.

Highlight the difference between the original and the smoothed snowflake.

Related Examples

de es fr ja ko pt-br zh