<<<<<<<<<<<<<<<<<

feature_normals(display) Filter feature_normals(display)

NAME

feature_normals - generate polygon normals from inconsistent meshes and/or along feature edges (by splitting edges)

DESCRIPTION

Feature_normals takes as input a display_data object (or filter) and on output generates surface normals. Unlike normal filter, feature_normals can handle polygonal meshes whose polygons are not consistently ordered. Also, feature normals will generate normals along sharp edges by splitting the mesh (i.e., duplicating points), updating the polygon definitions, and computing separate normals for the duplicated points.

To create a consistently ordered mesh, feature_normals uses a recursive traversal between neighboring polygons to insure consistent polygon ordering. However, because of limits on recursion in many computer systems, the recursion depth is controlled using the recursion_depth instance variable. For maximum performance this variable should be as large as possible.

As a side note, back lighting in the renderer (backlit=0) can be turned off if all normals in an closed object are pointed "out" of the object. This eliminates one light and can improve graphics performance. Feature_normals can be used to achieve this by turning consistency on, and possibly setting flip_normals on.

Currently feature_normals will generate normals for only polygons.

SUPERCLASS

adjacency_filter

INSTANCE VARIABLES

splitting boolean to specify whether polygonal mesh is split along feature edges. By default splitting is on.

feature_angle angle in degrees corresponding to dihedral angle between adjacent polygons. The feature_angle defines whether an edge exists between polygons.

consistency boolean to control whether polygon reordering is performed. Polygon reordering may change the order of the points defining the polygon so that neighbor polygons are ordered consistently. By default

consistency checking is on.

flip_normals boolean to control whether normals are flipped. If flip_normals is on and consistency checking is on, then the normals are flipped by reversing the order of the polygons. If consistency checking is off and flip_normals is on, then the normals are flipped by multiplying by -1.

recursion_depth parameter to control the depth of the recursive polygon reordering process. Make as large as possible.

MESSAGES

splitting_on!/off! turn on/off the splitting of polygon mesh across feature edges.

splitting? get the value of the splitting instance variable.

splitting= value get the value of the splitting instance variable.

feature_angle= value set the value (in degrees) of the feature edge angle.

feature_angles? set the value (in degrees) of the feature edge angle.

consistency_on!/off! turn on/off polygon consistency checking.

consistency? get the value of the consistency instance variable.

consistency= value get the value of the consistency instance variable.

flip_normals_on!/off! turn on/off the flip_normals of polygon mesh across feature edges.

flip_normals? get the value of the flip_normals instance variable.

flip_normals= value get the value of the flip_normals instance

variable.

recursion_depth? get the value of the recursion_depth instance variable.

recursion_depth= value get the value of the recursion_depth instance variable.

EXAMPLE

/* * Create simple geometry with inconsistent ordering of polygons. * Run through feature_normals filter to compute "good" normals. */ display_data new: dd points=( 0,0,0, 1,0,0, 0,1,0, 1,1,0, 1,0,1, 1,1,1, 0,1,1, ) polygons=( 3,1,2,3, 3,3,4,2, 4,2,4,6,5, 3,3,4,7, 3,4,7,6,

) ; feature_normals new: fnormals data_in= dd debugon! flip_normals_off! splitting_on! consistency_on! ; display_all new: da data_in= fnormals ; actor new: a modeller= da ; camera new: acamera range= [da bounds?] position= (-1,-1,1) default! on! ; light new: alight

position= (.7,.3,.1) focal_point= [acamera focal_point?] on! ; renderer new: aren actors=[actor instances?] cameras=[camera instances?] lights=[light instances?] render! ; scene new: s duration= 400 renderers= aren tick_actions=` acamera azimuth: 5; ' ;

SEE ALSO

adjacency_filter, triangle_strip_filter, decimate, display_filter, display_data


Please send comments and suggestions to
consult@rpi.edu