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

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...
 
Bmodelmodel_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

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
*modelmodel structure.
add_distancedistance to shift new components.
&nutypenew 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.

◆ 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
*modelshell model.
*gmodguide polyhedron model.
fractionfraction to adjust.
curv_flagflag 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.

◆ 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
*modelmodel structure.
distancedistance between components.
&nutypenew component type.
twodflag 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.

◆ model_curvature()

int model_curvature ( Bmodel model)

Calculates the curvature associated with each link.

Parameters
*modelmodel 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.

◆ model_ellipsoidicity()

double model_ellipsoidicity ( Bmodel model)

Calculates how close the model is to an ellipsoid shape.

Parameters
*modelmodel structure.
Returns
double ellipsoidicity.
The principal axes are calculated first.
Then the fit to an ellipsoid function is calculated.
Only the first model in the list is processed.

◆ model_inside_outside()

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

◆ model_sphericity()

double model_sphericity ( Bmodel model)

Calculates how close the model is to a spherical shape.

Parameters
*modelmodel structure.
Returns
double sphericity.
The deviation of vertices from the average radius is calculated.
Only the first model in the list is processed.