Mesh: expose trimByPlane to Python

This commit is contained in:
wmayer
2021-10-15 23:07:59 +02:00
parent 539bd3ceb1
commit bbe2865059
5 changed files with 32 additions and 7 deletions

View File

@@ -146,19 +146,19 @@ void CmdMeshPartTrimByPlane::activated(int)
Base::Vector3f plnNormal = Base::convertTo<Base::Vector3f>(normal);
if (role == Gui::SelectionRole::Inner) {
mesh->trim(plnBase, plnNormal);
mesh->trimByPlane(plnBase, plnNormal);
static_cast<Mesh::Feature*>(*it)->Mesh.finishEditing();
}
else if (role == Gui::SelectionRole::Outer) {
mesh->trim(plnBase, -plnNormal);
mesh->trimByPlane(plnBase, -plnNormal);
static_cast<Mesh::Feature*>(*it)->Mesh.finishEditing();
}
else if (role == Gui::SelectionRole::Split) {
Mesh::MeshObject copy(*mesh);
mesh->trim(plnBase, plnNormal);
mesh->trimByPlane(plnBase, plnNormal);
static_cast<Mesh::Feature*>(*it)->Mesh.finishEditing();
copy.trim(plnBase, -plnNormal);
copy.trimByPlane(plnBase, -plnNormal);
App::Document* doc = (*it)->getDocument();
Mesh::Feature* fea = static_cast<Mesh::Feature*>(doc->addObject("Mesh::Feature"));
fea->Label.setValue((*it)->Label.getValue());