0

I want to solve the below code to create an origami pattern

Manipulate [{
   {V},
   {H},
   {L},
   {S},
   {a},
   {b},
   {c},
   {d},
   {e},
   {f},
   {g},
   {h},
   {i},
   {k}
  } := {
   {Sqrt[1 + \[Micro]]},
   {Sqrt[\[Micro]]/v},
   {1/v},
   {Sqrt[1 - \[Micro]]},
   {S  k},
   {-L},
   {H},
   {S - V  H},
   {L},
   {S  L - V},
   {-S  k},
   {-S - V  H},
   {-S  L - V},
   {-L - V}
  }; Graphics3D@
   Polygon@{{
       {a, b, c, d},
       {d, c, e, f},
       {g, b, c, h},
       {c, h, i, e}
      } }[[All, All, 1]] /. Null -> 0, {\[Micro], 0, 1}]

This is the code that I want to run.

The link for the result is here

This is the result that I getMy result is an empty box

Please help me out with your expertise people.

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
  • 6
    Please link to (or show) the code in a form where we can copy/paste it. – bill s Aug 17 '19 at 04:15
  • Welcome to mma.SE, @genie_prabhu! You might find this useful: https://mathematica.stackexchange.com/q/18393/63039 and, I’m not confident, but I am quite sure your syntax is not accurate. Firstly, you want to define a list, as opposed to what is honestly quite a neat way of avant-garde-style input (what made you try this?), because that style of input will not work. Secondly, are your V’s all uppercase as you have them defined? It looks like the denominator in some are lowercase v to me is why I ask. See how they’re blue? Correct this, put it into a Solve, then ReplaceAll with the solution! – CA Trevillian Aug 17 '19 at 07:10
  • 1
    Thank you for your reply. I have posted the code in the required format. I saw the code in a [Mathematica one-liner competition] (https://blog.wolfram.com/2010/12/17/the-mathematica-one-liner-competition/) and wanted to try it out. The V is in smaller case as you mentioned, I tried changing it to upper case and used ReplaceAll but the result is still an empty box – genie_prabhu Aug 17 '19 at 16:39
  • @genie_prabhu name the two sets, lhs:=rhs then use solve to find the solution, name this sol, then use ReplaceAll on that to apply it to the set, then wrap that in the manipulate :) – CA Trevillian Aug 17 '19 at 22:04

1 Answers1

5

Your code is written in a style that makes it difficult to understand, but one thing is obvious: v must be given a value before any graphics can be displayed. Taking this into account and rewriting the code into something much simpler that I believe might be equivalent or close to equivalent to what you are trying get, I offer

Manipulate[
  {V, H, L, S} = {Sqrt[1 + μ], Sqrt[μ]/v, 1/v, Sqrt[1 - μ]};
  k = -L - V;
  {a, b, c, d, e, f, g, h, i} = {S k, -L, H, S - V H, L, S L - V, -S k, -S - V H, -S L - V};
  Graphics3D[Polygon[{{a, b, c}, {d, c, e}, {g, b, c}, {c, h, i}}],
    Boxed -> False],
  {μ, .01, 1, Appearance -> "Labeled"},
  {v, .01, 1, Appearance -> "Labeled"}]

demo

This produces a graphics object that looks like a folded 2D polygon, so even if this doesn't completely answer to your question, it may help you to move you in the right direction.

m_goldberg
  • 107,779
  • 16
  • 103
  • 257