Rhino C++ API  7.21
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ON_SquishParameters Class Reference

#include <opennurbs_plus_squish.h>

Public Member Functions

 ON_SquishParameters ()
 
void Dump (ON_TextLog &text_log) const
 
void DumpRelativeTolerances (ON_TextLog &text_log) const
 
void DumpSpringConstants (ON_TextLog &text_log) const
 
bool GetSpringConstants (double *boundary_bias, double *deformation_bias) const
 
bool Read (class ON_BinaryArchive &binary_archive)
 
void SetDeformation (ON_SquishDeformation deformation, bool bPreserveBoundary, double boundary_stretch_c=0.0, double boundary_comopress=0.0, double interior_stretch_c=0.0, double interior_compress_c=0.0)
 
void SetSpringConstants (double boundary_bias, double deformation_bias)
 
bool Write (class ON_BinaryArchive &binary_archive) const
 

Public Attributes

double m_absolute_limit
 
bool m_bAreaPreprocess
 
bool m_bGaussianBias
 
bool m_bLengthPostprocess
 Set to true to tune up the result. More...
 
bool m_bNewtonPreprocess
 Default is false. Set to true to debug problem cases. More...
 
bool m_bOptimize
 
double m_boundary_compress_c
 
double m_boundary_compress_rel_tol
 unused More...
 
double m_boundary_stretch_c
 
double m_boundary_stretch_rel_tol
 unused More...
 
bool m_bPreserveTopology
 
bool m_bSaveMapping
 
double m_diagonal_compress_c
 unused More...
 
double m_diagonal_compress_rel_tol
 unused More...
 
double m_diagonal_stretch_c
 unused More...
 
double m_diagonal_stretch_rel_tol
 unused More...
 
double m_interior_compress_c
 
double m_interior_compress_rel_tol
 unused More...
 
double m_interior_stretch_c
 
double m_interior_stretch_rel_tol
 unused More...
 
unsigned int m_material
 

Static Public Attributes

const static ON_SquishParameters DefaultValue
 

Constructor & Destructor Documentation

◆ ON_SquishParameters()

ON_SquishParameters::ON_SquishParameters ( )

Member Function Documentation

◆ Dump()

void ON_SquishParameters::Dump ( ON_TextLog text_log) const

◆ DumpRelativeTolerances()

void ON_SquishParameters::DumpRelativeTolerances ( ON_TextLog text_log) const

◆ DumpSpringConstants()

void ON_SquishParameters::DumpSpringConstants ( ON_TextLog text_log) const

◆ GetSpringConstants()

bool ON_SquishParameters::GetSpringConstants ( double *  boundary_bias,
double *  deformation_bias 
) const

Description: See if the spring constants could have been set with SetSpringConstants(). Parameters: boundary_bias - [out] deformation_bias - [out] Returns: If the spring constants have values that could be set by calling SetSpringConstants(), then boundary_bias and deformation_bias are set to those values and this function returns true. Otherwise, boundary_bias and deformation_bias are set to 0.0 and false is returned.

◆ Read()

bool ON_SquishParameters::Read ( class ON_BinaryArchive binary_archive)

◆ SetDeformation()

void ON_SquishParameters::SetDeformation ( ON_SquishDeformation  deformation,
bool  bPreserveBoundary,
double  boundary_stretch_c = 0.0,
double  boundary_comopress = 0.0,
double  interior_stretch_c = 0.0,
double  interior_compress_c = 0.0 
)

◆ SetSpringConstants()

void ON_SquishParameters::SetSpringConstants ( double  boundary_bias,
double  deformation_bias 
)

Description: A simplified interface for setting the m_*_stretch_c and m_*_compress_c constants. Parameters: boundary_bias - [in] 0.0 to 1.0 0.0: boundary and interior treated the same 1.0: strongest bias to preserving boundary lengths at the expense of interior distortion. deformation_bias - [in] -1.0 to 1.0 -1.0: strongest bias in favor of compression. 0.0: no preference between compression and stretching 1.0: strongest bias in favor of stretching

◆ Write()

bool ON_SquishParameters::Write ( class ON_BinaryArchive binary_archive) const

Member Data Documentation

◆ DefaultValue

const static ON_SquishParameters ON_SquishParameters::DefaultValue
static

◆ m_absolute_limit

double ON_SquishParameters::m_absolute_limit

If -1.0 <= m_absolute_limit < 0.0, then then an absolute compression limit is applied so that (2d length)/(3d length) >= fabs(m_absolute_limit). In particular, if m_absolute_limit = -1.0, then no compression is permitted (2d length) >= (3d length).

If 0.0 < m_absolute_limit <= 1.0 then then an absolute stretching limit is applied so that (2d length)/(3d length) <= 1/fabs(m_absolute_limit).

Examples: m_absolute_limit 1.0: no stretching, (2d length) <= 1.0*(3d length) 0.5: cap on stretching, 0.5*(2d length) <= (3d length) -0.5: cap on compression, (2d length) >= 0.5*(3d length) -1.0: no compression, (2d length) >= 1.0*(3d length)

◆ m_bAreaPreprocess

bool ON_SquishParameters::m_bAreaPreprocess

Set to true if the initial guess has at least 20% of the triangles in the wrong orientation.

◆ m_bGaussianBias

bool ON_SquishParameters::m_bGaussianBias

Set to bias deformation to happen in regions with relatively more Gaussian curvature. The mesh's m_K[] values must be set for this setting to have an effect.

◆ m_bLengthPostprocess

bool ON_SquishParameters::m_bLengthPostprocess

Set to true to tune up the result.

◆ m_bNewtonPreprocess

bool ON_SquishParameters::m_bNewtonPreprocess

Default is false. Set to true to debug problem cases.

These settings determine how the solution is calculated Leave them as is unless you are debugging.

◆ m_bOptimize

bool ON_SquishParameters::m_bOptimize

Enables the critical optimization step. Default is true. Setting it to false is used for debugging the results of the setup and preprocessing steps.

◆ m_boundary_compress_c

double ON_SquishParameters::m_boundary_compress_c

◆ m_boundary_compress_rel_tol

double ON_SquishParameters::m_boundary_compress_rel_tol

unused

◆ m_boundary_stretch_c

double ON_SquishParameters::m_boundary_stretch_c

spring constant for compressed boundary edges is m_boundary_compress_c/(rest length)

◆ m_boundary_stretch_rel_tol

double ON_SquishParameters::m_boundary_stretch_rel_tol

unused

***** these are unused ***** If a m_..._stretch_rel_tol parameter is > 1.0, then the mesh will be automatically split in areas where the relative stretch exceedes the specified relative tolerance. If a m_..._compress_rel_tol parameter is > 0.0 and < 1.0, then the mesh will be automatically split in areas where the relative compression exceedes the specified relative tolerance.

◆ m_bPreserveTopology

bool ON_SquishParameters::m_bPreserveTopology

If the mesh has coincident vertices and m_bPreserveTopology is true, then the flattening is based on the mesh's topology and coincident vertices will remain coincident. Otherwise coincident vertices are free to move apart.

◆ m_bSaveMapping

bool ON_SquishParameters::m_bSaveMapping

If m_bEnableMapBack is true, then ON_SquishMesh() will save extra information on the squished mesh so 3d points and curves near the input mesh can be mapped to the squished mesh and 2d points and curves on the squished mesh can be mapped back to the 3d mesh.

◆ m_diagonal_compress_c

double ON_SquishParameters::m_diagonal_compress_c

unused

◆ m_diagonal_compress_rel_tol

double ON_SquishParameters::m_diagonal_compress_rel_tol

unused

◆ m_diagonal_stretch_c

double ON_SquishParameters::m_diagonal_stretch_c

unused

◆ m_diagonal_stretch_rel_tol

double ON_SquishParameters::m_diagonal_stretch_rel_tol

unused

◆ m_interior_compress_c

double ON_SquishParameters::m_interior_compress_c

◆ m_interior_compress_rel_tol

double ON_SquishParameters::m_interior_compress_rel_tol

unused

◆ m_interior_stretch_c

double ON_SquishParameters::m_interior_stretch_c

◆ m_interior_stretch_rel_tol

double ON_SquishParameters::m_interior_stretch_rel_tol

unused

◆ m_material

unsigned int ON_SquishParameters::m_material

0 = geometric flattening algorithm (scale independent)the "spring" constant is proportional to 1/L^2 and the result is independent of scale. 1 = physical stress flattening algorithm (scale dependent) the "spring" constant is proportional to 1/L.