Control of selective laser sintering and selective laser melting processes