//==================================================================================================
bool GeomAPI_Wire::isRectangle(std::list<GeomPointPtr>& thePoints) const
{
+ thePoints.clear();
+
const TopoDS_Wire& aWire = TopoDS::Wire(impl<TopoDS_Shape>());
const Handle(Standard_Type)& aLineType = STANDARD_TYPE(Geom_Line);
}
return true;
}
+
+//==================================================================================================
+GeomPointPtr GeomAPI_Wire::middlePoint() const
+{
+ // find middle edge in the wire
+ std::list<GeomShapePtr> aSubs = subShapes(EDGE);
+ size_t aNbSubs = aSubs.size();
+ if (aNbSubs == 0)
+ return GeomPointPtr();
+
+ aNbSubs /= 2;
+ for (; aNbSubs > 0; --aNbSubs)
+ aSubs.pop_front();
+
+ // compute middle point on the middle edge
+ return aSubs.front()->middlePoint();
+}