Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ jobs:
run: |
emcmake cmake -S . -B build/wasm -DLIB3MF_BUILD_WASM=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build/wasm --target lib3mf_wasm -j"$(nproc)"
- name: Test indexed WASM slice vertices
run: node Tests/SliceVertex.mjs Tests/TestFiles/Slice/MultiSliceStack_TwoFiles.3mf
- name: Package WASM artifact
run: |
mkdir -p build/wasm-artifact
Expand Down
9 changes: 9 additions & 0 deletions Autogenerated/Bindings/C/lib3mf.h
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_addoperand(Lib3MF_BooleanObjec
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getoperand(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, sLib3MFTransform * pTransform);

/**
* Materializes the boolean shape into a newly created mesh object.
*
* @param[in] pBooleanObject - BooleanObject instance.
* @param[out] pMeshObject - new mesh object containing the tessellated boolean shape
* @return error code or 0 (success)
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_mergetomeshobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject);

/*************************************************************************************************************************
Class definition for BeamLattice
**************************************************************************************************************************/
Expand Down
10 changes: 10 additions & 0 deletions Autogenerated/Bindings/CDynamic/lib3mf_dynamic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable)
pWrapperTable->m_BooleanObject_GetOperandCount = NULL;
pWrapperTable->m_BooleanObject_AddOperand = NULL;
pWrapperTable->m_BooleanObject_GetOperand = NULL;
pWrapperTable->m_BooleanObject_MergeToMeshObject = NULL;
pWrapperTable->m_BeamLattice_GetMinLength = NULL;
pWrapperTable->m_BeamLattice_SetMinLength = NULL;
pWrapperTable->m_BeamLattice_GetClipping = NULL;
Expand Down Expand Up @@ -2224,6 +2225,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable,
if (pWrapperTable->m_BooleanObject_GetOperand == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_mergetomeshobject");
#else // _WIN32
pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_mergetomeshobject");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_BooleanObject_MergeToMeshObject == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength");
#else // _WIN32
Expand Down
10 changes: 10 additions & 0 deletions Autogenerated/Bindings/CDynamic/lib3mf_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,15 @@ typedef Lib3MFResult (*PLib3MFBooleanObject_AddOperandPtr) (Lib3MF_BooleanObject
*/
typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperandPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, sLib3MFTransform * pTransform);

/**
* Materializes the boolean shape into a newly created mesh object.
*
* @param[in] pBooleanObject - BooleanObject instance.
* @param[out] pMeshObject - new mesh object containing the tessellated boolean shape
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFBooleanObject_MergeToMeshObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject);

/*************************************************************************************************************************
Class definition for BeamLattice
**************************************************************************************************************************/
Expand Down Expand Up @@ -7223,6 +7232,7 @@ typedef struct {
PLib3MFBooleanObject_GetOperandCountPtr m_BooleanObject_GetOperandCount;
PLib3MFBooleanObject_AddOperandPtr m_BooleanObject_AddOperand;
PLib3MFBooleanObject_GetOperandPtr m_BooleanObject_GetOperand;
PLib3MFBooleanObject_MergeToMeshObjectPtr m_BooleanObject_MergeToMeshObject;
PLib3MFBeamLattice_GetMinLengthPtr m_BeamLattice_GetMinLength;
PLib3MFBeamLattice_SetMinLengthPtr m_BeamLattice_SetMinLength;
PLib3MFBeamLattice_GetClippingPtr m_BeamLattice_GetClipping;
Expand Down
11 changes: 11 additions & 0 deletions Autogenerated/Bindings/CSharp/Lib3MF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,9 @@ public class Lib3MFWrapper
[DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_getoperand", CallingConvention=CallingConvention.Cdecl)]
public unsafe extern static Int32 BooleanObject_GetOperand (IntPtr Handle, UInt32 AIndex, out IntPtr AOperandObject, out InternalTransform ATransform);

[DllImport("lib3mf.dll", EntryPoint = "lib3mf_booleanobject_mergetomeshobject", CallingConvention=CallingConvention.Cdecl)]
public unsafe extern static Int32 BooleanObject_MergeToMeshObject (IntPtr Handle, out IntPtr AMeshObject);

[DllImport("lib3mf.dll", EntryPoint = "lib3mf_beamlattice_getminlength", CallingConvention=CallingConvention.Cdecl)]
public unsafe extern static Int32 BeamLattice_GetMinLength (IntPtr Handle, out Double AMinLength);

Expand Down Expand Up @@ -4843,6 +4846,14 @@ public sTransform GetOperand (UInt32 AIndex, out CMeshObject AOperandObject)
return Internal.Lib3MFWrapper.convertInternalToStruct_Transform (intresultTransform);
}

public CMeshObject MergeToMeshObject ()
{
IntPtr newMeshObject = IntPtr.Zero;

CheckError(Internal.Lib3MFWrapper.BooleanObject_MergeToMeshObject (Handle, out newMeshObject));
return Internal.Lib3MFWrapper.PolymorphicFactory<CMeshObject>(newMeshObject);
}

}

public class CBeamLattice : CBase
Expand Down
9 changes: 9 additions & 0 deletions Autogenerated/Bindings/Cpp/lib3mf_abi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,15 @@ LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_addoperand(Lib3MF_BooleanObjec
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_getoperand(Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, Lib3MF::sTransform * pTransform);

/**
* Materializes the boolean shape into a newly created mesh object.
*
* @param[in] pBooleanObject - BooleanObject instance.
* @param[out] pMeshObject - new mesh object containing the tessellated boolean shape
* @return error code or 0 (success)
*/
LIB3MF_DECLSPEC Lib3MFResult lib3mf_booleanobject_mergetomeshobject(Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject);

/*************************************************************************************************************************
Class definition for BeamLattice
**************************************************************************************************************************/
Expand Down
16 changes: 16 additions & 0 deletions Autogenerated/Bindings/Cpp/lib3mf_implicit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,7 @@ class CBooleanObject : public CObject {
inline Lib3MF_uint32 GetOperandCount();
inline void AddOperand(classParam<CMeshObject> pOperandObject, const sTransform & Transform);
inline sTransform GetOperand(const Lib3MF_uint32 nIndex, PMeshObject & pOperandObject);
inline PMeshObject MergeToMeshObject();
};

/*************************************************************************************************************************
Expand Down Expand Up @@ -6092,6 +6093,21 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
return resultTransform;
}

/**
* CBooleanObject::MergeToMeshObject - Materializes the boolean shape into a newly created mesh object.
* @return new mesh object containing the tessellated boolean shape
*/
PMeshObject CBooleanObject::MergeToMeshObject()
{
Lib3MFHandle hMeshObject = (Lib3MFHandle)nullptr;
CheckError(lib3mf_booleanobject_mergetomeshobject(m_pHandle, &hMeshObject));

if (!hMeshObject) {
CheckError(LIB3MF_ERROR_INVALIDPARAM);
}
return std::shared_ptr<CMeshObject>(dynamic_cast<CMeshObject*>(m_pWrapper->polymorphicFactory(hMeshObject)));
}

/**
* Method definitions for class CBeamLattice
*/
Expand Down
10 changes: 10 additions & 0 deletions Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,15 @@ typedef Lib3MFResult (*PLib3MFBooleanObject_AddOperandPtr) (Lib3MF_BooleanObject
*/
typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperandPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, Lib3MF::sTransform * pTransform);

/**
* Materializes the boolean shape into a newly created mesh object.
*
* @param[in] pBooleanObject - BooleanObject instance.
* @param[out] pMeshObject - new mesh object containing the tessellated boolean shape
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFBooleanObject_MergeToMeshObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject);

/*************************************************************************************************************************
Class definition for BeamLattice
**************************************************************************************************************************/
Expand Down Expand Up @@ -7223,6 +7232,7 @@ typedef struct {
PLib3MFBooleanObject_GetOperandCountPtr m_BooleanObject_GetOperandCount;
PLib3MFBooleanObject_AddOperandPtr m_BooleanObject_AddOperand;
PLib3MFBooleanObject_GetOperandPtr m_BooleanObject_GetOperand;
PLib3MFBooleanObject_MergeToMeshObjectPtr m_BooleanObject_MergeToMeshObject;
PLib3MFBeamLattice_GetMinLengthPtr m_BeamLattice_GetMinLength;
PLib3MFBeamLattice_SetMinLengthPtr m_BeamLattice_SetMinLength;
PLib3MFBeamLattice_GetClippingPtr m_BeamLattice_GetClipping;
Expand Down
30 changes: 30 additions & 0 deletions Autogenerated/Bindings/CppDynamic/lib3mf_dynamic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1636,6 +1636,7 @@ class CBooleanObject : public CObject {
inline Lib3MF_uint32 GetOperandCount();
inline void AddOperand(classParam<CMeshObject> pOperandObject, const sTransform & Transform);
inline sTransform GetOperand(const Lib3MF_uint32 nIndex, PMeshObject & pOperandObject);
inline PMeshObject MergeToMeshObject();
};

/*************************************************************************************************************************
Expand Down Expand Up @@ -4210,6 +4211,7 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
pWrapperTable->m_BooleanObject_GetOperandCount = nullptr;
pWrapperTable->m_BooleanObject_AddOperand = nullptr;
pWrapperTable->m_BooleanObject_GetOperand = nullptr;
pWrapperTable->m_BooleanObject_MergeToMeshObject = nullptr;
pWrapperTable->m_BeamLattice_GetMinLength = nullptr;
pWrapperTable->m_BeamLattice_SetMinLength = nullptr;
pWrapperTable->m_BeamLattice_GetClipping = nullptr;
Expand Down Expand Up @@ -6220,6 +6222,15 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
if (pWrapperTable->m_BooleanObject_GetOperand == nullptr)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_mergetomeshobject");
#else // _WIN32
pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_mergetomeshobject");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_BooleanObject_MergeToMeshObject == nullptr)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength");
#else // _WIN32
Expand Down Expand Up @@ -11402,6 +11413,10 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_GetOperand == nullptr) )
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

eLookupError = (*pLookup)("lib3mf_booleanobject_mergetomeshobject", (void**)&(pWrapperTable->m_BooleanObject_MergeToMeshObject));
if ( (eLookupError != 0) || (pWrapperTable->m_BooleanObject_MergeToMeshObject == nullptr) )
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

eLookupError = (*pLookup)("lib3mf_beamlattice_getminlength", (void**)&(pWrapperTable->m_BeamLattice_GetMinLength));
if ( (eLookupError != 0) || (pWrapperTable->m_BeamLattice_GetMinLength == nullptr) )
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;
Expand Down Expand Up @@ -15487,6 +15502,21 @@ inline CBase* CWrapper::polymorphicFactory(Lib3MFHandle pHandle)
return resultTransform;
}

/**
* CBooleanObject::MergeToMeshObject - Materializes the boolean shape into a newly created mesh object.
* @return new mesh object containing the tessellated boolean shape
*/
PMeshObject CBooleanObject::MergeToMeshObject()
{
Lib3MFHandle hMeshObject = (Lib3MFHandle)nullptr;
CheckError(m_pWrapper->m_WrapperTable.m_BooleanObject_MergeToMeshObject(m_pHandle, &hMeshObject));

if (!hMeshObject) {
CheckError(LIB3MF_ERROR_INVALIDPARAM);
}
return std::shared_ptr<CMeshObject>(dynamic_cast<CMeshObject*>(m_pWrapper->polymorphicFactory(hMeshObject)));
}

/**
* Method definitions for class CBeamLattice
*/
Expand Down
10 changes: 10 additions & 0 deletions Autogenerated/Bindings/Go/lib3mf.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Autogenerated/Bindings/Go/lib3mf_dynamic.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ Lib3MFResult InitLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable)
pWrapperTable->m_BooleanObject_GetOperandCount = NULL;
pWrapperTable->m_BooleanObject_AddOperand = NULL;
pWrapperTable->m_BooleanObject_GetOperand = NULL;
pWrapperTable->m_BooleanObject_MergeToMeshObject = NULL;
pWrapperTable->m_BeamLattice_GetMinLength = NULL;
pWrapperTable->m_BeamLattice_SetMinLength = NULL;
pWrapperTable->m_BeamLattice_GetClipping = NULL;
Expand Down Expand Up @@ -2224,6 +2225,15 @@ Lib3MFResult LoadLib3MFWrapperTable(sLib3MFDynamicWrapperTable * pWrapperTable,
if (pWrapperTable->m_BooleanObject_GetOperand == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) GetProcAddress(hLibrary, "lib3mf_booleanobject_mergetomeshobject");
#else // _WIN32
pWrapperTable->m_BooleanObject_MergeToMeshObject = (PLib3MFBooleanObject_MergeToMeshObjectPtr) dlsym(hLibrary, "lib3mf_booleanobject_mergetomeshobject");
dlerror();
#endif // _WIN32
if (pWrapperTable->m_BooleanObject_MergeToMeshObject == NULL)
return LIB3MF_ERROR_COULDNOTFINDLIBRARYEXPORT;

#ifdef _WIN32
pWrapperTable->m_BeamLattice_GetMinLength = (PLib3MFBeamLattice_GetMinLengthPtr) GetProcAddress(hLibrary, "lib3mf_beamlattice_getminlength");
#else // _WIN32
Expand Down Expand Up @@ -8235,6 +8245,15 @@ Lib3MFResult CCall_lib3mf_booleanobject_getoperand(Lib3MFHandle libraryHandle, L
}


Lib3MFResult CCall_lib3mf_booleanobject_mergetomeshobject(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject)
{
if (libraryHandle == 0)
return LIB3MF_ERROR_INVALIDCAST;
sLib3MFDynamicWrapperTable * wrapperTable = (sLib3MFDynamicWrapperTable *) libraryHandle;
return wrapperTable->m_BooleanObject_MergeToMeshObject (pBooleanObject, pMeshObject);
}


Lib3MFResult CCall_lib3mf_beamlattice_getminlength(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength)
{
if (libraryHandle == 0)
Expand Down
13 changes: 13 additions & 0 deletions Autogenerated/Bindings/Go/lib3mf_dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,15 @@ typedef Lib3MFResult (*PLib3MFBooleanObject_AddOperandPtr) (Lib3MF_BooleanObject
*/
typedef Lib3MFResult (*PLib3MFBooleanObject_GetOperandPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, sLib3MFTransform * pTransform);

/**
* Materializes the boolean shape into a newly created mesh object.
*
* @param[in] pBooleanObject - BooleanObject instance.
* @param[out] pMeshObject - new mesh object containing the tessellated boolean shape
* @return error code or 0 (success)
*/
typedef Lib3MFResult (*PLib3MFBooleanObject_MergeToMeshObjectPtr) (Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject);

/*************************************************************************************************************************
Class definition for BeamLattice
**************************************************************************************************************************/
Expand Down Expand Up @@ -7223,6 +7232,7 @@ typedef struct {
PLib3MFBooleanObject_GetOperandCountPtr m_BooleanObject_GetOperandCount;
PLib3MFBooleanObject_AddOperandPtr m_BooleanObject_AddOperand;
PLib3MFBooleanObject_GetOperandPtr m_BooleanObject_GetOperand;
PLib3MFBooleanObject_MergeToMeshObjectPtr m_BooleanObject_MergeToMeshObject;
PLib3MFBeamLattice_GetMinLengthPtr m_BeamLattice_GetMinLength;
PLib3MFBeamLattice_SetMinLengthPtr m_BeamLattice_SetMinLength;
PLib3MFBeamLattice_GetClippingPtr m_BeamLattice_GetClipping;
Expand Down Expand Up @@ -8226,6 +8236,9 @@ Lib3MFResult CCall_lib3mf_booleanobject_addoperand(Lib3MFHandle libraryHandle, L
Lib3MFResult CCall_lib3mf_booleanobject_getoperand(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_uint32 nIndex, Lib3MF_MeshObject * pOperandObject, sLib3MFTransform * pTransform);


Lib3MFResult CCall_lib3mf_booleanobject_mergetomeshobject(Lib3MFHandle libraryHandle, Lib3MF_BooleanObject pBooleanObject, Lib3MF_MeshObject * pMeshObject);


Lib3MFResult CCall_lib3mf_beamlattice_getminlength(Lib3MFHandle libraryHandle, Lib3MF_BeamLattice pBeamLattice, Lib3MF_double * pMinLength);


Expand Down
18 changes: 18 additions & 0 deletions Autogenerated/Bindings/Java8/lib3mf/BooleanObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,24 @@ public static class GetOperandResult {
public Transform Transform;

}
/**
* Materializes the boolean shape into a newly created mesh object.
*
* @return new mesh object containing the tessellated boolean shape
* @throws Lib3MFException
*/
public MeshObject mergeToMeshObject() throws Lib3MFException {
Pointer bufferMeshObject = new Memory(8);
mWrapper.checkError(this, mWrapper.lib3mf_booleanobject_mergetomeshobject.invokeInt(new java.lang.Object[]{mHandle, bufferMeshObject}));
Pointer valueMeshObject = bufferMeshObject.getPointer(0);
MeshObject meshObject = null;
if (valueMeshObject == Pointer.NULL) {
throw new Lib3MFException(Lib3MFException.LIB3MF_ERROR_INVALIDPARAM, "MeshObject was a null pointer");
}
meshObject = mWrapper.PolymorphicFactory(valueMeshObject, MeshObject.class);
return meshObject;
}


}

Loading
Loading