Populate Lattice Module

Endpoint: https://studiobitonti.appspot.com/boxMorph

The Populate modulus function populates a given component (or set of components) into a conformal grid structure.


Component: Is the uploaded .Obj component to be arrayed.
Boxes: Is the name of uploaded box scaffold .json name.
File Name:  Name of the resultant file for the surface lattice.


BlendTargets: List of other components to be blended according to chosen attractors.
EPSILON: Is a float value determining the tolerance of removing duplicated members.
Bin:  The input of true or false, defines whether to export result as a compressed binary format instead of obj.


-Assign an .obj component to the lattice for population

.addCurveAttractor( ‘target.obj’, [ [x1,y1,z1] , [x2,y2,z2], …], range = 20 ):
-Adds an attractor curve that morphs the default component into a target component, using a list of 3-D coordinates and a user defined range.

- Sets the output of the generated conformal lattice

-populates the grid generated with the given components


The result is an .obj file located in storage.


The image and code below show an example grid for populating. The .json file is structured as a series of 8x3 matrices that represent the 8 corners of every cell in clockwise order from the bottom face to the top face.

Input:   Bike Handlebar conformal grid

Input: Bike Handlebar conformal grid

Input .Json Format: 
    # 3d coordinates for 8 corners of a box
    # 3d coordinates for 8 corners of a box
  # [[...],[...]....[...]]...... list of boxes composing the conformal grid
Input:   Sample lattice component

Input: Sample lattice component

Below we assign a default component (shown above) as an uploaded .obj file to fill in the lattice, using the .setComponent() method.

genysis.upload("EXPORTS/dimpleCube.obj", 'cell_0.obj', token)
genysis.upload("EXPORTS/jackCube.obj", 'cell_1.obj', token)

Input:   Sample topologically equivalent components

Input: Sample topologically equivalent components

We can add multiple topologically equivalent components to blend between (shown above) within the lattice by adding attractors, using the .addCurveAttractor() method.

# FUNCTION TO IMPORT ATT CURVES (as sets of points)
def parseAtt(dir):
    f = open(dir,'r')
    lines = f.read().split('\n')
    if lines[0] == "":
        return []
        crvPts = []
        for i in range(len(lines)):     
            entries = lines[i].split(' ')
            points = []
            for j in range(len(entries)):
                info = entries[j].split(',')
                point = [float(info[0]),float(info[1]),float(info[2])]
    return crvPts

attCrvs = parseAtt('CSV/attCrvs_ConformalDemo.csv')
for i in range(len(attCrvs)):

Finally, we use the .setOutput() method and the .populateLattice() method to generate the populate the lattice and store its output mesh on the server.

out_file_name = 'conformalLattice_0.obj'
Output:   Populated Handlebar in Context

Output: Populated Handlebar in Context

Francis Bitonti