![]() |
Bsoft 2.1.4
Bernard's software package
|
Library routines used for shell model processing. More...
#include "rwmodel.h"
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) |
Library routines used for shell model processing.
Adds a shell to a model using selected components.
*model | model structure. |
add_distance | distance to shift new components. |
&nutype | new component type. |
Each selected component is duplicated and shifted radially. Only the first model in the list is used.
Adjusts a shell model to the faces of a polyhedral guide model.
*model | shell model. |
*gmod | guide polyhedron model. |
fraction | fraction to adjust. |
curv_flag | flag to indicate curved surface. |
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.
Generates a new set of models by vonverting each component to a shell model.
*model | model structure. |
distance | distance between components. |
&nutype | new component type. |
twod | flag to indicate a 2D model. |
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.
int model_curvature | ( | Bmodel * | model | ) |
Calculates the curvature associated with each link.
*model | model structure (views modified). |
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.
double model_ellipsoidicity | ( | Bmodel * | model | ) |
Calculates how close the model is to an ellipsoid shape.
*model | model structure. |
The principal axes are calculated first. Then the fit to an ellipsoid function is calculated. Only the first model in the list is processed.
double model_sphericity | ( | Bmodel * | model | ) |
Calculates how close the model is to a spherical shape.
*model | model structure. |
The deviation of vertices from the average radius is calculated. Only the first model in the list is processed.