This commit is contained in:
ninja
2025-12-15 23:22:33 +08:00
parent 019570564b
commit 8782765fbc
809 changed files with 118753 additions and 18289 deletions

View File

@@ -1,6 +1,6 @@
/***********************************************************************************************************************
*
* Copyright (c) 2010 - 2022 by Tech Soft 3D, Inc.
* Copyright (c) 2010 - 2025 by Tech Soft 3D, Inc.
* The information contained herein is confidential and proprietary to Tech Soft 3D, Inc., and considered a trade secret
* as defined under civil and criminal statutes. Tech Soft 3D shall pursue its civil and criminal remedies in the event
* of unauthorized use or misappropriation of its trade secrets. Use of this information by anyone other than authorized
@@ -31,7 +31,7 @@ Common:
- Set up the P_SCHEMA environment variable to your Parasolid schema folder (ending with \base\schema);
- Copy pskernel.dll or libpskernel.so to your working directory (the HOOPS Exchange library binary folder).
Windows-specific:
- Provide the correct working directory, i.e. the HOOPS Exchange binary folder (i.e. ..\..\..\..\bin\win32);
- Provide the correct working directory, i.e. the HOOPS Exchange binary folder (i.e. ..\..\..\..\bin\win64_v142);
this setting is located in Project Properties --> Configuration Properties --> Debugging --> Working Directory;
- Set up the command line
- Then you can run it.
@@ -52,6 +52,7 @@ Linux-specific:
#define INITIALIZE_A3D_API
#include <A3DSDKIncludes.h>
#include <hoops_license.h>
#include "../common.hpp"
//######################################################################################################################
@@ -224,6 +225,7 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
MY_PRINTF(" -sewingtolerance real: sewing tolerance for sew mode (1e-4 millimeters by default)\n");
MY_PRINTF(" -iges 0|1 : export to iges file format 0 = off (by default), 1 = on\n");
MY_PRINTF(" -step 0|1 : export to step file format 0 = off (by default), 1 = on\n");
MY_PRINTF(" -multiproc 0|1 : unable multiprocessor computation 0 = off (by default), 1 = on\n");
return A3D_ERROR;
}
@@ -237,9 +239,9 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
sExport.m_sTranslateToPkPartsData.m_bDisjoinIfFaceFaceError = false;
sExport.m_sTranslateToPkPartsData.m_bSew = true;
sExport.m_sTranslateToPkPartsData.m_dSewingTolerance = 1e-4;
sExport.m_sTranslateToPkPartsData.m_pcPSBodyShopPath = "";
sExport.m_sTranslateToPkPartsData.m_pcPSBodyShopPath = const_cast<A3DUTF8Char*>("");
sExport.m_sTranslateToPkPartsData.m_bUseColour2Attribute = true;
sExport.m_sTranslateToPkPartsData.m_uiNbProc = 0; //getLogicalProcessor();
sExport.m_sTranslateToPkPartsData.m_uiNbProc = 0;
sExport.m_sExportParasolidData.m_bBStrictAssemblyStructure = true;
bool bStep = false;
@@ -324,6 +326,11 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
case 0: bSewExchange = false; break;
case 1: bSewExchange = true; break;
}
else if (!MY_STRCMP(ppcArgv[iArg], "-multiproc"))
switch (MY_ATOI(ppcArgv[++iArg]))
{
case 1: sExport.m_sTranslateToPkPartsData.m_uiNbProc = getLogicalProcessor(); break;
}
}
else
{
@@ -353,7 +360,7 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
#else
const char* pcLibPath = "";
#endif
A3DSDKHOOPSExchangeLoader sHoopsExchangeLoader(pcLibPath);
A3DSDKHOOPSExchangeLoader sHoopsExchangeLoader(pcLibPath, HOOPS_LICENSE);
CHECK_RET(sHoopsExchangeLoader.m_eSDKStatus);
CHECK_RET(A3DDllSetCallbacksMemory(CheckMalloc, CheckFree));
@@ -364,16 +371,16 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
char *workbuff = getenv("P_SCHEMA");
if (workbuff)
{
PrintLogMessage("P_SCHEMA="); PrintLogMessage(workbuff); PrintLogMessage("\n");
PrintConstLogMessage("P_SCHEMA="); PrintLogMessage(workbuff); PrintConstLogMessage("\n");
}
else
PrintLogMessage("P_SCHEMA= missing\n");
PrintConstLogMessage("P_SCHEMA= missing\n");
// initialize Parasolid
PrintLogMessage("Initializing Parasolid...\n");
PrintConstLogMessage("Initializing Parasolid...\n");
if (!ParasolidInitialize())
{
PrintLogError(0, "Parasolid initialization failure\n");
PrintConstLogError(0, "Parasolid initialization failure\n");
return A3D_ERROR;
}
@@ -403,7 +410,7 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
#endif
A3DExport sDirectExport(sDirectOutputPath);
PrintLogMessage("Conversion...\n");
PrintConstLogMessage("Conversion...\n");
CHECK_RET(sHoopsExchangeLoader.Convert(sImport, sDirectExport));
return A3D_SUCCESS;
}
@@ -414,7 +421,7 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
sImport.m_sLoadData.m_sSpecifics.m_sStep.m_bHealOrientations = true;
sImport.m_sLoadData.m_sGeneral.m_eReadGeomTessMode = kA3DReadGeomAndTess;
sImport.m_sLoadData.m_sTessellation.m_eTessellationLevelOfDetail = kA3DTessLODMedium;
PrintLogMessage("TranslateToPkParts...\n");
PrintConstLogMessage("TranslateToPkParts...\n");
A3DStatus iRet = sHoopsExchangeLoader.Import(sImport);
if (iRet != A3D_SUCCESS && iRet != A3D_LOAD_MISSING_COMPONENTS)
CHECK_RET(iRet);
@@ -440,11 +447,12 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
switch (sHoopsExchangeLoader.Export(sExport))
{
case A3D_SUCCESS: break;
case A3D_HEPB_MISSING: PrintLogError(0, "Can't load HEPB library"); return A3D_ERROR;
case A3D_PARASOLID_ERROR_970: PrintLogError(0, "Can't access Parasolid schema"); return A3D_ERROR;
case A3D_BODYSHOP_MISSING: PrintLogError(0, "Can't load BodyShop library"); return A3D_ERROR;
case A3D_WRITE_KEEPPARSEDENTITIES_DISABLED: PrintLogError(0, "KeepParsedEntities reading option must be enabled when using TranslateToPkParts"); return A3D_ERROR;
default: PrintLogError(0, "TranslateToPkParts Failure"); return A3D_ERROR;
case A3D_HEPB_MISSING: PrintConstLogError(0, "Can't load HEPB library"); return A3D_ERROR;
case A3D_PARASOLID_ERROR_970: PrintConstLogError(0, "Can't access Parasolid schema"); return A3D_ERROR;
case A3D_PARASOLID_ERROR_5022: PrintConstLogError(0, "Bad Parasolid version"); return A3D_ERROR;
case A3D_BODYSHOP_MISSING: PrintConstLogError(0, "Can't load BodyShop library"); return A3D_ERROR;
case A3D_WRITE_KEEPPARSEDENTITIES_DISABLED: PrintConstLogError(0, "KeepParsedEntities reading option must be enabled when using TranslateToPkParts"); return A3D_ERROR;
default: PrintConstLogError(0, "TranslateToPkParts Failure"); return A3D_ERROR;
}
A3DUTF8Char acOutPutKeyUTF8[_MAX_PATH];
@@ -456,11 +464,11 @@ int main(A3DInt32 iArgc, A3DUTF8Char** ppcArgv)
if (!iNbPkParts)
{
PrintLogError(0, "No part to transmit\n");
PrintConstLogError(0, "No part to transmit\n");
return A3D_SUCCESS;
}
PrintLogMessage("PK_PART_transmit...\n");
PrintConstLogMessage("PK_PART_transmit...\n");
PK_PART_transmit_o_t sTransmitOptions;
PK_PART_transmit_o_m(sTransmitOptions);