<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.povray.org/content?action=history&amp;feed=atom&amp;title=User%3AWfpokorny%2FDensityFile%2Fdf3XYZsizeBashExample</id>
	<title>User:Wfpokorny/DensityFile/df3XYZsizeBashExample - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.povray.org/content?action=history&amp;feed=atom&amp;title=User%3AWfpokorny%2FDensityFile%2Fdf3XYZsizeBashExample"/>
	<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=User:Wfpokorny/DensityFile/df3XYZsizeBashExample&amp;action=history"/>
	<updated>2026-10-09T15:35:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.povray.org/content?title=User:Wfpokorny/DensityFile/df3XYZsizeBashExample&amp;diff=8660&amp;oldid=prev</id>
		<title>Wfpokorny: Initial bash example for df3 x,y,z size page</title>
		<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=User:Wfpokorny/DensityFile/df3XYZsizeBashExample&amp;diff=8660&amp;oldid=prev"/>
		<updated>2016-08-18T16:35:12Z</updated>

		<summary type="html">&lt;p&gt;Initial bash example for df3 x,y,z size page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;p&amp;gt;The following bash script will run on many operating systems. Place the lines between the two &amp;quot;cut here&amp;quot; lines into a file called df3xyzsize.sh and save it.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Run it, for example, with the command:&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash df3xyzsize.sh spiral.df3&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which should output the lines: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
50&lt;br /&gt;
50&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;assuming the spiral.df3 is that shipped with POV-Ray.&amp;lt;/p&amp;gt;   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
----------------------------------------------- cut here ------------------------------------------&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#----------------------------------------------&lt;br /&gt;
# Convert the first 6 bytes of df3 file to a hex string which is &lt;br /&gt;
# then cut into three parts corresponding to the three unsigned, two  &lt;br /&gt;
# byte integers. Each of these four character hex strings is then&lt;br /&gt;
# converted to an integer value and returned in x, y, z order. &lt;br /&gt;
#----------------------------------------------&lt;br /&gt;
&lt;br /&gt;
  echo $((16#`head -c 6 $1 | xxd -p | head -c 4`))&lt;br /&gt;
  echo $((16#`head -c 6 $1 | xxd -p | tail -c 9 | head -c 4`))&lt;br /&gt;
  echo $((16#`head -c 6 $1 | xxd -p | tail -c 5 | head -c 4`))&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
----------------------------------------------- cut here ------------------------------------------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wfpokorny</name></author>
	</entry>
</feed>