| Bsoft 2.0.5 Bernard's software package

Functions | Variables
model_plane.cpp File Reference

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"`

Go to the source code of this file.

## 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

## Detailed Description

Library routines used for plane models.

Author
  Bernard Heymann

Date
  Created: 20140925
  Modified: 20141008

Definition in file model_plane.cpp.

## Function Documentation

## ◆ model_adjust_to_guide()

int model_adjust_to_guide | ( | Bmodel * | model,
|  | Bmodel * | gmod,
|  | double | sigma
| ) |  |

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.

Parameters

  *model | shell model.
  *gmod | guide polyhedron model.
  sigma | smoothness of model.

Returns
  int 0.

Definition at line 136 of file model_plane.cpp.

## ◆ model_distance_to_guide()

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.

Parameters

  loc | location to be tested.
  vec | direction vector associated with the location.
  *guide | guide model.
  sigma2 | smoothness weighting parameter.

Returns
  Bmodel* new circle model.

Definition at line 102 of file model_plane.cpp.

## ◆ model_fit_plane()

Vector3<double> model_fit_plane | ( | Bmodel * | model | ) |

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.

Parameters

  *model | model structure.

Returns
  Vector3<double> plane normal.

Definition at line 30 of file model_plane.cpp.

## ◆ model_generate_from_plane_guide()

Bmodel* model_generate_from_plane_guide | ( | Bmodel * | guide,
|  | double | separation,
|  | double | sigma
| ) |  |

Generates a plane model and fits a plane through it.

Parameters

  *guide | model structure.
  separation | separation between components for new model.
  sigma | smoothness of model.

Returns
  Bmodel* new model based on input 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.

Definition at line 186 of file model_plane.cpp.

## Variable Documentation

## ◆ verbose

int verbose