Surface Feature Detection
Detecting feature edges of a surface mesh is done in mouette
in the FeatureEdgeDetector
class. This class encapsulates various strategies of detection and stores the result for a given mesh.
Usage
or
This fills the various container attributes that can be accessed in the FeatureEdgeDetector
class.
FeatureEdgeDetector(only_border=False, flag_corners=True, corner_order=4, compute_feature_graph=True, verbose=True)
Bases: Worker
Worker used to detect features on a surface mesh. Feature edges are of three types:
-
Marked edges from the input file (reading the "hard_edges" attribute on edges)
-
Boundary edges
-
Edges such that their dihedral angle is large (crease edges)
The FeatureEdgeDetector
object ican be given as a parameter in parametrization or frame field algorithms that need feature edge alignment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
only_border
|
bool
|
If set to True, will only consider border edges as features. Defaults to False. |
False
|
flag_corners
|
bool
|
If set to True, will also compute a goal angle defect (multiple of pi/2) of each detected vertices. Defaults to True. |
True
|
corner_order
|
int
|
For corner detection, considers corners of angle defect 2pi/corner_order. Defaults to 4 (corners of pi/2). |
4
|
compute_feature_graph
|
bool
|
whether to compute a Polyline object representing the feature graph. For debug and visualization purposes. Defaults to True. |
True
|
verbose
|
bool
|
Verbose mode. Defaults to True. |
True
|
Attributes:
Name | Type | Description |
---|---|---|
feature_vertices |
set
|
indices of the vertices that are adjacent to at least one feature edge |
feature_edges |
set
|
indices of feature edges |
feature_degree |
Attribute
|
number of feature edges each vertex is adjacent to |
local_feat_edges |
dict
|
features edges in the neighborhood of each vertex (in the order of |
corners |
Attribute
|
the order of each detected vertex corners |
feature_graph
property
the feature edges as a polyline object
_add_hard_edges_to_features(mesh, feature_attr)
The mesh may already define a set of "hard" edges, for instance if it was imported from a file where edges were specified. These edges should be registered as features, but we filter them if their curvature is too small.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
feature_attr
|
Attribute
|
the feature flag to fill in |
required |
Returns:
Name | Type | Description |
---|---|---|
Attribute |
Attribute
|
the modified feature flag |
_add_sharp_angles_to_features(mesh, feature_attr)
_compute_feature_graph(mesh)
Computes self._feature_mesh
clear()
Clears the data structures
detect(mesh)
Runs the detection on a provided mesh.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mesh
|
SurfaceMesh
|
the input mesh |
required |