|
Bsoft
2.1.0
Bernard's software package
|
Library routines used for shell model processing. More...
#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"Go to the source code of this file.
Functions | |
| long | model_add_shell (Bmodel *model, double add_distance, Bstring &nutype) |
| 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_fast (Vector3< double > vec, Bmodel *model, int curv_flag) |
| Determines if a vector is inside or outside model boundaries. More... | |
| double | model_inside_outside (Vector3< double > vec, Bmodel *model, int curv_flag, int fast) |
Variables | |
| int | verbose |
Library routines used for shell model processing.
Definition in file model_shell.cpp.
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.
Definition at line 32 of file model_shell.cpp.
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.
Definition at line 85 of file model_shell.cpp.
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.
Definition at line 139 of file model_shell.cpp.
| 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.
Definition at line 279 of file model_shell.cpp.
| double model_ellipsoidicity | ( | Bmodel * | model | ) |
Calculates how close the model is to an ellipsoid shape.
| *model | model structure. |
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.
Definition at line 401 of file model_shell.cpp.
Determines if a vector is inside or outside model boundaries.
| vec | vector to test for. |
| *model | model structure. |
| curv_flag | flag to indicate curved surface. |
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.
| *model | model structure. |
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.
|
extern |