if (!fill.IsDone()) {
StdFail_NotDone::Raise("Fillet can't be computed on the given shape with the given radius");
}
- aShape = fill.Shape();
+ aShape = GEOMUtils::ReduceCompound( fill.Shape() );
if (aShape.IsNull()) return 0;
{
return BRepTools::Write( shape, fileName );
}
+
+TopoDS_Shape GEOMUtils::ReduceCompound( const TopoDS_Shape& shape )
+{
+ TopoDS_Shape result = shape;
+
+ if ( shape.ShapeType() == TopAbs_COMPOUND ||
+ shape.ShapeType() == TopAbs_COMPSOLID ) {
+
+ TopTools_ListOfShape l;
+
+ TopoDS_Iterator it ( shape );
+ for ( ; it.More(); it.Next() )
+ l.Append( it.Value() );
+ if ( l.Extent() == 1 && l.First() != shape )
+ result = ReduceCompound( l.First() );
+ }
+
+ return result;
+}
*/
Standard_EXPORT bool Write( const TopoDS_Shape& shape,
const char* fileName );
+
+ /*!
+ * \brief Extract single SOLID from COMPSOLID or COMPOUND.
+ *
+ * If the argument shape is a COMPUND or COMPSOLID and there's
+ * only single simple-shape type inside, this sub-shape is returned as a result;
+ * otherwise, the shape is not changed.
+ *
+ * \param shape compound or compsolid being processed.
+ * \retval TopoDS_Shape resulting shape
+ */
+ Standard_EXPORT TopoDS_Shape ReduceCompound( const TopoDS_Shape& shape );
};
#endif