| Bsoft 2.0.5 Bernard's software package

Functions
model_shell.h File Reference

Library routines used for shell model processing. More...

`#include "rwmodel.h"`

Go to the source code of this file.

## Functions
long | model_add_shell (Bmodel *model, double add_distance, Bstring &new_type)
| Adds a shell to a model using selected components. More...
int | model_adjust_shell_to_guide (Bmodel *model, Bmodel *gmod, double fraction, int curv_flag)
| Adjusts a shell model to the faces of a polyhedral guide model. More...
Bmodel * | model_components_to_shells (Bmodel *model, double distance, Bstring &nutype, int twod)
| Generates a new set of models by vonverting each component to a shell model. More...
double | model_sphericity (Bmodel *model)
| Calculates how close the model is to a spherical shape. More...
double | model_ellipsoidicity (Bmodel *model)
| Calculates how close the model is to an ellipsoid shape. More...
int | model_curvature (Bmodel *model)
| Calculates the curvature associated with each link. More...
double | model_inside_outside (Vector3< double > vec, Bmodel *model, int curv_flag, int fast)

## Detailed Description

Library routines used for shell model processing.

Author
  Bernard Heymann

Date
  Created: 20060908
  Modified: 20161013

Definition in file model_shell.h.

## Function Documentation

## ◆ model_add_shell()

long model_add_shell | ( | Bmodel * | model,
|  | double | add_distance,
|  | Bstring & | nutype
| ) |  |

Adds a shell to a model using selected components.

Parameters

  *model | model structure.
  add_distance | distance to shift new components.
  &nutype | new component type.

Returns
  long number of components in new shell.

      Each selected component is duplicated and shifted radially.
      Only the first model in the list is used.

Definition at line 32 of file model_shell.cpp.

## ◆ model_adjust_shell_to_guide()

int model_adjust_shell_to_guide | ( | Bmodel * | model,
|  | Bmodel * | gmod,
|  | double | fraction,
|  | int | curv_flag
| ) |  |

Adjusts a shell model to the faces of a polyhedral guide model.

Parameters

  *model | shell model.
  *gmod | guide polyhedron model.
  fraction | fraction to adjust.
  curv_flag | flag to indicate curved surface.

Returns
  int 0.

      For each component, it is determined whether it is located inside or
      outside the appropriate polyhedral face, and its coordinates adjust
      closer to the face by the indicated fraction.

Definition at line 85 of file model_shell.cpp.

## ◆ model_components_to_shells()

Bmodel* model_components_to_shells | ( | Bmodel * | model,
|  | double | distance,
|  | Bstring & | nutype,
|  | int | twod
| ) |  |

Generates a new set of models by vonverting each component to a shell model.

Parameters

  *model | model structure.
  distance | distance between components.
  &nutype | new component type.
  twod | flag to indicate a 2D model.

Returns
  Bmodel* new list of models.

      Each selected component is converted to a shell model.
      The radius is taken from the original component radius.
      The given distance defines the distance between the new
      components and their radii.

Definition at line 139 of file model_shell.cpp.

## ◆ model_curvature()

int model_curvature | ( | Bmodel * | model | ) |

Calculates the curvature associated with each link.

Parameters

  *model | model structure (views modified).

Returns
  int 0.

      The difference angle in the normals or view vectors of each pair of
      vertices of a link represents the curvature for that link.
      Curvature at each component is calculated as the average of the
      curvature of the attached links and set as the component FOM.
      The model curvature is calculated as the average component curvature
      and set as the model FOM.

Definition at line 279 of file model_shell.cpp.

## ◆ model_ellipsoidicity()

double model_ellipsoidicity | ( | Bmodel * | model | ) |

Calculates how close the model is to an ellipsoid shape.

Parameters

  *model | model structure.

Returns
  double ellipsoidicity.

      The principle axes are calculated first.
      Then the fit to an ellipsoid function is calculated.
      Only the first model in the list is processed.

Definition at line 234 of file model_shell.cpp.

## ◆ model_inside_outside()

double model_inside_outside | ( | Vector3< double > | vec,
|  | Bmodel * | model,
|  | int | curv_flag,
|  | int | fast
| ) |  |

Definition at line 401 of file model_shell.cpp.

## ◆ model_sphericity()

double model_sphericity | ( | Bmodel * | model | ) |

Calculates how close the model is to a spherical shape.

Parameters

  *model | model structure.

Returns
  double sphericity.

      The deviation of vertices from the average radius is calculated.
      Only the first model in the list is processed.

Definition at line 194 of file model_shell.cpp.