/Users/bernard/b20/bsoft/src/model/model_shell.cpp(3)

NAME
/Users/bernard/b20/bsoft/src/model/model_shell.cpp - Library routines used for shell model processing.

SYNOPSIS

#include 'model_create.h'
#include 'model_shell.h'
#include 'model_color.h'
#include 'model_util.h'
#include 'model_transform.h'
#include 'model_select.h'
#include 'random_numbers.h'
#include 'utilities.h'

  Functions
long model_add_shell (Bmodel *model, double add_distance, Bstring &nutype)
Adds a shell to a model using selected components.
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.
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.
double model_sphericity (Bmodel *model)
Calculates how close the model is to a spherical shape.
double model_ellipsoidicity (Bmodel *model)
Calculates how close the model is to an ellipsoid shape.
int model_curvature (Bmodel *model)
Calculates the curvature associated with each link.
double model_inside_outside_fast (Vector3< double > vec, Bmodel *model, int curv_flag)
Determines if a vector is inside or outside model boundaries.
double model_inside_outside (Vector3< double > vec, Bmodel *model, int curv_flag, int fast)

  Variables
int verbose

Detailed Description

Library routines used for shell model processing.

Author:
    Bernard Heymann

Date:
    Created: 20060908

    Modified: 20161013

Definition in file model_shell.cpp.

Function Documentation

  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.

  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.

  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.

  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.

  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.

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

Definition at line 401 of file model_shell.cpp.

  double model_inside_outside_fast (Vector3< double > vec, Bmodel * model, int curv_flag)

Determines if a vector is inside or outside model boundaries.

Parameters:
    vec vector to test for.
    *model model structure.
    curv_flag flag to indicate curved surface.

Returns:
    double distance from interface (inside positive).

    Whether a point is inside or outside is based on the model structure,
    where the intersection of a vector through the point with the plane through
    the three closest vertices is the dividing point. The following set of
    equations is solved:
        v/|v| = w0 * a0 + w1 * a1 + w2 * a2
    where v is the point to be judged, and w<n> are the weights for the
    contributing vectors a<n>.
    The distance to the triangle plane intersecting point is:
        d = 1/(w0 + w1 + w2)
    The distance to the curved surface through the three vertices is:
        d = w0 * |a0| + w1 * |a1| + w2 * |a2|
    where the weights have been normalized:
        w0 + w1 + w2 = 1
    Requirement: The sampled component location vectors must be set up
        in the component force vectors.
    Only the first model in the linked list is used.

Definition at line 341 of file model_shell.cpp.

  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.

Variable Documentation

  int verbose

Author

Generated automatically by Doxygen for Bsoft from the source code.