forked from 1b-agent/opencadstudio-upstream
feat(area): add object and aggregate modes
Mesh-backed measurements need cached surface metrics. Keep shared loop collection available in web builds.
This commit is contained in:
1 parent
feb110404c
commit
48332ee807
8 files changed
+456
-60
No files matched your search
@@ -1789,6 +1789,14 @@ impl OpenCADStudio {
|
||||
self.restore_pre_cmd_tangent();
|
||||
self.command_line.push_output(&msg);
|
||||
}
|
||||
CmdResult::ReportMeasurement(msg) => {
|
||||
self.tabs[i].snap_result = None;
|
||||
self.tabs[i].scene.clear_preview_wire();
|
||||
self.command_line.push_output(&msg);
|
||||
if let Some(prompt) = self.tabs[i].active_cmd.as_ref().map(|c| c.prompt()) {
|
||||
self.command_line.push_info(&prompt);
|
||||
}
|
||||
}
|
||||
CmdResult::AlignSelected {
|
||||
handles,
|
||||
src1,
|
||||
|
||||
@@ -2710,11 +2710,20 @@ impl OpenCADStudio {
|
||||
.map(|c| c.inject_before_entity_pick())
|
||||
.unwrap_or(false);
|
||||
if inject_first {
|
||||
let surface_area = self.tabs[i]
|
||||
.scene
|
||||
.meshes
|
||||
.get(&handle)
|
||||
.or_else(|| self.tabs[i].scene.block_meshes.get(&handle))
|
||||
.map(|mesh| mesh.metrics.surface_area);
|
||||
if let Some(entity) =
|
||||
self.tabs[i].scene.document.get_entity(handle).cloned()
|
||||
{
|
||||
if let Some(cmd) = self.tabs[i].active_cmd.as_mut() {
|
||||
cmd.inject_picked_entity(entity);
|
||||
if let Some(area) = surface_area {
|
||||
cmd.inject_picked_surface_area(area);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user