Volume Lattice

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


The volume lattice function fills a regular euclidean lattice structure inside of a closed volume, cutting the lattice at the bounding surfaces.

Input:


Component: Is the uploaded .Obj component to be arrayed.
Volume: Uploaded bounding volume mesh to be populated.
Component Size: Defines the size of the base component.
File Name:  Name of the resultant file for the surface lattice.
T: [YOUR SECRET TOKEN]

Optional:

.setComponent(‘component.obj’):
-Assign an .obj component to the lattice for population

.setVolume(‘volume.obj’):
-Assign a closed mesh that you want the lattice to fill

.setComponentSize(float):
-Assigns a float number defining the cell size of the lattice

.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.

.setOutput(‘output.obj’):
- Sets the output of the generated conformal lattice

.run(token):
-generates the volume lattice that fills the mesh volume

Output:

A list of result files in storage.


Example:

First, set the volume to fill, base component and the size of each component using the .setVolume(), .setComponent(), and .setVolume() methods respectively.

Input: Lattice Unit

Input: Lattice Unit

Input: Closed Volume Mesh

Input: Closed Volume Mesh

lattice = genysis.volumeLattice()
lattice.setVolume("vol.obj")
lattice.setComponentSize(8)
lattice.setComponent('cell_0.obj')

Then, you can use the .setOutput() method then the .run() method to generate the final lattice. Too see how to blend between multiple topologically equivalent components please refer to the example below.

lattice.setOutput('volume-lattice-curves.obj')
lattice.run(token)
Output: Volume Lattice Output

Output: Volume Lattice Output

The example below illustrates how to blend between different topologically equivalent units, using the .addCurveAttractor() method.

Input: Componenets Unit_0 & Unit_1

Input: Componenets Unit_0 & Unit_1

Input: Volume

Input: Volume

def parseAtt(dir):
    f = open(dir,'r')
    lines = f.read().split('\n')
    if lines[0] == "":
        return []
    else:
        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])]
                points.append(point)
            crvPts.append(points)
    return crvPts

attCrvs = parseAtt('CSV/attCrvs_demo.csv')

for i in range(len(attCrvs)):
  lattice.addCurveAttractor('cell_1.obj',attCrvs[i],range=21)
Output: Top View

Output: Top View

Francis Bitonti