> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ntop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to warp a lattice with sine wave spacing

## Objective:

Learn how to warp a lattice using a sine wave field.

## Applies to:

* Lattices
* Remap field

## Procedure:

**1.** **Create a design space:**

* * Import or create the geometry where you want the lattice to fill (this will be used at the end)
    * Create a **Box**
      * Length: 50 mm
      * Width: 10 mm
      * Height: 10 mm

**2.** **Generating a lattice in a region larger than the design space:** (this allows us to create the sine field in a larger area and trim it down after)

* * Add a **Periodic Lattice** block
    * Insert a **Graph Unit Cell**
      * Unit Cell: Body-Centered Cubic
    * Insert a **Rectangular Cell Map**
      * Volume: Insert your own larger design space or add a **Box** with a length of 500 mm, a width of 10 mm, and a height of 10 mm (this is a lot longer than the design space created in Step 1a)
      * Cell Size: 1 x 1 x 1 mm
    * Thickness: 0 mm

![A periodic lattice created using a graph unit cell and a rectangular cell map](https://files.learn.ntop.com/help-articles/lattices/5996401367315.png)

**3. Create the Sine wave field:**

* Add a **Sin** block
  * Insert a **Divide** block into the Operand input
    * Operand A: x
    * Operand B: 1mm
  * Add a **Multiply** block
    * Operand A: Insert the **Sin** block
    * Operand B: 1 mm

The **Divide** and **Multiply** blocks remove and re-assign units. The values of 1 mm can be changed to alter the wavelength and the amplitude.

![Creating the Sin field and applying units to the field](https://files.learn.ntop.com/help-articles/lattices/360103261413.png)

To preview the field, select the **Multiply** block and hit 'f' to bring up the [Field Viewer](/help-articles/knowledge-base/user-interface/how-to-use-the-field-viewer). Set the Colormap to 'Turbo'. Below, you can see the visualization of the sine wave.

![The sin field visualized](https://files.learn.ntop.com/help-articles/lattices/360101102254.png)

* * Add a **Remap Field** block (this re-maps the lattice field with the sine wave on the x-axis)
    * Scalar Field: Insert the Implicit Property chip from the **Periodic Lattice Body** in Step 1
    * X: Insert the **Multiply** block
    * Y: Y
    * Z: Z

![Remapping the field of the lattice body using the sin field](https://files.learn.ntop.com/help-articles/lattices/5996428370835.png)

**3. Normalize the Field:** This block is useful for remapping fields with severe deformations. It helps make the thickness more accurate. Without it, the underlying field can be stretched.

<Note>
  **Note:** You can now grab a Normalize field chip from the block's Properties panel.
</Note>

* * [Download the Custom Block](https://ntopology.box.com/s/gvstffta0tayhcu9of70k9h41uwywj5d) Normalize Field and [import](https://support.ntop.com/hc/en-us/articles/360060151133) it into your notebook
    * Add the **Normalize Field** block
      * Insert the **Remap Field** block from Step 2

**4. Thicken the Lattice:**

* * Add a **Thicken Body** block
    * Insert the **Normalize Field** block from Step 3
    * Set the Thickness to 0.25 mm

**5. Trim the Lattice:**

* * Add a **Boolean Intersect** block
    * Body 0: Thickened Lattice
    * Body 1: Design Space

![A boolean intersect of the sin wave generated lattice and the design space to trim down the lattice size](https://files.learn.ntop.com/help-articles/lattices/1500002206502.png)

In the image below, we compare the lattice to the sine wave field. You can see the lattice is elongated where the sine wave is at the min and max values.

![The sin wave remapped lattice overlayed over the sin wave field](https://files.learn.ntop.com/help-articles/lattices/360103264213.png)

And that's it! You've successfully warped your lattice with a sine wave.

Are you still having issues? Contact the [support team](https://support.ntopology.com/hc/en-us/requests/new), and we'll be happy to help!

## Download the Example file:

* [Example file](https://files.learn.ntop.com/Support%20Article%20Example%20Files/Knowledge%20Base/Lattices/Sine%20Lattice%20Spacing.ntop)

## Keywords:

*field lattice thicken view cell periodic unit remap multiply math beta mapping trim warp how-to size re sine sin wave normalize divide turbo*
