FreeCAD-Doc/localwiki/Macro_HighlightDifference.html
2018-07-08 12:11:49 -05:00

111 lines
6.4 KiB
HTML

<html><head><title>Macro HighlightDifference</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type='text/css' href='wiki.css' rel='stylesheet'></head><body><h1>Macro HighlightDifference</h1></div>
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-parser-output"><table class="fcinfobox wikitable ct" width="100%" style="float: right; width: 230px; margin-left: 10px;">
<tr>
<td class="ctTitle">
<h3><span class="mw-headline" id="HightlightDifference"><a href="https://www.freecadweb.org/wiki/index.php?title=File:HighlightDifference.png" class="image"><img alt="HighlightDifference.png" src="HighlightDifference.png" width="32" height="32" /></a> HightlightDifference</span></h3>
</td></tr>
<tr>
<th class="ctOdd">Description
</th></tr>
<tr>
<td class="ctEven left macro-description">Compute the difference between two shapes
</td></tr>
<tr>
<th class="ctOdd">Author
</th></tr>
<tr>
<td class="ctEven macro-author"><a href="https://www.freecadweb.org/wiki/index.php?title=User:Ga%C3%ABl_Ecorchard&amp;action=edit&amp;redlink=1" class="new" title="User:Gaël Ecorchard (page does not exist)">Gaël Ecorchard</a>
</td></tr>
<tr>
<th class="ctOdd">Links
</th></tr>
<tr>
<td class="ctEven"><a href="Macros_recipes.html" title="Macros recipes">Macros recipes</a><br /><a href="How_to_install_macros.html" title="How to install macros">How to install macros</a><br /><a href="Customize_Toolbars.html" title="Customize Toolbars">How to customize toolbars</a>
</td></tr>
<tr>
<th class="ctOdd">Version
</th></tr>
<tr>
<td class="ctEven macro-version">1.0
</td></tr>
<tr>
<th class="ctOdd">Date last modification
</th></tr>
<tr>
<td class="ctEven macro-date">2015-09-24
</td></tr>
<tr>
<th class="ctOdd">
</th></tr>
<tr>
<td class="ctToc"><br /><div id="toc" class="toc"><div class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1"><a href="#HightlightDifference"><span class="tocnumber">1</span> <span class="toctext">HightlightDifference</span></a></li>
<li class="toclevel-1 tocsection-1"><a href="#Description"><span class="tocnumber">2</span> <span class="toctext">Description</span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#Example"><span class="tocnumber">3</span> <span class="toctext">Example</span></a></li>
<li class="toclevel-1 tocsection-3"><a href="#Script"><span class="tocnumber">4</span> <span class="toctext">Script</span></a></li>
<li class="toclevel-1 tocsection-4"><a href="#Links"><span class="tocnumber">5</span> <span class="toctext">Links</span></a></li>
</ul>
</div>
</td></tr>
</table>
<p><br />
</p>
<h2><span class="mw-headline" id="Description">Description</span></h2>
<p>Compute the difference between two shapes. Additions are marked red, removals are marked green. Both original parts will be half transparent. The volume of the additions and removals are printed in the console.
</p><p><a href="https://www.freecadweb.org/wiki/index.php?title=File:Macro_HighlightDifference_02.png" class="image" title="Result difference twoo objects created"><img alt="Result difference twoo objects created" src="400px-Macro_HighlightDifference_02.png" width="400" height="300" srcset="/wiki/images/thumb/6/65/Macro_HighlightDifference_02.png/600px-Macro_HighlightDifference_02.png 1.5x, /wiki/images/6/65/Macro_HighlightDifference_02.png 2x" /></a>
</p>
<h2><span class="mw-headline" id="Example">Example</span></h2>
<center>
<ul class="gallery mw-gallery-traditional">
<li class="gallerybox" style="width: 235px"><div style="width: 235px">
<div class="thumb" style="width: 230px;"><div style="margin:50px auto;"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Macro_HighlightDifference_00.png" class="image"><img alt="" src="200px-Macro_HighlightDifference_00.png" width="200" height="150" srcset="/wiki/images/thumb/5/5f/Macro_HighlightDifference_00.png/300px-Macro_HighlightDifference_00.png 1.5x, /wiki/images/thumb/5/5f/Macro_HighlightDifference_00.png/400px-Macro_HighlightDifference_00.png 2x" /></a></div></div>
<div class="gallerytext">
<p>Original objects
</p>
</div>
</div></li>
<li class="gallerybox" style="width: 235px"><div style="width: 235px">
<div class="thumb" style="width: 230px;"><div style="margin:50px auto;"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Macro_HighlightDifference_02.png" class="image"><img alt="" src="200px-Macro_HighlightDifference_02.png" width="200" height="150" srcset="/wiki/images/thumb/6/65/Macro_HighlightDifference_02.png/300px-Macro_HighlightDifference_02.png 1.5x, 400px-Macro_HighlightDifference_02.png 2x" /></a></div></div>
<div class="gallerytext">
<p>The resulting objects are coloured red and green (here offset)
</p>
</div>
</div></li>
<li class="gallerybox" style="width: 235px"><div style="width: 235px">
<div class="thumb" style="width: 230px;"><div style="margin:50px auto;"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Macro_HighlightDifference_01.png" class="image"><img alt="" src="200px-Macro_HighlightDifference_01.png" width="200" height="150" srcset="/wiki/images/thumb/d/dd/Macro_HighlightDifference_01.png/300px-Macro_HighlightDifference_01.png 1.5x, /wiki/images/thumb/d/dd/Macro_HighlightDifference_01.png/400px-Macro_HighlightDifference_01.png 2x" /></a></div></div>
<div class="gallerytext">
<p>The original objects are transparent 80% and not modify
</p>
</div>
</div></li>
</ul>
</center>
<div style="clear:both"></div>
<p><br />
</p>
<h2><span class="mw-headline" id="Script">Script</span></h2>
<p>The code is visible on Github: <a rel="nofollow" class="external text" href="https://github.com/FreeCAD/FreeCAD-macros/blob/master/Utility/HighlightDifference.FCMacro">Utility/HighlightDifference.FCMacro</a>.
</p>
<h2><span class="mw-headline" id="Links">Links</span></h2>
<ul><li> See for the complementary macro <a href="Macro_HighlightCommon.html" title="Macro HighlightCommon">Macro_HighlightCommon</a></li>
<li> The discussion on forum <a rel="nofollow" class="external text" href="http://forum.freecadweb.org/viewtopic.php?f=22&amp;t=12426">"collision detection", overlapping</a></li></ul>
<p><br />
</p>
</div>
</div>
</div><div class="printfooter">
Online version: "<a dir="ltr" href="https://www.freecadweb.org/wiki/index.php?title=Macro_HighlightDifference&amp;oldid=241016">http://www.freecadweb.org/wiki/index.php?title=Macro_HighlightDifference&amp;oldid=241016</a>"</div>
<div id="catlinks" class="catlinks" data-mw="interface"></div><div class="visualClear"></div>
</div>
</div>
<div id="mw-navigation">
<h2>Navigation menu</h2>
</body></html>