Вы можете использовать уменьшить и назначение деструктурирования и объединить объект в нужном формате, используя клавиши.
let array = [{cart: { fruits: {}, vegetables: {}, juices: {}}},{cart: { boxes: {}, tools: {}, bottles: {}}}]
let op = array.reduce( (op,inp) => {
let key = Object.keys(inp)[0]
op[key] = {...op[key], ...inp[key]}
return op
},{})
console.log(op)
Вы ранее использовали библиотеку C #?
В C ++ нет стандартной библиотеки функций для кривых Безье (пока). Конечно, вы можете свернуть свой собственный (CodeProject образец ) или найти математическую библиотеку.
Этот пост хорошо объясняет эту идею, но в Actionscript. Перевод не должен быть большой проблемой.
If you just want to display a Bezier curve, you can use something like PolyBezier for Windows.
If you want to implement the routine yourself, you can find linear interpolation code all over the Intarnetz.
I believe the Boost libraries have support for this. Linear interpolation, not Beziers specifically. Don't quote me on this, however.