forked from 1b-agent/opencadstudio-upstream
Merge pull request #954 from ramox81/codex/pyramid-command-properties
Match pyramid creation and properties behavior
This commit is contained in:
7 files changed
+1055
-27
No files matched your search
@@ -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();
|
||||
|
||||
@@ -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],
|
||||
|
||||
Reference in new issue
Block a user