Skip to content
Permalink
Browse files

Fix #3329 globalPosition in Stl export

  • Loading branch information...
WandererFan authored and yorikvanhavre committed Jul 22, 2018
1 parent e45a367 commit e267eac7bb5d9779f1481212bad449d6fe7b1452
Showing with 14 additions and 1 deletion.
  1. +1 −0 CMakeLists.txt
  2. +2 −0 src/Mod/Mesh/App/CMakeLists.txt
  3. +9 −1 src/Mod/Mesh/App/Exporter.cpp
  4. +2 −0 src/Mod/Mesh/App/PreCompiled.h
@@ -345,6 +345,7 @@ REQUIRES_MODS(BUILD_IDF BUILD_PART)
REQUIRES_MODS(BUILD_IMPORT BUILD_PART)
REQUIRES_MODS(BUILD_INSPECTION BUILD_MESH BUILD_POINTS BUILD_PART)
REQUIRES_MODS(BUILD_JTREADER BUILD_MESH)
REQUIRES_MODS(BUILD_MESH BUILD_PART)
REQUIRES_MODS(BUILD_MESH_PART BUILD_PART BUILD_MESH BUILD_SMESH)
REQUIRES_MODS(BUILD_FLAT_MESH BUILD_MESH_PART)
REQUIRES_MODS(BUILD_OPENSCAD BUILD_MESH_PART BUILD_DRAFT)
@@ -11,12 +11,14 @@ include_directories(
${XercesC_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR}
${EIGEN3_INCLUDE_DIR}
${OCC_INCLUDE_DIR}
)

set(Mesh_LIBS
${Boost_LIBRARIES}
FreeCADBase
FreeCADApp
Part
)

if (BUILD_QT5)
@@ -40,6 +40,8 @@

#include "App/Part.h"

#include <Mod/Part/App/TopoShape.h>

#include <zipios++/zipoutputstream.h>

using namespace Mesh;
@@ -173,16 +175,22 @@ bool MergeExporter::addMeshFeat(App::DocumentObject *obj)
bool MergeExporter::addPartFeat(App::DocumentObject *obj, float tol)
{
auto *shape(obj->getPropertyByName("Shape"));

if (shape && shape->getTypeId().isDerivedFrom(App::PropertyComplexGeoData::getClassTypeId())) {
Base::Reference<MeshObject> mesh(new MeshObject());

auto countFacets( mergingMesh.countFacets() );

auto geoData( static_cast<App::PropertyComplexGeoData*>(shape)->getComplexData() );
if (geoData) {
const Part::TopoShape* ts = static_cast<const Part::TopoShape*>(geoData);
Part::TopoShape tsCopy(*ts);
App::GeoFeature* gf = static_cast<App::GeoFeature*>(obj);
tsCopy.setPlacement(gf->globalPlacement());

std::vector<Base::Vector3d> aPoints;
std::vector<Data::ComplexGeoData::Facet> aTopo;
geoData->getFaces(aPoints, aTopo, tol);
tsCopy.getFaces(aPoints, aTopo, tol);

mesh->addFacets(aTopo, aPoints, false);
if (countFacets == 0)
@@ -30,8 +30,10 @@
// Exporting of App classes
#ifdef FC_OS_WIN32
# define MeshExport __declspec(dllexport)
# define PartExport __declspec(dllimport)
#else // for Linux
# define MeshExport
# define PartExport
#endif


0 comments on commit e267eac

Please sign in to comment.
You can’t perform that action at this time.