flatcam/doc/build/flatcamobj.html
2014-04-05 00:40:10 -04:00

451 lines
19 KiB
HTML

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FlatCAM Objects &mdash; Cirkuix 0.5 documentation</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.5',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
<link rel="top" title="Cirkuix 0.5 documentation" href="index.html"/>
<link rel="next" title="FlatCAM Application" href="app.html"/>
<link rel="prev" title="Camlib" href="camlib.html"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> Cirkuix</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="camlib.html">Camlib</a><ul>
<li class="toctree-l2"><a class="reference internal" href="camlib.html#geometry">Geometry</a></li>
<li class="toctree-l2"><a class="reference internal" href="camlib.html#gerber">Gerber</a></li>
<li class="toctree-l2"><a class="reference internal" href="camlib.html#aperturemacro">ApertureMacro</a></li>
<li class="toctree-l2"><a class="reference internal" href="camlib.html#excellon">Excellon</a></li>
<li class="toctree-l2"><a class="reference internal" href="camlib.html#cncjob">CNCJob</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="">FlatCAM Objects</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#flatcamobj">FlatCAMObj</a></li>
<li class="toctree-l2"><a class="reference internal" href="#flatcamgerber">FlatCAMGerber</a></li>
<li class="toctree-l2"><a class="reference internal" href="#flatcamexcellon">FlatCAMExcellon</a></li>
<li class="toctree-l2"><a class="reference internal" href="#flatcamcncjob">FlatCAMCNCjob</a></li>
<li class="toctree-l2"><a class="reference internal" href="#flatcamgeometry">FlatCAMGeometry</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="app.html">FlatCAM Application</a><ul>
<li class="toctree-l2"><a class="reference internal" href="app.html#app">App</a></li>
<li class="toctree-l2"><a class="reference internal" href="app.html#plotcanvas">PlotCanvas</a></li>
<li class="toctree-l2"><a class="reference internal" href="app.html#objectcollection">ObjectCollection</a></li>
<li class="toctree-l2"><a class="reference internal" href="app.html#measurement">Measurement</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="devman.html">FlatCAM Developer Manual</a><ul>
<li class="toctree-l2"><a class="reference internal" href="devman.html#options">Options</a></li>
<li class="toctree-l2"><a class="reference internal" href="devman.html#serialization">Serialization</a></li>
<li class="toctree-l2"><a class="reference internal" href="devman.html#geometry-processing">Geometry Processing</a></li>
</ul>
</li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="icon icon-reorder"></i>
<a href="index.html">Cirkuix</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>FlatCAM Objects</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/flatcamobj.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section" id="module-FlatCAM">
<span id="flatcam-objects"></span><h1>FlatCAM Objects<a class="headerlink" href="#module-FlatCAM" title="Permalink to this headline"></a></h1>
<div class="section" id="flatcamobj">
<h2>FlatCAMObj<a class="headerlink" href="#flatcamobj" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="FlatCAM.FlatCAMObj">
<em class="property">class </em><tt class="descclassname">FlatCAM.</tt><tt class="descname">FlatCAMObj</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj" title="Permalink to this definition"></a></dt>
<dd><p>Base type of objects handled in FlatCAM. These become interactive
in the GUI, can be plotted, and their options can be modified
by the user in their respective forms.</p>
<dl class="method">
<dt id="FlatCAM.FlatCAMObj.build_ui">
<tt class="descname">build_ui</tt><big>(</big><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.build_ui" title="Permalink to this definition"></a></dt>
<dd><p>Sets up the UI/form for this object.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="FlatCAM.FlatCAMObj.deserialize">
<tt class="descname">deserialize</tt><big>(</big><em>obj_dict</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.deserialize" title="Permalink to this definition"></a></dt>
<dd><p>Re-builds an object from its serialized version.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>obj_dict</strong> (<em>dict</em>) &#8211; Dictionary representing a FlatCAMObj</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="FlatCAM.FlatCAMObj.plot">
<tt class="descname">plot</tt><big>(</big><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.plot" title="Permalink to this definition"></a></dt>
<dd><p>Plot this object (Extend this method to implement the actual plotting).
Axes get created, appended to canvas and cleared before plotting.
Call this in descendants before doing the plotting.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Whether to continue plotting or not depending on the &#8220;plot&#8221; option.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="FlatCAM.FlatCAMObj.read_form">
<tt class="descname">read_form</tt><big>(</big><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.read_form" title="Permalink to this definition"></a></dt>
<dd><p>Reads form into <tt class="docutils literal"><span class="pre">self.options</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="FlatCAM.FlatCAMObj.read_form_item">
<tt class="descname">read_form_item</tt><big>(</big><em>option</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.read_form_item" title="Permalink to this definition"></a></dt>
<dd><p>Reads the specified option from the UI form into <tt class="docutils literal"><span class="pre">self.options</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>option</strong> (<em>str</em>) &#8211; Name of the option.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="FlatCAM.FlatCAMObj.serialize">
<tt class="descname">serialize</tt><big>(</big><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.serialize" title="Permalink to this definition"></a></dt>
<dd><p>Returns a representation of the object as a dictionary so
it can be later exported as JSON. Override this method.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Dictionary representing the object</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="FlatCAM.FlatCAMObj.set_form_item">
<tt class="descname">set_form_item</tt><big>(</big><em>option</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.set_form_item" title="Permalink to this definition"></a></dt>
<dd><p>Copies the specified option to the UI form.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>option</strong> (<em>str</em>) &#8211; Name of the option (Key in <tt class="docutils literal"><span class="pre">self.options</span></tt>).</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="FlatCAM.FlatCAMObj.setup_axes">
<tt class="descname">setup_axes</tt><big>(</big><em>figure</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.setup_axes" title="Permalink to this definition"></a></dt>
<dd><p>1) Creates axes if they don&#8217;t exist. 2) Clears axes. 3) Attaches
them to figure if not part of the figure. 4) Sets transparent
background. 5) Sets 1:1 scale aspect ratio.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>figure</strong> (<em>matplotlib.figure.Figure</em>) &#8211; A Matplotlib.Figure on which to add/configure axes.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="FlatCAM.FlatCAMObj.to_form">
<tt class="descname">to_form</tt><big>(</big><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.to_form" title="Permalink to this definition"></a></dt>
<dd><p>Copies options to the UI form.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="flatcamgerber">
<h2>FlatCAMGerber<a class="headerlink" href="#flatcamgerber" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="FlatCAM.FlatCAMGerber">
<em class="property">class </em><tt class="descclassname">FlatCAM.</tt><tt class="descname">FlatCAMGerber</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMGerber" title="Permalink to this definition"></a></dt>
<dd><p>Represents Gerber code.</p>
<dl class="method">
<dt id="FlatCAM.FlatCAMGerber.convert_units">
<tt class="descname">convert_units</tt><big>(</big><em>units</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMGerber.convert_units" title="Permalink to this definition"></a></dt>
<dd><p>Converts the units of the object by scaling dimensions in all geometry
and options.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>units</strong> (<em>str</em>) &#8211; Units to which to convert the object: &#8220;IN&#8221; or &#8220;MM&#8221;.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="flatcamexcellon">
<h2>FlatCAMExcellon<a class="headerlink" href="#flatcamexcellon" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="FlatCAM.FlatCAMExcellon">
<em class="property">class </em><tt class="descclassname">FlatCAM.</tt><tt class="descname">FlatCAMExcellon</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMExcellon" title="Permalink to this definition"></a></dt>
<dd><p>Represents Excellon/Drill code.</p>
</dd></dl>
</div>
<div class="section" id="flatcamcncjob">
<h2>FlatCAMCNCjob<a class="headerlink" href="#flatcamcncjob" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="FlatCAM.FlatCAMCNCjob">
<em class="property">class </em><tt class="descclassname">FlatCAM.</tt><tt class="descname">FlatCAMCNCjob</tt><big>(</big><em>name</em>, <em>units='in'</em>, <em>kind='generic'</em>, <em>z_move=0.1</em>, <em>feedrate=3.0</em>, <em>z_cut=-0.002</em>, <em>tooldia=0.0</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMCNCjob" title="Permalink to this definition"></a></dt>
<dd><p>Represents G-Code.</p>
</dd></dl>
</div>
<div class="section" id="flatcamgeometry">
<h2>FlatCAMGeometry<a class="headerlink" href="#flatcamgeometry" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="FlatCAM.FlatCAMGeometry">
<em class="property">class </em><tt class="descclassname">FlatCAM.</tt><tt class="descname">FlatCAMGeometry</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMGeometry" title="Permalink to this definition"></a></dt>
<dd><p>Geometric object not associated with a specific
format.</p>
<dl class="method">
<dt id="FlatCAM.FlatCAMGeometry.offset">
<tt class="descname">offset</tt><big>(</big><em>vect</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMGeometry.offset" title="Permalink to this definition"></a></dt>
<dd><p>Offsets all geometry by a given vector/</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>vect</strong> (<em>tuple</em>) &#8211; (x, y) vector by which to offset the object&#8217;s geometry.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="FlatCAM.FlatCAMGeometry.plot">
<tt class="descname">plot</tt><big>(</big><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMGeometry.plot" title="Permalink to this definition"></a></dt>
<dd><p>Plots the object into its axes. If None, of if the axes
are not part of the app&#8217;s figure, it fetches new ones.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="FlatCAM.FlatCAMGeometry.scale">
<tt class="descname">scale</tt><big>(</big><em>factor</em><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMGeometry.scale" title="Permalink to this definition"></a></dt>
<dd><p>Scales all geometry by a given factor.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>factor</strong> (<em>float</em>) &#8211; Factor by which to scale the object&#8217;s geometry/</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="app.html" class="btn btn-neutral float-right" title="FlatCAM Application"/>Next <span class="icon icon-circle-arrow-right"></span></a>
<a href="camlib.html" class="btn btn-neutral" title="Camlib"><span class="icon icon-circle-arrow-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2014, Juan Pablo Caram.
</p>
</div>
<a href="https://github.com/snide/sphinx_rtd_theme">Sphinx theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>
</footer>
</div>
</div>
</section>
</div>
</body>
</html>