Fix handling of BezierCurves
Replace custom bbox code with OCC/Base code Refactor duplicate code Geometry/DrawProjectSplit
This commit is contained in:
@@ -124,8 +124,8 @@ std::vector<TopoDS_Edge> DrawProjectSplit::getEdgesForWalker(TopoDS_Shape shape,
|
||||
|
||||
|
||||
TechDrawGeometry::GeometryObject* DrawProjectSplit::buildGeometryObject(
|
||||
TopoDS_Shape shape,
|
||||
gp_Pnt& inputCenter,
|
||||
TopoDS_Shape shape,
|
||||
gp_Pnt& inputCenter,
|
||||
Base::Vector3d direction)
|
||||
{
|
||||
TechDrawGeometry::GeometryObject* geometryObject = new TechDrawGeometry::GeometryObject("DrawProjectSplit");
|
||||
@@ -231,30 +231,10 @@ std::vector<TopoDS_Edge> DrawProjectSplit::getEdges(TechDrawGeometry::GeometryOb
|
||||
Base::Console().Log("LOG - DPS::extractFaces - no newEdges\n");
|
||||
}
|
||||
newEdges = removeDuplicateEdges(newEdges);
|
||||
|
||||
return newEdges;
|
||||
}
|
||||
|
||||
|
||||
double DrawProjectSplit::simpleMinDist(TopoDS_Shape s1, TopoDS_Shape s2)
|
||||
{
|
||||
Standard_Real minDist = -1;
|
||||
|
||||
BRepExtrema_DistShapeShape extss(s1, s2);
|
||||
if (!extss.IsDone()) {
|
||||
Base::Console().Message("FE - BRepExtrema_DistShapeShape failed");
|
||||
return -1;
|
||||
}
|
||||
int count = extss.NbSolution();
|
||||
if (count != 0) {
|
||||
minDist = extss.Value();
|
||||
} else {
|
||||
minDist = -1;
|
||||
}
|
||||
return minDist;
|
||||
}
|
||||
|
||||
|
||||
//this routine is the big time consumer. gets called many times (and is slow?))
|
||||
//note param gets modified here
|
||||
bool DrawProjectSplit::isOnEdge(TopoDS_Edge e, TopoDS_Vertex v, double& param, bool allowEnds)
|
||||
@@ -276,7 +256,7 @@ bool DrawProjectSplit::isOnEdge(TopoDS_Edge e, TopoDS_Vertex v, double& param, b
|
||||
}
|
||||
}
|
||||
if (!outOfBox) {
|
||||
double dist = simpleMinDist(v,e);
|
||||
double dist = DrawUtil::simpleMinDist(v,e);
|
||||
if (dist < 0.0) {
|
||||
Base::Console().Error("DPS::isOnEdge - simpleMinDist failed: %.3f\n",dist);
|
||||
result = false;
|
||||
|
||||
Reference in New Issue
Block a user