transformParts

open override fun transformParts(transformation: (Shape3d) -> Shape3d): Shape3d

Some transformations require the points and faces data. This isn't available for Union3d, Difference3d and Intersection3d, so it may seem impossible to transform a union, difference or intersection. We can though. If we pull the component parts out of the union/difference/intersection, apply the transformation to those shapes, and then recombine the results.

It isn't important that you understand how this works, but if you want to ... Imagine you have a mathematical equation such as (2x + y), and you wish to multiply it by three. No suppose, for some reason, we can't multiply the result of an addition, but we still want to perform : 3 * (2x + y). The solution is to multiple each part by 3, and then perform the addition last : 32x + 3y = 6x + 3y.

In our analogy, addition is like a Union3d, and multiplication is like transform (which requires the points and faces data).