Skip to content

Commit

Permalink
Docs usage
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielPollithy committed Jun 23, 2019
1 parent f17a11b commit 56318e5
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 1 deletion.
File renamed without changes.
11 changes: 11 additions & 0 deletions doc/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,14 @@ Usage
To use pypcd in a project::

import pypcd

# also can read from file handles.
pc = pypcd.PointCloud.from_path('foo.pcd')
# pc.pc_data has the data as a structured array
# pc.fields, pc.count, etc have the metadata

# center the x field
pc.pc_data['x'] -= pc.pc_data['x'].mean()

# save as binary compressed
pc.save_pcd('bar.pcd', compression='binary_compressed')
Binary file modified docs/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/doctrees/usage.doctree
Binary file not shown.
11 changes: 11 additions & 0 deletions docs/html/_sources/usage.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,14 @@ Usage
To use pypcd in a project::

import pypcd

# also can read from file handles.
pc = pypcd.PointCloud.from_path('foo.pcd')
# pc.pc_data has the data as a structured array
# pc.fields, pc.count, etc have the metadata

# center the x field
pc.pc_data['x'] -= pc.pc_data['x'].mean()

# save as binary compressed
pc.save_pcd('bar.pcd', compression='binary_compressed')
2 changes: 1 addition & 1 deletion docs/html/searchindex.js

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions docs/html/usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@
<h1>Usage<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h1>
<p>To use pypcd in a project:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">pypcd</span>

<span class="c1"># also can read from file handles.</span>
<span class="n">pc</span> <span class="o">=</span> <span class="n">pypcd</span><span class="o">.</span><span class="n">PointCloud</span><span class="o">.</span><span class="n">from_path</span><span class="p">(</span><span class="s1">&#39;foo.pcd&#39;</span><span class="p">)</span>
<span class="c1"># pc.pc_data has the data as a structured array</span>
<span class="c1"># pc.fields, pc.count, etc have the metadata</span>

<span class="c1"># center the x field</span>
<span class="n">pc</span><span class="o">.</span><span class="n">pc_data</span><span class="p">[</span><span class="s1">&#39;x&#39;</span><span class="p">]</span> <span class="o">-=</span> <span class="n">pc</span><span class="o">.</span><span class="n">pc_data</span><span class="p">[</span><span class="s1">&#39;x&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">mean</span><span class="p">()</span>

<span class="c1"># save as binary compressed</span>
<span class="n">pc</span><span class="o">.</span><span class="n">save_pcd</span><span class="p">(</span><span class="s1">&#39;bar.pcd&#39;</span><span class="p">,</span> <span class="n">compression</span><span class="o">=</span><span class="s1">&#39;binary_compressed&#39;</span><span class="p">)</span>
</pre></div>
</div>
</div>
Expand Down

0 comments on commit 56318e5

Please sign in to comment.