Thomj-Dev / SEMBAS

GNU General Public License v3.0
0 stars 0 forks source link

MeshExplorer Redundant Sampling #42

Open ThomJ130 opened 1 week ago

ThomJ130 commented 1 week ago

The MeshExplorer currently does an overlap check prior to adding a branch to its queue. However, this doesn't entirely eliminate overlaps, since it is checked on the first sample, and therefore it's not on the boundary and provides no guarantees of minimum distance between boundary points.

We can add an additional overlap check on the boundary point itself prior to adding any of its branches. The boundary point that was there first already has added its branches, and therefore there is no need to add any more, and no additional branches need to be added.

Two things to measure:

kcajeel commented 11 hours ago

Is the logic to check the boundary the same as it is to check the first sample in select_parent()?

Where

            let hs = &self.boundary[id]; // line 71
            let p = *hs.b + self.d * v;

            if !self.check_overlap(p) {
                return Some((*hs, id, v));
            }

Can be repurposed in the step() method as:

                    if let AdhererState::FoundBoundary(hs) = adh.get_state() { // line 166
                        let p = *hs.b + self.d * sample.into_inner();

                        if !self.check_overlap(p) {
                            self.boundary.push(hs);
                            self.add_child(hs, Some(NodeIndex::new(self.current_parent)));
                            self.adherer = None
                        }
                    }