From 22cfda67defb281ccc707ed5c0b9e56584ec4982 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 11 Dec 2012 20:06:56 +0100 Subject: [PATCH 1/2] Fix bug in check for intersection of axis with sketch --- src/Mod/PartDesign/App/FeatureSketchBased.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index 4ccd562d91..9b01368fb2 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -561,11 +561,15 @@ const bool SketchBased::checkLineCrossesFace(const gp_Lin &line, const TopoDS_Fa TopoDS_Wire wire = ShapeAnalysis::OuterWire(face); BRepExtrema_DistShapeShape distss(wire, mkEdge.Shape(), Precision::Confusion()); if (distss.IsDone()) { + if (distss.Value() > Precision::Confusion()) + return false; // build up map vertex->edge TopTools_IndexedDataMapOfShapeListOfShape vertex2Edge; TopExp::MapShapesAndAncestors(wire, TopAbs_VERTEX, TopAbs_EDGE, vertex2Edge); for (Standard_Integer i=1; i<= distss.NbSolution(); i++) { + if (distss.PointOnShape1(i).Distance(distss.PointOnShape2(i)) > Precision::Confusion()) + continue; BRepExtrema_SupportType type = distss.SupportTypeShape1(i); if (type == BRepExtrema_IsOnEdge) { //This further check is not really needed From e6d84af12df7ffb4c85a7d131a4e1ce6f5e1e0a3 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 12 Dec 2012 12:11:55 +0100 Subject: [PATCH 2/2] 0000912: Fit selection doesn't work as expected --- src/Gui/View3DInventorViewer.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 6e17e1d72a..6a0b733c59 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -104,6 +104,7 @@ #include "SoFCVectorizeU3DAction.h" #include "SoFCVectorizeSVGAction.h" #include "SoFCDB.h" +#include "Application.h" #include "MainWindow.h" #include "NavigationStyle.h" #include "ViewProvider.h" @@ -1447,6 +1448,7 @@ void View3DInventorViewer::viewAll(float factor) void View3DInventorViewer::viewSelection() { +#if 0 // Search for all SoFCSelection nodes SoSearchAction searchAction; searchAction.setType(SoFCSelection::getClassTypeId()); @@ -1472,6 +1474,18 @@ void View3DInventorViewer::viewSelection() root->addChild(select); } } +#else + SoGroup* root = new SoGroup(); + root->ref(); + + std::vector selection = Selection().getObjectsOfType(App::DocumentObject::getClassTypeId()); + for (std::vector::iterator it = selection.begin(); it != selection.end(); ++it) { + ViewProvider* vp = Application::Instance->getViewProvider(*it); + if (vp) { + root->addChild(vp->getRoot()); + } + } +#endif SoCamera* cam = this->getCamera(); if (cam) cam->viewAll(root, this->getViewportRegion());