/Users/bernard/b20/bsoft/src/model/model_poly_spiral.cpp(3)

NAME
/Users/bernard/b20/bsoft/src/model/model_poly_spiral.cpp - Functions to generate polyhedra using the spiral algorithm.

SYNOPSIS

#include 'rwmodel.h'
#include 'model_poly.h'
#include 'model_poly_spiral.h'
#include 'model_mechanics.h'
#include 'model_links.h'
#include 'model_transform.h'
#include 'model_util.h'
#include 'Matrix.h'
#include 'math_util.h'
#include 'linked_list.h'
#include 'Vector3.h'
#include 'utilities.h'
#include <sys/stat.h>
#include <fcntl.h>

  Functions
int polygon_add (int n, int valence, Bmodel *model)
int seq_count_adj_pentagons (Bstring &seq)
int model_vertex_types_in_first_polygons (Bmodel *model, int npoly)
int model_adjacent_pentagons (Bmodel *model)
int model_adjacent_pentagons_in_first_polygons (Bmodel *model, int npoly)
Bmodel * model_poly_spiral (Bstring &seq, int valence, int requirements)
Generates a polyhedron using the spiral algorithm.
int model_poly_spiral_regularize (Bmodel *model)
int model_polyhedron_check (Bmodel *model, int valence)
Checks a polyhedron for accuracy and completeness.
Bmodel * model_poly_gen_sequence (Bstring &seq, int valence, int enantiomorph, int requirements, int nm)
Generates a polyhedron using a given sequence.
Bmodel * model_poly_gen_sequence (Bstring &seq, int valence, int enantiomorph, int requirements, int nm, double *table)
Generates a polyhedron using a given sequence.
Bmodel * model_poly_gen_permutations (int vertices, int valence, int enantiomorph)
All polyhedra are generated for a given number of vertices.
Bmodel * model_poly_gen_cone (int tip, int body, int base, int valence, int enantiomorph, int requirements)
A cone tip with 5 pentagons and a base with 7 pentagons are use to generate polyhedra.
Bmodel * model_poly_gen_lozenge (int ttop, int tbody, int valence, int enantiomorph, int requirements)
Two icosahedral tips are set up and polyhedra generated by rotating the 2 tips.
Bmodel * model_poly_gen_coffin (int ttop, int tbody, int tbase, int valence, int enantiomorph, int requirements)
An icosahedral tip and a 6-fold base is set up and polyhedra generated by rotating the tip and base.
Bmodel * model_poly_gen_coffin_loose (int ttop, int tbody, int tbase, int valence, int enantiomorph, int requirements)
An icosahedral tip and a 6-fold base is set up and polyhedra generated by permuting the tip and base.
Bmodel * model_poly_gen_coffin_jiggle (int ttop, int tbody, int tbase, int valence, int enantiomorph, int requirements)
An icosahedral tip and a 6-fold base is set up and polyhedra generated by moving pentagons around.
Bmodel * model_poly_gen_3part (Bstring stip, Bstring sbody, Bstring sbase, int valence, int enantiomorph, int requirements)
Generates several polyhedra by permuting the first and last parts of a three-part sequence.
Bmodel * move_pentagons (int len, int p[12], int n, int valence, int enantiomorph, int requirements, int *nm)
Bmodel * model_poly_gen_move_pentagons (Bstring &seq, int valence, int enantiomorph, int requirements)
Generates many polyhedrons using a given sequence and moving pentagons around.

  Variables
int verbose

Detailed Description

Functions to generate polyhedra using the spiral algorithm.

Author:
    Bernard Heymann

Date:
    Created: 20071127

    Modified: 20110810

Definition in file model_poly_spiral.cpp.

Function Documentation

  int model_adjacent_pentagons (Bmodel * model)

Definition at line 228 of file model_poly_spiral.cpp.

  int model_adjacent_pentagons_in_first_polygons (Bmodel * model, int npoly)

Definition at line 243 of file model_poly_spiral.cpp.

  Bmodel* model_poly_gen_3part (Bstring stip, Bstring sbody, Bstring sbase, int valence, int enantiomorph, int requirements)

Generates several polyhedra by permuting the first and last parts of a three-part sequence.

A recursive algorithm is used to generate several models by shifting the
positions of pentagons in a sequence.

Parameters:
    stip tip sequence (permuted).
    sbody body sequence (all hexagons).
    sbase base/end sequence (permuted).
    valence vertex valence.
    enantiomorph flag to generate enantiomorphs.
    requirements polyhedron requirements.

Returns:
    Bmodel* new model, NULL if generation failed.

Definition at line 814 of file model_poly_spiral.cpp.

  Bmodel* model_poly_gen_coffin (int ttop, int tbody, int tbase, int valence, int enantiomorph, int requirements)

An icosahedral tip and a 6-fold base is set up and polyhedra generated by rotating the tip and base.

Parameters:
    ttop number of polygons between pentagons in the tip.
    tbody number of body rings.
    tbase number of polygons between pentagons in the base
    valence vertex valence.
    enantiomorph flag to generate enantiomorphs.
    requirements polyhedron requirements.

Returns:
    Bmodel* new model, NULL if generation failed.

Definition at line 665 of file model_poly_spiral.cpp.

  Bmodel* model_poly_gen_coffin_jiggle (int ttop, int tbody, int tbase, int valence, int enantiomorph, int requirements)

An icosahedral tip and a 6-fold base is set up and polyhedra generated by moving pentagons around.

Parameters:
    ttop number of polygons between pentagons in the tip.
    tbody number of body rings.
    tbase number of polygons between pentagons in the base
    valence vertex valence.
    enantiomorph flag to generate enantiomorphs.
    requirements polyhedron requirements.

Returns:
    Bmodel* new model, NULL if generation failed.

Definition at line 770 of file model_poly_spiral.cpp.

  Bmodel* model_poly_gen_coffin_loose (int ttop, int tbody, int tbase, int valence, int enantiomorph, int requirements)

An icosahedral tip and a 6-fold base is set up and polyhedra generated by permuting the tip and base.

Parameters:
    ttop number of polygons between pentagons in the tip.
    tbody number of body rings.
    tbase number of polygons between pentagons in the base
    valence vertex valence.
    enantiomorph flag to generate enantiomorphs.
    requirements polyhedron requirements.

Returns:
    Bmodel* new model, NULL if generation failed.

Definition at line 732 of file model_poly_spiral.cpp.

  Bmodel* model_poly_gen_cone (int tip, int body, int base, int valence, int enantiomorph, int requirements)

A cone tip with 5 pentagons and a base with 7 pentagons are use to generate polyhedra.

Parameters:
    tip number of vertices in the tip.
    body number of vertices in the body.
    base number of vertices in the base.
    valence vertex valence.
    enantiomorph flag to generate enantiomorphs.
    requirements polyhedron requirements.

Returns:
    Bmodel* new model, NULL if generation failed.

Definition at line 557 of file model_poly_spiral.cpp.

  Bmodel* model_poly_gen_lozenge (int ttop, int tbody, int valence, int enantiomorph, int requirements)

Two icosahedral tips are set up and polyhedra generated by rotating the 2 tips.

Parameters:
    ttop number of polygons between pentagons in the tip.
    tbody number of body rings.
    valence vertex valence.
    enantiomorph flag to generate enantiomorphs.
    requirements polyhedron requirements.

Returns:
    Bmodel* new model, NULL if generation failed.

Definition at line 598 of file model_poly_spiral.cpp.

  Bmodel* model_poly_gen_move_pentagons (Bstring & seq, int valence, int enantiomorph, int requirements)

Generates many polyhedrons using a given sequence and moving pentagons around.

A recursive algorithm is used to generate several models by shifting the
positions of pentagons in a sequence.

Parameters:
    &seq polygon sequence.
    valence vertex valence.
    enantiomorph flag to generate enantiomorphs.
    requirements polyhedron requirements.

Returns:
    Bmodel* new model, NULL if generation failed.

Definition at line 915 of file model_poly_spiral.cpp.

  Bmodel* model_poly_gen_permutations (int vertices, int valence, int enantiomorph)

All polyhedra are generated for a given number of vertices.

Parameters:
    vertices number of vertices.
    valence vertex valence.
    enantiomorph flag to generate enantiomorphs.

Returns:
    Bmodel* new model, NULL if generation failed.

Definition at line 494 of file model_poly_spiral.cpp.

  Bmodel* model_poly_gen_sequence (Bstring & seq, int valence, int enantiomorph, int requirements, int nm)

Generates a polyhedron using a given sequence.

A single model is generated based on the sequence.

Parameters:
    &seq polygon sequence.
    valence vertex valence.
    enantiomorph flag to generate enantiomorphs.
    requirements polyhedron requirements.
    nm current number of models (before creating this one).

Returns:
    Bmodel* new model, NULL if generation failed.

Definition at line 399 of file model_poly_spiral.cpp.

  Bmodel* model_poly_gen_sequence (Bstring & seq, int valence, int enantiomorph, int requirements, int nm, double * table)

Generates a polyhedron using a given sequence.

A single model is generated based on the sequence.
A table is used to keep track of sets of eigenvalues of previous models
to avoid generating redundant models.

Parameters:
    &seq polygon sequence.
    valence vertex valence.
    enantiomorph flag to generate enantiomorphs.
    requirements polyhedron requirements.
    nm current number of models (before creating this one).
    *table table for sets of eigenvalues.

Returns:
    Bmodel* new model, NULL if generation failed.

Definition at line 419 of file model_poly_spiral.cpp.

  Bmodel* model_poly_spiral (Bstring & seq, int valence, int requirements)

Generates a polyhedron using the spiral algorithm.

Polygons are added based on the given sequence.
The success of the algorithm is checked using the indicated requirements:
    0       only a polyhedron consistency check is done
    1       the exact number of vertices must be obtained
    2       only a polyhedron with isolated pentagons is accepted
The generation fails when an incorrect number of vertices are added
or some of the vertices have incorrect valency.

Parameters:
    &seq polygon sequence.
    valence vertex valence.
    requirements polyhedron requirements.

Returns:
    Bmodel* new model, NULL if generation failed.

Definition at line 274 of file model_poly_spiral.cpp.

  int model_poly_spiral_regularize (Bmodel * model)

Definition at line 317 of file model_poly_spiral.cpp.

  int model_polyhedron_check (Bmodel * model, int valence)

Checks a polyhedron for accuracy and completeness.

Every component must have the required number of links = valence.
Every component must have the required number of polygons = valence.
The polyhedron must adhere to Euler's formula:
    components + polygons - links = 2

Parameters:
    *model model structure.
    valence vertex valence.

Returns:
    int number of failed conditions.

Definition at line 336 of file model_poly_spiral.cpp.

  int model_vertex_types_in_first_polygons (Bmodel * model, int npoly)

Definition at line 206 of file model_poly_spiral.cpp.

  Bmodel* move_pentagons (int len, int p[12], int n, int valence, int enantiomorph, int requirements, int * nm)

Definition at line 864 of file model_poly_spiral.cpp.

  int polygon_add (int n, int valence, Bmodel * model)

Definition at line 39 of file model_poly_spiral.cpp.

  int seq_count_adj_pentagons (Bstring & seq)

Definition at line 196 of file model_poly_spiral.cpp.

Variable Documentation

  int verbose

Author

Generated automatically by Doxygen for Bsoft from the source code.