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.
|
|
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.
|
|
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.
- Parameters
-
includeEdges | contain all edges 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.
- Parameters
-
keyVertices | contain all vertices 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 |