Bsoft  2.1.0
Bernard's software package
bmodedit.cpp
Go to the documentation of this file.
1 
9 #include "rwmodel.h"
10 #include "model_create.h"
11 #include "model_map.h"
12 #include "model_multifit.h"
13 #include "model_compare.h"
14 #include "model_color.h"
15 #include "model_select.h"
16 #include "model_links.h"
17 #include "model_util.h"
18 #include "utilities.h"
19 #include "options.h"
20 #include "timer.h"
21 
22 // Declaration of global variables
23 extern int verbose; // Level of output to the screen
24 
25 /* Usage assistance */
26 const char* use[] = {
27 " ",
28 "Usage: bmodedit [options] in.star",
29 "---------------------------------",
30 "Creates models.",
31 "The size of a new model is defined by the -distance option (except -gaussian).",
32 "If input files are specified, the new model is added or the new components replace old ones.",
33 " ",
34 "Actions for creation:",
35 "-create mod1 New model with the given ID.",
36 "-symmetry O-3 New model type based on symmetry (T, O and I).",
37 //"-type tetrahedron New model type: tetrahedron, cube, octahedron, dodecahedron,",
38 //" icosahedron, helix.",
39 "-shell 134.2 Generate a spherical shell with the given radius.",
40 "-fibonacci 244,50 Generate a fibonacci sphere: number of components and radius.",
41 "-icosahedron 238.5,3,1 Generate an icosahedral shell with the given radius and divisions,",
42 " and a flag to make it spherical.",
43 "-circle 527,243 Generate a circle with the given radius and z offset.",
44 "-ellipse 620.5,314.9,5.2 Generate an ellipse with the given x and y semi-axes lengths and z offset.",
45 "-ellipsoid 24.3,51.2,68 Generate an ellipsoid with the given x,y,z semi-axes.",
46 "-cylinder 88.3,155 Generate a cylinder with the given radius and length.",
47 "-spindle 88.3,9.5 Generate a spindle with the radius and packing separation.",
48 "-randomfill 56 Random model with a number of non-overlapping components (use with -componentradius).",
49 "-randomshell 87 Random model with a number of components on a shell.",
50 "-gaussian 44,30.7 Random model with a number of gaussian distributed components and standard deviation.",
51 "-peaks cc.map Generate a model from peaks in a map.",
52 " ",
53 "Actions:",
54 "-all Reset selection to all models and components before other selections.",
55 "-replace Replace existing components with newly created ones (default add).",
56 "-reduce submod.star Replace each set of linked components with one new component and write sub-model file.",
57 "-id model1 Set model identifier.",
58 "-settype VER Set all component types.",
59 "-changetype VER,KRN Change component type name.",
60 "-add -56,3.45,-123 Add a component (define model with -id and type with -settype).",
61 "-associate TRS,trs.pdb Associate a component type with a file name.",
62 "-linklength 56.3 Generate links with this maximum length.",
63 "-rdf 1.2 Calculate the radial distribution function with the given sampling (angstrom).",
64 "-consolidate 85.4 Consolidate models: components are considered the same if within the given distance.",
65 " ",
66 "Parameters:",
67 "-verbose 7 Verbosity of output.",
68 "-distance 54.7 Component distance from origin (default 100 angstrom).",
69 "-helix 31.6,43.2,35 Helix with given rise, rotation angle and number of components.",
70 "-direction 0.2,-0.5,0.3 Direction vector (for -cylinder and -spindle).",
71 "-componentradius 0.5 Component display radius (angstrom).",
72 "-linkradius 0.5 Link display radius (angstrom).",
73 "-color 0.1,0.5,0.2,1 Color new models.",
74 " ",
75 "Parameters for generating a model:",
76 "-points 152 Number of points.",
77 "-separation 2.5 Separation distance between points.",
78 " ",
79 "Input:",
80 "-parameters param.star Input parameter file.",
81 "-map file.map Input map file to associate with shell model.",
82 " ",
83 "Output:",
84 "-output newmod.star New model file.",
85 "-catenate catmap.pif New file name for catenated model maps.",
86 " ",
87 NULL
88 };
89 
90 int main(int argc, char **argv)
91 {
92  /* Initialize variables */
93  Bstring create(0); // ID of new model
94  Bstring symmetry_string; // Point group for new model type
95  double shell_radius(-1); // Radius of sphere
96  long fibonacci(0); // Number of components for Fibonacci sphere
97  int ico_divisions(0); // Number of divisions for icosahedral sphere
98  int sphere_flag(0); // Flag to make the icosahedral shell spherical
99  double circle_radius(0); // Circle radius
100  double circle_offset(0); // Offset of circle in z
101  Vector3<double> ellipse_semi_z; // Ellipse semi-axes and offset in z
102  Vector3<double> ellipsoid_semi; // Ellipsoid semi-axes
103  Vector3<double> dir; // Cylinder or spindle direction
104  double cyl_rad(0), cyl_len(0); // Cylinder radius and length
105  double spindle_rad(0), packing(0); // Spindle radius and packing separation
106  long ncomp(0); // Number of components for random models
107  int model_shell(0); // Flag to indicate random sphere model
108  double model_std(0); // Standard deviation for random gaussian model
109  int all(0); // Keep selection as read from file
110  int replace(0); // Default action is to add models
111  Bstring reduce; // Reduce linked components and write sub-model
112  Bstring model_id; // Model identifier
113  Bstring set_type; // Component type to set
114  Bstring change_type; // Component type to change and new type name
115  Bstring associate_type; // Component type
116  Bstring associate_file; // Component type file name
117  Bstring peakmap; // Map with peaks to generate a new model
118  int newcomp(0); // Flag to indicate new component
119  Vector3<double> newloc; // New component location
120  double linklength(0); // Link length for generating links
121  double rdf_interval(0); // Calculate RDF at this sampling (0=not)
122  double consolidate(0); // Cutoff to consider components the same
123  double model_radius(100); // Model radius
124  double helix_rise(0); // Helical rise
125  double helix_angle(0); // Helical rotation angle
126  long helix_comp(0); // Number of helical components
127  double compradius(0); // Component display radius
128  double linkradius(0); // Link display radius
129  RGBA<double> color(1,1,1,1); // Color specification
130  int set_color(0); // Flag to set color
131  long points(0); // Number of points on the sphere
132  double separation(0); // Distance between points
133  Bstring paramfile; // Input parameter file name
134  Bstring mapfile; // Input map file name
135  Bstring outfile; // Output parameter file name
136  Bstring catname; // Output catenated map file name
137  Bstring astr;
138 
139  int optind;
140  Boption* option = get_option_list(use, argc, argv, optind);
141  Boption* curropt;
142  for ( curropt = option; curropt; curropt = curropt->next ) {
143  if ( curropt->tag == "create" ) create = curropt->value;
144  if ( curropt->tag == "symmetry" )
145  symmetry_string = curropt->symmetry_string();
146  if ( curropt->tag == "shell" )
147  if ( ( shell_radius = curropt->value.real() ) < 1 )
148  cerr << "-shell: The radius must be specified!" << endl;
149  if ( curropt->tag == "fibonacci" )
150  if ( curropt->values(fibonacci, points) < 1 )
151  cerr << "-fibonacci: The number of components must be specified!" << endl;
152  if ( curropt->tag == "icosahedron" ) {
153  if ( curropt->values(shell_radius, ico_divisions, sphere_flag) < 1 )
154  cerr << "-icosahedron: The radius and divisions must be specified!" << endl;
155  else if ( ico_divisions < 1 ) ico_divisions = 1;
156  }
157  if ( curropt->tag == "circle" )
158  if ( curropt->values(circle_radius, circle_offset) < 1 )
159  cerr << "-circle: The circle radius must be specified!" << endl;
160  if ( curropt->tag == "ellipse" )
161  if ( curropt->values(ellipse_semi_z[0], ellipse_semi_z[1],
162  ellipse_semi_z[2]) < 2 )
163  cerr << "-ellipse: The major and minor semiaxes must be specified!" << endl;
164  if ( curropt->tag == "ellipsoid" )
165  if ( curropt->values(ellipsoid_semi[0], ellipsoid_semi[1],
166  ellipsoid_semi[2]) < 3 )
167  cerr << "-ellipsoid: The 3 semiaxes must be specified!" << endl;
168  if ( curropt->tag == "cylinder" )
169  if ( curropt->values(cyl_rad, cyl_len) < 2 )
170  cerr << "-cylinder: Both radius and length must be specified!" << endl;
171  if ( curropt->tag == "spindle" )
172  if ( curropt->values(spindle_rad, packing) < 2 )
173  cerr << "-spindle: Both radius and packing separation must be specified!" << endl;
174  if ( curropt->tag == "randomfill" )
175  if ( ( ncomp = curropt->value.integer() ) < 1 )
176  cerr << "-randomfill: The number of components must be specified!" << endl;
177  if ( curropt->tag == "randomshell" ) {
178  if ( ( ncomp = curropt->value.integer() ) < 1 )
179  cerr << "-randomshell: The number of components must be specified!" << endl;
180  else model_shell = 1;
181  }
182  if ( curropt->tag == "gaussian" )
183  if ( curropt->values(ncomp, model_std) < 2 )
184  cerr << "-gaussian: The number of components and standard deviation must be specified!" << endl;
185  if ( curropt->tag == "all" ) all = 1;
186  if ( curropt->tag == "replace" ) replace = 1;
187  if ( curropt->tag == "reduce" )
188  reduce = curropt->filename();
189  if ( curropt->tag == "id" ) {
190  model_id = curropt->value;
191  if ( model_id.length() < 1 )
192  cerr << "-id: An identifier must be specified!" << endl;
193  }
194  if ( curropt->tag == "settype" )
195  set_type = curropt->value;
196  if ( curropt->tag == "changetype" )
197  change_type = curropt->value;
198  if ( curropt->tag == "associate" ) {
199  astr = curropt->value;
200  associate_type = astr.pre(',');
201  associate_file = astr.post(',');
202  astr = 0;
203  }
204  if ( curropt->tag == "peaks" )
205  peakmap = curropt->filename();
206  if ( curropt->tag == "add" ) {
207  if ( curropt->values(newloc[0], newloc[1], newloc[2]) < 3 )
208  cerr << "-add: Three coordinates must be specified!" << endl;
209  else
210  newcomp = 1;
211  }
212  if ( curropt->tag == "linklength" )
213  if ( ( linklength = curropt->value.real() ) < 0.1 )
214  cerr << "-linklength: A link length must be specified!" << endl;
215  if ( curropt->tag == "rdf" )
216  if ( ( rdf_interval = curropt->value.real() ) < 0.001 )
217  cerr << "-rdf: A sampling interval must be specified!" << endl;
218  if ( curropt->tag == "consolidate" )
219  if ( ( consolidate = curropt->real() ) < 1 )
220  cerr << "-consolidate: A cutoff distance must be specified!" << endl;
221  if ( curropt->tag == "distance" )
222  if ( ( model_radius = curropt->value.real() ) < 1 )
223  cerr << "-distance: A value must be specified!" << endl;
224  if ( curropt->tag == "helix" ) {
225  if ( curropt->values(helix_rise, helix_angle, helix_comp) < 3 )
226  cerr << "-helix: The rise, angle and number must be specified!" << endl;
227  else
228  helix_angle *= M_PI/180.0;
229  }
230  if ( curropt->tag == "direction" )
231  dir = curropt->vector3();
232  if ( curropt->tag == "componentradius" )
233  if ( ( compradius = curropt->value.real() ) < 0.1 )
234  cerr << "-componentradius: The component display radius must be specified!" << endl;
235  if ( curropt->tag == "linkradius" )
236  if ( ( linkradius = curropt->value.real() ) < 0.1 )
237  cerr << "-linkradius: The link display radius must be specified!" << endl;
238  if ( curropt->tag == "color" ) {
239  if ( curropt->values(
240  color[0], color[1], color[2], color[3]) < 3 ) {
241  cerr << "-color: At least three color values must be specified!" << endl;
242  } else {
243  set_color = 1;
244  }
245  }
246  if ( curropt->tag == "points" )
247  if ( ( points = curropt->value.integer() ) < 1 )
248  cerr << "-points: The number of points must be specified!" << endl;
249  if ( curropt->tag == "separation" )
250  if ( ( separation = curropt->value.real() ) < 0.1 )
251  cerr << "-separation: The separation distance must be specified!" << endl;
252  if ( curropt->tag == "parameters" )
253  paramfile = curropt->filename();
254  if ( curropt->tag == "map" )
255  mapfile = curropt->filename();
256  if ( curropt->tag == "output" )
257  outfile = curropt->filename();
258  if ( curropt->tag == "catenate" )
259  catname = curropt->filename();
260  }
261  option_kill(option);
262 
263  double ti = timer_start();
264 
265  // Read all the parameter files
266  Bstring* file_list = NULL;
267  Bmodel* model = NULL;
268  Bmodel* mp = NULL;
269  Bmodel* newmod = NULL;
270  Bsymmetry* sym = NULL;
271 
272  while ( optind < argc ) string_add(&file_list, argv[optind++]);
273  if ( file_list ) {
274  model = read_model(file_list, paramfile);
275  string_kill(file_list);
276  }
277 
278  if ( create.length() ) newmod = model_init(create);
279 
280  if ( peakmap.length() ) {
281  Bimage* map = read_img(peakmap, 1, 0);
282  if ( !map ) bexit(-1);
283  newmod = model_from_peaks(map, 0, 0);
284  delete map;
285  }
286 
287  if ( symmetry_string.length() ) {
288  if ( symmetry_string.contains("H") ) {
289  newmod = model_helix(model_radius, helix_rise, helix_angle, helix_comp);
290  } else {
291  sym = init_point_group_symmetry(symmetry_string);
292  newmod = model_platonic(sym, model_radius);
293  kill_symmetry(sym);
294  }
295 // } else if ( model_type ) {
296 // if ( model_type < 6 ) newmod = model_platonic(model_type, model_radius);
297 // else newmod = model_helix(model_radius, helix_rise, helix_angle, helix_comp);
298  } else if ( ncomp > 0 ) {
299  if ( model_std > 0 ) {
300  newmod = model_random_gaussian(ncomp, model_std);
301  } else if ( model_shell ) {
302  if ( separation ) newmod = model_random_shell(ncomp, model_radius, separation);
303  else newmod = model_random_shell(ncomp, model_radius);
304  } else {
305  newmod = model_random(ncomp, compradius, model_radius);
306  }
307  } else if ( fibonacci > 0 ) {
308  newmod = model_create_fibonacci_sphere(fibonacci, points);
309  } else if ( shell_radius >= 0 ) {
310  if ( ico_divisions > 0 )
311  newmod = model_create_icosahedron(shell_radius, ico_divisions, sphere_flag);
312  else
313  newmod = model_create_shell(points, shell_radius, separation);
314  } else if ( circle_radius > 0) {
315  newmod = model_create_circle(circle_radius, circle_offset, separation);
316  } else if ( ellipse_semi_z[0] > 0 && ellipse_semi_z[1] > 0) {
317  newmod = model_create_ellipse(ellipse_semi_z, separation);
318  } else if ( ellipsoid_semi.volume() > 0) {
319  newmod = model_create_ellipsoid(ellipsoid_semi, separation);
320  } else if ( cyl_len > 0) {
321  newmod = model_create_cylinder(dir, cyl_rad, cyl_len, separation);
322  } else if ( spindle_rad > 0 && packing > 0) {
323  newmod = model_create_spindle(dir, spindle_rad, separation, packing);
324  }
325 
326  if ( model_id.length() ) newmod->id = model_id;
327  else model_id = "create";
328 
329  if ( set_type.length() ) model_set_type(newmod, set_type);
330 
331  if ( associate_file.length() )
332  model_associate(newmod, associate_type, associate_file);
333 
334  if ( linklength > 0 ) model_link_list_generate(newmod, linklength);
335 
336  if ( mapfile.length() ) newmod->fmap = mapfile;
337 
338  if ( replace && model ) {
339  for ( mp = model; mp; mp = mp->next )
340 // model_copy_components(mp, newmod);
341  model_replace_components(mp, newmod);
342  } else {
343  if ( model )
344  for ( mp = model; mp->next; mp = mp->next ) ; // Pointer to last model
345  if ( mp ) mp->next = newmod;
346  else model = newmod;
347  mp = newmod;
348  }
349 
351 
352  if ( newcomp ) model_add_component(model, model_id, set_type, newloc);
353 
354  if ( change_type.length() ) model_change_type(model, change_type);
355 
356  if ( reduce.length() ) model_reduce_linked(model, reduce, 1);
357 
358  if ( consolidate ) model_consolidate(model, consolidate);
359 
360 // if ( !model->poly ) model_poly_generate(model);
361 
362  if ( rdf_interval > 0 ) model_radial_distribution(model, rdf_interval);
363 
364  if ( compradius ) models_process(model, compradius, model_set_component_radius);
365 
366  if ( linkradius ) models_process(model, linkradius, model_set_link_radius);
367 
368  if ( set_color ) model_color_uniformly(model, color);
369 
370  if ( catname.length() ) model_catenate_maps(model, catname);
371 
373 
374  // Write an output parameter format file if a name is given
375  if ( outfile.length() && model ) {
376  write_model(outfile, model);
377  }
378 
379  model_kill(model);
380 
381  if ( verbose & VERB_TIME )
382  timer_report(ti);
383 
384  bexit(0);
385 }
386 
Boption
A class for a command line input option.
Definition: options.h:26
use
const char * use[]
Definition: bmodedit.cpp:26
verbose
int verbose
model_create_ellipsoid
Bmodel * model_create_ellipsoid(Vector3< double > axes, double distance)
Creates an ellipsoid with given semiaxes and component separation.
Definition: model_create.cpp:1011
model_from_peaks
Bmodel * model_from_peaks(Bimage *p, double threshold, int wrap)
Generates a model from peaks in a map.
Definition: model_multifit.cpp:209
string_kill
int string_kill(Bstring *list)
Kills a string linked list.
Definition: Bstring.cpp:768
replace
int replace(fstream *fin, char *rstring1, char *rstring2)
Definition: bfile.cpp:409
rwmodel.h
Header file for reading and writing atomic model files.
Bstring
Definition: Bstring.h:29
model_random_gaussian
Bmodel * model_random_gaussian(long ncomp, double std)
Generates components at random gaussian-distributed locations and with random views.
Definition: model_create.cpp:318
model_change_type
int model_change_type(Bmodel *model, Bstring &change_type)
Change a component type name.
Definition: rwmodel.cpp:548
Bstring::integer
long integer()
Definition: Bstring.cpp:547
Boption::next
Boption * next
Definition: options.h:28
Vector3< double >
bexit
int bexit(int value)
Exit function for cleanup and debugging.
Definition: utilities.cpp:280
model_map.h
Header file for model to map conversions.
Bmodel::next
Bmodel * next
Definition: rwmodel.h:120
get_option_list
Boption * get_option_list(const char *use[], int argc, char *argv[], int &optind)
Parses command line arguments based on a template.
Definition: options.cpp:40
Bstring::real
double real()
Definition: Bstring.cpp:553
options.h
Header file for option handlers.
model_create_circle
Bmodel * model_create_circle(double radius, double z, double distance)
Creates a circle with the given radius, height, and component separation.
Definition: model_create.cpp:897
model_radial_distribution
long model_radial_distribution(Bmodel *model, double interval)
Calculates the radial distribution function of a model.
Definition: model_util.cpp:605
Bstring::post
Bstring post(char c)
Definition: Bstring.cpp:402
model_create_spindle
Bmodel * model_create_spindle(Vector3< double > direction, double radius, double separation, double packing)
Creates a spindle packed inside a sphere.
Definition: model_create.cpp:1229
Bsymmetry
Definition: symmetry.h:38
model_compare.h
Functions to compare models and components.
main
int main(int argc, char **argv)
Definition: bmodedit.cpp:90
Bmodel::fmap
Bstring fmap
Definition: rwmodel.h:125
models_process
long models_process(Bmodel *model, long(modfunc)(Bmodel *))
Process a list of models using the specified function.
Definition: model_util.cpp:36
model_init
Bmodel * model_init(Bstring &id)
Initializes a model structure.
Definition: rwmodel.cpp:147
model_selection_stats
long model_selection_stats(Bmodel *model)
Calculates selection statistics.
Definition: model_select.cpp:870
Boption::tag
Bstring tag
Definition: options.h:29
Boption::values
long values(T1 &v1, T2 &v2)
Definition: options.h:115
read_img
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
Definition: rwimg.cpp:77
Boption::real
double real()
Definition: options.h:107
model_random_shell
Bmodel * model_random_shell(long ncomp, double radius)
Generates random components on a shell.
Definition: model_create.cpp:361
model_create.h
Library routines used for model creation.
Bstring::pre
Bstring pre(char c)
Definition: Bstring.cpp:389
Bmodel::id
Bstring id
Definition: rwmodel.h:121
Boption::value
Bstring value
Definition: options.h:30
model_color_uniformly
int model_color_uniformly(Bmodel *model, RGBA< float > color)
Colors model components uniformly.
Definition: model_color.cpp:29
model_kill
int model_kill(Bmodel *model)
Deallocates all memory in the list.
Definition: rwmodel.cpp:1127
model_catenate_maps
int model_catenate_maps(Bmodel *model, Bstring &filename)
Concatenates all model maps into one multi-image file.
Definition: model_map.cpp:158
Bimage
General image parameter class.
Definition: Bimage.h:177
model_select.h
Header file for reading and writing atomic model files.
timer.h
Utilities for timing functions.
model_create_ellipse
Bmodel * model_create_ellipse(Vector3< double > axes, double distance)
Creates an ellipse with given semiaxes and component separation.
Definition: model_create.cpp:947
model_reset_selection
long model_reset_selection(Bmodel *model)
Resets the selection to all components.
Definition: model_select.cpp:232
Boption::symmetry_string
Bstring symmetry_string()
Definition: options.h:233
model_multifit.h
Header file for searching for a template in a map and returning multiple hits in a model.
VERB_TIME
#define VERB_TIME
Definition: utilities.h:114
Bmodel
Definition: rwmodel.h:119
timer_start
double timer_start()
Starts timer and prints the time.
Definition: timer.cpp:61
M_PI
#define M_PI
Definition: utilities.h:63
utilities.h
Header file for general utilities.
write_model
int write_model(Bstring &filename, Bmodel *model)
Writes model parameters.
Definition: rwmodel.cpp:92
RGBA
Definition: Color.h:162
model_create_cylinder
Bmodel * model_create_cylinder(Vector3< double > direction, double radius, double length, double distance)
Creates a cylinder with the given radius, length, and component separation.
Definition: model_create.cpp:1101
Boption::vector3
Vector3< double > vector3()
Definition: options.h:148
Bstring::length
long length() const
Definition: Bstring.cpp:263
model_platonic
Bmodel * model_platonic(Bsymmetry *sym, double radius)
Generates a platonic polyhedron.
Definition: model_create.cpp:82
init_point_group_symmetry
Bsymmetry * init_point_group_symmetry(Bstring symmetry_string)
Sets up a symmetry structure from a string identifier.
Definition: symmetry.cpp:39
timer_report
double timer_report(double lasttime)
Reports the time elapsed since a given time.
Definition: timer.cpp:76
model
Bmodel * model
Definition: bshow.cpp:34
Vector3::volume
double volume()
Definition: Vector3.h:237
model_create_fibonacci_sphere
Bmodel * model_create_fibonacci_sphere(long number, double radius)
Creates a Fibonacci sphere point model.
Definition: model_create.cpp:569
kill_symmetry
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
Definition: symmetry.cpp:207
Boption::filename
Bstring filename()
Definition: options.h:85
option_kill
int option_kill(Boption *option)
Deallocates a linked list of option structures.
Definition: options.cpp:111
model_util.h
Library routines used for model processing.
read_model
Bmodel * read_model(Bstring &filename)
Definition: rwmodel.cpp:29
model_add_component
Bcomponent * model_add_component(Bmodel *model, Bstring &id, Bstring &type, Vector3< double > loc)
Adds a component to a model.
Definition: model_create.cpp:32
model_set_type
int model_set_type(Bmodel *model, Bstring &set_type)
Reset the component types.
Definition: rwmodel.cpp:519
Bstring::contains
bool contains(const Bstring &s)
Definition: Bstring.cpp:592
model_set_component_radius
long model_set_component_radius(Bmodel *model, double comprad)
Set the display radius for all components to a specific value.
Definition: rwmodel.cpp:1247
model_consolidate
long model_consolidate(Bmodel *model, double distance)
Consolidates close components within a model.
Definition: model_compare.cpp:264
model_associate
int model_associate(Bmodel *model, Bstring &associate_type, Bstring &associate_file)
Associates a model file with a component type.
Definition: rwmodel.cpp:1160
model_random
Bmodel * model_random(long ncomp, double comp_radius, double max_radius)
Generates components at random non-overlapping locations and with random views.
Definition: model_create.cpp:201
model_create_icosahedron
Bmodel * model_create_icosahedron(double radius, long divisions, double sphere_fraction)
Creates an icosahedron point model.
Definition: model_create.cpp:732
model_replace_components
long model_replace_components(Bmodel *model, Bmodel *modref)
Replaces all components in a model with reference components.
Definition: model_util.cpp:227
model_color.h
Functions to color models.
string_add
Bstring * string_add(Bstring **list, const char *string)
Adds a string to a linked list.
Definition: Bstring.cpp:713
model_create_shell
Bmodel * model_create_shell(long number, double radius, double distance)
Creates a sphere point model.
Definition: model_create.cpp:472
model_helix
Bmodel * model_helix(double radius, double helix_rise, double helix_angle, long ncomp)
Generates a helix model.
Definition: model_create.cpp:153