Page MenuHome

Mesh sampling system for unified point-on-mesh handling.
Needs RevisionPublic

Authored by Lukas Tönne (lukastoenne) on Dec 1 2014, 3:10 PM.

Details

Summary

This code is not yet used by any feature in master, but has proved very useful in the Gooseberry branch and several WIP patches. Inclusion into master was requested to avoid diverging code in branches and get part of the Gooseberry code merged early on.

The core idea is to have a common way of identifying points on mesh surfaces. Efficient evaluation of such points after deformation and mappable modifiers (e.g. subdivision) tracks positions, normals and other surface attributes. This is used extensively in the particle/hair systems and could be useful for certain tools, duplicators, etc.. Currently the particle systems in particular are very fragile and succeptible to mesh changes because of the unreliable way mesh surface mapping is stored. While the new system at this point uses essentially the same method, it at least provides a centralized DNA type that can be improved easily without too much effort and compatiblity issues.

In addition to evaluating surface samples the system also provides a central place to implement surface sampling algorithms, such as random sampling, ray casting, paint-like tools, etc.

Diff Detail

Repository
rB Blender
Branch
mesh_samples

Event Timeline

Lukas Tönne (lukastoenne) retitled this revision from to Mesh sampling system for unified point-on-mesh handling..
Lukas Tönne (lukastoenne) updated this object.
Sergey Sharybin (sergey) added inline comments.
source/blender/makesdna/DNA_meshdata_types.h
303

Why it's a DNA?

Does't seem to be saved to file, so should be marked appropriate (with two # thingies, check BevList for example).

Seems fine, the RNA part is disconnected though.

How this is accessed from from Python isnt so clear currently.

source/blender/blenkernel/intern/mesh_sample.c
134

Would prefer to assert here, and make it the responsability of the caller not to pass an invalid index.

Unless theres a good reason we can't trust the caller.

This revision now requires changes to proceed.Feb 4 2015, 6:49 PM