<?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=Reference%3ADifference</id>
	<title>Reference:Difference - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.povray.org/content?action=history&amp;feed=atom&amp;title=Reference%3ADifference"/>
	<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Difference&amp;action=history"/>
	<updated>2026-04-06T18:24:32Z</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=Reference:Difference&amp;diff=6834&amp;oldid=prev</id>
		<title>Jholsenback: 1 revision: Reference Migration Initial Load</title>
		<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Difference&amp;diff=6834&amp;oldid=prev"/>
		<updated>2012-03-15T19:06:04Z</updated>

		<summary type="html">&lt;p&gt;1 revision: Reference Migration Initial Load&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:06, 15 March 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Jholsenback</name></author>
	</entry>
	<entry>
		<id>https://wiki.povray.org/content?title=Reference:Difference&amp;diff=6833&amp;oldid=prev</id>
		<title>Jholsenback: 1 revision: Initial Load (TF)</title>
		<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Difference&amp;diff=6833&amp;oldid=prev"/>
		<updated>2012-03-11T22:27:10Z</updated>

		<summary type="html">&lt;p&gt;1 revision: Initial Load (TF)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Objects]]&lt;br /&gt;
[[Category:Constructive Solid Geometry]]&lt;br /&gt;
{{#indexentry:CSG, difference}}&lt;br /&gt;
{{#indexentry:difference, keyword}}&lt;br /&gt;
{{#indexentry:keyword, difference}}&lt;br /&gt;
&amp;lt;p&amp;gt;The CSG &amp;lt;code&amp;gt;difference&amp;lt;/code&amp;gt; operation takes the intersection between&lt;br /&gt;
the first object and the inverse of all subsequent objects. Thus only points&lt;br /&gt;
inside object &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; and outside object &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; belong to the&lt;br /&gt;
difference of both objects.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The result is a subtraction of the 2nd shape from the first shape as shown&lt;br /&gt;
in the figure below.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;centered&amp;quot; width=&amp;quot;660x&amp;quot; cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;10&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;&lt;br /&gt;
    [[Image:RefImgDiffobj.gif|center|640px&amp;lt;!--center---&amp;gt;]]&lt;br /&gt;
  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;&lt;br /&gt;
    &amp;lt;p class=&amp;quot;caption&amp;quot;&amp;gt;The difference between two objects.&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The syntax is:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DIFFERENCE:&lt;br /&gt;
  difference {&lt;br /&gt;
    SOLID_OBJECTS...&lt;br /&gt;
    [OBJECT_MODIFIERS...]&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The component objects must have well defined inside/outside properties.&lt;br /&gt;
Patch objects are not allowed. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p class=&amp;quot;Note&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; If the first object is entirely inside the subtracted objects, the difference object disappears.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Here is an example of a properly formed difference:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
difference {&lt;br /&gt;
  box { &amp;amp;lt;-1.5, -1, -1&amp;amp;gt;, &amp;amp;lt;0.5, 1, 1&amp;amp;gt; }&lt;br /&gt;
  cylinder { &amp;amp;lt;0.5, 0, -1&amp;amp;gt;, &amp;amp;lt;0.5, 0, 1&amp;amp;gt;, 1 }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;Note&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; Internally, POV-Ray simply adds the &amp;lt;code&amp;gt;inverse&amp;lt;/code&amp;gt; keyword&lt;br /&gt;
to the second (and subsequent) objects and then performs an intersection.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; The&lt;br /&gt;
example above is equivalent to:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
intersection {&lt;br /&gt;
  box { &amp;amp;lt;-1.5, -1, -1&amp;amp;gt;, &amp;amp;lt;0.5, 1, 1&amp;amp;gt; }&lt;br /&gt;
  cylinder { &amp;amp;lt;0.5, 0, -1&amp;amp;gt;, &amp;amp;lt;0.5, 0, 1&amp;amp;gt;, 1 inverse }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jholsenback</name></author>
	</entry>
</feed>