MeshLib
 
Loading...
Searching...
No Matches
MRDotNet/MRMesh.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshOrPoints.h"
3
5
6public value struct PointOnFace
7{
10};
11
18
27
29public ref class Mesh : public MeshOrPoints
30{
31internal:
32 Mesh( MR::Mesh* mesh );
33
34public:
37 virtual property VertCoordsReadOnly^ Points { VertCoordsReadOnly^ get(); }
40
41 virtual property Box3f^ BoundingBox { Box3f^ get(); }
50 array<VertId>^ GetLeftTriVerts( EdgeId e );
51
53 void Transform( AffineXf3f^ xf );
55 void Transform( AffineXf3f^ xf, VertBitSet^ region );
58
60 double Volume();
62 double Volume( FaceBitSet^ region );
63
65 static Mesh^ FromTriangles( VertCoords^ points, MR::DotNet::Triangulation^ triangles );
67 static Mesh^ FromTrianglesDuplicatingNonManifoldVertices( VertCoords^ points, MR::DotNet::Triangulation^ triangles );
68
70 static Mesh^ FromAnySupportedFormat( System::String^ path );
72 static void ToAnySupportedFormat( Mesh^ mesh, System::String^ path );
73
74 static bool operator==( Mesh^ a, Mesh^ b );
75 static bool operator!=( Mesh^ a, Mesh^ b );
76
78 static Mesh^ MakeCube( Vector3f^ size, Vector3f^ base );
80 static Mesh^ MakeSphere( float radius, int vertexCount );
82 static Mesh^ MakeTorus( float primaryRadius, float secondaryRadius, int primaryResolution, int secondaryResolution );
83
84 static Mesh^ MakeCylinder( float radius, float length );
85 static Mesh^ MakeCylinder( float radius, float startAngle, float arcSize, float length );
86 static Mesh^ MakeCylinder( float radius, float startAngle, float arcSize, float length, int resolution );
87 static Mesh^ MakeCylinder( float radius0, float radius1, float startAngle, float arcSize, float length, int resolution );
88
90 static MeshProjectionResult FindProjection( Vector3f^ point, MeshPart meshPart, float maxDistanceSquared );
91 static MeshProjectionResult FindProjection( Vector3f^ point, MeshPart meshPart, float maxDistanceSquared, AffineXf3f^ xf );
92 static MeshProjectionResult FindProjection( Vector3f^ point, MeshPart meshPart, float maxDistanceSquared, AffineXf3f^ xf, float minDistanceSquared );
93
94private:
95 MR::Mesh* mesh_;
96
97 VertCoords^ points_;
98
99 VertBitSet^ validPoints_;
100 FaceBitSet^ validFaces_;
101 MR::DotNet::Triangulation^ triangulation_;
102 EdgePath^ holeRepresentiveEdges_;
103 Box3f^ boundingBox_;
104
105internal:
106 MR::Mesh* getMesh() { return mesh_; }
107 void clearManagedResources();
108};
109
110
111
#define MR_DOTNET_NAMESPACE_BEGIN
Definition MRDotNet/MRMeshFwd.h:42
BitSetReadOnly VertBitSetReadOnly
Definition MRDotNet/MRMeshFwd.h:78
ReadOnlyCollection< Vector3f^> VertCoordsReadOnly
Definition MRDotNet/MRMeshFwd.h:96
List< ThreeVertIds > Triangulation
Definition MRDotNet/MRMeshFwd.h:69
ReadOnlyCollection< ThreeVertIds > TriangulationReadOnly
Definition MRDotNet/MRMeshFwd.h:70
ReadOnlyCollection< EdgeId > EdgePathReadOnly
Definition MRDotNet/MRMeshFwd.h:73
List< Vector3f^> VertCoords
Definition MRDotNet/MRMeshFwd.h:95
List< EdgeId > EdgePath
Definition MRDotNet/MRMeshFwd.h:72
#define MR_DOTNET_NAMESPACE_END
Definition MRDotNet/MRMeshFwd.h:43
int FaceId
Definition MRDotNet/MRMeshFwd.h:53
int EdgeId
Definition MRDotNet/MRMeshFwd.h:52
BitSetReadOnly FaceBitSetReadOnly
Definition MRDotNet/MRMeshFwd.h:79
length
Definition MRObjectDimensionsEnum.h:14
affine transformation: y = A*x + b, where A in VxV, and b in V
Definition MRDotNet/MRAffineXf.h:8
Definition MRDotNet/MRBitSet.h:39
Box given by its min- and max- corners.
Definition MRBox3.h:8
represents a mesh, including topology (connectivity) information and point coordinates,
Definition MRDotNet/MRMesh.h:30
static Mesh MakeCylinder(float radius, float startAngle, float arcSize, float length, int resolution)
static Mesh MakeCylinder(float radius0, float radius1, float startAngle, float arcSize, float length, int resolution)
static void ToAnySupportedFormat(Mesh^ mesh, System::String^ path)
saves mesh to file of any supported format
static Mesh MakeSphere(float radius, int vertexCount)
creates a sphere of given radius and vertex count
static Mesh MakeCube(Vector3f^ size, Vector3f^ base)
creates a parallelepiped with given sizes and base
static Mesh MakeCylinder(float radius, float startAngle, float arcSize, float length)
property FaceBitSetReadOnly ValidFaces
set of all valid faces
Definition MRDotNet/MRMesh.h:43
void Transform(AffineXf3f^ xf)
transforms all points
double Volume()
returns volume of whole mesh
property EdgePathReadOnly HoleRepresentiveEdges
edges with no valid left face for every boundary in the mesh
Definition MRDotNet/MRMesh.h:47
static bool operator!=(Mesh^ a, Mesh^ b)
void Transform(AffineXf3f^ xf, VertBitSet^ region)
transforms all points in the region
double Volume(FaceBitSet^ region)
returns volume of closed mesh region, if region is not closed DBL_MAX is returned
static Mesh FromTriangles(VertCoords^ points, MR::DotNet::Triangulation^ triangles)
creates mesh from point coordinates and triangulation
void PackOptimally()
packs tightly and rearranges vertices, triangles and edges to put close in space elements in close in...
static MeshProjectionResult FindProjection(Vector3f^ point, MeshPart meshPart, float maxDistanceSquared)
static Mesh MakeCylinder(float radius, float length)
virtual property VertBitSetReadOnly ValidPoints
set of all valid vertices
Definition MRDotNet/MRMesh.h:39
static MeshProjectionResult FindProjection(Vector3f^ point, MeshPart meshPart, float maxDistanceSquared, AffineXf3f^ xf, float minDistanceSquared)
static Mesh FromTrianglesDuplicatingNonManifoldVertices(VertCoords^ points, MR::DotNet::Triangulation^ triangles)
creates mesh from point coordinates and triangulation. If some vertices are not manifold,...
static bool operator==(Mesh^ a, Mesh^ b)
static MeshProjectionResult FindProjection(Vector3f^ point, MeshPart meshPart, float maxDistanceSquared, AffineXf3f^ xf)
virtual property Box3f BoundingBox
Definition MRDotNet/MRMesh.h:41
virtual property VertCoordsReadOnly Points
point coordinates
Definition MRDotNet/MRMesh.h:37
static MeshProjectionResult FindProjection(Vector3f^ point, MeshPart meshPart)
static Mesh FromAnySupportedFormat(System::String^ path)
loads mesh from file of any supported format
array< VertId > GetLeftTriVerts(EdgeId e)
static Mesh MakeTorus(float primaryRadius, float secondaryRadius, int primaryResolution, int secondaryResolution)
creates a torus with given parameters
represents a 3-dimentional float-typed vector
Definition MRDotNet/MRVector3.h:8
represents a point cloud or a mesh
Definition MRDotNet/MRMeshOrPoints.h:12
Definition MRMesh/MRMesh.h:23
Definition MRDotNet/MRMesh.h:20
FaceBitSet region
Definition MRDotNet/MRMesh.h:22
MeshPart(Mesh^ mesh, FaceBitSet^ region)
Mesh mesh
Definition MRDotNet/MRMesh.h:21
MeshPart(Mesh^ mesh)
Definition MRDotNet/MRMesh.h:13
float distanceSquared
Definition MRDotNet/MRMesh.h:16
PointOnFace pointOnFace
Definition MRDotNet/MRMesh.h:14
MeshTriPoint meshTriPoint
Definition MRDotNet/MRMesh.h:15
Definition MRDotNet/MRMeshTriPoint.h:25
Definition MRDotNet/MRMesh.h:7
Vector3f point
Definition MRDotNet/MRMesh.h:9
FaceId faceId
Definition MRDotNet/MRMesh.h:8