I imagine you're looking to do something like this (starting at 3:04)? From a game called StarForge.
Essentially, you need to simulate the basic forces of stress:
Compression - Generally simulated by calculating the amount of force being applied to an object and its "squishy-ness". When the compression gets too high you can have materials crumble, crumple or shatter.
Shear - This is a force across cross section. You can limit this to just a few pre-selected cross sections. This is the force that will cause objects to deform under stress (eventually breaking).
Tension - Essentially the opposite of compression. This is measured by calculating the amount of force pulling on an object. So having an entire structure suspended by a single cube would cause that coupling to break.
All in all, this is going to be very math heavy and will likely take a lot of optimizations to get working in a performance friendly way. Calculating stresses like this in real time is a lot easier when you're just dealing with simple cubes, but it'll still be a challenge without a good amount of engineering knowledge.