<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://w.arbores.tech/w/index.php?action=history&amp;feed=atom&amp;title=Twoville</id>
	<title>Twoville - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://w.arbores.tech/w/index.php?action=history&amp;feed=atom&amp;title=Twoville"/>
	<link rel="alternate" type="text/html" href="http://w.arbores.tech/w/index.php?title=Twoville&amp;action=history"/>
	<updated>2026-04-04T04:32:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.11</generator>
	<entry>
		<id>http://w.arbores.tech/w/index.php?title=Twoville&amp;diff=16070&amp;oldid=prev</id>
		<title>Daniel K. Schneider: Text replacement - &quot;$&quot; to &quot;
{{edutechwiki}}&quot;</title>
		<link rel="alternate" type="text/html" href="http://w.arbores.tech/w/index.php?title=Twoville&amp;diff=16070&amp;oldid=prev"/>
		<updated>2021-04-10T00:18:08Z</updated>

		<summary type="html">&lt;p&gt;Text replacement - &amp;quot;$&amp;quot; to &amp;quot; {{edutechwiki}}&amp;quot;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:18, 10 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l171&quot;&gt;Line 171:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 171:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:laser cutting]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:laser cutting]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:computational making]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:computational making]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{edutechwiki}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Daniel K. Schneider</name></author>
	</entry>
	<entry>
		<id>http://w.arbores.tech/w/index.php?title=Twoville&amp;diff=15779&amp;oldid=prev</id>
		<title>Daniel K. Schneider: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://w.arbores.tech/w/index.php?title=Twoville&amp;diff=15779&amp;oldid=prev"/>
		<updated>2021-04-09T22:53:14Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:53, 10 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Daniel K. Schneider</name></author>
	</entry>
	<entry>
		<id>http://w.arbores.tech/w/index.php?title=Twoville&amp;diff=15778&amp;oldid=prev</id>
		<title>Daniel K. Schneider at 19:23, 24 January 2020</title>
		<link rel="alternate" type="text/html" href="http://w.arbores.tech/w/index.php?title=Twoville&amp;diff=15778&amp;oldid=prev"/>
		<updated>2020-01-24T19:23:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; {{stub}}&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
{{quotation|Twoville is a programming language for generating two-dimensional SVG images that can be fed into vinyl or laser cutters. It also supports animation at the syntactic level.}} ([https://twodee.org/blog/ teaching machines], retrieved Jan 2019.&lt;br /&gt;
&lt;br /&gt;
Twoville is under development (as of Jan 2020), but it can be used.&lt;br /&gt;
&lt;br /&gt;
There exist few other alternatives, e.g. the no longer supported [[TurtleBlocks]].&lt;br /&gt;
&lt;br /&gt;
== The language ==&lt;br /&gt;
&lt;br /&gt;
Unlike the similar [[Madeup]] environment for 3D printing, created by the same author, this environment is &amp;#039;&amp;#039;as of Jan 2020&amp;#039;&amp;#039; less well documented and does not include a block version.&lt;br /&gt;
&lt;br /&gt;
The syntax looks a mix of [[Logo]] and JavaScript.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
Defining a blue rectangle&lt;br /&gt;
&amp;lt;source lang=&amp;quot;logos&amp;quot;&amp;gt;&lt;br /&gt;
width = 150&lt;br /&gt;
height = 100&lt;br /&gt;
with rectangle ()&lt;br /&gt;
  corner = [0,0]&lt;br /&gt;
  size = [20, 10]&lt;br /&gt;
  color = [0.1, 0.1, 1]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below, an alternative notation, using property syntax:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;logos&amp;quot;&amp;gt;&lt;br /&gt;
width = 150&lt;br /&gt;
height = 100&lt;br /&gt;
rect = rectangle ()&lt;br /&gt;
rect.corner = [0,0]&lt;br /&gt;
rect.size = [20, 10]&lt;br /&gt;
rect.color = [0.1, 0.1, 1]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
The following code defines a haircut&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;logos&amp;quot;&amp;gt;&lt;br /&gt;
spokeDelta = 10&lt;br /&gt;
outerRadius = 50&lt;br /&gt;
&lt;br /&gt;
with viewport&lt;br /&gt;
  center = [0, 0]&lt;br /&gt;
  size = [outerRadius * 2 + 10, outerRadius * 2 + 10]&lt;br /&gt;
&lt;br /&gt;
// Spokes.&lt;br /&gt;
for i to 180+spokeDelta by spokeDelta&lt;br /&gt;
  degrees = i&lt;br /&gt;
  x = outerRadius * cos(degrees)&lt;br /&gt;
  y = outerRadius * sin(degrees)&lt;br /&gt;
  with line()&lt;br /&gt;
    vertex().position = [0, 0]&lt;br /&gt;
    vertex().position = [x, y]&lt;br /&gt;
    color = :black&lt;br /&gt;
    color = [0, 0, 0]&lt;br /&gt;
    size = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[image:twovillespokes.png|thumb|800px|none|Spokes made with Twoville, inspired from [https://twodee.org/blog/16979 PolarGraph]]]&lt;br /&gt;
&lt;br /&gt;
To make this suitable for laser cutting we can define a rectangle with a red hairline. Since rectangles do seem to require a fill color, we set its opacity to 0. The exported dimensions are pixels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;logos&amp;quot;&amp;gt;&lt;br /&gt;
spokeDelta = 9&lt;br /&gt;
outerRadius = 100&lt;br /&gt;
&lt;br /&gt;
with viewport&lt;br /&gt;
  center = [0, 0]&lt;br /&gt;
  size = [outerRadius * 2 + 10, outerRadius * 2 + 10]&lt;br /&gt;
&lt;br /&gt;
// Spokes.&lt;br /&gt;
for i to 180+spokeDelta by spokeDelta&lt;br /&gt;
  degrees = i&lt;br /&gt;
  x = outerRadius * cos(degrees)&lt;br /&gt;
  y = outerRadius * sin(degrees)&lt;br /&gt;
  with line()&lt;br /&gt;
    vertex().position = [0, 0]&lt;br /&gt;
    vertex().position = [x, y]&lt;br /&gt;
    color = :black&lt;br /&gt;
    color = [0, 0, 0]&lt;br /&gt;
    size = 3&lt;br /&gt;
&lt;br /&gt;
// rect for the cut line&lt;br /&gt;
with rectangle ()&lt;br /&gt;
  center = [0,outerRadius/2]&lt;br /&gt;
  size = [outerRadius*2+10,outerRadius+10]&lt;br /&gt;
  color = [0,0,0]&lt;br /&gt;
  opacity = 0&lt;br /&gt;
  stroke.size = 0.01&lt;br /&gt;
  stroke.color = [1.0,0.0,0.0]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[image:twovillespokes-2.svg|thumb|400px|none|Spokes made with Twoville, fit for laser cutting with a [[Trotec Speedy 100R]] ]]&lt;br /&gt;
&lt;br /&gt;
In order to laser cut this through [[Inkscape]], we had to make two modifications to the export SVG drawing&lt;br /&gt;
* fix the document size, i.e. add some margin (File -&amp;gt; Document Properties)&lt;br /&gt;
* transform the spikes from lines to path (Path -&amp;gt; Stroke to Path)&lt;br /&gt;
&lt;br /&gt;
=== Language elements ===&lt;br /&gt;
&lt;br /&gt;
Like [[Madeup]], Twoville supports conditionals, loops, functions, and arrays.&lt;br /&gt;
&lt;br /&gt;
=== Primitive objects ===&lt;br /&gt;
&lt;br /&gt;
common properties:&lt;br /&gt;
 color = [R, G, B], values = 0..1 or :color&lt;br /&gt;
 stroke.size&lt;br /&gt;
 stroke.color&lt;br /&gt;
 stroke.rgb&lt;br /&gt;
 opacity = 0..1&lt;br /&gt;
 rotate.pivot = [x,y]&lt;br /&gt;
 rotate.degrees = deg&lt;br /&gt;
&lt;br /&gt;
==== rectangle ====&lt;br /&gt;
&lt;br /&gt;
 rectangle ()&lt;br /&gt;
&lt;br /&gt;
properties:&lt;br /&gt;
 corner = [x,y]&lt;br /&gt;
 center = [x,y]&lt;br /&gt;
 size = [width, length]&lt;br /&gt;
 rounding = x &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== circle ====&lt;br /&gt;
 circle ()&lt;br /&gt;
&lt;br /&gt;
Properties&lt;br /&gt;
 center&lt;br /&gt;
 radius = [r]&lt;br /&gt;
&lt;br /&gt;
==== path ====&lt;br /&gt;
 path ()&lt;br /&gt;
&lt;br /&gt;
properties &lt;br /&gt;
 stroke.color = :blue&lt;br /&gt;
 stoke.size = n.m&lt;br /&gt;
 opacity = true or false&lt;br /&gt;
 closed = true or false&lt;br /&gt;
&lt;br /&gt;
==== arc ====&lt;br /&gt;
 arc ()&lt;br /&gt;
&lt;br /&gt;
Arcs are line segments of a circle. Must be used with path.&lt;br /&gt;
 &lt;br /&gt;
properties:&lt;br /&gt;
 position = [x,y] defines what ??&lt;br /&gt;
 degrees = db, defines the length of the arc&lt;br /&gt;
&lt;br /&gt;
==== line ====&lt;br /&gt;
&lt;br /&gt;
 line ()&lt;br /&gt;
&lt;br /&gt;
 vertex().position = [x,y]&lt;br /&gt;
&lt;br /&gt;
=== Animation ===&lt;br /&gt;
 &lt;br /&gt;
 15 -&amp;gt; t means &amp;quot;time after 15 seconds&amp;quot;&lt;br /&gt;
 t -&amp;gt; 30 means &amp;quot;time as it approaches 40 seconds&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://twodee.org/twoville/ https://twodee.org/twoville/], the online TwoVille environment.&lt;br /&gt;
&lt;br /&gt;
* [https://twodee.org/blog/16563 Introducing Twoville], February 24, 2018 by Chris Johnson. This piece explains some early animation features&lt;br /&gt;
&lt;br /&gt;
[[Category:Programming]]&lt;br /&gt;
[[category:laser cutting]]&lt;br /&gt;
[[category:computational making]]&lt;/div&gt;</summary>
		<author><name>Daniel K. Schneider</name></author>
	</entry>
</feed>