cm.core

cm.core

Improvements to space volume function

The function spaceVolumeUpdateObjects now has a new argument SnapperFilter filter. If filter is provided, only objects that are accepted by the filter will be updated.

As this is a minor release, a new function of the same name with the new argument will be introduced to avoid interface changes. We will combine the two functions in the following release.

public void spaceVolumeUpdateObjects(Snapper z, vector u, bool undoable=true, Snapper{} visited=new Snapper{}, bool force=false) {
public void spaceVolumeUpdateObjects(Snapper z, vector u, SnapperFilter filter, bool undoable=true, Snapper{} visited=new Snapper{}, bool force=false) {

Old:
    ...
    // Child snapper placement is relevant to it's parent. 
    for (s in attachedSnappers) if (s.isChildSnapper) attachedSnappers.remove(s);

New:
    ...
    // Child snapper placement is relevant to it's parent. Also remove filtered out snappers.
    for (s in attachedSnappers) {
        if (s.isChildSnapper or (filter and !filter.accepts(s))) {
            attachedSnappers.remove(s);
        }
    }