Macro HighlightDifference

From FreeCAD Documentation
Jump to: navigation, search
Other languages:
English • ‎français • ‎italiano • ‎română

HighlightDifference.png HighlightDifference

Description
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.

Macro version : 1.0
Date last modification : 2015-09-24
Author
Gaël Ecorchard
Download
None
Links
Macro Version
1.0
Date last modification
2015-09-24
FreeCAD Version(s)
None
Default shortcut
None
See also
None


Description

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.

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon_Installer.


##This code is copied instead of the original macro code

##to guide the user to the offline download page

##Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki

##or if the RAW code url is extra wiki location

import PySide

from PySide import QtGui ,QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,u"Information",
    "This macro must by downloaded with this link" + "\n"
    " " + "\n"
    "https://raw.githubusercontent.com/FreeCAD/FreeCAD-macros/master/Utility/HighlightDifference.FCMacro" + "\n"
    " " + "\n"
    "Quit this window for access in the download page" )

diag.setWindowFlags(PySide.QtCore.Qt.WindowStaysOnTopHint)

diag.setWindowModality(QtCore.Qt.ApplicationModal)

diag.exec_()

import webbrowser 

webbrowser.open("https://raw.githubusercontent.com/FreeCAD/FreeCAD-macros/master/Utility/HighlightDifference.FCMacro")
<class="rawcodeurl"><a href="https://raw.githubusercontent.com/FreeCAD/FreeCAD-macros/master/Utility/HighlightDifference.FCMacro">raw code</a>


Macro HighlightDifference 02.png

Result difference two objects created


Example


Script

The code is visible on Github: Utility/HighlightDifference.FCMacro.

Links