diff --git a/src/Mod/Import/App/AppImportPy.cpp b/src/Mod/Import/App/AppImportPy.cpp index cac2e5261..edd87a66f 100644 --- a/src/Mod/Import/App/AppImportPy.cpp +++ b/src/Mod/Import/App/AppImportPy.cpp @@ -121,7 +121,6 @@ static PyObject * importer(PyObject *self, PyObject *args) try { IGESControl_Controller::Init(); - Interface_Static::SetIVal("read.surfacecurve.mode",3); IGESCAFControl_Reader aReader; // http://www.opencascade.org/org/forum/thread_20603/?forum=3 aReader.SetReadVisible(hGrp->GetBool("SkipBlankEntities", true) diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index 2a62ed7b8..fcf515de1 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -162,7 +162,6 @@ static PyObject * importer(PyObject *self, PyObject *args) try { IGESControl_Controller::Init(); - Interface_Static::SetIVal("read.surfacecurve.mode",3); IGESCAFControl_Reader aReader; // http://www.opencascade.org/org/forum/thread_20603/?forum=3 aReader.SetReadVisible(hGrp->GetBool("SkipBlankEntities", true) @@ -518,7 +517,6 @@ static PyObject * ocaf(PyObject *self, PyObject *args) Base::Reference hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("IGES"); IGESControl_Controller::Init(); - Interface_Static::SetIVal("read.surfacecurve.mode",3); IGESCAFControl_Reader aReader; // http://www.opencascade.org/org/forum/thread_20603/?forum=3 aReader.SetReadVisible(hGrp->GetBool("SkipBlankEntities", true) diff --git a/src/Mod/Part/App/AppPart.cpp b/src/Mod/Part/App/AppPart.cpp index afefb26e1..684f73a64 100644 --- a/src/Mod/Part/App/AppPart.cpp +++ b/src/Mod/Part/App/AppPart.cpp @@ -297,6 +297,32 @@ void PartExport initPart() Base::Reference hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part"); + // General + Base::Reference hGenGrp = hGrp->GetGroup("General"); + // http://www.opencascade.org/org/forum/thread_20801/ + // read.surfacecurve.mode: + // A preference for the computation of curves in an entity which has both 2D and 3D representation. + // Each TopoDS_Edge in TopoDS_Face must have a 3D and 2D curve that references the surface. + // If both 2D and 3D representation of the entity are present, the computation of these curves depends on + // the following values of parameter: + // 0: "Default" - no preference, both curves are taken + // 3: "3DUse_Preferred" - 3D curves are used to rebuild 2D ones + // Additional modes for IGES + // 2: "2DUse_Preferred" - the 2D is used to rebuild the 3D in case of their inconsistency + // -2: "2DUse_Forced" - the 2D is always used to rebuild the 3D (even if 2D is present in the file) + // -3: "3DUse_Forced" - the 3D is always used to rebuild the 2D (even if 2D is present in the file) + int readsurfacecurve = hGenGrp->GetInt("ReadSurfaceCurveMode", 0); + Interface_Static::SetIVal("read.surfacecurve.mode", readsurfacecurve); + + // write.surfacecurve.mode (STEP-only): + // This parameter indicates whether parametric curves (curves in parametric space of surface) should be + // written into the STEP file. This parameter can be set to Off in order to minimize the size of the resulting + // STEP file. + // Off (0) : writes STEP files without pcurves. This mode decreases the size of the resulting file. + // On (1) : (default) writes pcurves to STEP file + int writesurfacecurve = hGenGrp->GetInt("WriteSurfaceCurveMode", 1); + Interface_Static::SetIVal("write.surfacecurve.mode", writesurfacecurve); + //IGES handling Base::Reference hIgesGrp = hGrp->GetGroup("IGES"); int value = Interface_Static::IVal("write.iges.brep.mode"); diff --git a/src/Mod/Part/App/ImportIges.cpp b/src/Mod/Part/App/ImportIges.cpp index a5734616e..1ef0bc619 100644 --- a/src/Mod/Part/App/ImportIges.cpp +++ b/src/Mod/Part/App/ImportIges.cpp @@ -69,9 +69,7 @@ int Part::ImportIgesParts(App::Document *pcDoc, const char* FileName) try { Base::FileInfo fi(FileName); // read iges file - // http://www.opencascade.org/org/forum/thread_20801/ IGESControl_Controller::Init(); - Interface_Static::SetIVal("read.surfacecurve.mode",3); // load data exchange message files Message_MsgFile::LoadFromEnv("CSF_XSMessage","IGES"); diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index 00f12d431..9b07ce655 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -569,9 +569,7 @@ void TopoShape::importIges(const char *FileName) { try { // read iges file - // http://www.opencascade.org/org/forum/thread_20801/ IGESControl_Controller::Init(); - Interface_Static::SetIVal("read.surfacecurve.mode",3); IGESControl_Reader aReader; // Ignore construction elements // http://www.opencascade.org/org/forum/thread_20603/?forum=3