mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0031617: Export STEP in nonmanifold mode corrupts the shape
This commit is contained in:
parent
bbb7f3fa94
commit
1d5cadffa7
@ -16,6 +16,7 @@
|
|||||||
#include <Interface_CheckIterator.hxx>
|
#include <Interface_CheckIterator.hxx>
|
||||||
#include <Interface_InterfaceModel.hxx>
|
#include <Interface_InterfaceModel.hxx>
|
||||||
#include <Interface_Macros.hxx>
|
#include <Interface_Macros.hxx>
|
||||||
|
#include <Interface_Static.hxx>
|
||||||
#include <Message_Messenger.hxx>
|
#include <Message_Messenger.hxx>
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
#include <Standard_Failure.hxx>
|
#include <Standard_Failure.hxx>
|
||||||
@ -29,6 +30,7 @@
|
|||||||
#include <XSControl_Controller.hxx>
|
#include <XSControl_Controller.hxx>
|
||||||
#include <XSControl_TransferWriter.hxx>
|
#include <XSControl_TransferWriter.hxx>
|
||||||
#include <XSControl_Utils.hxx>
|
#include <XSControl_Utils.hxx>
|
||||||
|
#include <ShapeUpgrade_RemoveLocations.hxx>
|
||||||
|
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(XSControl_TransferWriter,Standard_Transient)
|
IMPLEMENT_STANDARD_RTTIEXT(XSControl_TransferWriter,Standard_Transient)
|
||||||
|
|
||||||
@ -133,12 +135,22 @@ Standard_Boolean XSControl_TransferWriter::RecognizeShape (const TopoDS_Shape& s
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
IFSelect_ReturnStatus XSControl_TransferWriter::TransferWriteShape
|
IFSelect_ReturnStatus XSControl_TransferWriter::TransferWriteShape
|
||||||
(const Handle(Interface_InterfaceModel)& model,
|
(const Handle(Interface_InterfaceModel)& theModel,
|
||||||
const TopoDS_Shape& shape)
|
const TopoDS_Shape& theShape)
|
||||||
{
|
{
|
||||||
IFSelect_ReturnStatus status = IFSelect_RetVoid;
|
IFSelect_ReturnStatus status = IFSelect_RetVoid;
|
||||||
if (myController.IsNull()) return IFSelect_RetError;
|
if (myController.IsNull()) return IFSelect_RetError;
|
||||||
if (model.IsNull()) return IFSelect_RetVoid;
|
if (theModel.IsNull()) return IFSelect_RetVoid;
|
||||||
|
|
||||||
|
TopoDS_Shape aShape = theShape;
|
||||||
|
Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0;
|
||||||
|
if (isNMMode)
|
||||||
|
{
|
||||||
|
ShapeUpgrade_RemoveLocations aRemLoc;
|
||||||
|
aRemLoc.SetRemoveLevel(TopAbs_COMPOUND);
|
||||||
|
aRemLoc.Remove(aShape);
|
||||||
|
aShape = aRemLoc.GetResult();
|
||||||
|
}
|
||||||
|
|
||||||
if (myTransferWriter.IsNull()) myTransferWriter = new Transfer_FinderProcess;
|
if (myTransferWriter.IsNull()) myTransferWriter = new Transfer_FinderProcess;
|
||||||
// effacer l actor : Controller s en charge
|
// effacer l actor : Controller s en charge
|
||||||
@ -149,10 +161,10 @@ IFSelect_ReturnStatus XSControl_TransferWriter::TransferWriteShape
|
|||||||
try {
|
try {
|
||||||
OCC_CATCH_SIGNALS
|
OCC_CATCH_SIGNALS
|
||||||
PrintStats(myTransferMode);
|
PrintStats(myTransferMode);
|
||||||
sout << "****** Transferring Shape, ShapeType = " << shape.ShapeType();
|
sout << "****** Transferring Shape, ShapeType = " << aShape.ShapeType();
|
||||||
sout<<" ******"<<Message_EndLine;
|
sout<<" ******"<<Message_EndLine;
|
||||||
status = myController->TransferWriteShape
|
status = myController->TransferWriteShape
|
||||||
(shape,myTransferWriter,model,myTransferMode);
|
(aShape,myTransferWriter,theModel,myTransferMode);
|
||||||
}
|
}
|
||||||
catch(Standard_Failure const& anException) {
|
catch(Standard_Failure const& anException) {
|
||||||
sout<<"**** **** TransferWriteShape, EXCEPTION : ";
|
sout<<"**** **** TransferWriteShape, EXCEPTION : ";
|
||||||
|
15
tests/bugs/step/bug31617
Normal file
15
tests/bugs/step/bug31617
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
puts "============================================================"
|
||||||
|
puts "OCC31617: Export STEP in nonmanifold mode corrupts the shape"
|
||||||
|
puts "============================================================"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
brestore [locate_data_file bug31617.brep] a
|
||||||
|
|
||||||
|
param write.step.nonmanifold 1
|
||||||
|
|
||||||
|
testwritestep comp_nonmanifold.step a
|
||||||
|
testreadstep comp_nonmanifold.step result
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
|
||||||
|
checknbshapes result -ref [lrange [nbshapes a] 11 16]
|
Loading…
x
Reference in New Issue
Block a user