Difference between revisions of "Dimensions"

From Sega Retro

(I used to be good at this)
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:highest|{{Highest|{{{1|}}}|{{{2|}}}|{{{3|}}}}}}}{{
+
<includeonly>{{#vardefine:width|{{#if:{{{wi|}}}|{{#expr:{{{wi}}}*0.0254}}|{{{wm|1}}}}}}}{{
#vardefine:newwidth|{{#expr:({{{1|}}}/{{#var:highest}})*{{{diagramsize|200}}}}}}}{{
+
#vardefine:height|{{#if:{{{hi|}}}|{{#expr:{{{hi}}}*0.0254}}|{{{hm|1}}}}}}}{{
#vardefine:newheight|{{#expr:({{{2|}}}/{{#var:highest}})*{{{diagramsize|200}}}}}}}{{
+
#vardefine:depth|{{#if:{{{di|}}}|{{#expr:{{{di}}}*0.0254}}|{{{dm|1}}}}}}}{{
#vardefine:newdepth|{{#expr:(({{{3|}}}/{{#var:highest}})*{{{diagramsize|200}}})/2}}}}{{
+
#vardefine:highest|{{Highest|{{#var:height}}|{{#var:width}}|{{#var:depth}}}}}}{{
#vardefine:movex|{{#expr:{{#var:newdepth}} * cos(45)}}}}{{
+
#vardefine:newwidth|{{#expr:({{#var:width}}/{{#var:highest}})*{{{diagramsize|150}}}}}}}{{
#vardefine:movey|{{#expr:{{#var:newdepth}} * sin(45)}}}}<div style="border:1px solid #F00; max-width:{{{diagramsize|200}}}px; min-width:{{{diagramsize|200}}}px; max-height:{{{diagramsize|200}}}px; min-height:{{{diagramsize|200}}}px;">{{
+
#vardefine:newheight|{{#expr:({{#var:height}}/{{#var:highest}})*{{{diagramsize|150}}}}}}}{{
DrawLine|colour=#009|x1=0|y1={{{diagramsize|200}}}|w={{#var:newheight}}|angle=90}}{{
+
#vardefine:newdepth|{{#expr:(({{#var:depth}}/{{#var:highest}})*{{{diagramsize|150}}})*(2/3)}}}}{{
DrawLine|colour=#009|x1={{#var:newwidth}}|y1={{{diagramsize|200}}}|w={{#var:newheight}}|angle=90}}{{
+
#vardefine:movex|{{#expr:{{#var:newdepth}} * cos(45*0.0174533)}}}}{{
DrawLine|colour=#009|x1=0|y1={{{diagramsize|200}}}|w={{#var:newwidth}}}}{{
+
#vardefine:movey|{{#expr:{{#var:newdepth}} * sin(45*0.0174533)}}}}{{
DrawLine|colour=#009|x1=0|y1={{#expr:{{{diagramsize|200}}}-{{#var:newheight}}}}|w={{#var:newwidth}}}}{{
+
#vardefine:newdiagramwidth|{{#expr:{{#var:newwidth}} + {{#var:movex}}}}}}{{
 +
#vardefine:newdiagramheight|{{#expr:{{#var:newheight}} + {{#var:movey}}}}}}<div style="display: inline-block; margin:0px 80px 40px 40px; max-width:{{#var:newdiagramwidth}}px; min-width:{{#var:newdiagramwidth}}px; max-height:{{#var:newdiagramheight}}px; min-height:{{#var:newdiagramheight}}px;">{{
 +
DrawLine|colour=#000|x1=0|y1={{#var:newdiagramheight}}|w={{#var:newheight}}|angle=90}}{{
 +
DrawLine|colour=#000|x1={{#var:newwidth}}|y1={{#var:newdiagramheight}}|w={{#var:newheight}}|angle=90}}{{
 +
DrawLine|colour=#000|x1=0|y1={{#var:newdiagramheight}}|w={{#var:newwidth}}}}{{
 +
DrawLine|colour=#000|x1=0|y1={{#expr:{{#var:newdiagramheight}}-{{#var:newheight}}}}|w={{#var:newwidth}}}}{{
  
DrawLine|colour=#090|x1={{#var:movex}}|y1={{#expr:{{{diagramsize|200}}}-{{#var:movey}}}}|w={{#var:newheight}}|angle=90|dashed=yes}}{{
+
DrawLine|colour=#999|x1={{#var:movex}}|y1={{#expr:{{#var:newdiagramheight}}-{{#var:movey}}}}|w={{#var:newheight}}|angle=90|dashed=yes}}{{
DrawLine|colour=#090|x1={{#expr:{{#var:movex}} + {{#var:newwidth}}}}|y1={{#expr:{{{diagramsize|200}}}-{{#var:movey}}}}|w={{#var:newheight}}|angle=90}}{{
+
DrawLine|colour=#000|x1={{#expr:{{#var:movex}} + {{#var:newwidth}}}}|y1={{#expr:{{#var:newdiagramheight}}-{{#var:movey}}}}|w={{#var:newheight}}|angle=90}}{{
DrawLine|colour=#090|x1={{#var:movex}}|y1={{#expr:{{{diagramsize|200}}}-{{#var:movey}}}}|w={{#var:newwidth}}|dashed=yes}}{{
+
DrawLine|colour=#999|x1={{#var:movex}}|y1={{#expr:{{#var:newdiagramheight}}-{{#var:movey}}}}|w={{#var:newwidth}}|dashed=yes}}{{
DrawLine|colour=#090|x1={{#var:movex}}|y1={{#expr:{{{diagramsize|200}}}-{{#var:newheight}}-{{#var:movey}}}}|w={{#var:newwidth}}}}{{
+
DrawLine|colour=#000|x1={{#var:movex}}|y1={{#expr:{{#var:newdiagramheight}}-{{#var:newheight}}-{{#var:movey}}}}|w={{#var:newwidth}}}}{{
  
DrawLine|colour=#909|x1={{#var:newwidth}}|y1={{{diagramsize|200}}}|w={{#var:newdepth}}|angle=45}}{{
+
DrawLine|colour=#000|x1={{#var:newwidth}}|y1={{#var:newdiagramheight}}|w={{#var:newdepth}}|angle=45}}{{
DrawLine|colour=#909|x1={{#var:newwidth}}|y1={{#expr:{{{diagramsize|200}}}-{{#var:newheight}}}}|w={{#var:newdepth}}|angle=45}}{{
+
DrawLine|colour=#000|x1={{#var:newwidth}}|y1={{#expr:{{#var:newdiagramheight}}-{{#var:newheight}}}}|w={{#var:newdepth}}|angle=45}}{{
DrawLine|colour=#909|x1=0|y1={{{diagramsize|200}}}|w={{#var:newdepth}}|angle=45|dashed=yes}}{{
+
DrawLine|colour=#999|x1=0|y1={{#var:newdiagramheight}}|w={{#var:newdepth}}|angle=45|dashed=yes}}{{
DrawLine|colour=#909|x1=0|y1={{#expr:{{{diagramsize|200}}}-{{#var:newheight}}}}|w={{#var:newdepth}}|angle=45}}
+
DrawLine|colour=#000|x1=0|y1={{#expr:{{#var:newdiagramheight}}-{{#var:newheight}}}}|w={{#var:newdepth}}|angle=45}}{{
</div>
+
 
*{{{1|}}} -> {{#var:newwidth}}
+
DrawLine|colour=#999|x1=-10|y1={{#var:newdiagramheight}}|w={{#var:newheight}}|angle=90}}{{
*{{{2|}}} -> {{#var:newheight}}
+
DrawLine|colour=#999|x1=0|y1={{#expr:{{#var:newdiagramheight}} + 10}}|w={{#var:newwidth}}}}{{
*{{{3|}}} -> {{#var:newdepth}}
+
DrawLine|colour=#999|x1={{#expr:{{#var:newwidth}} + 7.07}}|y1={{#expr:{{#var:newdiagramheight}} + 7.07}}|w={{#var:newdepth}}|angle=45}}<div
 +
style="position:relative; vertical-align:top; white-space: nowrap; text-align:center; transform: translate({{#expr:{{#var:newwidth}}/3}}px,{{#var:newdiagramheight}}px); width:0; height:0; line-height:0;"><small>{{RolloverText|{{ConvertDistance|m={{#var:width}}|inchesonly=true}}|Width}}</small></div><div
 +
style="position:relative; vertical-align:top; white-space: nowrap; transform: translate(-30px,{{#expr:{{#var:newdiagramheight}}-({{#var:newheight}}/2)}}px) rotate(-90deg); text-align:center; width:0; height:0; line-height:0;"><small>{{RolloverText|{{ConvertDistance|m={{#var:height}}|inchesonly=true}}|Height}}</small></div><div
 +
style="position:relative; vertical-align:top; white-space: nowrap; transform: translate({{#expr:{{#var:newwidth}}+({{#var:newdepth}}/2)}}px,{{#expr:{{#var:newdiagramheight}}-({{#var:newdepth}}/2)}}px); text-align:left; width:0; height:0; line-height:0;"><small>{{RolloverText|{{ConvertDistance|m={{#var:depth}}|inchesonly=true}}|Depth}}</small></div><div style="position:relative; vertical-align:top;  transform:translate({{#expr:{{#var:newdiagramwidth}}+30}}px,-20px); white-space: nowrap; width:0; height:0; line-height:0;" >{{{ref|}}}</div></div>
 
</includeonly>
 
</includeonly>
 
<noinclude>
 
<noinclude>
{{Dimensions|20|30|60}}
+
Template for visualising dimensions. Units can be supplied in either metric (m) or imperial (i).
{{Dimensions|60|30|20}}
+
 
{{Dimensions|20|60|30}}
+
==Examples==
[[Category:Sega Retro templates]]
+
<pre>{{Dimensions|wm=20|hm=30|dm=60}}</pre>
 +
{{Dimensions|wm=20|hm=30|dm=60}}
 +
<pre>{{Dimensions|wm=60|hm=30|dm=20|diagramsize=300}}</pre>
 +
{{Dimensions|wm=60|hm=30|dm=20|diagramsize=300}}
 +
<pre>{{Dimensions|wi=20|hi=60|di=30|ref={{ref|http://www.google.com}}}}</pre>
 +
{{Dimensions|wi=20|hi=60|di=30|ref={{ref|http://www.google.com}}}}
 +
[[Category:Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 13:07, 1 January 2022


Template for visualising dimensions. Units can be supplied in either metric (m) or imperial (i).

Examples

{{Dimensions|wm=20|hm=30|dm=60}}
20 m (787.4")
30 m (1181.1")
60 m (2362.2")


{{Dimensions|wm=60|hm=30|dm=20|diagramsize=300}}
60 m (2362.2")
30 m (1181.1")
20 m (787.4")


{{Dimensions|wi=20|hi=60|di=30|ref={{ref|http://www.google.com}}}}
508 mm (20")
1.524 m (60")
762 mm (30")