1
/***************************************************************************
2
* Copyright (c) 2004 Werner Mayer <wmayer[at]users.sourceforge.net> *
4
* This file is part of the FreeCAD CAx development system. *
6
* This library is free software; you can redistribute it and/or *
7
* modify it under the terms of the GNU Library General Public *
8
* License as published by the Free Software Foundation; either *
9
* version 2 of the License, or (at your option) any later version. *
11
* This library is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU Library General Public License for more details. *
16
* You should have received a copy of the GNU Library General Public *
17
* License along with this library; see the file COPYING.LIB. If not, *
18
* write to the Free Software Foundation, Inc., 59 Temple Place, *
19
* Suite 330, Boston, MA 02111-1307, USA *
21
***************************************************************************/
23
#include "PreCompiled.h"
25
#include <App/Application.h>
26
#include <Base/Console.h>
27
#include <Base/Interpreter.h>
32
#include "FeatureMeshCurvature.h"
33
#include "FeatureMeshDefects.h"
34
#include "FeatureMeshExport.h"
35
#include "FeatureMeshImport.h"
36
#include "FeatureMeshSegmentByMesh.h"
37
#include "FeatureMeshSetOperations.h"
38
#include "FeatureMeshSolid.h"
39
#include "FeatureMeshTransform.h"
40
#include "FeatureMeshTransformDemolding.h"
42
#include "MeshFeaturePy.h"
43
#include "MeshPointPy.h"
49
extern PyObject* initModule();
55
PyObject* meshModule = Mesh::initModule();
56
Base::Console().Log("Loading Mesh module... done\n");
58
// NOTE: To finish the initialization of our own type objects we must
59
// call PyType_Ready, otherwise we run into a segmentation fault, later on.
60
// This function is responsible for adding inherited slots from a type's base class.
61
ParameterGrp::handle handle = App::GetApplication().GetParameterGroupByPath(
62
"User parameter:BaseApp/Preferences/Mod/Mesh");
63
ParameterGrp::handle asy = handle->GetGroup("Asymptote");
64
MeshCore::MeshOutput::SetAsymptoteSize(asy->GetASCII("Width", "500"), asy->GetASCII("Height"));
68
Base::Interpreter().addType(&Mesh::MeshPointPy ::Type,meshModule,"MeshPoint");
69
Base::Interpreter().addType(&Mesh::EdgePy ::Type,meshModule,"Edge");
70
Base::Interpreter().addType(&Mesh::FacetPy ::Type,meshModule,"Facet");
71
Base::Interpreter().addType(&Mesh::MeshPy ::Type,meshModule,"Mesh");
72
Base::Interpreter().addType(&Mesh::MeshFeaturePy::Type,meshModule,"Feature");
74
Mesh::Extension3MFFactory::addProducer(new Mesh::GuiExtension3MFProducer);
77
Mesh::PropertyNormalList ::init();
78
Mesh::PropertyCurvatureList ::init();
79
Mesh::PropertyMaterial ::init();
80
Mesh::PropertyMeshKernel ::init();
82
Mesh::MeshObject ::init();
83
Mesh::MeshSegment ::init();
85
Mesh::Feature ::init();
86
Mesh::FeatureCustom ::init();
87
Mesh::FeaturePython ::init();
88
Mesh::Import ::init();
89
Mesh::Export ::init();
90
Mesh::Transform ::init();
91
Mesh::TransformDemolding ::init();
92
Mesh::Curvature ::init();
93
Mesh::SegmentByMesh ::init();
94
Mesh::SetOperations ::init();
95
Mesh::FixDefects ::init();
96
Mesh::HarmonizeNormals ::init();
97
Mesh::FlipNormals ::init();
98
Mesh::FixNonManifolds ::init();
99
Mesh::FixDuplicatedFaces ::init();
100
Mesh::FixDuplicatedPoints ::init();
101
Mesh::FixDegenerations ::init();
102
Mesh::FixDeformations ::init();
103
Mesh::FixIndices ::init();
104
Mesh::FillHoles ::init();
105
Mesh::RemoveComponents ::init();
107
Mesh::Sphere ::init();
108
Mesh::Ellipsoid ::init();
109
Mesh::Cylinder ::init();
111
Mesh::Torus ::init();
115
PyMOD_Return(meshModule);