Implementation of common logic for OCCT formats.
//!< Internal parameters for transfer process
struct DE_SectionGlobal
{
- Standard_Real LengthUnit = 1.0; //!< Scale length unit value from MM, default 1.0 (MM)
+ Standard_Real LengthUnit = 1.0; //!< Target Unit (scaling based on MM) for the transfer process, default 1.0 (MM)
+ Standard_Real SystemUnit = 1.0; //!< System Unit (scaling based on MM) to be used when initial unit is unknown, default 1.0 (MM)
} GlobalParameters;
private:
const Standard_Boolean theIsRecursive)
{
GlobalParameters.LengthUnit = theResource->RealVal("general.length.unit", GlobalParameters.LengthUnit, THE_CONFIGURATION_SCOPE());
+ GlobalParameters.SystemUnit = theResource->RealVal("general.system.unit", GlobalParameters.SystemUnit, THE_CONFIGURATION_SCOPE());
if (theIsRecursive)
{
for (DE_ConfigurationFormatMap::Iterator aFormatIter(myConfiguration);
aResult += "\n";
}
aResult += "!Global parameters. Used for all providers\n";
- aResult += "!Length scale unit value. Should be more the 0. Default value: 1.0(MM)\n";
+ aResult += "!Length scale unit value. Should be more than 0. Default value: 1.0(MM)\n";
aResult += THE_CONFIGURATION_SCOPE() + ".general.length.unit :\t " + GlobalParameters.LengthUnit + "\n";
+ aResult += "!System unit value. Should be more than 0. Default value: 1.0(MM)\n";
+ aResult += THE_CONFIGURATION_SCOPE() + ".general.system.unit :\t " + GlobalParameters.SystemUnit + "\n";
if (theIsRecursive)
{
for (DE_ConfigurationFormatMap::Iterator aFormatIter(myConfiguration);
return false;
}
+ Handle(DEBRepCascade_ConfigurationNode) aNode = Handle(DEBRepCascade_ConfigurationNode)::DownCast(GetNode());
+ if (aNode->GlobalParameters.LengthUnit != 1.0)
+ {
+ Message::SendWarning() << "Warning in the DEBRepCascade_Provider during writing the file " <<
+ thePath << "\t: Target Units for writing were changed, but current format doesn't support scaling";
+ }
+
if (aLabels.Length() == 1)
{
aShape = aSTool->GetShape(aLabels.Value(1));
return false;
}
Handle(DEBRepCascade_ConfigurationNode) aNode = Handle(DEBRepCascade_ConfigurationNode)::DownCast(GetNode());
+ if (aNode->GlobalParameters.LengthUnit != 1.0)
+ {
+ Message::SendWarning() << "Warning in the DEBRepCascade_Provider during writing the file " <<
+ thePath << "\t: Target Units for writing were changed, but current format doesn't support scaling";
+ }
if (aNode->InternalParameters.WriteBinary)
{
if (aNode->InternalParameters.WriteVersionBin > static_cast<BinTools_FormatVersion>(BinTools_FormatVersion_UPPER) ||
{
Handle(TDocStd_Application) anApp = new TDocStd_Application();
BinXCAFDrivers::DefineFormat(anApp);
+
+ Handle(DEXCAFCascade_ConfigurationNode) aNode = Handle(DEXCAFCascade_ConfigurationNode)::DownCast(GetNode());
+ if (aNode->GlobalParameters.LengthUnit != 1.0)
+ {
+ Message::SendWarning() << "Warning in the DEXCAFCascade_Provider during writing the file " <<
+ thePath << "\t: Target Units for writing were changed, but current format doesn't support scaling";
+ }
+
PCDM_StoreStatus aStatus = PCDM_SS_Doc_IsNull;
if (!thePath.IsEmpty())
{
theResource->IntegerVal("write.brep.mode", InternalParameters.WriteBRepMode, aScope);
InternalParameters.WriteConvertSurfaceMode = (WriteMode_ConvertSurface)
theResource->IntegerVal("write.convertsurface.mode", InternalParameters.WriteConvertSurfaceMode, aScope);
- InternalParameters.WriteUnit = (UnitsMethods_LengthUnit)
- theResource->IntegerVal("write.unit", InternalParameters.WriteUnit, aScope);
InternalParameters.WriteHeaderAuthor =
theResource->StringVal("write.header.author", InternalParameters.WriteHeaderAuthor, aScope);
InternalParameters.WriteHeaderCompany =
aResult += aScope + "write.convertsurface.mode :\t " + InternalParameters.WriteConvertSurfaceMode + "\n";
aResult += "!\n";
- aResult += "!\n";
- aResult += "!Allows choosing the unit. The default unit for Open CASCADE Technology is \"MM\" (millimeter).";
- aResult += "You can choose to write a file into any unit accepted by IGES\n";
- aResult += "!Default value: MM(2). Available values: \"INCH\"(1), \"MM\"(2), \"??\"(3), \"FT\"(4), \"MI\"(5), ";
- aResult += "\"M\"(6), \"KM\"(7), \"MIL\"(8), \"UM\"(9), \"CM\"(10), \"UIN\"(11)\n";
- aResult += aScope + "write.unit :\t " + InternalParameters.WriteUnit + "\n";
- aResult += "!\n";
-
aResult += "!\n";
aResult += "!Gives the name of the author of the file\n";
aResult += "!Default value: {System name of the user}. Available values: <string>\n";
// Write
WriteMode_BRep WriteBRepMode = WriteMode_BRep_Faces; //<! Flag to define entities type to write
WriteMode_ConvertSurface WriteConvertSurfaceMode = WriteMode_ConvertSurface_Off; //<! Flag to convert surface to elementary
- UnitsMethods_LengthUnit WriteUnit = UnitsMethods_LengthUnit_Millimeter; //<! Define unit to write IGES file
TCollection_AsciiString WriteHeaderAuthor; //<! Name of the author of the file
TCollection_AsciiString WriteHeaderCompany; //<! Name of the sending company
TCollection_AsciiString WriteHeaderProduct; //<! Name of the sending product
myOldValues.WriteBRepMode = (IGESCAFControl_ConfigurationNode::WriteMode_BRep)Interface_Static::IVal("write.iges.brep.mode");
myOldValues.WriteConvertSurfaceMode = (IGESCAFControl_ConfigurationNode::WriteMode_ConvertSurface)Interface_Static::IVal("write.convertsurface.mode");
- myOldValues.WriteUnit = (UnitsMethods_LengthUnit)Interface_Static::IVal("write.iges.unit");
myOldValues.WriteHeaderAuthor = Interface_Static::CVal("write.iges.header.author");
myOldValues.WriteHeaderCompany = Interface_Static::CVal("write.iges.header.company");
myOldValues.WriteHeaderProduct = Interface_Static::CVal("write.iges.header.product");
Interface_Static::SetIVal("write.iges.brep.mode", theParameter.WriteBRepMode);
Interface_Static::SetIVal("write.convertsurface.mode", theParameter.WriteConvertSurfaceMode);
- Interface_Static::SetIVal("write.iges.unit", theParameter.WriteUnit);
Interface_Static::SetCVal("write.iges.header.author", theParameter.WriteHeaderAuthor.ToCString());
Interface_Static::SetCVal("write.iges.header.company", theParameter.WriteHeaderCompany.ToCString());
Interface_Static::SetCVal("write.iges.header.product", theParameter.WriteHeaderProduct.ToCString());
Handle(IGESCAFControl_ConfigurationNode) aNode = Handle(IGESCAFControl_ConfigurationNode)::DownCast(GetNode());
personizeWS(theWS);
initStatic(aNode);
- XCAFDoc_DocumentTool::SetLengthUnit(theDocument, aNode->InternalParameters.WriteUnit, UnitsMethods_LengthUnit_Millimeter);
- IGESCAFControl_Writer aWriter(theWS);
+ Standard_Integer aFlag = IGESData_BasicEditor::GetFlagByValue(aNode->GlobalParameters.LengthUnit);
+ IGESCAFControl_Writer aWriter(theWS, (aFlag > 0) ? IGESData_BasicEditor::UnitFlagName(aFlag) : "MM");
+ IGESData_GlobalSection aGS = aWriter.Model()->GlobalSection();
+ Standard_Real aScaleFactorMM = 1.;
+ Standard_Boolean aHasUnits = XCAFDoc_DocumentTool::GetLengthUnit(theDocument, aScaleFactorMM, UnitsMethods_LengthUnit_Millimeter);
+ if (aHasUnits)
+ {
+ aGS.SetCascadeUnit(aScaleFactorMM);
+ }
+ else
+ {
+ aGS.SetCascadeUnit(aNode->GlobalParameters.SystemUnit);
+ Message::SendWarning() << "Warning in the IGESCAFControl_Provider during writing the file " <<
+ thePath << "\t: The document has no information on Units. Using global parameter as initial Unit.";
+ }
+ if (aFlag == 0)
+ {
+ aGS.SetScale(aNode->GlobalParameters.LengthUnit);
+ }
+ aWriter.Model()->SetGlobalSection(aGS);
aWriter.SetColorMode(aNode->InternalParameters.WriteColor);
aWriter.SetNameMode(aNode->InternalParameters.WriteName);
aWriter.SetLayerMode(aNode->InternalParameters.WriteLayer);
}
Handle(IGESCAFControl_ConfigurationNode) aNode = Handle(IGESCAFControl_ConfigurationNode)::DownCast(GetNode());
initStatic(aNode);
- TCollection_AsciiString aUnit(UnitsMethods::DumpLengthUnit(aNode->InternalParameters.WriteUnit));
- aUnit.UpperCase();
- IGESControl_Writer aWriter(aUnit.ToCString(),
- aNode->InternalParameters.WriteBRepMode);
+ Standard_Integer aFlag = IGESData_BasicEditor::GetFlagByValue(aNode->GlobalParameters.LengthUnit);
+ IGESControl_Writer aWriter((aFlag > 0) ? IGESData_BasicEditor::UnitFlagName(aFlag) : "MM",
+ aNode->InternalParameters.WriteBRepMode);
+ IGESData_GlobalSection aGS = aWriter.Model()->GlobalSection();
+ aGS.SetCascadeUnit(aNode->GlobalParameters.SystemUnit);
+ if (!aFlag)
+ {
+ aGS.SetScale(aNode->GlobalParameters.LengthUnit);
+ }
+ aWriter.Model()->SetGlobalSection(aGS);
Standard_Boolean aIsOk = aWriter.AddShape(theShape);
if (!aIsOk)
{
// SetWS (WS,scratch); // this should be the only required command here
}
+//=======================================================================
+//function : IGESCAFControl_Writer
+//purpose :
+//=======================================================================
+
+IGESCAFControl_Writer::IGESCAFControl_Writer(const Handle(XSControl_WorkSession)& WS,
+ const Standard_CString theUnit)
+ :IGESControl_Writer(theUnit)
+{
+
+ WS->SetModel(Model());
+ WS->SetMapWriter(TransferProcess());
+ myColorMode = Standard_True;
+ myNameMode = Standard_True;
+ myLayerMode = Standard_True;
+}
+
//=======================================================================
//function : Transfer
//purpose :
//! Creates a reader tool and attaches it to an already existing Session
//! Clears the session if it was not yet set for IGES
Standard_EXPORT IGESCAFControl_Writer(const Handle(XSControl_WorkSession)& WS, const Standard_Boolean scratch = Standard_True);
+
+ //! Creates a reader tool and attaches it to an already existing Session
+ //! Clears the session if it was not yet set for IGES
+ //! Sets target Unit for the writing process.
+ Standard_EXPORT IGESCAFControl_Writer(const Handle(XSControl_WorkSession)& theWS, const Standard_CString theUnit);
//! Transfers a document to a IGES model
//! Returns True if translation is OK
//#73 rln 10.03.99 S4135: "read.scale.unit" does not affect GlobalSection
//if (Interface_Static::IVal("read.scale.unit") == 1) vmm = vmm * 1000.;
// vmm est exprime en MILLIMETRES
- if (vmm >= 25. && vmm <= 26. ) return SetUnitFlag(1);
- if (vmm >= 0.9 && vmm <= 1.1 ) return SetUnitFlag(2);
- if (vmm >= 300. && vmm <= 310. ) return SetUnitFlag(4);
- if (vmm >= 1600000. && vmm <= 1620000. ) return SetUnitFlag(5);
- if (vmm >= 990. && vmm <= 1010. ) return SetUnitFlag(6);
- if (vmm >= 990000. && vmm <= 1010000. ) return SetUnitFlag(7);
- if (vmm >= 0.025 && vmm <= 0.026 ) return SetUnitFlag(8);
- if (vmm >= 0.0009 && vmm <= 0.0011 ) return SetUnitFlag(9);
- if (vmm >= 9. && vmm <= 11. ) return SetUnitFlag(10);
- if (vmm >= 0.000025 && vmm <= 0.000026) return SetUnitFlag(11);
- return Standard_False;
+ Standard_Integer aFlag = GetFlagByValue(vmm);
+ return (aFlag > 0) ? SetUnitFlag(aFlag) : Standard_False;
+}
+
+//=======================================================================
+//function : GetFlagByValue
+//purpose :
+//=======================================================================
+Standard_Integer IGESData_BasicEditor::GetFlagByValue(const Standard_Real theValue)
+{
+ if (theValue >= 25. && theValue <= 26.) return 1;
+ if (theValue >= 0.9 && theValue <= 1.1) return 2;
+ if (theValue >= 300. && theValue <= 310.) return 4;
+ if (theValue >= 1600000. && theValue <= 1620000.) return 5;
+ if (theValue >= 990. && theValue <= 1010.) return 6;
+ if (theValue >= 990000. && theValue <= 1010000.) return 7;
+ if (theValue >= 0.025 && theValue <= 0.026) return 8;
+ if (theValue >= 0.0009 && theValue <= 0.0011) return 9;
+ if (theValue >= 9. && theValue <= 11.) return 10;
+ if (theValue >= 0.000025 && theValue <= 0.000026) return 11;
+ return 0;
}
//=======================================================================
//! Returns the maximum allowed value for Drafting Flag
Standard_EXPORT static Standard_Integer DraftingMax();
+ //! Returns Flag corresponding to the scaling theValue.
+ //! Returns 0 if there's no such flag.
+ Standard_EXPORT static Standard_Integer GetFlagByValue(const Standard_Real theValue);
+
Handle(RWGltf_ConfigurationNode) aNode = Handle(RWGltf_ConfigurationNode)::DownCast(GetNode());
RWMesh_CoordinateSystemConverter aConverter;
- aConverter.SetInputLengthUnit(aNode->GlobalParameters.LengthUnit / 1000);
+ Standard_Real aScaleFactorM = 1.;
+ if (!XCAFDoc_DocumentTool::GetLengthUnit(theDocument, aScaleFactorM))
+ {
+ aConverter.SetInputLengthUnit(aNode->GlobalParameters.SystemUnit / 1000.);
+ Message::SendWarning() << "Warning in the RWGltf_Provider during writing the file " <<
+ thePath << "\t: The document has no information on Units. Using global parameter as initial Unit.";
+ }
aConverter.SetInputCoordinateSystem(aNode->InternalParameters.SystemCS);
- aConverter.SetOutputLengthUnit(aNode->InternalParameters.FileLengthUnit);
+ if (aNode->GlobalParameters.LengthUnit != 1000.)
+ {
+ Message::SendWarning() << "Warning in the RWGltf_Provider during writing the file " <<
+ thePath << "\t: Target format doesn't support custom units. Model will be scaled to Meters";
+ }
+ aConverter.SetOutputLengthUnit(1.); // gltf units always Meters
aConverter.SetOutputCoordinateSystem(aNode->InternalParameters.FileCS);
TColStd_IndexedDataMapOfStringString aFileInfo;
}
RWMesh_CoordinateSystemConverter aConverter;
- aConverter.SetInputLengthUnit(aNode->GlobalParameters.LengthUnit / 1000);
+ Standard_Real aScaleFactorMM = 1.;
+ if (XCAFDoc_DocumentTool::GetLengthUnit(theDocument, aScaleFactorMM, UnitsMethods_LengthUnit_Millimeter))
+ {
+ aConverter.SetInputLengthUnit(aScaleFactorMM / 1000.);
+ }
+ else
+ {
+ aConverter.SetInputLengthUnit(aNode->GlobalParameters.SystemUnit / 1000.);
+ Message::SendWarning() << "Warning in the RWObj_Provider during writing the file " <<
+ thePath << "\t: The document has no information on Units. Using global parameter as initial Unit.";
+ }
aConverter.SetInputCoordinateSystem(aNode->InternalParameters.SystemCS);
- aConverter.SetOutputLengthUnit(aNode->InternalParameters.FileLengthUnit);
+ aConverter.SetOutputLengthUnit(aNode->GlobalParameters.LengthUnit / 1000.);
aConverter.SetOutputCoordinateSystem(aNode->InternalParameters.FileCS);
RWObj_CafWriter aWriter(thePath);
aFileInfo.Add("Comments", aNode->InternalParameters.WriteComment);
}
RWMesh_CoordinateSystemConverter aConverter;
- aConverter.SetInputLengthUnit(aNode->GlobalParameters.LengthUnit / 1000);
+ Standard_Real aScaleFactorM = 1.;
+ if (XCAFDoc_DocumentTool::GetLengthUnit(theDocument, aScaleFactorM))
+ {
+ aConverter.SetInputLengthUnit(aScaleFactorM);
+ }
+ else
+ {
+ aConverter.SetInputLengthUnit(aNode->GlobalParameters.SystemUnit / 1000.);
+ Message::SendWarning() << "Warning in the RWPly_Provider during writing the file " <<
+ thePath << "\t: The document has no information on Units. Using global parameter as initial Unit.";
+ }
aConverter.SetInputCoordinateSystem(aNode->InternalParameters.SystemCS);
- aConverter.SetOutputLengthUnit(aNode->InternalParameters.FileLengthUnit);
+ aConverter.SetOutputLengthUnit(aNode->GlobalParameters.LengthUnit / 1000.);
aConverter.SetOutputCoordinateSystem(aNode->InternalParameters.FileCS);
RWPly_CafWriter aPlyCtx(thePath);
return false;
}
+ Handle(RWStl_ConfigurationNode) aNode = Handle(RWStl_ConfigurationNode)::DownCast(GetNode());
+ if (aNode->GlobalParameters.LengthUnit != 1.0)
+ {
+ Message::SendWarning() << "Warning in the RWStl_Provider during writing the file " <<
+ thePath << "\t: Target Units for writing were changed, but current format doesn't support scaling";
+ }
+
if (aLabels.Length() == 1)
{
aShape = aSTool->GetShape(aLabels.Value(1));
return false;
}
Handle(RWStl_ConfigurationNode) aNode = Handle(RWStl_ConfigurationNode)::DownCast(GetNode());
+ if (aNode->GlobalParameters.LengthUnit != 1.0)
+ {
+ Message::SendWarning() << "Warning in the RWStl_Provider during writing the file " <<
+ thePath << "\t: Target Units for writing were changed, but current format doesn't support scaling";
+ }
StlAPI_Writer aWriter;
aWriter.ASCIIMode() = aNode->InternalParameters.WriteAscii;
return false;
}
Handle(STEPCAFControl_ConfigurationNode) aNode = Handle(STEPCAFControl_ConfigurationNode)::DownCast(GetNode());
-
- XCAFDoc_DocumentTool::SetLengthUnit(theDocument,
- UnitsMethods::GetLengthUnitScale(aNode->InternalParameters.WriteUnit,
- UnitsMethods_LengthUnit_Millimeter), UnitsMethods_LengthUnit_Millimeter);
personizeWS(theWS);
STEPCAFControl_Writer aWriter;
aWriter.Init(theWS);
aWriter.SetNameMode(aNode->InternalParameters.WriteName);
aWriter.SetLayerMode(aNode->InternalParameters.WriteLayer);
aWriter.SetPropsMode(aNode->InternalParameters.WriteProps);
-
- TDF_Label aLabel;
StepData_ConfParameters aParams;
+ Standard_Real aScaleFactorMM = 1.;
+ if (XCAFDoc_DocumentTool::GetLengthUnit(theDocument, aScaleFactorMM, UnitsMethods_LengthUnit_Millimeter))
+ {
+ aModel->SetLocalLengthUnit(aScaleFactorMM);
+ }
+ else
+ {
+ aModel->SetLocalLengthUnit(aNode->GlobalParameters.SystemUnit);
+ Message::SendWarning() << "Warning in the STEPCAFControl_Provider during writing the file " <<
+ thePath << "\t: The document has no information on Units. Using global parameter as initial Unit.";
+ }
+ UnitsMethods_LengthUnit aTargetUnit = UnitsMethods::GetLengthUnitByFactorValue(aNode->GlobalParameters.LengthUnit, UnitsMethods_LengthUnit_Millimeter);
+ aParams.WriteUnit = aTargetUnit;
+ aModel->SetWriteLengthUnit(aNode->GlobalParameters.LengthUnit);
+ TDF_Label aLabel;
if (!aWriter.Transfer(theDocument, aParams, aMode, 0, theProgress))
{
Message::SendFail() << "Error in the STEPCAFControl_Provider during writing the file " <<
STEPControl_Writer aWriter;
aWriter.SetWS(theWS);
IFSelect_ReturnStatus aWritestat = IFSelect_RetVoid;
- Handle(StepData_StepModel) aModel = aWriter.Model();
- aModel->SetWriteLengthUnit(UnitsMethods::GetLengthUnitScale(aNode->InternalParameters.WriteUnit, UnitsMethods_LengthUnit_Millimeter));
+ Handle(StepData_StepModel) aModel = aWriter.Model();;
StepData_ConfParameters aParams;
+ aModel->SetLocalLengthUnit(aNode->GlobalParameters.SystemUnit);
+ UnitsMethods_LengthUnit aTargetUnit = UnitsMethods::GetLengthUnitByFactorValue(aNode->GlobalParameters.LengthUnit, UnitsMethods_LengthUnit_Millimeter);
+ aParams.WriteUnit = aTargetUnit;
+ if (aTargetUnit == UnitsMethods_LengthUnit_Undefined)
+ {
+ aModel->SetWriteLengthUnit(1.0);
+ Message::SendWarning() << "Custom units are not supported by STEP format, but LengthUnit global parameter doesn't fit any predefined unit. Units will be scaled to Millimeters";
+ }
+ else
+ {
+ aModel->SetWriteLengthUnit(aNode->GlobalParameters.LengthUnit);
+ }
aWritestat = aWriter.Transfer(theShape, aNode->InternalParameters.WriteModelType, aParams, true, theProgress);
if (aWritestat != IFSelect_RetDone)
{
VrmlAPI_Writer aWriter;
aWriter.SetRepresentation(static_cast<VrmlAPI_RepresentationOfShape>(aNode->InternalParameters.WriteRepresentationType));
- Standard_Real aScaleFactorM = aNode->GlobalParameters.LengthUnit;
- if (!aWriter.WriteDoc(theDocument, thePath.ToCString(), aScaleFactorM))
+ Standard_Real aScaling = 1.;
+ Standard_Real aScaleFactorMM = 1.;
+ if (XCAFDoc_DocumentTool::GetLengthUnit(theDocument, aScaleFactorMM, UnitsMethods_LengthUnit_Millimeter))
+ {
+ aScaling = aScaleFactorMM / aNode->GlobalParameters.LengthUnit;
+ }
+ else
+ {
+ aScaling = aNode->GlobalParameters.SystemUnit / aNode->GlobalParameters.LengthUnit;
+ Message::SendWarning() << "Warning in the Vrml_Provider during writing the file " <<
+ thePath << "\t: The document has no information on Units. Using global parameter as initial Unit.";
+ }
+ if (!aWriter.WriteDoc(theDocument, thePath.ToCString(), aScaling))
{
Message::SendFail() << "Error in the Vrml_Provider during wtiting the file " <<
thePath << "\t: File was not written";
global.priority.IGES : OCC
global.priority.PLY : OCC
global.general.length.unit : 1
+global.general.system.unit : 1
provider.STEP.OCC.read.iges.bspline.continuity : 1
provider.STEP.OCC.read.precision.mode : 0
provider.STEP.OCC.read.precision.val : 0.0001
global.priority.IGES : OCC
global.priority.PLY : OCC
global.general.length.unit : 1
+global.general.system.unit : 1
provider.STEP.OCC.read.iges.bspline.continuity : 1
provider.STEP.OCC.read.precision.mode : 0
provider.STEP.OCC.read.precision.val : 0.0001
}
XGetOneShape S0 D0
-param xstep.cascade.unit M
-if [catch {ReadGltf D1 $filename} catch_result] {
- puts "Error : Problem with reading file"
-} else {
- puts "OK : Reading is correct"
-}
-XGetOneShape S1 D1
-
-if [catch {WriteFile D0 $write_path -conf "provider.GLTF.OCC.file.length.unit : 0.001 "} catch_result] {
+if [catch {WriteFile D0 $write_path -conf "global.general.length.unit : 1 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
puts "OK : Reading is correct"
}
-if [catch {WriteFile D1 $write_path -conf "provider.GLTF.OCC.file.length.unit : 1 "} catch_result] {
+if [catch {WriteFile D0 $write_path -conf "global.general.length.unit : 1 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
}
-if [catch {readfile S4 $write_path -conf "global.general.length.unit : 1000 "} catch_result] {
+if [catch {ReadFile D6 $write_path -conf "global.general.length.unit : 1 "} catch_result] {
+ puts "Error : Problem with reading file"
+} else {
+ puts "OK : Reading is correct"
+}
+XGetOneShape S6 D6
+
+param xstep.cascade.unit M
+if [catch {ReadGltf D1 $filename} catch_result] {
puts "Error : Problem with reading file"
} else {
puts "OK : Reading is correct"
}
+XGetOneShape S1 D1
-if [catch {writefile S1 $write_path} catch_result] {
+if [catch {WriteFile D1 $write_path -conf "global.general.length.unit : 1000 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
}
-if [catch {readfile S5 $write_path} catch_result] {
+if [catch {readfile S4 $write_path -conf "global.general.length.unit : 1000 "} catch_result] {
puts "Error : Problem with reading file"
} else {
puts "OK : Reading is correct"
}
-if [catch {WriteFile D0 $write_path -conf "provider.GLTF.OCC.file.length.unit : 0.001 "} catch_result] {
+if [catch {writefile S1 $write_path -conf "global.general.system.unit : 1000 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
}
-if [catch {ReadFile D6 $write_path -conf "global.general.length.unit : 1 "} catch_result] {
+if [catch {readfile S5 $write_path} catch_result] {
puts "Error : Problem with reading file"
} else {
puts "OK : Reading is correct"
}
-XGetOneShape S6 D6
-if [catch {writefile S1 $write_path -conf "provider.GLTF.OCC.file.length.unit : 1 "} catch_result] {
+if [catch {writefile S1 $write_path -conf "global.general.length.unit : 1000 \n global.general.system.unit : 1000 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
}
XGetOneShape S7 D7
-array set areas {0 3.18785e+06 1 3.18785 2 3.18785e+06 3 3.18785e+06 4 3.18785 5 3.18785 6 3.18785e+06 7 3.18785e-06}
+array set areas {0 3.18785e+06 1 3.18785 2 3.18785e+06 3 3.18785e+06 4 3.18785 5 3.18785e+06 6 3.18785e+06 7 3.18785}
array set results {0 S0 1 S1 2 S2 3 S3 4 S4 5 S5 6 S6 7 S7}
for { set anind 0} { $anind < 8 } { incr anind } {
checkprops $results($anind) -s $areas($anind) -eps 1e-2
}
XGetOneShape S1 D1
-if [catch {WriteFile D0 $write_path -conf "provider.IGES.write.iges.unit : 1 "} catch_result] {
+if [catch {WriteFile D0 $write_path -conf "global.general.length.unit : 25.4 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
puts "OK : Reading is correct"
}
-if [catch {WriteFile D1 $write_path -conf "provider.IGES.write.iges.unit : 6 "} catch_result] {
+if [catch {WriteFile D1 $write_path -conf "global.general.length.unit : 1000 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
puts "OK : Reading is correct"
}
-if [catch {WriteFile D0 $write_path -conf "provider.IGES.write.iges.unit : 2 "} catch_result] {
+if [catch {WriteFile D0 $write_path -conf "global.general.length.unit : 1 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
}
XGetOneShape S6 D6
-if [catch {writefile S1 $write_path -conf "provider.IGES.write.iges.unit : 1 "} catch_result] {
+if [catch {writefile S1 $write_path -conf "global.general.length.unit : 25.4 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
}
XGetOneShape S7 D7
-array set areas {0 11995.4 1 0.0119954 2 47916.8 3 11979.2 4 0.0479168 5 0.0119792 6 47916.8 7 18.5678}
+array set areas {0 11995.4 1 0.0119954 2 11979.2 3 11979.2 4 11979.2 5 0.0119792 6 11979.2 7 18.5678}
array set results {0 S0 1 S1 2 S2 3 S3 4 S4 5 S5 6 S6 7 S7}
for { set anind 0} { $anind < 8 } { incr anind } {
checkprops $results($anind) -s $areas($anind) -eps 1e-2
}
XGetOneShape S1 D1
-if [catch {WriteFile D0 $write_path -conf "provider.OBJ.OCC.file.length.unit : 0.001 "} catch_result] {
+if [catch {WriteFile D0 $write_path -conf "global.general.length.unit : 1 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
}
-if [catch {readfile S2 $write_path} catch_result] {
+if [catch {readfile S2 $write_path -conf "provider.OBJ.OCC.file.length.unit : 0.001 "} catch_result] {
puts "Error : Problem with reading file"
} else {
puts "OK : Reading is correct"
} else {
puts "OK : Writing is correct"
}
-if [catch {readfile S3 $write_path} catch_result] {
+if [catch {readfile S3 $write_path -conf "provider.OBJ.OCC.file.length.unit : 0.001 "} catch_result] {
puts "Error : Problem with reading file"
} else {
puts "OK : Reading is correct"
}
-if [catch {WriteFile D1 $write_path -conf "provider.OBJ.OCC.file.length.unit : 1 "} catch_result] {
+if [catch {WriteFile D1 $write_path -conf "global.general.length.unit : 1000 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
}
-if [catch {readfile S4 $write_path -conf "global.general.length.unit : 1000 "} catch_result] {
+if [catch {readfile S4 $write_path -conf "global.general.length.unit : 1000 \n provider.OBJ.OCC.file.length.unit : 1"} catch_result] {
puts "Error : Problem with reading file"
} else {
puts "OK : Reading is correct"
} else {
puts "OK : Writing is correct"
}
-if [catch {readfile S5 $write_path} catch_result] {
+if [catch {readfile S5 $write_path -conf "provider.OBJ.OCC.file.length.unit : 0.001 "} catch_result] {
puts "Error : Problem with reading file"
} else {
puts "OK : Reading is correct"
}
-if [catch {WriteFile D0 $write_path -conf "provider.GLTF.OCC.file.length.unit : 0.001 "} catch_result] {
+if [catch {WriteFile D0 $write_path -conf "global.general.length.unit : 1 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
}
XGetOneShape S6 D6
-if [catch {writefile S1 $write_path -conf "provider.GLTF.OCC.file.length.unit : 1 "} catch_result] {
+if [catch {writefile S1 $write_path -conf "global.general.length.unit : 1000 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
}
-if [catch {ReadFile D7 $write_path -conf "global.general.length.unit : 1000 "} catch_result] {
+if [catch {ReadFile D7 $write_path -conf "global.general.length.unit : 1000 \n provider.OBJ.OCC.file.length.unit : 1"} catch_result] {
puts "Error : Problem with reading file"
} else {
puts "OK : Reading is correct"
param xstep.cascade.unit MM
-if [catch {WriteFile D0 $write_path -conf "provider.STEP.write.step.unit : 1 "} catch_result] {
+if [catch {WriteFile D0 $write_path -conf "global.general.length.unit : 25.4 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
puts "OK : Reading is correct"
}
-if [catch {writefile S0 $write_path } catch_result] {
+if [catch {writefile S0 $write_path -conf "global.general.system.unit : 1 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
puts "OK : Reading is correct"
}
-if [catch {WriteFile D1 $write_path -conf "provider.STEP.write.step.unit : 6 "} catch_result] {
+if [catch {WriteFile D1 $write_path -conf "global.general.length.unit : 1000 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
puts "OK : Reading is correct"
}
-if [catch {WriteFile D0 $write_path -conf "provider.STEP.write.step.unit : 2 "} catch_result] {
+if [catch {WriteFile D0 $write_path -conf "global.general.length.unit : 1 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
}
XGetOneShape S6 D6
-if [catch {writefile S1 $write_path -conf "provider.STEP.write.step.unit : 1 "} catch_result] {
+if [catch {writefile S1 $write_path -conf "global.general.length.unit : 25.4 "} catch_result] {
puts "Error : Problem with writing file"
} else {
puts "OK : Writing is correct"
}
XGetOneShape S7 D7
-array set areas {0 2.52381e+06 1 2.52381 2 2.52381e+06 3 2.52381e+06 4 2.52381 5 2.52381 6 2.52381e+06 7 3911.92}
+array set areas {0 2.52381e+06 1 2.52381 2 2.52381e+06 3 2.52381e+06 4 2.52381e+06 5 2.52381 6 2.52381e+06 7 3911.92}
array set results {0 S0 1 S1 2 S2 3 S3 4 S4 5 S5 6 S6 7 S7}
for { set anind 0} { $anind < 8 } { incr anind } {
checkprops $results($anind) -s $areas($anind) -eps 1e-2
}
XGetOneShape S7 D7
-array set areas {0 5.3415e+06 1 5.3415 2 5.3415e+06 3 5.3415e+06 4 5.3415 5 5.3415 6 5.3415e+06 7 5.3415e-06}
+array set areas {0 5.3415e+06 1 5.3415 2 5.3415e+06 3 5.3415e+06 4 5.3415e+06 5 5.3415 6 5.3415e+06 7 5.3415e-06}
array set results {0 S0 1 S1 2 S2 3 S3 4 S4 5 S5 6 S6 7 S7}
for { set anind 0} { $anind < 8 } { incr anind } {
checkprops $results($anind) -s $areas($anind) -eps 1e-2