flatcamobj.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <!DOCTYPE html>
  2. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  3. <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>FlatCAM Objects &mdash; Cirkuix 0.5 documentation</title>
  8. <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT:'./',
  12. VERSION:'0.5',
  13. COLLAPSE_INDEX:false,
  14. FILE_SUFFIX:'.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="_static/jquery.js"></script>
  19. <script type="text/javascript" src="_static/underscore.js"></script>
  20. <script type="text/javascript" src="_static/doctools.js"></script>
  21. <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  22. <script type="text/javascript" src="_static/js/theme.js"></script>
  23. <script type="text/javascript">
  24. jQuery(function () {
  25. SphinxRtdTheme.StickyNav.enable();
  26. });
  27. </script>
  28. <link rel="top" title="Cirkuix 0.5 documentation" href="index.html"/>
  29. <link rel="next" title="FlatCAM Application" href="app.html"/>
  30. <link rel="prev" title="Camlib" href="camlib.html"/>
  31. <script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script>
  32. </head>
  33. <body class="wy-body-for-nav" role="document">
  34. <div class="wy-grid-for-nav">
  35. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  36. <div class="wy-side-nav-search">
  37. <a href="index.html" class="icon icon-home"> Cirkuix</a>
  38. <div role="search">
  39. <form id ="rtd-search-form" class="wy-form" action="search.html" method="get">
  40. <input type="text" name="q" placeholder="Search docs" />
  41. <input type="hidden" name="check_keywords" value="yes" />
  42. <input type="hidden" name="area" value="default" />
  43. </form>
  44. </div>
  45. </div>
  46. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  47. <ul class="current">
  48. <li class="toctree-l1"><a class="reference internal" href="camlib.html">Camlib</a><ul>
  49. <li class="toctree-l2"><a class="reference internal" href="camlib.html#geometry">Geometry</a></li>
  50. <li class="toctree-l2"><a class="reference internal" href="camlib.html#gerber">Gerber</a></li>
  51. <li class="toctree-l2"><a class="reference internal" href="camlib.html#aperturemacro">ApertureMacro</a></li>
  52. <li class="toctree-l2"><a class="reference internal" href="camlib.html#excellon">Excellon</a></li>
  53. <li class="toctree-l2"><a class="reference internal" href="camlib.html#cncjob">CNCJob</a></li>
  54. </ul>
  55. </li>
  56. <li class="toctree-l1 current"><a class="current reference internal" href="">FlatCAM Objects</a><ul>
  57. <li class="toctree-l2"><a class="reference internal" href="#flatcamobj">FlatCAMObj</a></li>
  58. <li class="toctree-l2"><a class="reference internal" href="#flatcamgerber">FlatCAMGerber</a></li>
  59. <li class="toctree-l2"><a class="reference internal" href="#flatcamexcellon">FlatCAMExcellon</a></li>
  60. <li class="toctree-l2"><a class="reference internal" href="#flatcamcncjob">FlatCAMCNCjob</a></li>
  61. <li class="toctree-l2"><a class="reference internal" href="#flatcamgeometry">FlatCAMGeometry</a></li>
  62. </ul>
  63. </li>
  64. <li class="toctree-l1"><a class="reference internal" href="app.html">FlatCAM Application</a><ul>
  65. <li class="toctree-l2"><a class="reference internal" href="app.html#app">App</a></li>
  66. <li class="toctree-l2"><a class="reference internal" href="app.html#plotcanvas">PlotCanvas</a></li>
  67. <li class="toctree-l2"><a class="reference internal" href="app.html#objectcollection">ObjectCollection</a></li>
  68. <li class="toctree-l2"><a class="reference internal" href="app.html#measurement">Measurement</a></li>
  69. </ul>
  70. </li>
  71. <li class="toctree-l1"><a class="reference internal" href="devman.html">FlatCAM Developer Manual</a><ul>
  72. <li class="toctree-l2"><a class="reference internal" href="devman.html#options">Options</a></li>
  73. <li class="toctree-l2"><a class="reference internal" href="devman.html#serialization">Serialization</a></li>
  74. <li class="toctree-l2"><a class="reference internal" href="devman.html#geometry-processing">Geometry Processing</a></li>
  75. </ul>
  76. </li>
  77. </ul>
  78. </div>
  79. &nbsp;
  80. </nav>
  81. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  82. <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
  83. <i data-toggle="wy-nav-top" class="icon icon-reorder"></i>
  84. <a href="index.html">Cirkuix</a>
  85. </nav>
  86. <div class="wy-nav-content">
  87. <div class="rst-content">
  88. <div role="navigation" aria-label="breadcrumbs navigation">
  89. <ul class="wy-breadcrumbs">
  90. <li><a href="index.html">Docs</a> &raquo;</li>
  91. <li>FlatCAM Objects</li>
  92. <li class="wy-breadcrumbs-aside">
  93. <a href="_sources/flatcamobj.txt" rel="nofollow"> View page source</a>
  94. </li>
  95. </ul>
  96. <hr/>
  97. </div>
  98. <div role="main">
  99. <div class="section" id="module-FlatCAM">
  100. <span id="flatcam-objects"></span><h1>FlatCAM Objects<a class="headerlink" href="#module-FlatCAM" title="Permalink to this headline">¶</a></h1>
  101. <div class="section" id="flatcamobj">
  102. <h2>FlatCAMObj<a class="headerlink" href="#flatcamobj" title="Permalink to this headline">¶</a></h2>
  103. <dl class="class">
  104. <dt id="FlatCAM.FlatCAMObj">
  105. <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>
  106. <dd><p>Base type of objects handled in FlatCAM. These become interactive
  107. in the GUI, can be plotted, and their options can be modified
  108. by the user in their respective forms.</p>
  109. <dl class="method">
  110. <dt id="FlatCAM.FlatCAMObj.build_ui">
  111. <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>
  112. <dd><p>Sets up the UI/form for this object.</p>
  113. <table class="docutils field-list" frame="void" rules="none">
  114. <col class="field-name" />
  115. <col class="field-body" />
  116. <tbody valign="top">
  117. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">None</td>
  118. </tr>
  119. <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">None</td>
  120. </tr>
  121. </tbody>
  122. </table>
  123. </dd></dl>
  124. <dl class="method">
  125. <dt id="FlatCAM.FlatCAMObj.deserialize">
  126. <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>
  127. <dd><p>Re-builds an object from its serialized version.</p>
  128. <table class="docutils field-list" frame="void" rules="none">
  129. <col class="field-name" />
  130. <col class="field-body" />
  131. <tbody valign="top">
  132. <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>
  133. </tr>
  134. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
  135. </tr>
  136. </tbody>
  137. </table>
  138. </dd></dl>
  139. <dl class="method">
  140. <dt id="FlatCAM.FlatCAMObj.plot">
  141. <tt class="descname">plot</tt><big>(</big><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.plot" title="Permalink to this definition">¶</a></dt>
  142. <dd><p>Plot this object (Extend this method to implement the actual plotting).
  143. Axes get created, appended to canvas and cleared before plotting.
  144. Call this in descendants before doing the plotting.</p>
  145. <table class="docutils field-list" frame="void" rules="none">
  146. <col class="field-name" />
  147. <col class="field-body" />
  148. <tbody valign="top">
  149. <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>
  150. </tr>
  151. <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
  152. </tr>
  153. </tbody>
  154. </table>
  155. </dd></dl>
  156. <dl class="method">
  157. <dt id="FlatCAM.FlatCAMObj.read_form">
  158. <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>
  159. <dd><p>Reads form into <tt class="docutils literal"><span class="pre">self.options</span></tt>.</p>
  160. <table class="docutils field-list" frame="void" rules="none">
  161. <col class="field-name" />
  162. <col class="field-body" />
  163. <tbody valign="top">
  164. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">None</td>
  165. </tr>
  166. <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">None</td>
  167. </tr>
  168. </tbody>
  169. </table>
  170. </dd></dl>
  171. <dl class="method">
  172. <dt id="FlatCAM.FlatCAMObj.read_form_item">
  173. <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>
  174. <dd><p>Reads the specified option from the UI form into <tt class="docutils literal"><span class="pre">self.options</span></tt>.</p>
  175. <table class="docutils field-list" frame="void" rules="none">
  176. <col class="field-name" />
  177. <col class="field-body" />
  178. <tbody valign="top">
  179. <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>
  180. </tr>
  181. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
  182. </tr>
  183. </tbody>
  184. </table>
  185. </dd></dl>
  186. <dl class="method">
  187. <dt id="FlatCAM.FlatCAMObj.serialize">
  188. <tt class="descname">serialize</tt><big>(</big><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMObj.serialize" title="Permalink to this definition">¶</a></dt>
  189. <dd><p>Returns a representation of the object as a dictionary so
  190. it can be later exported as JSON. Override this method.</p>
  191. <table class="docutils field-list" frame="void" rules="none">
  192. <col class="field-name" />
  193. <col class="field-body" />
  194. <tbody valign="top">
  195. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Dictionary representing the object</td>
  196. </tr>
  197. <tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
  198. </tr>
  199. </tbody>
  200. </table>
  201. </dd></dl>
  202. <dl class="method">
  203. <dt id="FlatCAM.FlatCAMObj.set_form_item">
  204. <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>
  205. <dd><p>Copies the specified option to the UI form.</p>
  206. <table class="docutils field-list" frame="void" rules="none">
  207. <col class="field-name" />
  208. <col class="field-body" />
  209. <tbody valign="top">
  210. <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>
  211. </tr>
  212. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
  213. </tr>
  214. </tbody>
  215. </table>
  216. </dd></dl>
  217. <dl class="method">
  218. <dt id="FlatCAM.FlatCAMObj.setup_axes">
  219. <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>
  220. <dd><p>1) Creates axes if they don&#8217;t exist. 2) Clears axes. 3) Attaches
  221. them to figure if not part of the figure. 4) Sets transparent
  222. background. 5) Sets 1:1 scale aspect ratio.</p>
  223. <table class="docutils field-list" frame="void" rules="none">
  224. <col class="field-name" />
  225. <col class="field-body" />
  226. <tbody valign="top">
  227. <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>
  228. </tr>
  229. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
  230. </tr>
  231. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">None</td>
  232. </tr>
  233. </tbody>
  234. </table>
  235. </dd></dl>
  236. <dl class="method">
  237. <dt id="FlatCAM.FlatCAMObj.to_form">
  238. <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>
  239. <dd><p>Copies options to the UI form.</p>
  240. <table class="docutils field-list" frame="void" rules="none">
  241. <col class="field-name" />
  242. <col class="field-body" />
  243. <tbody valign="top">
  244. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">None</td>
  245. </tr>
  246. </tbody>
  247. </table>
  248. </dd></dl>
  249. </dd></dl>
  250. </div>
  251. <div class="section" id="flatcamgerber">
  252. <h2>FlatCAMGerber<a class="headerlink" href="#flatcamgerber" title="Permalink to this headline">¶</a></h2>
  253. <dl class="class">
  254. <dt id="FlatCAM.FlatCAMGerber">
  255. <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>
  256. <dd><p>Represents Gerber code.</p>
  257. <dl class="method">
  258. <dt id="FlatCAM.FlatCAMGerber.convert_units">
  259. <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>
  260. <dd><p>Converts the units of the object by scaling dimensions in all geometry
  261. and options.</p>
  262. <table class="docutils field-list" frame="void" rules="none">
  263. <col class="field-name" />
  264. <col class="field-body" />
  265. <tbody valign="top">
  266. <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>
  267. </tr>
  268. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
  269. </tr>
  270. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">None</td>
  271. </tr>
  272. </tbody>
  273. </table>
  274. </dd></dl>
  275. </dd></dl>
  276. </div>
  277. <div class="section" id="flatcamexcellon">
  278. <h2>FlatCAMExcellon<a class="headerlink" href="#flatcamexcellon" title="Permalink to this headline">¶</a></h2>
  279. <dl class="class">
  280. <dt id="FlatCAM.FlatCAMExcellon">
  281. <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>
  282. <dd><p>Represents Excellon/Drill code.</p>
  283. </dd></dl>
  284. </div>
  285. <div class="section" id="flatcamcncjob">
  286. <h2>FlatCAMCNCjob<a class="headerlink" href="#flatcamcncjob" title="Permalink to this headline">¶</a></h2>
  287. <dl class="class">
  288. <dt id="FlatCAM.FlatCAMCNCjob">
  289. <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>
  290. <dd><p>Represents G-Code.</p>
  291. </dd></dl>
  292. </div>
  293. <div class="section" id="flatcamgeometry">
  294. <h2>FlatCAMGeometry<a class="headerlink" href="#flatcamgeometry" title="Permalink to this headline">¶</a></h2>
  295. <dl class="class">
  296. <dt id="FlatCAM.FlatCAMGeometry">
  297. <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>
  298. <dd><p>Geometric object not associated with a specific
  299. format.</p>
  300. <dl class="method">
  301. <dt id="FlatCAM.FlatCAMGeometry.offset">
  302. <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>
  303. <dd><p>Offsets all geometry by a given vector/</p>
  304. <table class="docutils field-list" frame="void" rules="none">
  305. <col class="field-name" />
  306. <col class="field-body" />
  307. <tbody valign="top">
  308. <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>
  309. </tr>
  310. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
  311. </tr>
  312. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">None</td>
  313. </tr>
  314. </tbody>
  315. </table>
  316. </dd></dl>
  317. <dl class="method">
  318. <dt id="FlatCAM.FlatCAMGeometry.plot">
  319. <tt class="descname">plot</tt><big>(</big><big>)</big><a class="headerlink" href="#FlatCAM.FlatCAMGeometry.plot" title="Permalink to this definition">¶</a></dt>
  320. <dd><p>Plots the object into its axes. If None, of if the axes
  321. are not part of the app&#8217;s figure, it fetches new ones.</p>
  322. <table class="docutils field-list" frame="void" rules="none">
  323. <col class="field-name" />
  324. <col class="field-body" />
  325. <tbody valign="top">
  326. <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">None</td>
  327. </tr>
  328. </tbody>
  329. </table>
  330. </dd></dl>
  331. <dl class="method">
  332. <dt id="FlatCAM.FlatCAMGeometry.scale">
  333. <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>
  334. <dd><p>Scales all geometry by a given factor.</p>
  335. <table class="docutils field-list" frame="void" rules="none">
  336. <col class="field-name" />
  337. <col class="field-body" />
  338. <tbody valign="top">
  339. <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>
  340. </tr>
  341. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td>
  342. </tr>
  343. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">None</td>
  344. </tr>
  345. </tbody>
  346. </table>
  347. </dd></dl>
  348. </dd></dl>
  349. </div>
  350. </div>
  351. </div>
  352. <footer>
  353. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  354. <a href="app.html" class="btn btn-neutral float-right" title="FlatCAM Application"/>Next <span class="icon icon-circle-arrow-right"></span></a>
  355. <a href="camlib.html" class="btn btn-neutral" title="Camlib"><span class="icon icon-circle-arrow-left"></span> Previous</a>
  356. </div>
  357. <hr/>
  358. <div role="contentinfo">
  359. <p>
  360. &copy; Copyright 2014, Juan Pablo Caram.
  361. </p>
  362. </div>
  363. <a href="https://github.com/snide/sphinx_rtd_theme">Sphinx theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>
  364. </footer>
  365. </div>
  366. </div>
  367. </section>
  368. </div>
  369. </body>
  370. </html>