![]() |
Bsoft 2.1.4
Bernard's software package
|
Library routines used for plane models. More...
#include "model_create.h"
#include "model_transform.h"
#include "model_views.h"
#include "model_util.h"
#include "utilities.h"
Functions | |
Vector3< double > | model_fit_plane (Bmodel *model) |
Fits a plane through a model. More... | |
double | model_distance_to_guide (Vector3< double > loc, Vector3< double > vec, Bmodel *guide, double sigma2) |
Calculates the distance between a location and the local guide model. More... | |
int | model_adjust_to_guide (Bmodel *model, Bmodel *gmod, double sigma) |
Adjusts a shell model to the faces of a polyhedral guide model. More... | |
Bmodel * | model_generate_from_plane_guide (Bmodel *guide, double separation, double sigma) |
Generates a plane model and fits a plane through it. More... | |
Variables | |
int | verbose |
Library routines used for plane models.
Adjusts a shell model to the faces of a polyhedral guide model.
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 | shell model. |
*gmod | guide polyhedron model. |
sigma | smoothness of model. |
double model_distance_to_guide | ( | Vector3< double > | loc, |
Vector3< double > | vec, | ||
Bmodel * | guide, | ||
double | sigma2 | ||
) |
Calculates the distance between a location and the local guide model.
Each guide component is used to calculate a distance of the location to the guide plane and a lateral distance to the guide component. The lateral distance is used to calculate a gaussian distributed weight which in turn is used to calculate a weighted average of the distance to the guide plane.
loc | location to be tested. |
vec | direction vector associated with the location. |
*guide | guide model. |
sigma2 | smoothness weighting parameter. |
Fits a plane through a model.
A plane is fit through the components and the normal calculated from: n•p = d where n is the normal vector, p is a point in the plane, and d is the offset. Only the first model is fit.
*model | model structure. |
Generates a plane model and fits a plane through it.
*guide | model structure. |
separation | separation between components for new model. |
sigma | smoothness of model. |
The principal axes of a planar model are calculated and a new plane model generated with the given separation between components. The components of the new model are then adjusted to fit the guide model.
|
extern |