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

connectivity(display) Filter connectivity(display)

NAME

connectivity - extract surface data that shares common vertices.

DESCRIPTION

Connectivity takes as input a display_data object (or filter) and on output creates new data based on various types of surface connectivity. A surface is connected when lines, polygons, and/or triangle strips share one or more points. Connectivity can be used to extract one or more surfaces, and/or color surfaces based on surface number.

Surfaces can be extracted in four different ways: 1) color surfaces, 2) largest surface, 3) seeded surfaces, and 4) specified surfaces. Coloring surfaces means extracting surfaces and creating scalar data corresponding to surface number. Surface extraction based on largest surface means extracting the single surface that contains the largest number of lines, polygons, and/or triangle strips. Surface extraction based on seeded surfaces means extracting a surface whose lines, polygons, and/or triangle strips are connected to a list of specified points. Specified surface extraction means extracting a surface of a specified surface number.

As a side note: to create a consistently ordered mesh, connectivity 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.

Another note: extracting surfaces using the color surfaces method forces the creation of scalars corresponding to surface number. The coloring instance variable can be used in the other extraction methods (largest surface, seeded surfaces, specified surfaces) to color the extracted surface(s).

SUPERCLASS

adjacency_filter

INSTANCE VARIABLES

coloring boolean to specify whether scalar values are generated according to surface number. When coloring is off, input scalars are simply passed through.

recursion_depth parameter to control the depth of the recursive

polygon connectivity process. Make as large as possible.

MESSAGES

coloring_on!/off! turn on/off surface coloring

coloring? get the value of the splitting instance variable.

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

color_surfaces! extract all surfaces but color them according to surface number. This is the default behavior.

number_surfaces?/no_surfaces? return the number of surfaces in the input data.

extract_largest_surface! set the filter to extract the largest connected surface from the input data.

extract_seeded_surface! set the filter to extract a seeded surface from the input data.

seed_points= (p1,p2,...) set the list of seed points (based on id) to use when extracting seeded surface.

seed_points+ (p1,p2,...) add to the list of seed points (based on id) to use when extracting seeded surface.

seed_points? get the list of seed points.

extract_specified_surfaces! set the filter to extract surfaces specified in the surfaces list.

surfaces= (s1,s2,...) set the list of surface (based on id) to use when extracting specified surface.

surfaces+ (s1,s2,...) add to the list of surfaces (based on id) to use when extracting specified surfaces.

surfaces? get the list of specified surfaces.

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 a display data and largest surface from it. */ display_data new: dd points=( 0,0,0, 1,0,0, 2,0,0, 0,1,0, 1,1,0, 2,1,0, 3,1,0, 0,2,0, 1,2,0, 2,2,0, 3,2,0, 0,3,0, 1,3,0, ) lines=( 2,3,6, 2,4,8, ) polygons=( 4,1,2,5,4, 4,6,7,11,10, 4,8,9,13,12, ) ; connectivity new: conn data_in= dd color_surfaces! debugon! ; display_all new: da data_in= conn range=(1,[conn number_surfaces?]) ; actor new: a modeller= da ; camera new: acamera range= [da bounds?] position= (0,0,1)

default! on! ; renderer new: aren actors=[actor instances?] cameras=[camera instances?] render! ;

conn extract_largest_surface! ; aren render!;

conn extract_seeded_surfaces! seed_points=(3) ; aren render!;

conn extract_specified_surfaces! surfaces=(1,2) ; aren render!;

SEE ALSO

adjacency_filter, triangle_strip_filter, decimate, display_filter, display_data


Please send comments and suggestions to
consult@rpi.edu