This page was generated from docs/documents/notebooks/design/placement.ipynb.
Interactive online version: Binder badge - Download notebook -

Placement of parts and objects

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

[1]:
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

[2]:
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()
[2]:

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

[3]:
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()
[3]: