# [Bf-funboard] UV map and Volumetric UVW map creation by electrostatic simulation

Tiago Estill de Noronha TiagoTiagoT+Bf-funboard at Gmail.com
Mon Apr 7 21:55:10 CEST 2014

```Inspired by https://www.youtube.com/watch?v=U0GDNqqgw3U i came up with this
idea:

For creation of a 2d UV map, you have particles starting at each vertex,
they are repelled by each other, the surface, and their previous path
(their own and the others'), you iterate this system till everyone of them
crosses the surface of an imaginary sphere (the radius is set by the user),
or after N (set by the user) iterations have passed (giving an error if it
ends with at least one particle having not gone outside of the sphere). The
sphere has the default spherical UV map (lat-long or equirectangular map);
the UV map for each face is created by interpolating the UV values of the
point where their vertices crossed the sphere's surface. And to allow
control of how much detail each part of the surface is given, there could
be some sort of user defined weightmap that defines the "charge" of the
vertices; vertices with bigger charges would push other vertices further
apart, giving the faces those vertices belong to a bigger chunk of the UV
map (ideally, there would be the option of automatically generating the
chargemap based on face and/or edge size).

And to create a volumetric UVW map that agrees with the surface's UV map,
the initial setup is similar; except instead of letting the particles go
outward, you make them go inward; and make them be attracted to loose
vertices and edges (vertices and edges that are not part of any face),
while still being repelled by each other. Then for each step in the
iteration, you keep the respective UV values and increase the W value;
values along the path of each vertex between steps is interpolated between
steps, and similarly the values for the volumes between path steps is
interpolated from the surrounding paths. The reason for needing the loose
vertices/edges is so there is a known end condition that each particle must
reach, keep them from resting against the surface, and to give the user
more control over the flow of the map. For this version in particular, i
think also being able to set step size (how much each "particle" moves per
iteration) would be a good idea; might be useful for 2d UV map creation as
well though, specially with more complex shapes (though for the last step,
the one that should lead to the loose vertex or edge, the set length would
be ignored once the distance is smaller than that length, so the
"particles" don't overshoot the target).

To provide the user even more control over the flow of the volumetric maps,
it would be cool to have the option of having forcefields influence the
motion of the "particles", together with the loose vertices and edges.

To allow editing of the surface map without needing to regenerate the flow
of the volumetric map, use the spherical map for the surface when
generating the volumetric map, and then map the new 2d map to the imaginary
sphere, replacing the corresponding surface values when calculating the
volumetric map's values.

ps: the stuff described in that video would also be good for improving the
Shrinkwrap and the Solidify modifiers, extrusion of multiple faces
simultaneously, and perhaps other things i haven't thought of yet.
```