Unfolding.coordsMethod
coords(X; columns=nothing)

Reshape and filter dataframe or matrix and return the matrix in right format for unfolding.

Parameters:

  • X - the input Dataframe or matrix with the coordinates.
  • columns - if the input is a Dataframe with more than 3 columns, the column names of the three coordinates must be informed here (e.g. ["X","Y","Z"]).
Unfolding.errorsMethod
errors(mode, coords, unf_coords; search=:knn, neigh=16, maxerr=5)

Unfolding distorts the original distances between neighbor points. This function returns two types of results depending on mode.

If mode = :ids, this gives the IDs of the points above and below the maxerr threshold as a tuple such that (idspassedthetests, idsnotpassedthe_tests)

If mode = :dists, this function output the difference of the expected distance for each pair analyzed in the neighborhood. Can be used as input in a boxplot to verify distortions.

Parameters:

  • mode - type of error, :ids or :dists.
  • coords - coordinate matrix of the points before unfolding.
  • unf_coords - coordinate matrix of the points after unfolding.
  • search - type of neighborhood, :knn or :radius.
  • neigh - number of neighbors or radius used to make the validations.
  • maxerr - the maximum accepted absolute difference of the distances if mode = :ids.
Unfolding.getreferenceMethod
getreference(blocks; axis=["X","Y","Z"])

Extract the mid-surface points that split the informed block model in two. Returns a coordinate matrix with the reference points for unfolding.

Parameters:

  • blocks - coordinate matrix of the regular blocks centroids.
  • axis - axis or list of axis that will be scanned to extract reference points. Defaults to ["X","Y","Z"].
Unfolding.landmark_isomapFunction
landmark_isomap(coords, search=:knn, neigh=16, anchors=1500)

This function runs Landmark Isomap at 3-D points and returns a coordinate matrix with the unfolded points.

Parameters:

  • coords - coordinate matrix of the reference points.
  • search - search type to build neighbors graph for Isomap (:knn for k-nearest neighbor or :radius for radius search)
  • neigh - number of neighbors (for search=:knn) or radius distance (for search=:radius) to build neighbors graph for Isomap.
  • anchors - number of anchors/landmark points for the dimensionality reduction.
Unfolding.to_vtkFunction
to_vtk(outname, coordinates, props)

Export the coordinates as VTK points named outname.vtu. Optionally, extra properties are passed via props as NamedTuple or Dict, where the first item is the property name and the second is an array with the property values.

Unfolding.unfoldMethod
unfold(to_unf, ref, unf_ref; optim=:default)

Unfold the input points to_unf based on points already unfolded unf_ref and their correspondent in the original space ref. Useful to unfold samples after the domain is already unfolded, for example. Returns a coordinate matrix with the unfolded points. Or a tuple of matrices if to_unf is a list of points.

Parameters:

  • to_unf - coordinate matrix with the points that will be unfolded
  • ref - coordinate matrix with the reference points for unfolding
  • unf_ref - coordinate matrix with the unfolded reference points
  • optim - additional parameters for optimization step; either :default or a NamedTuple with the keys shown below

optim parameters:

Default: optim = (search=:knn, neigh=50, maxerr=5, nchunks=1)

  • search - search type to optimize locally (:knn for k-nearest neighbor or :radius for radius search).
  • neigh - number of neighbors (for search=:knn) or radius distance (for search=:radius) to local optimization.
  • maxerr - the maximum accepted distortion for unfolding optimization.
  • nchunks - number of rounds of optimization.
Unfolding.unfoldMethod
unfold(ref, to_unf, samps=nothing; isomap=:default, optim=:default)

Unfold the input points to_unf based on the reference points informed in ref. Returns a coordinate matrix with the unfolded points. Or a tuple of matrices if to_unf is a list of points.

Parameters:

  • to_unf - coordinate matrix with the points that will be unfolded
  • ref - coordinate matrix with the reference points for unfolding
  • isomap - additional parameters for isomap step; either :default or a NamedTuple with the keys shown below
  • optim - additional parameters for optimization step; either :default or a NamedTuple with the keys shown below

isomap parameters:

Default: isomap = (search=:knn, neigh=16, anchors=1500, reftol=0.01)

  • search - search type to build neighbors graph for Isomap (:knn for k-nearest neighbor or :radius for radius search).
  • neigh - number of neighbors (for search=:knn) or radius distance (for search=:radius) to build neighbors graph for Isomap.
  • anchors - number of anchors for landmark isomap
  • reftol - distance to which reference points are considered duplicates

optim parameters:

Default: optim = (search=:knn, neigh=50, maxerr=5, nchunks=4)

  • search - search type to optimize locally (:knn for k-nearest neighbor or :radius for radius search).
  • neigh - number of neighbors (for search=:knn) or radius distance (for search=:radius) to local optimization.
  • maxerr - the maximum accepted distortion for unfolding optimization.
  • nchunks - number of rounds of optimization.