|
Bsoft 2.1.4
Bernard's software package
|
Functions to generate polyhedra using the spiral algorithm. More...
#include "rwmodel.h"Functions | |
| Bmodel * | model_poly_spiral (Bstring &seq, int valence, int requirements) |
| Generates a polyhedron using the spiral algorithm. More... | |
| int | model_polyhedron_check (Bmodel *model, int valence) |
| Checks a polyhedron for accuracy and completeness. More... | |
| Bmodel * | model_poly_gen_sequence (Bstring &seq, int valence, int enantiomorph, int requirements, int nm) |
| Generates a polyhedron using a given sequence. More... | |
| Bmodel * | model_poly_gen_sequence (Bstring &seq, int valence, int enantiomorph, int requirements, int nm, vector< double > &table) |
| Generates a polyhedron using a given sequence. More... | |
| Bmodel * | model_poly_gen_permutations (int vertices, int valence, int enantiomorph) |
| All polyhedra are generated for a given number of vertices. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
Functions to generate polyhedra using the spiral algorithm.
| 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.
| 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. |
A recursive algorithm is used to generate several models by shifting the positions of pentagons in a sequence.
| 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.
| 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. |
| 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.
| 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. |
| 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.
| 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. |
| 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.
| 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. |
| 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.
| 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. |
| 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.
| &seq | polygon sequence. |
| valence | vertex valence. |
| enantiomorph | flag to generate enantiomorphs. |
| requirements | polyhedron requirements. |
A recursive algorithm is used to generate several models by shifting the positions of pentagons in a sequence.
| Bmodel * model_poly_gen_permutations | ( | int | vertices, |
| int | valence, | ||
| int | enantiomorph | ||
| ) |
All polyhedra are generated for a given number of vertices.
| vertices | number of vertices. |
| valence | vertex valence. |
| enantiomorph | flag to generate enantiomorphs. |
| Bmodel * model_poly_gen_sequence | ( | Bstring & | seq, |
| int | valence, | ||
| int | enantiomorph, | ||
| int | requirements, | ||
| int | nm | ||
| ) |
Generates a polyhedron using a given sequence.
| &seq | polygon sequence. |
| valence | vertex valence. |
| enantiomorph | flag to generate enantiomorphs. |
| requirements | polyhedron requirements. |
| nm | current number of models (before creating this one). |
A single model is generated based on the sequence.
| Bmodel * model_poly_gen_sequence | ( | Bstring & | seq, |
| int | valence, | ||
| int | enantiomorph, | ||
| int | requirements, | ||
| int | nm, | ||
| vector< double > & | table | ||
| ) |
Generates a polyhedron using a given sequence.
| &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. |
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.
Generates a polyhedron using the spiral algorithm.
| &seq | polygon sequence. |
| valence | vertex valence. |
| requirements | polyhedron requirements. |
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.
| int model_polyhedron_check | ( | Bmodel * | model, |
| int | valence | ||
| ) |
Checks a polyhedron for accuracy and completeness.
| *model | model structure. |
| valence | vertex valence. |
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