- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to delete points from structured scans from a large ReCap project and the RCProject::deletePointsFromStructuredScan() function consistently runs out of memory and fails with a bad allocation exception.
The code looks like this:
/// Delete the points from the panorama clouds to reduce the size of the project on disk
void DeletePanoramaPoints(const std::string& rcp_path) {
Foundation::RCCode error_code;
auto project = Data::RCProject::loadFromFile(rcp_path, Data::RCFileAccess::ReadWrite,
Data::RCProjectUserEdits::None, error_code);
recap_utils::CheckCode(error_code, "project load");
// Permanently remove deleted scan points to reduce project size on disk
recap_utils::CheckCode(project->deletePointsFromStructuredScan(true), "deleting points from structured scans");
if (!project->permanentlyDeletePoints()) {
throw std::runtime_error("Could not permanently delete points");
}
}The ReCap project has one unstructured scan and many structured scans, and all of the points in the structured scans are marked as deleted (using approach from https://forums.autodesk.com/t5/recap-sdk/deleting-points/m-p/10414930/highlight/true#M353). The code above works well for models with a small number of scans, but fails for a model with 279 scans. All structured scans have the same number of points and the total size on disk is ~207G. Total system memory is 32G.
Currently the call to deletePointsFromStructuredScan() uses all the available system memory and then fails with a bad allocation exception. Alternatively, if the call to deletePointsFromStructuredScan() is removed then it succeeds but the project size on disk remains the same.
- Is this a bug? Other functions seem to respect the system memory limit set in the ReCap SDK (RCProject::setSystemMemoryLimitInMB()) e.g. when setting the points as deleted in the large model, memory use grows to ~50% and then the memory for cached scans is freed so that the threshold is not exceeded. Should deletePointsFromStructuredScan() also respect the SDK's memory limit?
- What is the recommended way to delete points from a project that is too big to fit entirely into memory?
- Is there a workaround to delete points scan-by-scan rather than per-project? I don't see any method in RCScan or RCStructuredScan to permanently delete points, it seems to be only accessible via RCProject which then iterates over each scan in the project itself.
Thanks in advance for any help.
Solved! Go to Solution.