FreeCAD C++
|
#include <Mod/Mesh/App/Mesh.h>
The MeshObject class provides an interface for the underlying MeshKernel class and most of its algorithm on it.
Public Member Functions | |
void | swap (MeshCore::MeshKernel &Kernel) |
Subelement management | |
virtual std::vector< const char * > | getElementTypes (void) const |
virtual unsigned long | countSubElements (const char *Type) const |
virtual Data::Segment * | getSubElement (const char *Type, unsigned long) const |
get the subelement by type and number | |
virtual void | getFacesFromSubelement (const Data::Segment *, std::vector< Base::Vector3d > &Points, std::vector< Base::Vector3d > &PointNormals, std::vector< Facet > &faces) const |
Querying | |
std::string | representation () const |
std::string | topologyInfo () const |
unsigned long | countPoints () const |
unsigned long | countFacets () const |
unsigned long | countEdges () const |
unsigned long | countSegments () const |
bool | isSolid () const |
MeshPoint | getPoint (unsigned long) const |
Mesh::Facet | getFacet (unsigned long) const |
double | getSurface () const |
double | getVolume () const |
virtual void | getPoints (std::vector< Base::Vector3d > &Points, std::vector< Base::Vector3d > &Normals, float Accuracy, uint16_t flags=0) const |
virtual void | getFaces (std::vector< Base::Vector3d > &Points, std::vector< Facet > &Topo, float Accuracy, uint16_t flags=0) const |
std::vector< unsigned long > | getPointsFromFacets (const std::vector< unsigned long > &facets) const |
I/O | |
unsigned int | getMemSize (void) const |
void | Save (Base::Writer &writer) const |
void | SaveDocFile (Base::Writer &writer) const |
void | Restore (Base::XMLReader &reader) |
void | RestoreDocFile (Base::Reader &reader) |
void | save (const char *file, MeshCore::MeshIO::Format f=MeshCore::MeshIO::Undefined, const MeshCore::Material *mat=0, const char *objectname=0) const |
void | save (std::ostream &, MeshCore::MeshIO::Format f, const MeshCore::Material *mat=0, const char *objectname=0) const |
bool | load (const char *file, MeshCore::Material *mat=0) |
bool | load (std::istream &, MeshCore::MeshIO::Format f, MeshCore::Material *mat=0) |
void | save (std::ostream &) const |
void | load (std::istream &) |
Manipulation | |
void | addFacet (const MeshCore::MeshGeomFacet &facet) |
void | addFacets (const std::vector< MeshCore::MeshGeomFacet > &facets) |
void | addFacets (const std::vector< MeshCore::MeshFacet > &facets, bool checkManifolds) |
void | addFacets (const std::vector< MeshCore::MeshFacet > &facets, const std::vector< Base::Vector3f > &points, bool checkManifolds) |
void | addFacets (const std::vector< Data::ComplexGeoData::Facet > &facets, const std::vector< Base::Vector3d > &points, bool checkManifolds) |
void | setFacets (const std::vector< MeshCore::MeshGeomFacet > &facets) |
void | setFacets (const std::vector< Data::ComplexGeoData::Facet > &facets, const std::vector< Base::Vector3d > &points) |
void | addMesh (const MeshObject &) |
void | addMesh (const MeshCore::MeshKernel &) |
void | deleteFacets (const std::vector< unsigned long > &removeIndices) |
void | deletePoints (const std::vector< unsigned long > &removeIndices) |
std::vector< std::vector< unsigned long > > | getComponents () const |
unsigned long | countComponents () const |
void | removeComponents (unsigned long) |
unsigned long | getPointDegree (const std::vector< unsigned long > &facets, std::vector< unsigned long > &point_degree) const |
void | fillupHoles (unsigned long, int, MeshCore::AbstractPolygonTriangulator &) |
void | offset (float fSize) |
void | offsetSpecial2 (float fSize) |
void | offsetSpecial (float fSize, float zmax, float zmin) |
void | clear (void) |
clears the Mesh | |
void | transformToEigenSystem () |
Base::Matrix4D | getEigenSystem (Base::Vector3d &v) const |
void | movePoint (unsigned long, const Base::Vector3d &v) |
void | setPoint (unsigned long, const Base::Vector3d &v) |
void | smooth (int iterations, float d_max) |
void | decimate (float fTolerance, float fReduction) |
Base::Vector3d | getPointNormal (unsigned long) const |
std::vector< Base::Vector3d > | getPointNormals () const |
void | crossSections (const std::vector< TPlane > &, std::vector< TPolylines > §ions, float fMinEps=1.0e-2f, bool bConnectPolygons=false) const |
void | cut (const Base::Polygon2d &polygon, const Base::ViewProjMethod &proj, CutType) |
void | trim (const Base::Polygon2d &polygon, const Base::ViewProjMethod &proj, CutType) |
Selection | |
void | deleteSelectedFacets () |
void | deleteSelectedPoints () |
void | addFacetsToSelection (const std::vector< unsigned long > &) const |
void | addPointsToSelection (const std::vector< unsigned long > &) const |
void | removeFacetsFromSelection (const std::vector< unsigned long > &) const |
void | removePointsFromSelection (const std::vector< unsigned long > &) const |
unsigned long | countSelectedFacets () const |
bool | hasSelectedFacets () const |
unsigned long | countSelectedPoints () const |
bool | hasSelectedPoints () const |
void | getFacetsFromSelection (std::vector< unsigned long > &) const |
void | getPointsFromSelection (std::vector< unsigned long > &) const |
void | clearFacetSelection () const |
void | clearPointSelection () const |
Boolean operations | |
MeshObject * | unite (const MeshObject &) const |
MeshObject * | intersect (const MeshObject &) const |
MeshObject * | subtract (const MeshObject &) const |
MeshObject * | inner (const MeshObject &) const |
MeshObject * | outer (const MeshObject &) const |
Topological operations | |
void | refine () |
void | removeNeedles (float) |
void | optimizeTopology (float) |
void | optimizeEdges () |
void | splitEdges () |
void | splitEdge (unsigned long, unsigned long, const Base::Vector3f &) |
void | splitFacet (unsigned long, const Base::Vector3f &, const Base::Vector3f &) |
void | swapEdge (unsigned long, unsigned long) |
void | collapseEdge (unsigned long, unsigned long) |
void | collapseFacet (unsigned long) |
void | collapseFacets (const std::vector< unsigned long > &) |
void | insertVertex (unsigned long, const Base::Vector3f &v) |
void | snapVertex (unsigned long, const Base::Vector3f &v) |
Mesh validation | |
unsigned long | countNonUniformOrientedFacets () const |
void | flipNormals () |
void | harmonizeNormals () |
void | validateIndices () |
void | validateCaps (float fMaxAngle, float fSplitFactor) |
void | validateDeformations (float fMaxAngle, float fEps) |
void | validateDegenerations (float fEps) |
void | removeDuplicatedPoints () |
void | removeDuplicatedFacets () |
bool | hasNonManifolds () const |
void | removeNonManifolds () |
void | removeNonManifoldPoints () |
bool | hasSelfIntersections () const |
void | removeSelfIntersections () |
void | removeSelfIntersections (const std::vector< unsigned long > &) |
void | removeFoldsOnSurface () |
void | removeFullBoundaryFacets () |
bool | hasInvalidPoints () const |
void | removeInvalidPoints () |
void | mergeFacets () |
Mesh segments | |
void | addSegment (const Segment &) |
void | addSegment (const std::vector< unsigned long > &) |
const Segment & | getSegment (unsigned long) const |
Segment & | getSegment (unsigned long) |
MeshObject * | meshFromSegment (const std::vector< unsigned long > &) const |
std::vector< Segment > | getSegmentsOfType (GeometryType, float dev, unsigned long minFacets) const |
![]() | |
ComplexGeoData (void) | |
Constructor. | |
virtual | ~ComplexGeoData () |
Destructor. | |
virtual Segment * | getSubElementByName (const char *Name) const |
get subelement by combined name | |
virtual void | getLinesFromSubelement (const Segment *, std::vector< Base::Vector3d > &Points, std::vector< Line > &lines) const |
void | applyTransform (const Base::Matrix4D &rclTrf) |
void | applyTranslation (const Base::Vector3d &) |
void | applyRotation (const Base::Rotation &) |
void | setPlacement (const Base::Placement &rclPlacement) |
Base::Placement | getPlacement () const |
virtual Base::Vector3d | getPointFromLineIntersection (const Base::Vector3f &base, const Base::Vector3f &dir) const |
virtual void | getLines (std::vector< Base::Vector3d > &Points, std::vector< Line > &lines, float Accuracy, uint16_t flags=0) const |
virtual bool | getCenterOfGravity (Base::Vector3d ¢er) const |
![]() | |
BaseClass () | |
Construction. | |
virtual | ~BaseClass () |
Destruction. | |
Static Public Member Functions | |
Primitives | |
static MeshObject * | createMeshFromList (Py::List &list) |
static MeshObject * | createSphere (float, int) |
static MeshObject * | createEllipsoid (float, float, int) |
static MeshObject * | createCylinder (float, float, int, float, int) |
static MeshObject * | createCone (float, float, float, int, float, int) |
static MeshObject * | createTorus (float, float, int) |
static MeshObject * | createCube (float, float, float) |
static MeshObject * | createCube (float, float, float, float) |
![]() | |
static std::string | encodeAttribute (const std::string &) |
Encodes an attribute upon saving. | |
Additional Inherited Members | |
![]() | |
Base::Vector3d | transformToOutside (const Base::Vector3f &vec) const |
from local to outside | |
Base::Vector3f | transformToInside (const Base::Vector3d &vec) const |
from local to inside | |
void Mesh::MeshObject::addMesh | ( | const MeshObject & | ) |
Combines two independent mesh objects.
void Mesh::MeshObject::addMesh | ( | const MeshCore::MeshKernel & | ) |
Combines two independent mesh objects.
|
virtual |
Sub type list List of different subelement types its NOT a list of the subelements itself
Implements Data::ComplexGeoData.
|
virtual |
Get faces from segment
Reimplemented from Data::ComplexGeoData.
unsigned long Mesh::MeshObject::getPointDegree | ( | const std::vector< unsigned long > & | facets, |
std::vector< unsigned long > & | point_degree | ||
) | const |
Checks for the given facet indices what will be the degree for each point when these facets are removed from the mesh kernel. The point degree information is stored in point_degree. The return value gives the number of points which will have a degree of zero.
|
virtual |
Get points from object with given accuracy
Reimplemented from Data::ComplexGeoData.
void Mesh::MeshObject::swap | ( | MeshCore::MeshKernel & | Kernel | ) |
Swaps the content of Kernel and the internal mesh kernel.