Placement of parts and objects

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

[1]:
import ada
[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):
    bm2 = bm.copy_to(f"bm{i}", (0,0,i-1), (1,0,i-1))
    bm2.placement = bm2.placement.rotate((0,0,1), angle)
    other_beams.append(bm2)
p = ada.Part('MyPart') / (bm, *other_beams)
p.show(embed_glb=True)
C:\AibelProgs\code\adapy\.pixi\envs\tests\Lib\site-packages\h5py\__init__.py:36: UserWarning: h5py is running against HDF5 (1, 14, 4) when it was built against (1, 14, 4, 3), this may cause problems
  _warn(("h5py is running against HDF5 {0} when it was built against {1}, "
[2]:
[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.show(embed_glb=True)
[3]:
[4]:
p.placement = p.placement.rotate((0,0,1), 45)
p.show(embed_glb=True)
[4]: