Distance Map

by 3D OPERATORS in Addons


Start by downloading the .py file. In Blender, go to Edit > Preferences > Add-ons. Click Install in the top bar, search for the .py file and click Install add-on from file. Then, type "Distance Map" in the search bar. Enable the addon and click Save preferences. You are now able to use the addon!


The Distance Map addon is visible in the Sidebar (hotkey N) > Distance Map. To generate a distance map, select two mesh objects. The distance map is built on the active object. The other object serves as target object, i.e. the object to which the distance is calculated. NOTE1: Modifiers are not applied before calculating the distance map. NOTE2: Color and text maps are not updated when an object is transformed after calculating the distance map.

* Generate Distance Map
Generate a distance map of two selected mesh objects. A new DM (Distance Map) object is added in the Outliner. Multiple distance maps of the same objects will get a prefix DM_v1, DM_v2, etc. Upon generating a distance map, the viewport shading is set to studio lighting "paint.sl" and viewport color is set to "Attribute".

* Raycast Mode
There are two methods to calculate a distance map. The "Normals" mode searches for the shortest distance from the source object to the target object along the positive or negative vertex normals. If no hit was found, the out of range color is used. The "Nearest" mode searches for the shortest distance to the target object in any direction. The hit location is compared to the vertex normal to determine whether the distance is positive or negative.

* Maximum Distance
This is the maximum search depth and hence, also the maximum distance for the colormap. The "No Hit" color is used for distances beyond the maximum search depth.

* Color Map Levels
Number of color levels that is used for the color map.

* Use Selected Geometry
If this box is checked, the distance map is calculated using only the selected geometry of the source and target objects. Make sure a selection is made on both objects in Edit Mode.

* Colormap
Colormap that is used for the distance map. There are some preset colormaps that can be used. Contact 3D OPERATORS to implement a new colormap in the Distance Map addon.

* No Hit
Color that is used when no raycast hit was found.

* Unselected
Color that is used for unselected geometry when "Use Selected Geometry" is checked.

* Use Custom Colormap
Use a colormap with customized colors instead of one of the presets.

* Number Of Colors
The number of colors used for interpolation in a customized colormap. Assign the desired predominant colors for a customized colormap below this setting. These colors with be interpolated linearly from -Maximum Distances to +Maximum Distance.

* Show Color Map
Display the colormap of the active distance map in the viewport.

* Show Distances
Display the distances of the selected vertices of the active distance map in the viewport. It is advised to select less than 100 vertices, as Blender may become slow otherwise.

* Font Size
The font size of the distances in the viewport.

* Decimals
The number of decimals of the distances in the viewport.

* Font Color
The font color of the distances in the viewport.

* Export Distances
Export the distances of the active distance map to a text file. The values can be copied to other software for further analysis. A "nan" value indicates that there was no raycast hit for this vertex.

Sales 30+
Customer Ratings 2
Average Rating
Dev Fund Contributor
Published about 4 years ago
Blender Version 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 4.0
License GPL
Have questions before purchasing?

Contact the Creator with your questions right now.

Login to Message