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 static Mesh^ FromTriangles( VertCoords^ points, MR::DotNet::Triangulation^ triangles );
62 static Mesh^ FromTrianglesDuplicatingNonManifoldVertices( VertCoords^ points, MR::DotNet::Triangulation^ triangles );
63
65 static Mesh^ FromAnySupportedFormat( System::String^ path );
67 static void ToAnySupportedFormat( Mesh^ mesh, System::String^ path );
68
69 static bool operator==( Mesh^ a, Mesh^ b );
70 static bool operator!=( Mesh^ a, Mesh^ b );
71
73 static Mesh^ MakeCube( Vector3f^ size, Vector3f^ base );
75 static Mesh^ MakeSphere( float radius, int vertexCount );
77 static Mesh^ MakeTorus( float primaryRadius, float secondaryRadius, int primaryResolution, int secondaryResolution );
78
79 static Mesh^ MakeCylinder( float radius, float length );
80 static Mesh^ MakeCylinder( float radius, float startAngle, float arcSize, float length );
81 static Mesh^ MakeCylinder( float radius, float startAngle, float arcSize, float length, int resolution );
82 static Mesh^ MakeCylinder( float radius0, float radius1, float startAngle, float arcSize, float length, int resolution );
83
85 static MeshProjectionResult FindProjection( Vector3f^ point, MeshPart meshPart, float maxDistanceSquared );
86 static MeshProjectionResult FindProjection( Vector3f^ point, MeshPart meshPart, float maxDistanceSquared, AffineXf3f^ xf );
87 static MeshProjectionResult FindProjection( Vector3f^ point, MeshPart meshPart, float maxDistanceSquared, AffineXf3f^ xf, float minDistanceSquared );
88
89private:
90 MR::Mesh* mesh_;
91
92 VertCoords^ points_;
93
94 VertBitSet^ validPoints_;
95 FaceBitSet^ validFaces_;
96 MR::DotNet::Triangulation^ triangulation_;
97 EdgePath^ holeRepresentiveEdges_;
98 Box3f^ boundingBox_;
99
100internal:
101 MR::Mesh* getMesh() { return mesh_; }
102 void clearManagedResources();
103};
104
105
106
#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
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
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
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 Triangulation.dox.py:1
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