Deprecated: Creation of dynamic property wpdb::$categories is deprecated in /var/www/twodee/blog/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$post2cat is deprecated in /var/www/twodee/blog/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$link2cat is deprecated in /var/www/twodee/blog/wp-includes/wp-db.php on line 668

Deprecated: Return type of WP_Theme::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-theme.php on line 554

Deprecated: Return type of WP_Theme::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-theme.php on line 595

Deprecated: Return type of WP_Theme::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-theme.php on line 535

Deprecated: Return type of WP_Theme::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-theme.php on line 544

Deprecated: Return type of WP_REST_Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/rest-api/class-wp-rest-request.php on line 960

Deprecated: Return type of WP_REST_Request::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/rest-api/class-wp-rest-request.php on line 980

Deprecated: Return type of WP_REST_Request::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/rest-api/class-wp-rest-request.php on line 992

Deprecated: Return type of WP_REST_Request::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/rest-api/class-wp-rest-request.php on line 1003

Deprecated: Return type of WP_Block_List::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 151

Deprecated: Return type of WP_Block_List::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 175

Deprecated: Return type of WP_Block_List::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 164

Deprecated: Return type of WP_Block_List::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 186

Deprecated: Return type of WP_Block_List::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 138

Deprecated: Return type of WP_Block_List::offsetExists($index) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 75

Deprecated: Return type of WP_Block_List::offsetGet($index) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 89

Deprecated: Return type of WP_Block_List::offsetSet($index, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 110

Deprecated: Return type of WP_Block_List::offsetUnset($index) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 127

Deprecated: Return type of WP_Block_List::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/twodee/blog/wp-includes/class-wp-block-list.php on line 199

Deprecated: Creation of dynamic property Automattic\Jetpack\Connection\Manager::$error_handler is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/vendor/automattic/jetpack-connection/src/class-manager.php on line 91

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Instagram_Gallery::$is_wpcom is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-instagram-gallery.php on line 23

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Mailchimp::$wpcom_is_wpcom_only_endpoint is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-mailchimp.php on line 17

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Tweetstorm_Gather::$wpcom_is_wpcom_only_endpoint is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-tweetstorm-gather.php on line 21

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Tweetstorm_Gather::$is_wpcom is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-tweetstorm-gather.php on line 22

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Gutenberg_Available_Extensions::$wpcom_is_site_specific_endpoint is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/gutenberg-available-extensions.php on line 20

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Memberships::$wpcom_is_wpcom_only_endpoint is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/memberships.php on line 23

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Memberships::$wpcom_is_site_specific_endpoint is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/memberships.php on line 24

Deprecated: Creation of dynamic property WPCOM_REST_API_V2_Endpoint_Subscribers::$wpcom_is_wpcom_only_endpoint is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/subscribers.php on line 15

Deprecated: Creation of dynamic property Automattic\Jetpack\Sync\Queue::$random_int is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-queue.php on line 38

Deprecated: Creation of dynamic property Automattic\Jetpack\Sync\Queue::$random_int is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/vendor/automattic/jetpack-sync/src/class-queue.php on line 38

Deprecated: Creation of dynamic property WPCOM_Widget_Goodreads::$shelves is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/modules/widgets/goodreads.php on line 33

Deprecated: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in /var/www/twodee/blog/wp-includes/script-loader.php on line 348

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$toolbar_classic_block is deprecated in /var/www/twodee/blog/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 347

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$toolbar_block is deprecated in /var/www/twodee/blog/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 349

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$toolbar_block_side is deprecated in /var/www/twodee/blog/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 350

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$panels_block is deprecated in /var/www/twodee/blog/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 351

Deprecated: Creation of dynamic property Advanced_Editor_Tools::$used_block_buttons is deprecated in /var/www/twodee/blog/wp-content/plugins/tinymce-advanced/tinymce-advanced.php on line 354

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /var/www/twodee/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /var/www/twodee/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /var/www/twodee/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /var/www/twodee/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /var/www/twodee/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: Creation of dynamic property WP_Block_Type::$plan_check is deprecated in /var/www/twodee/blog/wp-includes/class-wp-block-type.php on line 333

Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/twodee/blog/wp-includes/wp-db.php on line 3030

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /var/www/twodee/blog/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Warning: Cannot modify header information - headers already sent by (output started at /var/www/twodee/blog/wp-includes/class-wp-block-list.php:14) in /var/www/twodee/blog/wp-includes/feed-rss2.php on line 8
projects – teaching machines https://twodee.org/blog Sat, 11 Jun 2022 14:49:14 +0000 en-US hourly 1 https://wordpress.org/?v=5.7.1 Twoville at Bridges Math Art 2021 https://twodee.org/blog/18119 https://twodee.org/blog/18119#respond Tue, 03 Aug 2021 12:35:10 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
https://twodee.org/blog/18119 [...]]]> Following are the notes from a talk I gave at Brides Math Art 2021. My paper was a short paper, which means I had ten minutes to speak.

For the next ten minutes, I will tell some stories about a piece of software that I’ve been writing for making two-dimensional shapes using mathematics and computer science. There are a few things you should know before we begin:

  • I am a computer science educator, not a mathematics educator. My goals are perhaps different than yours.
  • I build software to help my students make things that have a life apart from the computer.
  • The software I build is not the product. The products I care about are my students and the shapes they are able to make.
  • My primary audience is young people in my community, not the whole world and professionals.

The software is called Twoville. It is a programming environment for generating scalable vector graphics files (SVGs). Twoville runs in the browser and is open-source and free. There are lots of 2D drawing languages and libraries. Twoville is different from most of them in that the shapes can be modified using either the mouse or code. This feature is best understood in a live demonstration.

Here we plot a rectangle:

I don’t use parameters much in Twoville for two reasons: I want all the data to be named and I want the lines of code to be short. When I work with young learners on iPads or Chromebooks, long lines make for clumsy editing. Instead of parameters, properties are assigned in separate statements. This can lead to repetitive prefixing, which can be eliminated using a scoping block:

One of my jobs as a computer science educator is to help my students learn to program. This is a demoralizing experience for many, so I try to stay near the spatial and visual domains so that they can use their prior knowledge as a human with a body as they think about the code. However, there’s no getting around the fact that programming is indirect manipulation of the output. Trying to tweak a shape only through code throws away a good chunk of our brains. Twoville tries to support more of my students’ brains by allowing direct manipulation of the output. The programmer may drag on the handles to modify a shape’s properties.

The properties don’t have to be just raw numbers in order to directly manipulate them. They can be expressions, and Twoville will do its best to preserve their structure. Consider directly manipulating this circle, whose radius is derived from a diameter variable:

When you directly manipulate the radius handle, the expression is maintained. Instead the variable value is adjusted. Behind the scenes, Twoville has some heuristics in place that guide how the the expression is updated. The structure of the radius assignment above looks like this:

$$\begin{align}\textrm{property} &= \textrm{left} \times \textrm{right}\end{align}$$

When the mouse drags on the handle, we determine a new radius value strictly from the mouse position. Some part of the expression needs to change. We favor changing the right operand, whose new value can be solved for:

$$\begin{align}\textrm{property}’ &= \textrm{left} \times \textrm{right}’ \\\textrm{right}’ &= \frac{\textrm{property}’}{\textrm{left}}\end{align}$$

If the right operand is not a simple number or a variable whose value is a simple number, then the left operand is updated instead of the right. If neither are simple, then an offset is added to the unchanged original expression:

$$\begin{align}\textrm{property}’ &= \textrm{left} \times \textrm{right} + \Delta \\\Delta &= \textrm{property}’ – \textrm{left} \times \textrm{right} \\\end{align}$$

If you don’t like these heuristics, you can lock an operand from being updated by surrounding it in parentheses.

There are other shapes beyond rectangles and circles. General polygons are available:

Polygons can be smoothed out by switching them to what I call ungons:

The smoothing is done by applying Chaikin’s algorithm, which turns polygons into sequences of Bézier curves.

The most general shape is a path, which supports straight edges, circular arcs, Bézier curves, and holes. Here I stitched together a couple of quadratic Bézier curves, omitting the second’s control point and letting it be placed automatically to maintain continuity:

Twoville is my vehicle for talking about computer science and math with young people in my community. We managed to hold a fabrication summer camp in June. The students used Twoville to create vinyl stickers, stencils for painting T-shirts, and acrylic structures. Here are a few of their creations:

(student work is shared only in the live talk)

Thus we have Twoville, a environment for making shapes that can be both indirectly manipulated with code and directly manipulated with a mouse. The shapes can then be fabricated. What questions do you have?

]]>
https://twodee.org/blog/18119/feed 0
Fabrication Summer Camp: Day 5 https://twodee.org/blog/17989 https://twodee.org/blog/17989#respond Fri, 04 Jun 2021 15:00:16 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
https://twodee.org/blog/17989 [...]]]> Welcome to the fifth day of our summer camp! Today is different than the others. It’s Laser-Cutter Day. You challenge is to spend the morning making a design that you want to last. In the afternoon we will take your designs to the Fabrication Lab and cut them out of acrylic.

There are a few rules that you need to follow to make sure the cutting process goes smoothly:

  1. Use a thin red stroke wherever you want the laser-cutter to cut completely through the material.
  2. Use black fill wherever you want the laser-cutter to etch partially into the material.
  3. Don’t use any other colors, and don’t fill in any shapes that you don’t want etched.
  4. Acrylic doesn’t bend, so don’t make any nets.
  5. Contain your design within a 4-inch square. If the exact dimensions aren’t important, use whatever numbers you want within a square, and we’ll scale it when we’re ready to cut. If exact dimensions are important, you’ll want to assume your numbers are in points. The laser cutter assumes your numbers are in these units. Every 72 points is 1-inch, so each side of a 4-inch square is 288 points.

When you have had your design looked over by a teacher, click the Send to Chris link in the settings panel.

]]>
https://twodee.org/blog/17989/feed 0
Fabrication Summer Camp: Day 4 https://twodee.org/blog/17974 https://twodee.org/blog/17974#respond Thu, 27 May 2021 15:09:25 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
https://twodee.org/blog/17974 [...]]]> Welcome to the fourth day of our summer camp! Laser and vinyl cutters create flat objects. Today we break out of the flat plane into the third dimension. In order to cut these objects with our tools, they must start out flat. But the objects can be folded and assembled into solid shapes. Solid objects that have been laid flat by unfolding them along their edges are sometimes called nets. We’ll make a few nets today.

Tetrahedron

A tetrahedron is the simplest shape that occupies all three dimensions. It is made of four equilateral triangles. There are several ways to unfold one so that it lies flat. Consider this method:

  1. Set the tetrahedron so it’s resting flat on a table.
  2. Peel one of the side triangles down so it lies flat.
  3. Peel one of the remaining side triangles down so it lies flat.
  4. Peel the last side triangle down so it lies flat.

What shape do the flattened triangles form? A bigger equilateral triangle.

We can make this shape in Twoville as a polygon with a bit of turtle geometry:

Notice how the internal edges are not visible. We don’t want our cutter to cut through the paper along these edges. However, wouldn’t it be nice if the cutter made a slight cut along them to make the paper easier to fold? Such a cut is called a score. Our cutter can be made to score paper. Let’s trace out these score lines using a path:

I’ve colored these lines in red. When I load this design into the cutter, I’ll state that all red lines are scores rather than cuts. I shouldn’t use red for anything else.

Suppose we cut this flat and assembled it into a solid tetrahedron again. The triangles would not stick to each other. We could attach them with tape, which would be visible. To attach them invisibly, we could add tabs along the edges that folded under the neighboring triangle. With a little glue, these tabs would hold the tetrahedron together.

In Twoville, we can add tabs by inserting a tab command right before an command that makes a straight line. Here we add a tab to the first triangle along each edge:

The tabs also need score lines. We add new segments to our path by tracing along the outer edge again. However, this time we use fly to skip over the triangle that doesn’t have a tab:

When we cut this out, we end up with a tetrahedron that almost makes itself. We just apply a little glue.

Sealed Box

Now it’s your turn design a net that folds into a box. A box has six sides: four walls on the side, one on the top, and one on the bottom. Here’s one possible unfolding with the four walls on the side in a long strip:

Draw your unfolded box on your graph paper. Label the coordinates of all the faces’ corners. Mark the edges where you would like tabs to appear. Not all of them need tabs; you will need to fold this in your brain to identify the ones that do.

Have your drawing checked by a teacher. After any issues are resolved, head to the computer and code it up. Add score lines between the faces and along the tabs in red. Then we’ll cut it.

Lidded Box

In our remaining time, you challenge is to make a box with a lid. The bottom of the box is made up of its rectangular base and four walls, plus some tabs to make the walls stick together. The top of the box is made up of its rectangular top and four walls, plus some tabs. Both parts look something like this without tabs:

Where do the tabs go?

For the bottom to fit inside the top, the bottom must be slightly smaller than the top. If you use variables, you can save yourself some effort. Design just one piece in terms of a variable. To produce the second piece, change the value of the variable slightly.

As always, start by drawing your design on graph paper. Check in with a teacher. Then code up your design and we’ll get it cut.

]]>
https://twodee.org/blog/17974/feed 0
Fabrication Summer Camp: Day 3 https://twodee.org/blog/17943 https://twodee.org/blog/17943#respond Fri, 21 May 2021 13:51:25 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
https://twodee.org/blog/17943 [...]]]> Welcome to the third day of our summer camp! All the shapes we’ve made up till now been solid objects. But some objects have holes, like buttons, donuts, and things with eyes and mouths. Additionally, our only means of adding curved edges has been to superimpose circles onto other objects. This superimposing is not a good fit for fabrication. Each shape will be traced out by a laser or a cutting tool, and when shapes overlap, there will be cuts on the inside of our object. Today we’re going to examine a new shape command that lets us add holes and curved edges without introducing unwanted cuts.

Initial

Earlier we traced out a blocky letter. My first initial is C, and I ended up with a design that looked like this:

Those right angles are too raw and rough. Lettering that pleases the reader has curvature. I’d rather have a C that looked like this:

We will make this better C using the path command. The path command is more general than rectangles, polylines, and polygons. It allows for both straight lines and curved lines. To draw this C, we anchor ourselves on the bottom of the internal straight edge using the go command and then draw a line straight upward with the line command:

Next we need a curve. In particular, we need a circular arc. An arc is a portion of circle’s perimeter. In this case, the circle is centered at (50, 70) and the arc is just 180 degrees of it. That is all we need to tell the orbit command:

To turn clockwise, we use a negative number of degrees.

We keep adding lines and arcs to arrive at this shape:

If we’d rather see the filled object instead of its outline, we remove the stroke and add a color:

Our vinyl cutter doesn’t care. It will cut along the outer edge of the shape whether we use fill or stroke.

Spaceship

The path command allows you to describe an arc in two ways:

  1. With the orbit command, which has degrees and center properties. Use this form when the arc orbits around something.
  2. With the bump command, which has degrees and position properties. Use this form when the arc must end at a certain location.

In the letter C above, we used the center property to make the inner and outer curves orbit around the same location. Sometimes reasoning about the center is difficult because the center isn’t actually part of the object. In such cases, the position property might be easier to use. For example, I modeled this spaceship by thinking about where I wanted the arcs to end:

Use whichever form makes sense to you. Note that you can’t define both position and center. In either form, you must define degrees.

Fish

Now it’s your turn to make an object with curved edges out of a path. You challenge is create a fish, perhaps like this one:

Start by drawing on your graph paper. Identify the vertices between the curved edges. Show your drawing to a teacher. Then start coding it up in Twoville.

Pac-Man

You may be familiar with a little yellow creature that eats pellets and runs away from ghosts. That creature is named Pac-Man. He was born in a Japanese arcade game in 1980. Pac-Man’s made mostly out of circles, which makes him a good candidate for modeling in Twoville. However, one of those circles is his eye, which is really just a hole. So far we haven’t seen a way to make holes in our shapes. That all changes with path.

To make a hole in an object defined as a path, we plot a new shape in front of an old one. Wherever the path overlaps with itself, a hole appears.

Consider this first attempt at plotting Pac-Man, which draws a circle with a wedge removed using the line and orbit commands:

Notice that this Pac-Man lacks an eye. We attach one by adding more pieces to the path. The easiest way is to use the circle command inside the path:

Holes do not need to be circles. We could have used the rectangle command. Or we can make any arbitrary shape using go, line, orbit, and bump. Here we make a triangular eye:

Before he looked hungry. Now he looks like he’s yawning.

ABDs

Remember that time you plotted a letter for someone you cared about, but that someone’s letter couldn’t have a hole in it? Well, we’re not limited anymore. Think of someone that you care about that can be identified by a letter that has a whole in it. In English, those letters are A, B, D, O, P, Q, and R.

Draw the letter on graph paper, use the path to trace its outer perimeter with all of its arcs and straight lines, and then trace out the perimeters of its holes. Identify its positions and sizes. Code it up and we’ll turn it into a sticker that you can give to the person you care about.

Bezier

We’ve seen how the path command allows us to add circular arcs to our shapes. Not all curves are simple circular arcs. A guitar pick, for example, doesn’t look very circular. Let’s examine how to model these other kinds of curves.

Suppose we have a starting position P. We want to connect P to position Q. A straight line would lead directly from on to the other, but we want a curve. To control the curvature, we add a third position that acts as a black hole that sucks the edge toward it. This third point is called a control point. As the control point moves farther from the edge, the curve gets bigger and bigger.

To see this in action, let’s model a leaf. We start with the stem, which is made of straight lines:

Now we jump to the tip, adding a control point to tug at the edge between the stem and the tip. We use the command quadratic to describe this curve:

Now we mirror this same pattern to complete the other side of the leaf, closing out the path with the back command:

A quadratic curve has a single control point tugging at the edge. To get even more control over the curvature, we can add two control points using the cubic command:

These kinds of curves are called Bézier curves. They are named after Pierre Bézier, who invented them so that he could describe the shapes of cars.

Shape Jam

We are going to have a shape jam. Your “theme” for today is to use paths and Bézier curves. Follow these steps in making your shape:

  1. Start by drawing on graph paper.
  2. Get your design inspected by a teacher to make sure it’s something we can fabricate.
  3. Mark the positions of the vertices and control points.
  4. Code up your shape in Twoville.

You will have about 30 minutes to make your design. Use that time to make something interesting that exercises your creativity and your brain. We’ll turn your creation into a vinyl sticker.

]]>
https://twodee.org/blog/17943/feed 0
Fabrication Summer Camp: Day 2 https://twodee.org/blog/17932 https://twodee.org/blog/17932#respond Sat, 15 May 2021 20:41:59 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
https://twodee.org/blog/17932 [...]]]> Welcome to the second day of our summer camp! Today we will explore two big ideas: loops and turtle geometry. Like yesterday, we will be drawing, coding, and making.

Caterpillar

Code is like a caterpillar. It is on its way to being something beautiful that will bring people delight. But it’s trapped in a body that doesn’t seem beautiful. Speaking of caterpillars, let’s design one using the ideas we discussed yesterday. Some caterpillars are sort of bulbous, so let’s string together a sequence of overlapping circles:

Writing this code wears me out. Even worse, if I later decide to change the radius or the color, I’ll have to change many lines. I’m likely to miss one. The cost of making changes discourages experimentation.

A better solution is to use a loop. Programming languages often support several kinds of loops. We’re going to talk about one: the for loop. A for loop walks through a sequence of numbers. For each value in the sequence, it runs its block of code. The value of the sequence is available in a variable. To walk through the numbers from 0 to 10, we write this loop:

This loop allows us to reduce our circle drawing code to something much shorter and less repetitive:

Now it’s much easier to change the color or radius.

If you want to apply a little curvature to the caterpillar and feel comfortable with trigonometric functions, you can alter the y-coordinate of the body segments using the sine function:

The for-to loop that we just saw always starts at 0 and stops when it reaches the upper bound. There’s also the for-in loop which allows you start at a different number. It looks like this:

Notice how 10 is printed. Unlike the for-to, the upper bound is included in the range of numbers that the loop walks through.

Tower

Now it’s your turn to make something. First draw this stack of rectangles on your graph paper:

Label the centers and the sizes of the rectangles.

Then write a Twoville program with a loop that plots them.

Turtle Geometry

So far, we’ve been thinking of space as a grid that we are flying over. We look down and see imaginary streets that intersect. To identify a location, we name its vertical street and its horizontal street.

This isn’t how you think about space when you are physically in the space instead of flying overhead. When you are on a bike or in a car, you think about moving forward and turning. This first-person perspective is sometimes called turtle geometry. Let’s try making a shape with turtle geometry instead of “bird geometry.”

In a moment, you are going to trace out the letter of someone’s name. To prepare you for that task, let’s pretend this shape is a letter:

In fact, this shape is a letter in Russian. It makes a P sound.

We’ll plot this letter with turtle geometry using a polyline, which is like a polygon but is not filled in. It starts off like this, with an additional weight property to control the line thickness:

With bird geometry, we used vertex.position to add each corner. With turtle geometry, we start by initially positioning the turtle. It has both a position and a direction or heading. The heading is an angle. A heading of 0 starts the turtle facing to the right. A heading of 90 starts the turtle facing up. Let’s start it facing up and sitting in the bottom-right corner:

We move the turtle forward with the walk command, which expects a distance property:

We turn the turtle with the turn command, which expects a degrees property. To turn left at a right angle, we turn 90 degrees:

Fast-forwarding a bit, we arrive at the inner perimeter:

Our distances change and we must also make turns to the right, which use a negative number of degrees:

The last leg is not closed. We could walk to close it off, or we could just switch to a polygon:

Letter

Now it’s time for you to make something of your own. Think of someone you care about. That could be a family member, a friend, or yourself. What is the first letter of that person’s name? If that person’s letter has holes in it, as we see in A, B, D, O, P, Q, and R, think of someone else, or think of a different name to represent that person. Later we’ll see how to add holes to shapes, but not yet.

Once you have a letter, follow these steps:

  1. Draw it on your graph paper in a block style. The letters must have thickness; they can’t just be lines.
  2. Identity the corner at which you want the turtle to start. Label its position and heading.
  3. For each edge, label its length.
  4. For each corner, measure how much the turtle turns from its current direction to align with the new edge.
  5. Turn your drawing into a Twoville program.

Ask lots of questions. When you’ve finished, we’ll fabricate your letter into a vinyl sticker that you can give to the person you have in mind.

Starfish

We’ve examined loops. We’ve examined turtle geometry. If we put these two ideas together, we can make some interesting and beautiful shapes, like a starfish maybe. As a first step, let’s model a pentagon. From the turtle’s perspective it moves forward, turns some degrees, moves forward, turns some degrees, and so on. It does this five times total. How many degrees does it turn at each bend? In total, it turns a complete circuit of 360 degrees. It has five steps to do it in, so each step is 360 / 5 = 72 degrees.

That leads to this program:

How would the program change in order to make a hexagon? We’d have six steps of 60 degrees each. A triangle? Three steps of 120 degrees each. A polygon with $n$ vertices? We’d have $n$ steps of $\frac{360}{n}$ degrees. Consider this parametric version of the same program:

Starfish generally have five arms, but some have 40 or 50. Probably we don’t need to think parametrically right now. Five is good. Here’s my preliminary sketch of the turtle walking along the edge of the starfish:

In my program, I’m going to start the turtle off at the bottom-right of the top arm, pointing upward:

Then I trace out the arm, which is currently very boxy:

To get five of these arms, I put this code in a for-to loop. But first I need to turn at the armpit. This is a right turn, so the number of degrees will be negative. The angle is bigger than a right angle, so the number will be greater than 90. Through either experimentation or math, we’ll find that number that we need is -108. Here’s our completed, repeated path:

The final step is to fill the starfish in. We could switch polyline to polygon, but the arms would be blocky. If we switch to an ungon, then we’ll get rounded corners on the arms:

Shape Jam

Just like yesterday, we are going to have a shape jam. Your “theme” for today is to use turtle geometry and loops. Follow these steps in making your shape:

  1. Start by drawing on graph paper.
  2. Get your design inspected by a teacher to make sure it’s something we can fabricate.
  3. Mark the turtle’s starting position and heading, the distances of each walk, and the degrees of each turn.
  4. Code up your shape in Twoville.

You will have about 30 minutes to make your design. Use that time to make something interesting that exercises your creativity and your brain. We’ll turn your creation into a vinyl sticker.

]]>
https://twodee.org/blog/17932/feed 0
Fabrication Summer Camp: Day 1 https://twodee.org/blog/17913 https://twodee.org/blog/17913#comments Thu, 06 May 2021 13:53:33 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
https://twodee.org/blog/17913 [...]]]>

Welcome to summer camp! My name is Chris. Scattered throughout the room are some of my friends that you will meet soon. For the next week, all of us will be making things with technology. The tools we’ll be using to make things include computers, a vinyl cutter, a laser cutter, and a pen plotter. We provide these tools for you to use, but there are some tools that we expect you to supply. Each day we need you to bring your brains, of course, but also your eyes and hands. Don’t try to borrow anybody else’s. They won’t fit you. We’ve tried to design this camp so that it’s more about you doing things with your brain and body than about listening to us talk.

Frankenshape

Speaking of body parts, let’s get right to our first making exercise. We will make a Frankenshape, a shape that is made out of other shapes. Our exercise will have three stages: drawing a prototype shape, measuring the physical shape’s properties, and programming a digital version of the shape that we can fabricate on one of our tools.

Drawing

Here are the supplies we need:

  • pencil
  • graph paper
  • scissors
  • ruler (optional)
  • compass (optional)

Notice there’s no computer on the list. In most of our activities, we will start with drawing. Our brain works better if our body is involved. So, here’s the challenge for you and your body:

  1. Draw an interesting creature or object on your graph paper using only circles and rectangles. Center each circle and rectangle on a grid point. Ensure that the circles and rectangles overlap and that there is only one “island” of shapes. Here’s my design, which may be a bat:
  2. Count how many circles and rectangles you have. My bat has five squares and one circle.
  3. Cut out your shape along only the outer edge.

Once that is done, we’ll get to know each other and our designs with this challenge:

  1. Flip over your shape so that it lies flat on the table and no pencil marks are visible. Only the design’s silhouette is visible.
  2. Find someone else in the room, learn their name, and invite them to your table.
  3. Ask them what they think your object is.
  4. Ask them how many circles and rectangles they see.
  5. Do this again with someone different.

Measuring

In a moment you will turn your design into a computer program. The program will produce a file that we can feed into the pen plotter or the vinyl cutter. Before that can happen, we need to figure out some numbers. In particular, we need this information:

  • The XY-coordinates of each shape’s center.
  • The radius of each circle.
  • The width and height of each rectangle.
  • The rotation of each rectangle.

To determine the xy-coordinates of each shape, first designate some point on the grid to be the origin, the location (0, 0). I choose my bat’s “belly button” to be the origin. The coordinates of each shape’s centers are then measurements of how far away they are from the origin:

Here’s my bat with its coordinates and sizes marked:

The rotations are not marked. The three squares are each rotated 45 degrees.

Programming

With your measurements identified, you are now ready to use the computer. Open a web browser and direct yourself to Twoville. In the editor, place one of your black circles by writing code like this:

Don’t use my numbers. Use your numbers. Notice the indentation. Notice the punctuation. These typographical details matter. We call the symbols [ and ] square brackets.

To plot a second circle, we use a second circle block:

Plot a rectangle with code like this:

Notice that rectangles have a size property similar to the circle’s radius property. Unlike radius, the size property must be set to a list of two numbers. If your rectangle is rotated, add a rotate block:

Putting all these ideas together, here is my bat:

When I run this, the bat shows up very small in the bottom-left corner. That’s because Twoville looks at the scene through a window whose bottom-left corner is at (0, 0) and whose dimensions are (100, 100). This window is only the default. We can alter it by setting properties of the view object:

We can even turn on a grid to help us identify locations:

After you get your shape made, we will fabricate it. You’ll submit your shape to me, I will load it into a vinyl cutter, and out will come a vinyl sticker.

Camera

Circles and rectangles are indispensible tools to have around, but they aren’t enough to make all the interesting designs out there. Let’s explore another design that requires a new kind of shape. Check out this movie camera:

Draw your own version of this camera on your graph paper. Put the corners and centers at intersections as much as possible.

What shapes did you use to make this design? I used two circles, one rectangle, and one trapezoid. I could have used a triangle instead of trapezoid. The general name for a shape with corners or vertices is a polygon. Rectangles are polygons, as are triangles, trapezoids, stars, and lightning bolts.

Measure the camera, identifying the sizes and the xy-coordinates of the vertices.

Program the camera in Twoville. For your new shape, use the polygon command, as demonstrated in this program that plots an elbow:

Barbell

Making is an iterative process. We try something and then we adjust it until it feels right. It’s not that we are wrong in our first attempts, it’s that we are uninformed. With each iteration, we get more information that inspires us to make further changes or perhaps return to an earlier iteration.

Coding is making and is also an iterative process. We write some code, inspect the output, and adjust the code. Sometimes adjusting the code can become tedious. For example, suppose you want to make this shape:

Later you decide the circles need to be bigger. You change one, but you mustn’t forget to change the other:

Then you decide the structure needs to be a little wider, so you change the x-coordinates of the circles:

Oh, you forgot that you also need to adjust the rectangle:

Right now the numbers are separate. They should be linked so that if we change the size of one circle, the other changes automatically. If we change the location of the right circle, the width of the rectangle changes automatically. We do this by naming the numbers using variables:

To make the height of the bar adjustable, we add another variable:

What happens if tweak the height of the bar?

It’s no longer centered. We need to adjust our corner so that half of the bar is below the x-axis. Instead of using plain numbers and variables, we perform a little math right in the code:

When we think about shapes in terms of a small set of variables, we are doing parametric design. The variables are the parameters that control the shape.

Shape Jam

There are these events where people gather together and spend 48 hours making a game. The participants get little sleep, eat a lot of pizza, and enjoy the community of others. At the end, the participants have a small game to show their friends and family. These events are called game jams.

We are going to have a shape jam. There will be no pizza, it won’t be nearly so long, and you can enjoy the community of others by working with a partner, if you so choose. Your challenge in this shape jam is to use circles, rectangles, polygons, variables, and mathematical expressions to make a parametric design. We will turn fabricate it into a vinyl sticker.

Game jams usually have themes. I don’t want to impose a theme on you. However, I do ask you that you incorporate all the ideas we’ve discussed up till now.

Follow these steps in making your shape:

  1. Start by drawing on graph paper.
  2. Get your design inspected by a teacher to make sure it’s something we can fabricate.
  3. Mark the vertex positions and sizes on the graph paper.
  4. Code up your shape in Twoville.

You will have about 30 minutes to make your design. Use that time to make something interesting that exercises your creativity and your brain.

]]>
https://twodee.org/blog/17913/feed 1
Perseverence Logo https://twodee.org/blog/17823 https://twodee.org/blog/17823#respond Sat, 20 Feb 2021 03:01:19 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
https://twodee.org/blog/17823 NASA landed a rover on Mars this week. When I saw the logo for Perseverence, I felt an irresistible urge to recreate it in Twoville. And so I did:

It’s not an exact match. NASA’s landings are better than my own.

]]>
https://twodee.org/blog/17823/feed 0
Dittos in Array Literals https://twodee.org/blog/17747 https://twodee.org/blog/17747#respond Mon, 30 Nov 2020 22:44:25 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
https://twodee.org/blog/17747 [...]]]> Color is often represented in computers in triplets of red, green, and blue intensities. Expressing a color is a matter of finding the right mix of these intensities. For example, here are the triplets for six of the most famous colors:

red = [1, 0, 0]
green = [0, 1, 0]
blue = [0, 0, 1]
yellow = [1, 1, 0]
cyan = [0, 1, 1]
magenta = [1, 0, 1]

Shades of gray require less understanding of how the intensities combine; all three intensities are the same. These are three shades of gray defined in the CSS standard:

gray = [0.5, 0.5, 0.5]
darkgray = [0.66, 0.66, 0.66]
lightgray = [0.83, 0.83, 0.83]

The names are confusing, but that’s a story for another day.

I am unhappy with how grays are expressed. If I find that a shade is too dark or too light, I have to change three numbers. But not when I’m the one writing the programming language! In Twoville, therefore, I have added a special ditto operator that can be used inside array literals to repeat the previous element.

gray = [0.5, ~, ~]
darkgray = [0.66, ~, ~]
lightgray = [0.83, ~, ~]

The symbol for ditto is the tilde. I wanted it to be a single character for compactness. The other punctuation characters have too much semantic baggage. Tilde is typically only used for bitwise negation, and I’ve got a named function for that. Bitwise negation doesn’t deserve a compact symbol.

Besides expressing grays, the ditto operator makes it easy to enforce square dimensions:

dimensions = [10, ~]

I could have achieved repeating array elements in other ways, perhaps through an array constructor or through some sort of replication operator. These might look something like this:

gray = array(3, 0.5)
gray = [0.5] x 3

But the ditto operator can act as a term in an expression:

powersOfTwo = [1, ~ * 2, ~ * 2, ~ * 2, ~ * 2]

There’s nothing quite as gratifying as being in charge of a language. Before that language has users, anyway.

]]>
https://twodee.org/blog/17747/feed 0
Twoville Limerick https://twodee.org/blog/17733 https://twodee.org/blog/17733#respond Fri, 20 Nov 2020 22:14:36 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
https://twodee.org/blog/17733 [...]]]> In October, a collaborator and I presented a poster on our 2D vector graphics languages at FabLearn 2020. The session started with everyone in the main Zoom room. Each presenter had 30 seconds to introduce their project, and then the crowd dispersed to individual breakout rooms.

Ever since I saw someone preview their paper with a foot-stomping fiddle routine at IEEE Visualization, I’ve tried to find my own ways to stand out during these lightning sessions. Limericks are more my style, and I wrote this one for FabLearn.

With a mouse you can do quite a lot
You can click on the shapes you have wrought
Drag them left, drag them right
Change their width, change their height
Do whatever the software’s been taught

What if you want to do other things?
Perhaps make Papert’s gears or some springs
Using math, using n
Doing once, then again
You need power that programming brings

We know making takes both brains and heart
We need tools that don’t keep them apart
Let’s have code, let’s have clicks
Since design is a mix
Today’s demo we think is a start

We had a few visitors, but not many. Maybe the limerick was bad. Other explanations are possible: we were right in the middle of a long list of breakout rooms, people smelled my fear, or educators are burned out on new apps that claim to save education. Who knows.

]]>
https://twodee.org/blog/17733/feed 0
Tricube https://twodee.org/blog/17710 https://twodee.org/blog/17710#respond Sun, 01 Nov 2020 20:40:54 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383

Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
https://twodee.org/blog/17710 [...]]]> A month ago one of my sons’ toys inspired me to try and model it in Madeup. Here is the original set of magnetic blocks:

And here is my first attempt at modeling them using Madeup’s dowel command with rounded bends:

Notice the hole in the middle. Given how the rounding is implemented, I was not able to remove it. You can bet that I was haunted by that hole. I took some time to design a new solidifier so that I could create this shape. The solidifier is called table. One feeds it a list of cross sections, all of the same cardinality, and the cross sections are connected together.

The shape generated by table has no hole.

Someday soon I’ll have a more general loft solidifier, which will allow cross sections of different cardinalities.

]]>
https://twodee.org/blog/17710/feed 0