Example A-1: Simple Filled 2D Part
In this example, a complete 2D part with a shape of 50×100 voxels is created with a base material of 1 and a voxel size of 0.02 units in all directions. The parameter log_debug is set to True for demonstration purposes.
The part is then exported to an Abaqus™ input file in 2D mode with CPE4R elements. The Non-Empty elements (which happens to be the whole model), are requested to be exported.
The code can be found in the examples folder of the main repository. It is also included below:
"""Script for Example A-1: Simple Filled 2D Part."""
from vcams.voxelpart import VoxelPart
# Create the part.
part = VoxelPart(size=(50, 100), base_material=1, voxel_size=(0.02, 0.02), name='Ex A-1 Simple 2D Part',
description='Example A-1: A simple 50*100 2D part filled with elements.', log_debug=True)
# Output the part.
part.output_abaqus_inp(file_name='ex_a1_simple_part_2d',
elem_code='CPE4R', dim='2D',
material_elem_sets='Non-Empty')