Merge pull request #954 from ramox81/codex/pyramid-command-properties

Match pyramid creation and properties behavior
This commit is contained in:
Hakan Seven authored and GitHub committed 2026-09-01 22:52:12 +03:00
commit 40b9124bd0
7 files changed
+1055 -27

No files matched your search

+2
View File
@@ -699,8 +699,10 @@ impl super::OpenCADStudio {
let history = solid_history::pyramid_op(
glam::DMat4::IDENTITY.to_cols_array(),
radius,
0.0,
height,
n,
true,
);
let handle = self.add_solid_model(entity, solid, history);
self.tabs[i].scene.deselect_all();
+27
View File
@@ -2074,6 +2074,9 @@ impl OpenCADStudio {
});
}
}
if specialized_primitive {
retain_specialized_primitive_sections(&mut sections);
}
let title = match entity {
acadrust::EntityType::Insert(ins) => {
let is_xref = self.tabs[i]
@@ -3047,6 +3050,30 @@ fn aggregate_solid_history_sections(
merged
}
fn retain_specialized_primitive_sections(
sections: &mut Vec<crate::scene::model::object::PropSection>,
) {
sections.iter_mut().for_each(|section| {
section.props.retain(|property| {
matches!(
property.field,
"color"
| "layer"
| "linetype"
| "linetype_scale"
| "plot_style"
| "lineweight"
| "transparency"
| "hyperlink"
| "material"
| "solid_history_type"
) || crate::scene::model::solid_history::is_primitive_property(property.field)
|| crate::scene::model::solid_history::is_history_choice(property.field)
});
});
sections.retain(|section| !section.props.is_empty());
}
fn merge_sections(
left: &[crate::scene::model::object::PropSection],
right: &[crate::scene::model::object::PropSection],