Working with Lists

Follow

This article will explain in detail what lists are and how to use lists in nTop Platform. Lists are an important concept in nTop. They often appear in boolean operations, simulations, topology optimization, and CAD body manipulation, and list processing is a powerful tool for completing repetitive functions on multiple inputs.

 

List Blocks

All blocks in nTop can exist as singular entities or as a list. To create a list of any type, type ‘list’ into the search bar, along with the block type you would like to create. Lists are denoted in nTop by a three small rectangles of increasing width in the bottom left corner of the data type icon. The size of a list is shown in parentheses next to the Block type.

create_sphere_list.gif

 

The example below shows a single Sphere block, represented by the first sphere, along with a Sphere List below it, consisting of three spheres.

1.png

 

In the Properties tab of the Info panel, you will see that List blocks contain the same information available for singular blocks, but each set of information is also a list. For example a list of points at the center of each listed sphere can be found in the properties tab of the Sphere List block.

3.png

 

To examine individual entities in a List, go to the bottom of the Properties tab in the Infopanel, and you will see each list entity identified by an index number ([0],[1],[2],...). The dropdown arrow next to the individual entities can be clicked to obtain more information on just that individual list entity.

You can also click and drag individual entities into the notebook to create a new single variable separated from the list.

 

sphere-drag.gif

 

List Processing

When applicable, blocks can accept list inputs instead of singular inputs, and the block will become a listed block. In the example below, we use the Mesh from Implicit Body to generate a surface mesh of the single sphere. Then, we use the same block, but place the Sphere List in the input, and a list of meshes is produced, containing three separate meshes for the three separate spheres.

Note that lists can be used in the input of custom blocks, so customized functions can be performed on multiple listed inputs at once.

2.png


List Manipulation

You can add entities to a list by simply dragging a new block into List block. Remember that all entities in a list must have the same block type (i.e. they must have the same icon in the top left corner of the block).

sphere_drag.gif

 

Or, lists can be added to by clicking the + sign in the top left corner next to the Info Panel button.

sphere_click_add.gif


The order of list entities can be changed by dragging list entities around within the List block

 rearrange.gif

 

To remove empty slots in a list, hover your cursor over the slot and click on the — sign that appears on the left. Lists that contain empty slots will be invalid until the empty slot is removed.

 sphere_remove.gif

 

Other list manipulation tools can be found in the Utilities Ribbon Tab, under ‘General’. These blocks are outlined below.

  • List Element: Extract a single entity from a list
  • Insert: Combine two lists into one by inserting a list into another at a specified index location.
  • Sub List: Extract a smaller list from a larger input list, based on a starting index and the desired size of the sub-list.
  • Remove: Remove one or more entities from a list, based on a starting index and the number of removed entities.


Groups

Groups in nTop are the same thing as lists, except they can contain a combination of any block types. For example, the group below consists of a point, a sphere, and a cube. The same list manipulation operations described above can be performed on groups.

4.png

 

Autopopulated Lists

Some blocks in nTop take in list inputs and combine them into a singular entity. An example of this is the Boolean Union block, which takes in a list of bodies and generates a single unioned body. Blocks like this are autopopulated with an empty list, which is useful for quickly dragging bodies inside to complete the operation, as shown below.

union1.gif

But, sometimes, a user already has a list prepared that they would like to perform a boolean union operation on. In this case, the autopopulated list must be deleted and replaced by the desired list.

 union.gif

 

Lists of One

Lists of one are sometimes unintentionally created by the user, or during CAD/Part importing. They can be converted to singular entities by either dragging the entity out of the Properties tab of the Info Panel, or by using the List Element block.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.