1
$\begingroup$

Basing on this code:

box1 = GeometricTransformation[Cuboid[{0, 0, 0}], ShearingMatrix[Pi/4, {1, 0, 0}, {-1, 1, 0}]]
box2 = GeometricTransformation[Cuboid[{1, 1, 0}], ShearingMatrix[-Pi/4, {1, 0, 0}, {-1, 1, 0}]]
Graphics3D@{box1, box2}

I would like to create a 3D figure (two joined cuboids) with adjustable bend angle and dimensions of cuboids {a,b,c} (Manipulate)

$\endgroup$
  • $\begingroup$ And what problems did you find? $\endgroup$ – Dr. belisarius Sep 30 '15 at 19:22
  • $\begingroup$ 1) unable to set the adjustable {a,b,c} dimensions for both cuboids simulatneously 2) cuboids do not maintain "stuck" under the chang of bend angle $\endgroup$ – ATomek Sep 30 '15 at 20:13
3
$\begingroup$
{gt, sc, sh, re} = {GeometricTransformation, ScalingTransform, 
                    ShearingTransform, ReflectionTransform}; 
{x, y} = {{1, 0, 0}, {0, 1, 0}}; 

Manipulate[ t = gt[gt[Cuboid[{0, 0, 0}], sc[{a, b, c}]], sh[p, x, y]]; 
            Graphics3D[{t, gt[t, re[y]]}, Axes -> True],
 {a, 1, 2}, {b, 1, 2}, {c, 1, 2}, {p, 0, Pi}]

Mathematica graphics

$\endgroup$
  • $\begingroup$ How would it look like if such parametrization for Cuboid was introduced: Cuboid[{0, 0, 0}], {Abs[-1/Sqrt[6] +a], Abs[-1/Sqrt[6] + a], Sqrt[2/3]}] $\endgroup$ – ATomek Sep 30 '15 at 21:17
1
$\begingroup$
Manipulate[
 box1 = GeometricTransformation[Cuboid[{0, 0, 0}],
                                ShearingMatrix[ θ, {1, 0, 0}, {-1, 1, 0}]];
 box2 = GeometricTransformation[Cuboid[{1, 1, 0}], 
                                ShearingMatrix[-θ, {1, 0, 0}, {-1, 1, 0}]];
 Graphics3D@{box1, box2},
 {{θ, 0}, -π/4, π/4}]

Mathematica graphics

$\endgroup$
  • $\begingroup$ I am looking for constant operation that will not separate the cuboids when changing the bend angle. $\endgroup$ – ATomek Sep 30 '15 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.