Bsoft 2.1.4
Bernard's software package
model_poly_spiral.h File Reference

Functions to generate polyhedra using the spiral algorithm. More...

#include "rwmodel.h"

Functions

Bmodelmodel_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...
 
Bmodelmodel_poly_gen_sequence (Bstring &seq, int valence, int enantiomorph, int requirements, int nm)
 Generates a polyhedron using a given sequence. More...
 
Bmodelmodel_poly_gen_sequence (Bstring &seq, int valence, int enantiomorph, int requirements, int nm, vector< double > &table)
 Generates a polyhedron using a given sequence. More...
 
Bmodelmodel_poly_gen_permutations (int vertices, int valence, int enantiomorph)
 All polyhedra are generated for a given number of vertices. More...
 
Bmodelmodel_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...
 
Bmodelmodel_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...
 
Bmodelmodel_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...
 
Bmodelmodel_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...
 
Bmodelmodel_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...
 
Bmodelmodel_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...
 
Bmodelmodel_poly_gen_move_pentagons (Bstring &seq, int valence, int enantiomorph, int requirements)
 Generates many polyhedrons using a given sequence and moving pentagons around. More...
 

Detailed Description

Functions to generate polyhedra using the spiral algorithm.

Author
Bernard Heymann
Date
Created: 20071127
Modified: 20210124

Function Documentation

◆ model_poly_gen_3part()

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.

Parameters
stiptip sequence (permuted).
sbodybody sequence (all hexagons).
sbasebase/end sequence (permuted).
valencevertex valence.
enantiomorphflag to generate enantiomorphs.
requirementspolyhedron requirements.
Returns
Bmodel* new model, NULL if generation failed.
A recursive algorithm is used to generate several models by shifting the
positions of pentagons in a sequence.

◆ model_poly_gen_coffin()

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
ttopnumber of polygons between pentagons in the tip.
tbodynumber of body rings.
tbasenumber of polygons between pentagons in the base
valencevertex valence.
enantiomorphflag to generate enantiomorphs.
requirementspolyhedron requirements.
Returns
Bmodel* new model, NULL if generation failed.

◆ model_poly_gen_coffin_jiggle()

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
ttopnumber of polygons between pentagons in the tip.
tbodynumber of body rings.
tbasenumber of polygons between pentagons in the base
valencevertex valence.
enantiomorphflag to generate enantiomorphs.
requirementspolyhedron requirements.
Returns
Bmodel* new model, NULL if generation failed.

◆ model_poly_gen_coffin_loose()

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
ttopnumber of polygons between pentagons in the tip.
tbodynumber of body rings.
tbasenumber of polygons between pentagons in the base
valencevertex valence.
enantiomorphflag to generate enantiomorphs.
requirementspolyhedron requirements.
Returns
Bmodel* new model, NULL if generation failed.

◆ model_poly_gen_cone()

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
tipnumber of vertices in the tip.
bodynumber of vertices in the body.
basenumber of vertices in the base.
valencevertex valence.
enantiomorphflag to generate enantiomorphs.
requirementspolyhedron requirements.
Returns
Bmodel* new model, NULL if generation failed.

◆ model_poly_gen_lozenge()

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
ttopnumber of polygons between pentagons in the tip.
tbodynumber of body rings.
valencevertex valence.
enantiomorphflag to generate enantiomorphs.
requirementspolyhedron requirements.
Returns
Bmodel* new model, NULL if generation failed.

◆ model_poly_gen_move_pentagons()

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.

Parameters
&seqpolygon sequence.
valencevertex valence.
enantiomorphflag to generate enantiomorphs.
requirementspolyhedron requirements.
Returns
Bmodel* new model, NULL if generation failed.
A recursive algorithm is used to generate several models by shifting the
positions of pentagons in a sequence.

◆ model_poly_gen_permutations()

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

All polyhedra are generated for a given number of vertices.

Parameters
verticesnumber of vertices.
valencevertex valence.
enantiomorphflag to generate enantiomorphs.
Returns
Bmodel* new model, NULL if generation failed.

◆ model_poly_gen_sequence() [1/2]

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

Generates a polyhedron using a given sequence.

Parameters
&seqpolygon sequence.
valencevertex valence.
enantiomorphflag to generate enantiomorphs.
requirementspolyhedron requirements.
nmcurrent number of models (before creating this one).
Returns
Bmodel* new model, NULL if generation failed.
A single model is generated based on the sequence.

◆ model_poly_gen_sequence() [2/2]

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.

Parameters
&seqpolygon sequence.
valencevertex valence.
enantiomorphflag to generate enantiomorphs.
requirementspolyhedron requirements.
nmcurrent number of models (before creating this one).
&tabletable for sets of eigenvalues.
Returns
Bmodel* new model, NULL if generation failed.
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.

◆ model_poly_spiral()

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

Generates a polyhedron using the spiral algorithm.

Parameters
&seqpolygon sequence.
valencevertex valence.
requirementspolyhedron requirements.
Returns
Bmodel* new model, NULL if generation failed.
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.

◆ model_polyhedron_check()

int model_polyhedron_check ( Bmodel model,
int  valence 
)

Checks a polyhedron for accuracy and completeness.

Parameters
*modelmodel structure.
valencevertex valence.
Returns
int number of failed conditions.
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