|
Action:
|
Creates a deformable surface model and returns a pointer to the deformable model object or NULL.
|
|
|
Prototype:
|
DS_dmod* DM_make_dmod_surface (
|
|
|
int& rtn_err,
|
// out: 0=success or
|
|
|
|
|
// negative err code
|
|
|
DS_pfunc* pfunc,
|
// in: defines the shape
|
|
|
|
|
// model
|
|
|
void* dmod_entity
|
// in: application ptr
|
|
|
|
= NULL,
|
// stored with dmod
|
|
|
int draw_state
|
// in: draw bits for
|
|
|
|
= (1 << 1)|
|
// application graphics
|
|
|
|
(1 << 2)|
|
// (draw loads,
|
|
|
|
(1 << 3),
|
// constraints, and
|
|
|
|
|
// seams)
|
|
|
int tag
|
// in: unique id for this
|
|
|
|
= 2,
|
// object
|
|
|
double au
|
// in: resist stretch u
|
|
|
|
= 1.0,
|
// direction
|
|
|
double av
|
// in: resist stretch v
|
|
|
|
= 1.0,
|
// direction
|
|
|
double atheta
|
// in: resist stretch
|
|
|
|
= 0.0,
|
// rotation angle
|
|
|
double bu
|
// in: resist bending u
|
|
|
|
= 5.0,
|
// direction
|
|
|
double bv
|
// in: resist bending v
|
|
|
|
= 5.0,
|
// direction
|
|
|
double btheta
|
// in: resist bending
|
|
|
|
= 0.0,
|
// rotation angle
|
|
|
double gamma
|
// in: resist bending
|
|
|
|
= 0.0,
|
// change rate
|
|
|
double delta
|
// in: resistance to
|
|
|
|
= 0.0,
|
// moving from default
|
|
|
|
|
// shape
|
|
|
double dt
|
// in: implicit
|
|
|
|
= 1.0,
|
// integration time
|
|
|
|
|
// step [1.0]
|
|
|
double mass
|
// in: physical param
|
|
|
|
= 0.0,
|
// (causes rippling)[1.0]
|
|
|
double damp
|
// in: physical param
|
|
|
|
= 0.0,
|
// (stable integration)
|
|
|
|
|
// [5.0]
|
|
|
SDM_options* sdmo
|
// in:SDM_options pointer
|
|
|
|
= NULL
|
//
|
|
|
);
|
|
|
Includes:
|
#include "kernel/acis.hxx"
|
|
#include "dshusk/dskernel/dmapi.hxx"
|
|
#include "dshusk/dskernel/dsdmod.hxx"
|
|
#include "dshusk/dskernel/dspfunc.hxx"
|
|
#include "dshusk/dskernel/sdm_options.hxx"
|
|
|
Description:
|
Modifies return_err.
|
|
|
Builds and returns a deformable model of the
pfunc shape. The
dmod_entity pointer is made available to applications that may want to store data with each deformable model. This pointer is never accessed (and so may be set to NULL) but can be retrieved by an application with the deformable model method call
DS_dmod->Entity() and it may be changed with the method
DS_deformable_model->Set_entity (entity).
draw_state is a bit-array integer which may be used by the application to control which pieces of deformable modeling information are rendered for each deformable model. See the
DM_DRAW_... environment variables defined in the file "dshusk/dskernel/dmapi.hxx" for a complete list. The
draw_state defaults to drawing loads, constraints, and seams.
tag is unique identifier for this deformable model. Since this deformable model will act as the root of its own patch hierarchy a good tag value is 2 which is its default value.
au (default=1) is this deformable model's resistance to stretch parameter value in the u direction,
av (default=1) is this deformable model's resistance to stretch parameter value in the v direction, and
atheta is an amount in radians by which those stretch resistance may be rotated within the surface.
bu (default=5) is this deformable model's resistance to bending parameter value in the u direction,
bv (default=5) is this deformable model's resistance to bending parameter value in the v direction, and
btheta is an amount in radians by which those bending resistances may be rotated within the surface.
delta (default=0) is this deformable model's resistance to displacement from the default shape.
dt (default =1) is the deformable modeling time step size taken with each call to
DM_solve().
mass (default 0.0) and
damp (default 0.0) are the dynamic parameters for this deformable model. With mass, a deformable model can overshoot and oscillate on its way to an equilibrium position. With damping the oscillations can diminish over time and the number of time steps until equilibrium is achieved may be increased. When both mass and damping are 0 (default behavior), a DM_solve() solves directly for the equilibrium position, ignoring the current value of dt.
|
|
|
mallocs is the calling program must free the memory of the returned deformable model pointer with a call to
DM_delete_dmod. The
pfunc pointer is stored within the deformable model and will be deleted when the deformable model is deleted. Do not call
DM_delete_pfunc on that pointer after this call. Do not make a second deformable model with this
pfunc pointer. Use
DM_copy_pfunc if you want to make another deformable model with this shape.
|
|
|
Errors:
|
DM_NULL_INPUT_PTR
|
|
The
pfunc cannot be NULL on input.
|
|
|
|
DM_BAD_TAG_VALUE
|
|
The tag value must be -1, to have the system assign one, or 2 or greater.
|
|
|
|
DM_BAD_ALPHA_VALUE
|
|
The value of
alpha must be 0 or positive.
|
|
|
|
DM_BAD_BETA_VALUE
|
|
The value of
beta must be 0 or positive.
|
|
|
|
DM_BAD_DELTA_VALUE
|
|
The value of
delta must be positive.
|
|
|
|
DM_BAD_DT_VALUE
|
|
The value of
dt must be positive.
|
|
|
|
DM_BAD_MASS_VALUE
|
|
The value of
mass must be 0 or positive.
|
|
|
|
DM_BAD_DAMP_VALUE
|
|
The value of
damp must be 0 or positive.
|
|
|
Library:
|
dshusk
|
|
|
Filename:
|
ds/dshusk/dskernel/dmapi.hxx
|
|
|
Effect:
|
Changes model
|