Skip to content

Commit

Permalink
[Part workbench] add command create points object from mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
mwganson authored and wwmayer committed Aug 27, 2019
1 parent 5a3fb20 commit 7fef642
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Mod/Part/Gui/CommandSimple.cpp
Expand Up @@ -195,20 +195,18 @@ void CmdPartPointsFromMesh::activated(int iMsg)
Gui::WaitCursor wc;
std::vector<App::DocumentObject*>::iterator it;
openCommand("Points from mesh");

for (it = meshes.begin(); it != meshes.end(); ++it) {
App::Document* doc = (*it)->getDocument();
std::string mesh = (*it)->getNameInDocument();

if (!(*it)->isDerivedFrom(Base::Type::fromName("Mesh::Feature")))
continue;
doCommand(Doc,"import Part");
doCommand(Doc,"mesh_pts = FreeCAD.getDocument(\"%s\").getObject(\"%s\").Mesh.Points\n",
doc->getName(),
mesh.c_str());
doc->getName(), mesh.c_str());
doCommand(Doc,"Part.show(Part.makeCompound([Part.Point(m.Vector).toShape() for m in mesh_pts]),\"%s\")\n",
(mesh+"_pts").c_str());
doCommand(Doc,"del mesh_pts\n");

}

commitCommand();
Expand Down

0 comments on commit 7fef642

Please sign in to comment.