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$
2
  • $\begingroup$ And what problems did you find? $\endgroup$ Commented Sep 30, 2015 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
    Commented Sep 30, 2015 at 20:13

2 Answers 2

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$
1
  • $\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
    Commented Sep 30, 2015 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$
1
  • $\begingroup$ I am looking for constant operation that will not separate the cuboids when changing the bend angle. $\endgroup$
    – ATomek
    Commented Sep 30, 2015 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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