Skip to content

Commit

Permalink
Deploy to GitHub pages
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored May 14, 2024
1 parent 8eabf79 commit bd76cc3
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
Binary file modified latest/.doctrees/environment.pickle
Binary file not shown.
Binary file modified latest/.doctrees/examples/example_mesh_basic.doctree
Binary file not shown.
Binary file modified latest/.doctrees/examples/example_mesh_constrained_on-arch.doctree
Binary file not shown.
16 changes: 8 additions & 8 deletions latest/examples/example_mesh_basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ <h2>Code</h2>
<span class="kn">from</span> <span class="nn">compas.geometry</span> <span class="kn">import</span> <span class="n">Vector</span>
<span class="kn">from</span> <span class="nn">compas_dr.numdata</span> <span class="kn">import</span> <span class="n">InputData</span>
<span class="kn">from</span> <span class="nn">compas_dr.solvers</span> <span class="kn">import</span> <span class="n">dr_numpy</span>
<span class="kn">from</span> <span class="nn">compas_view2.app</span> <span class="kn">import</span> <span class="n">App</span>
<span class="kn">from</span> <span class="nn">compas_viewer</span> <span class="kn">import</span> <span class="n">Viewer</span>

<span class="c1"># =============================================================================</span>
<span class="c1"># Input</span>
Expand Down Expand Up @@ -598,11 +598,11 @@ <h2>Code</h2>

<span class="n">forcecolor</span> <span class="o">=</span> <span class="n">Color</span><span class="o">.</span><span class="n">green</span><span class="p">()</span><span class="o">.</span><span class="n">darkened</span><span class="p">(</span><span class="mi">50</span><span class="p">)</span>

<span class="n">viewer</span> <span class="o">=</span> <span class="n">App</span><span class="p">()</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">view</span><span class="o">.</span><span class="n">camera</span><span class="o">.</span><span class="n">position</span> <span class="o">=</span> <span class="p">[</span><span class="mi">5</span><span class="p">,</span> <span class="o">-</span><span class="mi">5</span><span class="p">,</span> <span class="mi">20</span><span class="p">]</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">view</span><span class="o">.</span><span class="n">camera</span><span class="o">.</span><span class="n">look_at</span><span class="p">([</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">0</span><span class="p">])</span>
<span class="n">viewer</span> <span class="o">=</span> <span class="n">Viewer</span><span class="p">()</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">renderer</span><span class="o">.</span><span class="n">camera</span><span class="o">.</span><span class="n">target</span> <span class="o">=</span> <span class="p">[</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">renderer</span><span class="o">.</span><span class="n">camera</span><span class="o">.</span><span class="n">position</span> <span class="o">=</span> <span class="p">[</span><span class="mi">5</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">20</span><span class="p">]</span>

<span class="n">viewer</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">mesh</span><span class="p">)</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">scene</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">mesh</span><span class="p">,</span> <span class="n">show_points</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>

<span class="k">for</span> <span class="n">vertex</span> <span class="ow">in</span> <span class="n">fixed</span><span class="p">:</span>
<span class="n">point</span> <span class="o">=</span> <span class="n">Point</span><span class="p">(</span><span class="o">*</span><span class="n">mesh</span><span class="o">.</span><span class="n">vertex_coordinates</span><span class="p">(</span><span class="n">vertex</span><span class="p">))</span>
Expand All @@ -611,10 +611,10 @@ <h2>Code</h2>
<span class="n">ball</span> <span class="o">=</span> <span class="n">Sphere</span><span class="p">(</span><span class="n">radius</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span> <span class="n">point</span><span class="o">=</span><span class="n">point</span><span class="p">)</span><span class="o">.</span><span class="n">to_brep</span><span class="p">()</span>
<span class="n">line</span> <span class="o">=</span> <span class="n">Line</span><span class="p">(</span><span class="n">point</span><span class="p">,</span> <span class="n">point</span> <span class="o">-</span> <span class="n">residual</span><span class="p">)</span>

<span class="n">viewer</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">ball</span><span class="p">,</span> <span class="n">facecolor</span><span class="o">=</span><span class="n">Color</span><span class="o">.</span><span class="n">red</span><span class="p">())</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">linecolor</span><span class="o">=</span><span class="n">forcecolor</span><span class="p">,</span> <span class="n">linewidth</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">scene</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">ball</span><span class="p">,</span> <span class="n">surfacecolor</span><span class="o">=</span><span class="n">Color</span><span class="o">.</span><span class="n">red</span><span class="p">())</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">scene</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">linecolor</span><span class="o">=</span><span class="n">forcecolor</span><span class="p">,</span> <span class="n">lineswidth</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">show_points</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>

<span class="n">viewer</span><span class="o">.</span><span class="n">run</span><span class="p">()</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
</pre></div>
</div>
</section>
Expand Down
20 changes: 10 additions & 10 deletions latest/examples/example_mesh_constrained_on-arch.html
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ <h2>Code</h2>
<span class="kn">from</span> <span class="nn">compas_dr.constraints</span> <span class="kn">import</span> <span class="n">Constraint</span>
<span class="kn">from</span> <span class="nn">compas_dr.numdata</span> <span class="kn">import</span> <span class="n">InputData</span>
<span class="kn">from</span> <span class="nn">compas_dr.solvers</span> <span class="kn">import</span> <span class="n">dr_constrained_numpy</span>
<span class="kn">from</span> <span class="nn">compas_view2.app</span> <span class="kn">import</span> <span class="n">App</span>
<span class="kn">from</span> <span class="nn">compas_viewer</span> <span class="kn">import</span> <span class="n">Viewer</span>

<span class="c1"># =============================================================================</span>
<span class="c1"># Input</span>
Expand Down Expand Up @@ -620,25 +620,25 @@ <h2>Code</h2>

<span class="n">forcecolor</span> <span class="o">=</span> <span class="n">Color</span><span class="o">.</span><span class="n">green</span><span class="p">()</span><span class="o">.</span><span class="n">darkened</span><span class="p">(</span><span class="mi">50</span><span class="p">)</span>

<span class="n">viewer</span> <span class="o">=</span> <span class="n">App</span><span class="p">()</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">view</span><span class="o">.</span><span class="n">camera</span><span class="o">.</span><span class="n">position</span> <span class="o">=</span> <span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">,</span> <span class="o">-</span><span class="mi">10</span><span class="p">,</span> <span class="mi">5</span><span class="p">]</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">view</span><span class="o">.</span><span class="n">camera</span><span class="o">.</span><span class="n">look_at</span><span class="p">([</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">2</span><span class="p">])</span>
<span class="n">viewer</span> <span class="o">=</span> <span class="n">Viewer</span><span class="p">()</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">renderer</span><span class="o">.</span><span class="n">camera</span><span class="o">.</span><span class="n">target</span> <span class="o">=</span> <span class="p">[</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">2</span><span class="p">]</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">renderer</span><span class="o">.</span><span class="n">camera</span><span class="o">.</span><span class="n">position</span> <span class="o">=</span> <span class="p">[</span><span class="o">-</span><span class="mi">7</span><span class="p">,</span> <span class="o">-</span><span class="mi">10</span><span class="p">,</span> <span class="mi">5</span><span class="p">]</span>

<span class="n">viewer</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">mesh</span><span class="p">)</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">arch</span><span class="o">.</span><span class="n">to_polyline</span><span class="p">(),</span> <span class="n">linecolor</span><span class="o">=</span><span class="n">Color</span><span class="o">.</span><span class="n">cyan</span><span class="p">(),</span> <span class="n">linewidth</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">scene</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">mesh</span><span class="p">,</span> <span class="n">show_points</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">scene</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">arch</span><span class="o">.</span><span class="n">to_polyline</span><span class="p">(),</span> <span class="n">linecolor</span><span class="o">=</span><span class="n">Color</span><span class="o">.</span><span class="n">cyan</span><span class="p">(),</span> <span class="n">lineswidth</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">show_points</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>

<span class="k">for</span> <span class="n">vertex</span> <span class="ow">in</span> <span class="n">fixed</span><span class="p">:</span>
<span class="n">point</span> <span class="o">=</span> <span class="n">Point</span><span class="p">(</span><span class="o">*</span><span class="n">mesh</span><span class="o">.</span><span class="n">vertex_coordinates</span><span class="p">(</span><span class="n">vertex</span><span class="p">))</span>
<span class="n">residual</span> <span class="o">=</span> <span class="n">Vector</span><span class="p">(</span><span class="o">*</span><span class="n">result</span><span class="o">.</span><span class="n">residuals</span><span class="p">[</span><span class="n">vertex</span><span class="p">])</span> <span class="o">*</span> <span class="mf">0.1</span>
<span class="n">residual</span> <span class="o">=</span> <span class="n">Vector</span><span class="p">(</span><span class="o">*</span><span class="n">result</span><span class="o">.</span><span class="n">residuals</span><span class="p">[</span><span class="n">vertex</span><span class="p">])</span> <span class="o">*</span> <span class="mf">0.5</span>

<span class="n">ball</span> <span class="o">=</span> <span class="n">Sphere</span><span class="p">(</span><span class="n">radius</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span> <span class="n">point</span><span class="o">=</span><span class="n">point</span><span class="p">)</span><span class="o">.</span><span class="n">to_brep</span><span class="p">()</span>
<span class="n">line</span> <span class="o">=</span> <span class="n">Line</span><span class="p">(</span><span class="n">point</span><span class="p">,</span> <span class="n">point</span> <span class="o">-</span> <span class="n">residual</span><span class="p">)</span>
<span class="n">ballcolor</span> <span class="o">=</span> <span class="n">Color</span><span class="o">.</span><span class="n">blue</span><span class="p">()</span> <span class="k">if</span> <span class="n">constraints</span><span class="p">[</span><span class="n">vertex</span><span class="p">]</span> <span class="k">else</span> <span class="n">Color</span><span class="o">.</span><span class="n">red</span><span class="p">()</span>

<span class="n">viewer</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">ball</span><span class="p">,</span> <span class="n">facecolor</span><span class="o">=</span><span class="n">ballcolor</span><span class="p">)</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">linecolor</span><span class="o">=</span><span class="n">forcecolor</span><span class="p">,</span> <span class="n">linewidth</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">scene</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">ball</span><span class="p">,</span> <span class="n">surfacecolor</span><span class="o">=</span><span class="n">ballcolor</span><span class="p">,</span> <span class="n">show_points</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">scene</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">linecolor</span><span class="o">=</span><span class="n">forcecolor</span><span class="p">,</span> <span class="n">lineswidth</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">show_points</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>

<span class="n">viewer</span><span class="o">.</span><span class="n">run</span><span class="p">()</span>
<span class="n">viewer</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
</pre></div>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion latest/searchindex.js

Large diffs are not rendered by default.

0 comments on commit bd76cc3

Please sign in to comment.