openalea.cellcomplex.gmap package

Submodules

openalea.cellcomplex.gmap.basicshapes module

openalea.cellcomplex.gmap.basicshapes.crossshape()[source]
openalea.cellcomplex.gmap.basicshapes.cube(xsize=5, ysize=5, zsize=5, center=[0, 0, 0], gmap=None)[source]
openalea.cellcomplex.gmap.basicshapes.holeshape(xsize=5, ysize=5, zsize=5, internalratio=0.5, gmap=None)[source]
openalea.cellcomplex.gmap.basicshapes.mobiusband(gmap=None)[source]
openalea.cellcomplex.gmap.basicshapes.pgl2gmap(geometry, gmap=None)[source]
openalea.cellcomplex.gmap.basicshapes.polygon(pointlist, gmap=None)[source]
openalea.cellcomplex.gmap.basicshapes.polyline(pointlist, gmap=None)[source]
openalea.cellcomplex.gmap.basicshapes.square(p1, p2, p3, p4, gmap=None)[source]
openalea.cellcomplex.gmap.basicshapes.tetrahedra(p1, p2, p3, p4, gmap)[source]
openalea.cellcomplex.gmap.basicshapes.topopolygon(nbpoints=3, gmap=None)[source]
openalea.cellcomplex.gmap.basicshapes.topopolyline(nbpoints=3, gmap=None)[source]
openalea.cellcomplex.gmap.basicshapes.toposquare(gmap=None)[source]
openalea.cellcomplex.gmap.basicshapes.toposquares(nb=5, gmap=None)[source]

openalea.cellcomplex.gmap.gmap module

class openalea.cellcomplex.gmap.gmap.DartProxy(gmap, dartid)[source]
alpha(degree)[source]
get_position()[source]
position
set_alpha(degree, dart)[source]
set_position(pos)[source]
class openalea.cellcomplex.gmap.gmap.GMap(degree=2)[source]
add(gmap)[source]

add topology of gmap into self. Return mapping of element of gmap into self.

add_dart(dartid=None)[source]

Create a new dart and return its id

add_darts(nb)[source]
add_sdart(dartid=None)[source]
alpha(*degrees_and_dart)[source]

Return the alpha_i(alpha_j(...(dart))

are_linked_darts(degree, dart1, dart2)[source]

Are the two darts linked with a relation alpha_degree

are_sewable_dart(dart1, dart2, degree=None)[source]

Check if two elements of degree ‘degree’ that start at dart1 and dart2 are sewable.

cell_center(dart, degree)[source]
chamfering(dart, degree, geomratio=0.3)[source]
check_validity()[source]

Test the validity of the structure. Check if there is pending dart for alpha_0 and alpha_1 (fixed point)

closure()[source]
compatible_min_free_degree(dart1, dart2)[source]
contract_cell(dart, degree)[source]
copy()[source]
dart(dartid)[source]
dartdisplay(add=False, textsize=None)[source]
darts()[source]

Return a list of id representing the darts of the structure

darts2pglscene(textsize=None)[source]
decrease_degree()[source]

Find the degree of the link between the two darts

detect_sewable_cell(dart1, dart2, degree)[source]
display(degree=None, add=False, randomcolor=True)[source]
dual()[source]
eulercharacteristic()[source]
expand(gmap, degree, mapping)[source]

Insert gmap into self. links between gmap and self are specified using ‘degree’ and ‘mapping’. ‘mapping’ gives a mapping between darts of gmap to darts of self.

get_embedding_dart(propnameordict, degree, dart)[source]

Return the dart that contains the embedding. If no dart still exists, return dart

get_embedding_dart_and_value(propnameordict, degree, dart)[source]

Return the dart that contains the embedding. If no dart still exists, return dart

get_position(dart)[source]

Return the coordinates with the vertex <alpha_1,...,alpha_i>(dart)

has_position(dart)[source]

Return the coordinates with the vertex <alpha_1,...,alpha_i>(dart)

has_property(propnameordict, degree, dart)[source]
iboundary(degree=None)[source]
ichamfering(dart, degree)[source]
iclosure(degree)[source]
increase_degree()[source]
insert(gmap, degree, mapping)[source]

Insert gmap into self. links between gmap and self are specified using ‘degree’ and ‘mapping’. ‘mapping’ gives a mapping between darts of gmap to darts of self.

intuitive_sew(dart1, dart2, degree)[source]
is_contractible(dart, degree)[source]
is_expansible(gmap, degree, mapping)[source]

Test if gmap can be inserted into self. links between gmap and self are specified using ‘degree’ and ‘mapping’. ‘mapping’ gives a mapping between darts of gmap to darts of self.

is_free(dart, degree)[source]

Test if dart is free for alpha_degree (if it is a fixed point)

is_insertable(gmap, degree, mapping)[source]

Test if gmap can be inserted into self. links between gmap and self are specified using ‘degree’ and ‘mapping’. ‘mapping’ gives a mapping between darts of gmap to darts of self.

is_orientable()[source]
is_removable_cell(dart, degree)[source]
is_valid()[source]

Test the validity of the structure. Check if there is pending dart for alpha_0 and alpha_1 (fixed point)

iterate_over_each_adjacent_cell(dart, degree)[source]
iterate_over_each_connex_components()[source]
iterate_over_each_dart_of_a_i_cell(dart, degree)[source]
iterate_over_each_i_cell(degree)[source]
iterate_over_each_incident_cell(dart, degree, incidentdegree)[source]

Link the two darts with a relation alpha_degree

min_free_degree(dart)[source]

Return mninimum degree for which a dart is free

nb_cells(degree)[source]
nb_connex_components()[source]
nb_darts()[source]
orbit(dart, list_of_alpha_value)[source]

Return the orbit of dart using a list of alpha relation. Example of use: gmap.orbit(0,[0,1]). In python, you can use the set structure to process only once all darts of the orbit.

orbit_alphas_for_elements(degree, maxdegree=None)[source]

Return the alpha value for the orbit giving an element of a given degree. For instance a vertex is given by the orbit <alpha_1, ...., alpha_gmap_degree>.

orbit_alphas_to_sew(degree)[source]

Return the alpha value for the orbit to sew: <0, degree -2, degree +2, ..., gmap.degree alphas_for_orbits_to_sew = { 2 : { 0 : [2], 1 : None , 2 : [0] },

3 : { 0 : [2,3], 1: [3], 2 : [0], 3 : [0,1] } }
orbit_iter(dart, list_of_alpha_value)[source]

Return the orbit of dart using a list of alpha relation. Example of use: gmap.orbit(0,[0,1]). In python, you can use the set structure to process only once all darts of the orbit.

orderedorbit(dart, list_of_alpha_value)[source]

Return the orbit of dart using a list of alpha relation. Example of use. gmap.orbit(0,[0,1]). Warning: No fixed point for the given alpha should be contained.

orderedorbit_iter(dart, list_of_alpha_value)[source]

Return the orbit of dart using a list of alpha relation. Example of use. gmap.orbit(0,[0,1]). Warning: No fixed point for the given alpha should be contained.

orientation()[source]

Link the two darts with a relation alpha_degree. Do not check if they are free

pointvalence(gmap, pointdart)
print_alphas(darts=None)[source]
property(propnameordict, degree, dart)[source]
remove_cell(dart, degree)[source]
remove_dart(dart)[source]
restriction(darts)[source]

return a copy of self restricted to the given set of darts

scale(scaling)[source]
set_alpha(degree, dart, oppdart)[source]
set_position(dart, position)[source]

Associate coordinates with the vertex <alpha_1,...,alpha_i>(dart)

set_property(propnameordict, degree, dart, value)[source]
sew_dart(dart1, dart2, degree=None, verbose=False)[source]

Sew two elements of degree ‘degree’ that start at dart1 and dart2. Determine first the orbits of dart to sew. Sew pairs of corresponding darts.

translate(translation)[source]

Unlink the two darts with the relation alpha_degree. If dart2 is not given, it will uses the dart linked with dart1. If it is given, it check if it is the good one.

unsew_dart(dart1, degree=None)[source]

Sew two elements of degree ‘degree’ that start at dart1 and dart2. Determine first the orbits of dart to sew. Check if they are compatible Sew pairs of corresponding darts.

openalea.cellcomplex.gmap.gmap.pointvalence(gmap, pointdart)[source]

openalea.cellcomplex.gmap.gmap_tp module

class openalea.cellcomplex.gmap.gmap_tp.GMap[source]
add_dart()[source]

Create a new dart and return its id. Set its alpha_i to itself (fixed points)

adjacent_cells(dart, degree)[source]

Return all the elements of degree degree that are adjacent to the element dart with respect to the alpha relation of degree degree. (Typically all points sharing an edge with a point) For this iterate over all the dart of the orbit of (dart, degree). For each dart d of this orbit, get its neighbor n (alpha degree) and remove its orbit (n, degree) from the set of darts to consider. See function incident_cells for inspiration.

alpha(degree, dart)[source]
cell_center(dart, degree)[source]

Generic function to compute the center of any elements of any degree

dartdisplay(add=False, textsize=None)[source]
darts()[source]

Return a list of id representing the darts of the structure

darts2pglscene(textsize=None)[source]
display(color=[205, 205, 205], add=False)[source]
elements(degree)[source]

Return one dart per element of degree. For this, consider all darts as initial set S. Take the first dart d, remove from the set all darts of the orbit starting from d and corresponding to element of degree degree. Take then next element from set S and do the same until S is empty. Return all darts d that where use

eulercharacteristic(gmap)[source]
get_embedding_dart(dart, degree, propertydict)[source]

Check if a dart of the orbit representing the element of degree degree has already been associated with a value in propertydict. If yes, return this dart, else return the dart passed as argument

get_position(dart)[source]

Retrieve the coordinates associated to the vertex &lt;alpha_1, alpha_2>(dart)

incident_cells(dart, degree, incidentdegree)[source]

Return all the element of degree incidentdegree that are incident to the element dart of degree degree. (Typically all edges around a point) For this iterate over all the dart of the orbit of (dart, degree). For each dart d of this orbit, get all the darts coresponding to the orbit of the element (d, incidentdegree) and remove them from the original set. See function elements for inspiration.

insert_edge(dart)[source]

Insert an edge at the point represented by dart. Return a dart corresponding to the dandling edge end.

is_free(degree, dart)[source]

Test if dart is free for alpha_degree (if it is a fixed point)

is_valid()[source]

Test the validity of the structure. Check if there is pending dart for alpha_0 and alpha_1 (fixed point)

Link the two darts with a relation alpha_degree

nb_elements(degree)[source]
orbit(dart, list_of_alpha_value)[source]

Return the orbit of dart using a list of alpha relation. Example of use: gmap.orbit(0,[0,1]). In python, you can use the set structure to process only once all darts of the orbit.

orderedorbit(dart, list_of_alpha_value)[source]

Return the orbit of dart using a list of alpha relation. Example of use. gmap.orbit(0,[0,1]). Warning: No fixed point for the given alpha should be contained.

pointvalence(pointdart)[source]

Return the valence of a vertex

print_alphas()[source]

print for each dart, the value of the different alpha applications.

set_position(dart, position)[source]

Associate coordinates with the vertex &lt;alpha_1,alpha_2>(dart)

sew_dart(degree, dart1, dart2, merge_attribute=True)[source]

Sew two elements of degree ‘degree’ that start at dart1 and dart2. Determine first the orbits of dart to sew. Check if they are compatible Sew pairs of corresponding darts.

splitedge(dart)[source]

Operator to split an edge. Return a dart corresponding to the new points

splitface(dart1, dart2)[source]

split face by inserting an edge between dart1 and dart2

openalea.cellcomplex.gmap.operations module

openalea.cellcomplex.gmap.operations.catmullclark_subdivision(gmap)[source]
openalea.cellcomplex.gmap.operations.doosabin_subdivision(gmap)[source]
openalea.cellcomplex.gmap.operations.quadrangulation(gmap)[source]
openalea.cellcomplex.gmap.operations.topo_add_edge(gmap, dart1, dart2)[source]
openalea.cellcomplex.gmap.operations.topo_quadrangulation(gmap)[source]
openalea.cellcomplex.gmap.operations.topo_split_edge(gmap, dart)[source]
openalea.cellcomplex.gmap.operations.topo_triangulation(gmap, degree, dart)[source]

Module contents