+
+ bool isDegeneratedEdge = false;
+ // do not use the degenerated edge as a shape, a null context and shape is used in the case
+ if (theSubShape.get() && !theSubShape->isNull() && theSubShape->isEdge()) {
+ const TopoDS_Shape& aSubShape = theSubShape->impl<TopoDS_Shape>();
+ if (aSubShape.ShapeType() == TopAbs_EDGE)
+ isDegeneratedEdge = BRep_Tool::Degenerated(TopoDS::Edge(aSubShape));
+ }
+ if (!theContext.get() || isDegeneratedEdge) {