<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>y-it&#39;s site</title>
    <link rel="self" type="application/atom+xml" href="https://yit.k.vu/index.xml"/>
    <link rel="alternate" type="text/html" href="https://yit.k.vu"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-07-18T00:00:00+00:00</updated>
    <id>https://yit.k.vu/index.xml</id>
    <entry xml:lang="en">
        <title>Plotter Art</title>
        <published>2026-07-18T00:00:00+00:00</published>
        <updated>2026-07-18T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://yit.k.vu/art/plotter-art/"/>
        <id>https://yit.k.vu/art/plotter-art/</id>
        
        <content type="html" xml:base="https://yit.k.vu/art/plotter-art/">&lt;p&gt;The pictures made here were all made several years ago by now, but I am rewriting the descriptions now.&lt;/p&gt;
&lt;p&gt;The first group of pictures are flow fields.
Each point on the picture has a direction assigned to it.
This produces shape to a similar manner as tributaries form.
A bunch of starting points are picked on a grid,
and continuously follow the direction at each point they end up at.
The resulting picture can be changed by manipulating the directions.
For example, squaring a coordinate makes it always positive, locking the paths only increase that coordinate.&lt;/p&gt;
&lt;p&gt;For the first picture the direction is decided purely with perlin noise.
There are some zigzag artifacts due to the size of the steps taken.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/plotter/00.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This next picture has both the x and y directions squared,
causing the lines to always move to the bottom left.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/plotter/01.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;By squaring only one coordinate this picture has the lines go to the right.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/plotter/02.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Raising the x and y coordinates of the direction to a high odd power makes it follow cardinal directions.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/plotter/03.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This next picture reuses the squaring both coordinates trick, but after a change of basis.
This causes the direction to by biased towards flowing in an inwards circle.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/plotter/04.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Changing between an inwards bias and an outwards bias depending on the distance from the center
creates a stable ring around the middle.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/plotter/05.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Adding noise can make results that look noisy.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/plotter/06.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The change of basis operation can be based on another noise field to create a picture with a regionally varying bias.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/plotter/07.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;I don&#39;t actually remember what made this one happen.
I think it was a similar change of basis based on perlin noise thing.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/plotter/09.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This one is just a squaring both coordinates thing again, but rotated to fit on the page different.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/plotter/10.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now for a complete change of pace, my cat.
This is based on a picture taken with a camera, and then dithered.
Then a dot was created in each spot with a black pixel.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/plotter/08.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The remaining pictures are all variations on a Barnsley fern, or other tree fractal things.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/plotter/11.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/art/plotter/12.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/art/plotter/13.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/art/plotter/14.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/art/plotter/15.png&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Deriving the Line of Best Fit</title>
        <published>2023-12-31T00:00:00+00:00</published>
        <updated>2023-12-31T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://yit.k.vu/math/line-of-best-fit/"/>
        <id>https://yit.k.vu/math/line-of-best-fit/</id>
        
        <content type="html" xml:base="https://yit.k.vu/math/line-of-best-fit/">&lt;p&gt;We will define the set of points P as follows&lt;/p&gt;
&lt;p&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mi&gt;P&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mrow&gt;&lt;mo stretchy=&quot;true&quot; form=&quot;prefix&quot;&gt;{&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mo&gt;…&lt;/mo&gt;&lt;/mrow&gt;&lt;mo stretchy=&quot;true&quot; form=&quot;postfix&quot;&gt;}&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/p&gt;
&lt;p&gt;And the line of best fit will be defined as&lt;/p&gt;
&lt;p&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/math&gt;&lt;/p&gt;
&lt;p&gt;Finally to express the error of a line just sum the error for each point.
The error for a point is the squared difference between the
point&#39;s &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/math&gt; coordinate and the lines estimate
for the point&#39;s &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/math&gt; coordinate, &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/math&gt;.
The reason for squaring it is to make it always positive.
Otherwise a positive error and negative error could cancel out.
The reason for squaring instead of using an absolute value is for ease of the derivative.
As an expression for each point it is &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;-&lt;/mo&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;-&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;msup&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt;.
The total error for the whole line can be written as:&lt;/p&gt;
&lt;p&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mi&gt;E&lt;/mi&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;munder&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;,&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;mi&gt;ϵ&lt;/mi&gt;&lt;mi&gt;P&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;msup&gt;&lt;mrow&gt;&lt;mo stretchy=&quot;true&quot; form=&quot;prefix&quot;&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;-&lt;/mo&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;-&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;mo stretchy=&quot;true&quot; form=&quot;postfix&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;/math&gt;&lt;/p&gt;
&lt;p&gt;Going forward I will be leaving the bounds off of the summations, as they will
all be the same and only muddle up the notation.
The next step after finding the error function is to find the minimum.
It would be really convenient if there was one minimum and it was the only
critical point on the function.
After expanding the function it is evident that its highest coefficient term
of both &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/math&gt; and &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/math&gt; is parabolic.&lt;/p&gt;
&lt;p&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mo stretchy=&quot;true&quot; form=&quot;prefix&quot;&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;msup&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;-&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;-&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;mo&gt;-&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;mo stretchy=&quot;true&quot; form=&quot;postfix&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/p&gt;
&lt;p&gt;That shows that it will have only one critical point.
Next is checking if the critical point is a minimum or if it is a maximum or saddle point.
As &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/math&gt; goes to positive or negative infinity
the error function must go to positive infinity.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/math/line-of-best-fit/changing-y-intercept.svg&quot; alt=&quot;A diagram showing how changing the y-intercept effects the error&quot; class=&quot;content-img-white-bg&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Less obviously but with similar logic the same is true for &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/math&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/math/line-of-best-fit/changing-slope.svg&quot; alt=&quot;A diagram showing how changing the slope effects the error&quot; class=&quot;content-img-white-bg&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Having shown that the critical point is the point we are looking for, the next step is to find it.
We will start by taking the partial derivatives of the error function.&lt;/p&gt;
&lt;p&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mo mathvariant=&quot;italic&quot;&gt;∂&lt;/mo&gt;&lt;mi&gt;E&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo mathvariant=&quot;italic&quot;&gt;∂&lt;/mo&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mo stretchy=&quot;true&quot; form=&quot;prefix&quot;&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;-&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;mo stretchy=&quot;true&quot; form=&quot;postfix&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mo mathvariant=&quot;italic&quot;&gt;∂&lt;/mo&gt;&lt;mi&gt;E&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo mathvariant=&quot;italic&quot;&gt;∂&lt;/mo&gt;&lt;mi&gt;s&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mo stretchy=&quot;true&quot; form=&quot;prefix&quot;&gt;(&lt;/mo&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;mo&gt;-&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/mrow&gt;&lt;mo stretchy=&quot;true&quot; form=&quot;postfix&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/p&gt;
&lt;p&gt;Now all that remains is to find where both of those equal zero.
Starting with &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mo mathvariant=&quot;italic&quot;&gt;∂&lt;/mo&gt;&lt;mi&gt;E&lt;/mi&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mo mathvariant=&quot;italic&quot;&gt;∂&lt;/mo&gt;&lt;mi&gt;s&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/math&gt; first set it to zero,
then divide both sides by two.
Then distribute the summations and you are left with:&lt;/p&gt;
&lt;p&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;mo&gt;-&lt;/mo&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/math&gt;&lt;/p&gt;
&lt;p&gt;The &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/math&gt; can be distributed out of the summation and the
&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/math&gt; can be moved to the other side.&lt;/p&gt;
&lt;p&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/math&gt;&lt;/p&gt;
&lt;p&gt;For the next step remember what bounds on the summations are.
The term &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/math&gt; means the sum of &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/math&gt; added for each point.
The term &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/math&gt; means the total of all the &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/math&gt; coordinates.
If we divide both sides by the number of points then &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/math&gt;
will change to &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/math&gt; and &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/math&gt;
will change to the average &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/math&gt; value.
Now we have the equation&lt;/p&gt;
&lt;p&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mover&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo accent=&quot;true&quot;&gt;¯&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mover&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo accent=&quot;true&quot;&gt;¯&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/math&gt;&lt;/p&gt;
&lt;p&gt;showing that line of best fit goes through the average point.
The other equation doesn&#39;t turn out as neat, but still isn&#39;t too bad to solve.
Doing very similar steps as to the last equation you can find that&lt;/p&gt;
&lt;p&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mo&gt;∑&lt;/mo&gt;&lt;mrow&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/mrow&gt;&lt;/math&gt;&lt;/p&gt;
&lt;p&gt;Changing all the summations to averages will not be as nice as last time, but still make it easier to work with.&lt;/p&gt;
&lt;p&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mover&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo accent=&quot;true&quot;&gt;¯&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;mover&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo accent=&quot;true&quot;&gt;¯&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mover&gt;&lt;mrow&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/mrow&gt;&lt;mo accent=&quot;true&quot;&gt;¯&lt;/mo&gt;&lt;/mover&gt;&lt;/math&gt;&lt;/p&gt;
&lt;p&gt;You can then plug in the other formula tothat and solve for &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;/math&gt; to get&lt;/p&gt;
&lt;p&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mover&gt;&lt;mrow&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/mrow&gt;&lt;mo accent=&quot;true&quot;&gt;¯&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;-&lt;/mo&gt;&lt;mover&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo accent=&quot;true&quot;&gt;¯&lt;/mo&gt;&lt;/mover&gt;&lt;mover&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo accent=&quot;true&quot;&gt;¯&lt;/mo&gt;&lt;/mover&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mover&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo accent=&quot;true&quot;&gt;¯&lt;/mo&gt;&lt;/mover&gt;&lt;mover&gt;&lt;msup&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo accent=&quot;true&quot;&gt;¯&lt;/mo&gt;&lt;/mover&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;/math&gt;&lt;/p&gt;
&lt;p&gt;The result from that can be used with the &lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;inline&quot;&gt;&lt;mover&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo accent=&quot;true&quot;&gt;¯&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mover&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo accent=&quot;true&quot;&gt;¯&lt;/mo&gt;&lt;/mover&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/math&gt;
equation to find the line of best fit.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Boat</title>
        <published>2023-09-23T00:00:00+00:00</published>
        <updated>2023-09-23T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://yit.k.vu/projects/boat/"/>
        <id>https://yit.k.vu/projects/boat/</id>
        
        <content type="html" xml:base="https://yit.k.vu/projects/boat/">&lt;p&gt;A while ago I thought it would be a good idea to build a boat.
I gathered a group of my friends to design and construct this thing.
We had our first meeting where we agreed on random garbage we had that could be fashioned into a boat.
The buoyancy would be provided from old barrels of car wash chemicals and the surface palettes and from leftover deck supplies.
We bought 13 8&#39; 2x3&#39;s for the main frame of the boat, and some metal strap to hold the barrels on.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/projects/boat/wip.jpg&quot; alt=&quot;The boat being constructed. There is a wooden frame with a few barrels attached&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;We then looked for the paint that best resembled the blue color of Weezer&#39;s debut album &quot;Weezer&quot;,
which made us appear to be professional boat constructors.
We were able to get the boat to pass a NY inspection.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/projects/boat/trailer.jpg&quot; alt=&quot;The boat loaded on a trailer. The boat&amp;#39;s deck is the color of weezer&amp;#39;s debut album. Everything is covered in rain&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/projects/boat/canal.jpg&quot; alt=&quot;A view of the Erie canal with a sliver of the boat&amp;#39;s deck in frame towards the bottom&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After the incredible success of actually making a &quot;seaworthy&quot; vessel out of garbage we wanted to step it up a bit.
We wanted benches to allow more people to fit easier, and we lights so we could continue operating after sunset.
If we were putting lights on it we were going to go all out with the electrical system with a horn, navigation lights, deck lights,
a radio, and at one point a pump powered water gun.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/projects/boat/benches.jpg&quot; alt=&quot;The boat being relaunched after adding benches to it. It is proudly displaying its hull number&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/projects/boat/benches2.jpg&quot; alt=&quot;A picture from afar showing the boat tied up at a dock&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/projects/boat/lights.jpg&quot; alt=&quot;Nighttime picture of the boat showing the light system, with some large lens flares&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;h2 id=&quot;interactive-boat-models&quot;&gt;Interactive boat models&lt;/h2&gt;
&lt;script type=&#39;text/javascript&#39; src=&#39;/x3d/x3dom.js&#39;&gt;&lt;/script&gt;
&lt;link rel=&#39;stylesheet&#39; type=&#39;text/css&#39; href=&#39;/x3d/x3dom.css&#39;/&gt;
&lt;x3d&gt;
&lt;scene&gt;
&lt;inline url=old-boat.x3d&gt;
&lt;/scene&gt;
&lt;/x3d&gt;
&lt;script type=&#39;text/javascript&#39; src=&#39;/x3d/x3dom.js&#39;&gt;&lt;/script&gt;
&lt;link rel=&#39;stylesheet&#39; type=&#39;text/css&#39; href=&#39;/x3d/x3dom.css&#39;/&gt;
&lt;x3d&gt;
&lt;scene&gt;
&lt;inline url=boat.x3d&gt;
&lt;/scene&gt;
&lt;/x3d&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>High School Photography</title>
        <published>2023-05-21T00:00:00+00:00</published>
        <updated>2023-05-21T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://yit.k.vu/art/high-school-photo/"/>
        <id>https://yit.k.vu/art/high-school-photo/</id>
        
        <content type="html" xml:base="https://yit.k.vu/art/high-school-photo/">&lt;p&gt;These pictures were all taken for my advanced photography class in high school.
All of the really fuzzy noisy ones where taken through a
&lt;a rel=&quot;external&quot; href=&quot;https://en.wikipedia.org/wiki/Camera_obscura&quot;&gt;camera obscura&lt;/a&gt; made from a cardboard box.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/hs-photo/hands.jpg&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/art/hs-photo/pinhole-bin.jpg&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/art/hs-photo/pinhole-books.jpg&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/art/hs-photo/pinhole-building.jpg&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/art/hs-photo/pinhole-cars.jpg&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/art/hs-photo/pinhole-construction.jpg&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Ruins</title>
        <published>2022-09-28T00:00:00+00:00</published>
        <updated>2022-09-28T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://yit.k.vu/art/ruins/"/>
        <id>https://yit.k.vu/art/ruins/</id>
        
        <content type="html" xml:base="https://yit.k.vu/art/ruins/">&lt;p&gt;This is a picture of a building in Annapolis mid destruction.
The sky was not originally this purple, nor were the shadows this intense.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/ruins/ruins.jpg&quot; alt=&quot;&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Four Player Chess</title>
        <published>2022-04-22T00:00:00+00:00</published>
        <updated>2022-04-22T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://yit.k.vu/projects/four-player-chess/"/>
        <id>https://yit.k.vu/projects/four-player-chess/</id>
        
        <content type="html" xml:base="https://yit.k.vu/projects/four-player-chess/">&lt;p&gt;I designed and printed a four player chess set, which can be packaged into a relatively small space.
The outer 3 by 8 sections that each player&#39;s pieces start in can detach,
allowing it to be stored in the same size as the inner 8 by 8 section.
Removing the outer sections also allows normal two player chess to be played on the board.
The chess pieces I printed are hexagon chess pieces I found on thingiverse.
All the models that I made I used openscad for.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://www.thingiverse.com/thing:4901226&quot;&gt;https://www.thingiverse.com/thing:4901226&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://openscad.org/&quot;&gt;https://openscad.org/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;/projects/four-player-chess/set-up.jpg&quot; alt=&quot;Four player chess board&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The list of things that were printed for this are&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;main 8 by 8 board&lt;/li&gt;
&lt;li&gt;two 3 by 8 boards with the colors one way&lt;/li&gt;
&lt;li&gt;two 3 by 8 boards with the colors the other way&lt;/li&gt;
&lt;li&gt;four sets of chess pieces&lt;/li&gt;
&lt;li&gt;eight connecters&lt;/li&gt;
&lt;li&gt;box&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;/projects/four-player-chess/open.jpg&quot; alt=&quot;A picture of the parts of a four player chess board, all laid out&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Getting the chessboards to print with two colors was a fun challenge,
especially to get them to print with the least effort on my part.
The easiest to set up was to just do two prints, the squares and the back,
and to change the filament between the prints.
The things that I don&#39;t like about this approach are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Printer will cool down in between the prints&lt;/li&gt;
&lt;li&gt;The printer might home with slight differences for the two prints&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The way I ended up handling it was to make a new profile in the slicer, which I called ender 3 manual dual filament.
In the profile I said that the printer has two extruders, each doing a different color.
When it was time to switch the extruder it was using, the command was M600.
What that gcode command does is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Pause the print&lt;/li&gt;
&lt;li&gt;Park the print head&lt;/li&gt;
&lt;li&gt;Eject the filament&lt;/li&gt;
&lt;li&gt;Beep and wait for you to put the new filament in&lt;/li&gt;
&lt;li&gt;Purge the filament&lt;/li&gt;
&lt;li&gt;Resume the print&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Naturally it didn&#39;t just work like that, instead it completely ignored that command and started printing the whole thing in one color.
It turned out that the stock firmware did not have the M600 command implemented.
This meant that I had to find an alternative or put custom firmware on the printer.
The first thing I did was to find an alternative.
Instead of the M600 I wrote:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Switch to relative moving&lt;/li&gt;
&lt;li&gt;Move up&lt;/li&gt;
&lt;li&gt;Pause&lt;/li&gt;
&lt;li&gt;Move back down&lt;/li&gt;
&lt;li&gt;Switch back to absolute moving&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The bad news is that after being paused for too long it would disable the steppers and misalign the print.
In the end I just put custom firmware on the printer with the &lt;code&gt;ADVANCED_PAUSE_FEATURE&lt;/code&gt; and &lt;code&gt;NOZZLE_PARK_FEATURE&lt;/code&gt; enabled.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/projects/four-player-chess/mid-2-player.jpg&quot; alt=&quot;A picture of the chess board in the middle of a two player game, with green playing against purple&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/projects/four-player-chess/closed.jpg&quot; alt=&quot;A picture showing the board all closed up&quot; class=&quot;content-img&quot; /&gt;
&lt;img src=&quot;/projects/four-player-chess/top-off.jpg&quot; alt=&quot;The board with the top off, showing all the pieces inside&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>3D Scanning with an xbox Kinect</title>
        <published>2022-03-02T00:00:00+00:00</published>
        <updated>2022-03-02T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://yit.k.vu/projects/kinect/"/>
        <id>https://yit.k.vu/projects/kinect/</id>
        
        <content type="html" xml:base="https://yit.k.vu/projects/kinect/">&lt;p&gt;I have always wanted to do some 3d scanning, but I couldn&#39;t get photogrammetry set up on my computer.
Recently I got a kinect, a camera that also does depth so it should be able to do 3d scanning.
Processing seemed like a good choice for a language to use, since I am familiar with it and it has a kinect library.
My code is directly descended from the point cloud example for openkinect-for-processing.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://github.com/yit6/kinect-scanner/blob/main/scanner3.pde&quot;&gt;My Code For This&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://processing.org/&quot;&gt;Processing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://shiffman.net/p5/kinect/&quot;&gt;Tutorial for kinect and processing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://github.com/shiffman/OpenKinect-for-Processing/blob/master/OpenKinect-Processing/examples/Kinect_v1/PointCloud/PointCloud.pde&quot;&gt;Point cloud examle&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first step after getting the depth values from the kinect is to undo the perspective distortion.
A small change in position in points that are close to the kinect have a much larger change in apparent position than points that are far from the kinect.
The basic solution to this is to multiply the &lt;code&gt;x&lt;/code&gt; and the &lt;code&gt;y&lt;/code&gt; by the &lt;code&gt;z&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://graphics.stanford.edu/~mdfisher/Kinect.html&quot;&gt;Page about getting world coordinates from the kinect&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&quot;/projects/kinect/illustration.svg&quot; alt=&quot;There are dots split into two groups, a left group and a right group with an arrow pointing between them. The dots on the right are uniformly distributed, the ones on the left are squished vertically towards the right&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Now that there is a point cloud of world coordinates, it just has to be saved to a file.
The format I chose is obj, since it is so easy to output from a program.
To put a vertex in an obj file, just put a line in the file with &lt;code&gt;v x y z&lt;/code&gt; where &lt;code&gt;v&lt;/code&gt;
is the letter v, and &lt;code&gt;x y z&lt;/code&gt; are the x, y, and z coordinates of the vertex.
After all this is implemented, the program is capable of 3d scanning.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/projects/kinect/gui.png&quot; alt=&quot;screenshot of the pointcloud being shown in the ui&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;All you have to do is take multiple scans from different angles, then remove the unwanted points, then match
them up (I used blender to do this), and then turn the points into a mesh (I used meshlab to do this).
The problem with this approach is that it is a lot of effort, particularly the lining up the point clouds.
I found out that meshlab is able to mesh all the point clouds, and them match them up, or I could mesh the scans in the program I wrote.
All the points in the point cloud come from the kinect, which captures them as a grid.
This allows us to take the grid, and keep the faces how they were, even after transforming them with the depth.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/projects/kinect/grid.gif&quot; alt=&quot;gif showing how the grid gets deformed&quot; class=&quot;small-content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The next thing to automate is removing the unwanted points.
I chose to do this by filtering the depth.
Anything more than 1.5 meters I filtered out, since it is probably the background.
Additionally I filtered out the points with a depth of zero, since that means that their depth did not get recorded correctly.
This creates two problems.
The easy one is that some faces will no longer have all the vertices, so I just got rid of those faces.
The hard one is that when the vertices get deleted, the indices of all the following ones change.
What I originally had in the code was to add all the vertices, and then the indices for the faces
would follow a simple &lt;code&gt;x + y*width&lt;/code&gt; formula.
Alteratively, in pseudocode:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;for x from 0 to width:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	for y from 0 to height:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		add vertex x, y, z to obj file&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;for x from 0 to width:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	for y from 0 to height:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		add face x+y*width (x+1)+y*width (x+1)+(y+1)*width x+(y+1)*width to obj file&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;My solution to recalculating the indices is for the face to store a reference to the vertices, and turn
it to a number after the unnecessary vertices get deleted.&lt;/p&gt;
&lt;p&gt;Pseudocode:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;for x from 0 to width:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	for y from 0 to height:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		append to vertices vertex x, y, z&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;for x from 0 to width-1:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	for y from 0 to height-1:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		append to faces face(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;				vertex a = get vertex x+y*width&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;				vertex b = get vertex (x+1)+y*width&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;				vertex c = get vertex (x+1)+(y+1)*width&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;				vertex d = get vertex x+(y+1)*width&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;				)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;for every vertex&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	if the depth is not in range, get rid of it&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	index = 0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;for every remaining vertex&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	add vertex to obj file&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	set to index of the vertex to index&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	increment index&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;for every face&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	if the face still has all of its vertices&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;		add face a.index, b.index, c.index, d.index to obj file&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now the output of the code is several obj files that can be opened and aligned with meshlab.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/projects/kinect/meshlab.png&quot; alt=&quot;Meshlab aligning several scans of a lego space shuttle&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Colorado Springs</title>
        <published>2021-08-23T00:00:00+00:00</published>
        <updated>2021-08-23T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://yit.k.vu/art/colorado-springs/"/>
        <id>https://yit.k.vu/art/colorado-springs/</id>
        
        <content type="html" xml:base="https://yit.k.vu/art/colorado-springs/">&lt;p&gt;These are a bunch of pictures I got in Colorado Springs on a trip in 2021.
The first bunch are from the Garden of the Gods.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/colorado-springs/0.jpg&quot; alt=&quot;Two red rocks, with a blue sky behind and a row of trees in front, with yellowish grass at the bottom&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/colorado-springs/1.jpg&quot; alt=&quot;A white rock in front of a red rock, with green foliage in front and a blue sky behind&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/colorado-springs/2.jpg&quot; alt=&quot;A red rock fills the bottom right half of the screen, and the sky in the top left. A stop sign is visible in silhouette on the bottom left&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/colorado-springs/3.jpg&quot; alt=&quot;There is grass on the bottom half, sky on the top and a pinkish rock on the left.&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The next picture is from a modern gold mine.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/colorado-springs/4.jpg&quot; alt=&quot;A tiered hill with a winding road winding up it&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This picture is from the remains of an older gold mine.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/art/colorado-springs/5.jpg&quot; alt=&quot;A bare hill is visible in the top left, with green trees on all the other ground. There are the ruins of an old wooden building in the bottom left&quot; class=&quot;content-img&quot; /&gt;&lt;/p&gt;
&lt;p&gt;All of these pictures where taken on a Motorola droid RAZR smartphone camera.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Parametric Twist Containers</title>
        <published>2021-08-12T00:00:00+00:00</published>
        <updated>2021-08-12T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://yit.k.vu/projects/parametric-twist-container/"/>
        <id>https://yit.k.vu/projects/parametric-twist-container/</id>
        
        <content type="html" xml:base="https://yit.k.vu/projects/parametric-twist-container/">&lt;p&gt;I printed one of the twist containers that Devin Montes made, and it turned out great.
I had to make some of my own, so I could have any number of sides that I wanted.
The idea is that there are two twisted prisms, where on is just slightly bigger than the other.
If you get the tolerance right they will just barely slide past one another, which makes it hard for the air to get out.
I designed them using the program openscad.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://www.myminifactory.com/cn/users/MakeAnything/collection/twist-containers&quot;&gt;Collection of twist containers by Devin Montes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https://openscad.org&quot;&gt;Openscad Website&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Since there is an inside and an outside the model should be saved as two stl files.
I accomplished this with a shell script and an if statement with the input from the command.
Here is the shell script.&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F5C2E7;font-style: italic;&quot;&gt;#!/bin/sh&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt;openscad&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt; -DPART=&amp;#39;&amp;quot;inside&amp;quot;&amp;#39; -o inside.stl twist.scad&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt;openscad&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt; -DPART=&amp;#39;&amp;quot;outside&amp;quot;&amp;#39; -o outside.stl twist.scad&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then for openscad there needs to be an if statement to use this input.
If the part is equal to &lt;code&gt;&quot;inside&quot;&lt;/code&gt; then render the inside.
Otherwise, if it equals &lt;code&gt;&quot;outside&quot;&lt;/code&gt;, render the outside.
And if it is neither of those, display both for preview purposes.
Here is the important part of the openscad code:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;openscad&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;if&lt;/span&gt;&lt;span&gt; (PART &lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt; &amp;quot;inside&amp;quot;&lt;/span&gt;&lt;span&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    inside()&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt; else if&lt;/span&gt;&lt;span&gt; (PART &lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt; &amp;quot;outside&amp;quot;&lt;/span&gt;&lt;span&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    outside()&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt; else&lt;/span&gt;&lt;span&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    inside()&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt;    translate&lt;/span&gt;&lt;span&gt;([size&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;2&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;0&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;0&lt;/span&gt;&lt;span&gt;]) outside()&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the arguments say inside, it renders the inside.
If they say outside, it renders the outside.
Otherwise, it will preview both.
Here is the full openscad code:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;openscad&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;$&lt;/span&gt;&lt;span&gt;fn&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;256&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; //resolution of shape, turn higher for more tris&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;height&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;150&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; //The height of the container&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;tolerance&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;75&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; //The distance between the outer and the inner vases&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;size&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;70&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; //Approximately the diameter of the container&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;roundness&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;20&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; //The radius of the corners&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;twist&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=-&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;360&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; //Amount it twists by, negative to get a right handed container&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;chamfer_thickness&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; //How tal the chamfer is&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;chamfer_width&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; //How far in the chamfer goes&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;sides&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; //Number of sides on the container&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;base_thickness&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; //How tall the grip on the base is&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;base_width&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; //How far out the grip on the base is&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;base_slope&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span&gt;base_width/base_thickness&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; //How steep the grip is&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;module&lt;/span&gt;&lt;span&gt; base() { //Make a circle for every side, and evenly space them&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt;    hull&lt;/span&gt;&lt;span&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;        for&lt;/span&gt;&lt;span&gt; (i&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;1&lt;/span&gt;&lt;span&gt;:sides])&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt;            rotate&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;360&lt;/span&gt;&lt;span&gt;/sides&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;*&lt;/span&gt;&lt;span&gt;i)&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt;translate&lt;/span&gt;&lt;span&gt;([size/&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;-&lt;/span&gt;&lt;span&gt;roundness,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;0&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;0&lt;/span&gt;&lt;span&gt;])circle(roundness)&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;module&lt;/span&gt;&lt;span&gt; handle() { //Make two tapered prisms, and put them together&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt;    translate&lt;/span&gt;&lt;span&gt;([&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;0&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;0&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;-&lt;/span&gt;&lt;span&gt;base_thickness])&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    linear_extrude(base_thickness/&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;2&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt;scale&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span&gt;(size&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;+&lt;/span&gt;&lt;span&gt;base_slope&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;*&lt;/span&gt;&lt;span&gt;base_thickness)/size)base()&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt;    scale&lt;/span&gt;&lt;span&gt;([&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;1&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;1&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;1&lt;/span&gt;&lt;span&gt;])&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    linear_extrude(base_thickness/&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;2&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt;scale&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span&gt;(size&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;+&lt;/span&gt;&lt;span&gt;base_slope&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;*&lt;/span&gt;&lt;span&gt;base_thickness)/size)base()&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;module&lt;/span&gt;&lt;span&gt; chamfer() { //Make a tapered prism for the top chamfer&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt;    translate&lt;/span&gt;&lt;span&gt;([&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;0&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;0&lt;/span&gt;&lt;span&gt;,height&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;-&lt;/span&gt;&lt;span&gt;chamfer_thickness])&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    linear_extrude(chamfer_thickness,&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt;scale&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span&gt;(size&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;-&lt;/span&gt;&lt;span&gt;chamfer_width)/size)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    base()&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt;//The inside is the combination of a twisted prim, the base, and the chamfer&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;module&lt;/span&gt;&lt;span&gt; inside() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt;    union&lt;/span&gt;&lt;span&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        handle()&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            linear_extrude(height&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;-&lt;/span&gt;&lt;span&gt;chamfer_thickness,slices&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=$&lt;/span&gt;&lt;span&gt;fn,twist&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span&gt;twist)base()&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            chamfer()&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt;//The outside is just a twisted prism, just slightly bigger than the inside&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;module&lt;/span&gt;&lt;span&gt; outside() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    linear_extrude(height,slices&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=$&lt;/span&gt;&lt;span&gt;fn,twist&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span&gt;twist)offset(tolerance)base()&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt;//Get part information from the command line, so that both the inside and the outside can be rendered automatically&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PART&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span&gt;undef&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;if&lt;/span&gt;&lt;span&gt; (PART&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;inside&amp;quot;&lt;/span&gt;&lt;span&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    inside()&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;if&lt;/span&gt;&lt;span&gt; (PART&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;outside&amp;quot;&lt;/span&gt;&lt;span&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    outside()&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</content>
        
    </entry>
</feed>
