if (!anEdge.IsNull()) {
Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, myStart, myEnd);
if (!aCurve.IsNull()) {
- if (!BRep_Tool::IsClosed(anEdge))
- aCurve = new Geom_TrimmedCurve(aCurve, myStart, myEnd);
setImpl(new Handle(Geom_Curve)(aCurve));
}
}
#include <Geom_Plane.hxx>
#include <GeomProjLib.hxx>
+#include <BRep_Tool.hxx>
+#include <Geom_TrimmedCurve.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+
GeomAlgoAPI_Projection::GeomAlgoAPI_Projection(const GeomPlanePtr& thePlane)
: myPlane(thePlane)
{
GeomCurvePtr GeomAlgoAPI_Projection::project(const GeomEdgePtr& theEdge)
{
- GeomCurvePtr aCurve(new GeomAPI_Curve(theEdge));
+ GeomCurvePtr aCurve(new GeomAPI_Curve);
+
+ const TopoDS_Shape& aShape = theEdge->impl<TopoDS_Shape>();
+ TopoDS_Edge anEdge = TopoDS::Edge(aShape);
+ if (!anEdge.IsNull()) {
+ double aStart, aEnd;
+ Handle(Geom_Curve) anEdgeCurve = BRep_Tool::Curve(anEdge, aStart, aEnd);
+ if (!anEdgeCurve.IsNull() && !BRep_Tool::IsClosed(anEdge))
+ anEdgeCurve = new Geom_TrimmedCurve(anEdgeCurve, aStart, aEnd);
+ aCurve->setImpl(new Handle_Geom_Curve(anEdgeCurve));
+ }
+
return project(aCurve);
}
# Test projection to slope side face of the prism
Sketch_8 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_2"))
-aFailedIDs = set([1])
+aFailedIDs = set()
testProjections(Part_1_doc, Sketch_8, aProjectedList, aFailedIDs)
model.end()