It's a sphere inside a cube that represents a parent shape. The
that clause only goes with the cube.
There's a market along the road that runs to town.
There is no ambiguity here at all.
It's a man in a *balloon that floats** on the water.
My advice is kill the which in this case.
"that represents a parent shape" is a restrictive clause modifying cube. It does not modify: sphere inside a cube, which is a noun plus a prepositional phrase.
- restrictive clauses modify a noun. Not a noun and a preposition phrase as found in the OP's sentence.
Example of an unrestricted clause from the Oxford Dictionary [online] made into a restricted one.
clauses, restricted and unrestricted
It says: A restrictive relative clause provides essential information about the noun to which it refers.
unrestricted: The items, which are believed to be family heirlooms, included a grandfather clock worth around £3,000.
restricted: The items that are believed to be family heirlooms, included a grandfather clock worth around £3,000.
The lines in the painting that hangs on the North Wall are not straight.
The other sentence in the question using a restrictive clause:
It's a call expression inside a function that represents a parent call