Fine control of feature edge selection with mesh face and edge marks.

New "face marks" and "edge marks" have been introduced in mesh data
blocks.  In the edit mode of a mesh object, face marks can be put
to selected faces by choosing Mesh >> Faces >> Mark Freestyle Face
from the menu of a 3D View window or Ctrl-F >> Mark Freestyle Face
from the context menu.  Similarly, edge marks can be put to selected
edges by Mesh >> Edges >> Mark Freestyle Edge or Ctrl-E >> Mark
Freestyle Edge.  These marks should work fine with the Subdivision
surface modifier.

Moreover, two new conditions for feature edge selection have been
added to the Parameter Editor mode as described below:

1. The Selection by Edge Types option has now the new Edge Mark type,
which can be used to (de)select feature edges having edge marks.
This option can be used to add to (or remove from) the view map
arbitrary edges of mesh objects.

2. Selection by Face Marks option has been newly introduced, in which
face marks are used for feature edge selection in two ways.  One
option is called "One Face" which is to (de)select feature edges if
one of faces on the left and right of each feature edge has a face
mark.  The other option is "Both Faces" to (de)select feature edges
if both faces on the left and right have a face mark.
This commit is contained in:
Tamito Kajiyama
2011-10-06 02:04:43 +00:00
parent cb4f662927
commit f84e8e7640
45 changed files with 724 additions and 51 deletions

View File

@@ -752,6 +752,32 @@ class LengthThresholdUP1D(UnaryPredicate1D):
return False
return True
class FaceMarkBothUP1D(UnaryPredicate1D):
def __call__(self, inter): # ViewEdge
fe = inter.fedgeA()
while fe is not None:
if fe.isSmooth():
if fe.faceMark():
return True
else:
if fe.aFaceMark() and fe.bFaceMark():
return True
fe = fe.nextEdge()
return False
class FaceMarkOneUP1D(UnaryPredicate1D):
def __call__(self, inter): # ViewEdge
fe = inter.fedgeA()
while fe is not None:
if fe.isSmooth():
if fe.faceMark():
return True
else:
if fe.aFaceMark() or fe.bFaceMark():
return True
fe = fe.nextEdge()
return False
# predicates for splitting
class MaterialBoundaryUP0D(UnaryPredicate0D):
@@ -825,6 +851,8 @@ def process(layer_name, lineset_name):
flags |= Nature.SUGGESTIVE_CONTOUR
if lineset.select_material_boundary:
flags |= Nature.MATERIAL_BOUNDARY
if lineset.select_edge_mark:
flags |= Nature.EDGE_MARK
if flags != Nature.NO_FEATURE:
edge_type_criteria.append(pyNatureUP1D(flags))
else:
@@ -842,6 +870,8 @@ def process(layer_name, lineset_name):
edge_type_criteria.append(pyNatureUP1D(Nature.SUGGESTIVE_CONTOUR))
if lineset.select_material_boundary:
edge_type_criteria.append(pyNatureUP1D(Nature.MATERIAL_BOUNDARY))
if lineset.select_edge_mark:
edge_type_criteria.append(pyNatureUP1D(Nature.EDGE_MARK))
if lineset.select_contour:
edge_type_criteria.append(ContourUP1D())
if lineset.select_external_contour:
@@ -854,6 +884,15 @@ def process(layer_name, lineset_name):
if lineset.edge_type_negation == "EXCLUSIVE":
upred = NotUP1D(upred)
selection_criteria.append(upred)
# prepare selection criteria by face marks
if lineset.select_by_face_marks:
if lineset.face_mark_condition == "BOTH":
upred = FaceMarkBothUP1D()
else:
upred = FaceMarkOneUP1D()
if lineset.face_mark_negation == "EXCLUSIVE":
upred = NotUP1D(upred)
selection_criteria.append(upred)
# prepare selection criteria by group of objects
if lineset.select_by_group:
if lineset.group is not None and len(lineset.group.objects) > 0: