Skip to content

Placement of parts and objects

Notebook

This page was generated from placement.ipynb. Download it to run the examples yourself.

Placement of every object in adapy can be controlled using the ada.Placement object.

import ada

First let's check out how we can copy a single beam and apply a translation and rotation to each instance of the copy

bm = ada.Beam('bm1', (0,0,0), (1,0,0), 'IPE300')
other_beams = []
for i, angle in enumerate([45, 90, 135, 180], start=2):
    other_beams.append(bm.copy_to(f"bm{i}", (0,0,i-1), rotation_axis=(0,0,1), rotation_angle=angle))
p = ada.Part('MyPart') / (bm, *other_beams)
p.show()

Copy and applying translations/rotations can also be given on a part level.

w = 5
pl = ada.Plate('pl1', [(0,0), (w,0), (w,w), (0,w)], 0.01)
beams = ada.Beam.array_from_list_of_coords(pl.poly.points3d,'IPE300', make_closed=True)
p = ada.Part('myPart') / (pl, *beams)

p_top = ada.Part('TopPart') / (p, p.copy_to('my_copied_part', (0,0,1), (0,0,1), 45))
p_top.show()