SquishParameters

References
Parameters used by the 'Squish' command flattening algorithm

Constructors

SquishParameters

#Since v5.0
public SquishParameters()
Initializes a new instance with default values. Initial values are same as Default.

Finalizer

~SquishParameters

#
~SquishParameters()
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().

Properties

AbsoluteLimit

#Since v7.9
public double AbsoluteLimit { get; set; }
If -1.0 <= AnsoluteLimit < 0.0, then an absolute compression limit is applied so that (2d length)/(3d length) >= abs(AbsoluteLimit). In particular, Absolute = -1.0, then no compression is permitted(2d length) >= (3d length). If 0.0 < m_absolute_limit <= 1.0 then an absolute stretching limit is applied so that (2d length)/(3d length) <= 1/abs(AbsoluteLimit). Examples: AbsoluteLimit 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)

Algorithm

#Since v7.9
public SquishFlatteningAlgorithm Algorithm { get; set; }
The flattening algorithm to use: Geometric: (scale independent)the "spring" constant is proportional to 1/L^2 and the result is independent of scale. PhysicalStress: (scale dependent) the "spring" constant is proportional to 1/L.

BoundaryCompressConstant

#Since v7.9
public double BoundaryCompressConstant { get; set; }
Spring constant for compressed boundary edges times the rest length

BoundaryStretchConstant

#Since v7.9
public double BoundaryStretchConstant { get; set; }
Spring constant for stretched boundary edges

Default

#Since v7.9
public static SquishParameters Default { get; }
Gets the default Squishing parameters

InteriorCompressConstant

#Since v7.9
public double InteriorCompressConstant { get; set; }
Spring constant for compressed interior edges times the rest length

InteriorStretchConstant

#Since v7.9
public double InteriorStretchConstant { get; set; }
Spring constant for stretched boundary edges times the rest length

PreserveTopology

#Since v7.9
public bool PreserveTopology { get; set; }
the mesh has coincident vertices and PreserveTopology 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.

SaveMapping

#Since v7.9
public bool SaveMapping { get; set; }
If SaveMapping 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.

Methods

Dispose

#Since v7.9
public void Dispose()
Actively reclaims unmanaged resources that this instance uses.

Dispose

#
protected virtual void Dispose(bool disposing)
For derived class implementers.

This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.

You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.

Also, you must call the base virtual method within your overriding method.

disposing (bool)true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer.

GetSpringConstants

#Since v7.9
public bool GetSpringConstants(out double boundaryBias, out double deformationBias)
See if the spring constants could have been set with SetSpringConstants().
boundaryBias (out double)boundary_bias: 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.
deformationBias (out double)deformation_bias: -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
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, boundaryBias and deformationBias are set to 0.0 and false is returned.

SetDeformation

#Since v7.9
public void SetDeformation(SquishDeformation deformation, bool bPreserveBoundary, double boundaryStretchConstant, double boundaryCompressConstant, double interiorStretchConstant, double interiorCompressConstant)
Sets the squish deformation characteristics
deformation (SquishDeformation)
bPreserveBoundary (bool)
boundaryStretchConstant (double)
boundaryCompressConstant (double)
interiorStretchConstant (double)
interiorCompressConstant (double)

SetSpringConstants

#Since v7.9
public void SetSpringConstants(double boundaryBias, double deformationBias)
A simplified interface for setting the Stretch and Compression spring constants
boundaryBias (double)boundary_bias: 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.
deformationBias (double)deformation_bias: -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