mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-11 16:19:17 +05:00
0022862: EDF GEOM: MakeFillet returns a compound
This commit is contained in:
parent
ed7afb89f4
commit
e450289112
@ -130,7 +130,7 @@ Standard_Integer GEOMImpl_FilletDriver::Execute(TFunction_Logbook& log) const
|
|||||||
if (!fill.IsDone()) {
|
if (!fill.IsDone()) {
|
||||||
StdFail_NotDone::Raise("Fillet can't be computed on the given shape with the given radius");
|
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;
|
if (aShape.IsNull()) return 0;
|
||||||
|
|
||||||
|
@ -1174,3 +1174,22 @@ bool GEOMUtils::Write( const TopoDS_Shape& shape, const char* fileName )
|
|||||||
{
|
{
|
||||||
return BRepTools::Write( shape, fileName );
|
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;
|
||||||
|
}
|
||||||
|
@ -300,6 +300,18 @@ namespace GEOMUtils
|
|||||||
*/
|
*/
|
||||||
Standard_EXPORT bool Write( const TopoDS_Shape& shape,
|
Standard_EXPORT bool Write( const TopoDS_Shape& shape,
|
||||||
const char* fileName );
|
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
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user