A set of functions for selecting segments on a mesh.
More...
|
MRMESH_API FaceBitSet | MR::fillContourLeftByGraphCut (const MeshTopology &topology, const EdgePath &contour, const EdgeMetric &metric) |
| Fills region located to the left from given contour, by minimizing the sum of metric over the boundary.
|
|
MRMESH_API FaceBitSet | MR::fillContourLeftByGraphCut (const MeshTopology &topology, const std::vector< EdgePath > &contours, const EdgeMetric &metric) |
| Fills region located to the left from given contours, by minimizing the sum of metric over the boundary.
|
|
MRMESH_API FaceBitSet | MR::segmentByGraphCut (const MeshTopology &topology, const FaceBitSet &source, const FaceBitSet &sink, const EdgeMetric &metric) |
| Finds segment that divide mesh on source and sink (source included, sink excluded), by minimizing the sum of metric over the boundary.
|
|
MRMESH_API Expected< EdgeLoop > | MR::surroundingContour (const Mesh &mesh, std::vector< EdgeId > includeEdges, const EdgeMetric &edgeMetric, const Vector3f &dir) |
| Find the best closed edge loop passing through given edges, which minimizes the sum of given edge metric. The algorithm assumes that input edges can be projected on the plane orthogonal to given direction, then the center point of all input edges is found, and each segment of the searched loop is within infinite pie sector with this center and the borders passing via two sorted input edges.
|
|
MRMESH_API Expected< EdgeLoop > | MR::surroundingContour (const Mesh &mesh, std::vector< VertId > keyVertices, const EdgeMetric &edgeMetric, const Vector3f &dir) |
| Find the best closed edge loop passing through given vertices, which minimizes the sum of given edge metric. The algorithm assumes that input vertices can be projected on the plane orthogonal to given direction, then the center point of all input vertices is found, and each segment of the searched loop is within infinite pie sector with this center and the borders passing via two sorted input vertices.
|
|
A set of functions for selecting segments on a mesh.
How To
- Make Contour(-s)
First step to get a mesh segment by two (/three) points, is getting the contour that bounds the segment.
To do this, you can use surroundingContour
- Get Segment
For getting segment of mesh by contour(-s) use fillContourLeftByGraphCut.
Before
|
After
|
◆ fillContourLeftByGraphCut() [1/2]
Fills region located to the left from given contour, by minimizing the sum of metric over the boundary.
◆ fillContourLeftByGraphCut() [2/2]
Fills region located to the left from given contours, by minimizing the sum of metric over the boundary.
◆ segmentByGraphCut()
Finds segment that divide mesh on source and sink (source included, sink excluded), by minimizing the sum of metric over the boundary.
◆ surroundingContour() [1/2]
Find the best closed edge loop passing through given edges, which minimizes the sum of given edge metric. The algorithm assumes that input edges can be projected on the plane orthogonal to given direction, then the center point of all input edges is found, and each segment of the searched loop is within infinite pie sector with this center and the borders passing via two sorted input edges.
- Parameters
-
includeEdges | contain all edges in arbitrary order that must be present in the returned loop, probably with reversed direction (should have at least 2 elements) |
edgeMetric | returned loop will minimize the sum of this metric |
dir | direction approximately orthogonal to the loop |
◆ surroundingContour() [2/2]
Find the best closed edge loop passing through given vertices, which minimizes the sum of given edge metric. The algorithm assumes that input vertices can be projected on the plane orthogonal to given direction, then the center point of all input vertices is found, and each segment of the searched loop is within infinite pie sector with this center and the borders passing via two sorted input vertices.
- Parameters
-
keyVertices | contain all vertices in arbitrary order that returned loop must pass (should have at least 2 elements) |
edgeMetric | returned loop will minimize the sum of this metric |
dir | direction approximately orthogonal to the loop |