Genie3D

Module Contents

Classes

Genie3D

Base class for 3D geometric shape representation

class Genie3D.Genie3D(verbose=False)

Bases: lsdo_genie.bsplines.BsplineVolume.BsplineVolume

Base class for 3D geometric shape representation

Attributes:
verbosebool

Prints out information for troubleshooting

compute_errors()

Compute error values and print to terminal

compute_phi(pts)

Compute the phi value at a set of points

Parameters:
ptsnp.ndarray(N,3)

Set of points to be evaluated

Returns:
phinp.ndarray(N,)

The phi values at each input point

config(domain: numpy.ndarray, max_control_points: int, order: int = 4, min_ratio: float = 0.5)

Set up the Bspline for non-interference constraints

Parameters:
domainnp.ndarray(3,2)

Lower and upper bounds in each dimension for the domain of interest

max_control_pointsint

Maximum number of control points along the longest dimension

min_ratiofloat

Minimum ratio from the shortest dimension to the longest dimension to maintain uniform control point spacing

orderint

Polynomial order of the Bspline

get_basis(loc='surf', du=0, dv=0, dw=0)

Convenience function for building the basis matrix for different points

Parameters:
locstr

‘surf’ for surface points or ‘hess’ for quadrature points to evaluate the hessian

duint

Derivative in the ‘u’ direction

dvint

Derivative in the ‘v’ direction

dwint

Derivative in the ‘w’ direction

Returns:
basissps.csc_matrix(N,Ncp)

The basis matrix that can be multiplied with the control points to get (N,) output values

gradient_phi(pts: numpy.ndarray)

Compute the phi value at a set of points

Parameters:
ptsnp.ndarray(N,3)

Set of points to be evaluated

Returns:
dpdxnp.ndarray(N,)

The derivative of phi with respect to the x-coordinate

dpdynp.ndarray(N,)

The derivative of phi with respect to the y-coordinate

dpdznp.ndarray(N,)

The derivative of phi with respect to the z-coordinate

initialize_control_points(k: int = 10, rho: float = 10.0)

Initialize the control points using Hicken and Kaur’s explicit method

Parameters:
kint

Numer of nearest neighbors to include in the function

rhofloat

Smoothing parameter

Returns:
cpsnp.ndarray(Ncp,4)

The initial control points with (x,y,z,phi) values at each point

input_point_cloud(surface_points: numpy.ndarray = None, surface_normals: numpy.ndarray = None)

Input the point cloud data

Parameters:
surface_pointsnp.ndarray(N,3)

Positional data of the points in a point cloud

surface_normalsnp.ndarray(N,3)

Normal vectors of the points in a point cloud

solve_energy_minimization(Lp: float = 1.0, Ln: float = 1.0, Lr: float = 0.001, maxiter=None)

Solve the energy minimization problem

Parameters:
Lpfloat

Depricated weighting parameter for zero level set point energy term

Lnfloat

Weighting parameter for the normal vectors energy term

Lrfloat

Weighting parameter for the regularization energy term

spatial_to_parametric(pts: numpy.ndarray)

Convert (x,y,z) coordinates to (u,v,w) coordinates

Parameters:
ptsnp.ndarray(N,3)

The points to convert to parametric coordinates

Returns:
unp.ndarray(N,)

The ‘u’ parametric coordinates

vnp.ndarray(N,)

The ‘v’ parametric coordinates

wnp.ndarray(N,)

The ‘w’ parametric coordinates

visualize(phi_cps=None, res=30)

Visualize the isocontours, control points in 3D, and phi values along the x-y axes

Parameters:
resint

The resolution in each dimension to evaluate the function for visualization