Cloth Simulation with Procedural Plaid

Procedural cloth with plaid material. Made with Blender

This was fun, because how can you have too much plaid?
Thanks to Ryan King Art on Youtube for the Blender tutorial series on material nodes. His tutorials are great and I appreciate the effort in his editing. Support him if you can.

I often joke that I’ve learned Blender 3D every year for the last 20 years. Sometimes because I forgot what I previously learned and don’t use it frequently but more often it’s because a new release offers new tools and capabilities.
The development has seen major changes to the UI and entire interface in recent years.
The latest have been geometry and material or shader nodes. A way to procedurally or programatically link blocks, each affecting the output in a chain. Either to create geometry or to produce any desired material. Plaid in this case.
A previous post shows another example using nodes to create and animate fake trees.

A Blender 3D Material Nodes example

It can get messy and may look confusing but when grouped the key attributes are easily accessed and changed. It makes sense that the Blender Add-On called “Node Wrangler” comes in handy.

Blender is a free and open source 3D application, completely extendable using Python. It continually delivers updated features and is capable of producing amazing compositing/animation/video/3D printing, you name it. (I do miss the game engine)

If you’re looking to learn 3D I highly recommend Blender 3D
And again look for Ryan King Art on Youtube for plenty of beginner tutorials.

Published
Categorized as Blender

Generative Fill or Degenerate Phil

Generative fill in Adobe Photoshop (beta) is a pretty amazing tool to extend images. Background artists, web designers, print layout artists, or anybody who deals with incorrect aspect ratios or odd image dimentions will be thrilled by the output.

The image below represents a photo I took near Iceberg Lake in Whistler BC. Portrait aspect on 1920×1080 canvas.

source image to adobe photoshop generative fill

To extend the image CTRL+SELECT image.
Select Inverse – COMMAND+SHIFT+I
SELECT > MODIFY > EXPAND – 3px
EDIT > Generative Fill…. (No Prompts)

En Voila! a landscape that does not exists.
Notice how it recognizes the light source, maintains correct shadows, tones and palette.

2/3 of this image is created by AI

Two thirds of the above image was created by AI/ML yet the middle remains completely untouched and my creation. Does this mean the image was “generated by AI”? “Enhanced by AI”? “Extended by AI”?
Or just fake?

Prompts allow for text based editing and generation with mixed results. Note that prompts will only add to the selection. In this case outside of the main image here.
Ultimately however it finally gets classified, anyone looking to extend beyond an image will be happily surprised with the results of Generative Fill.

“Degenerate Phil” on the other hand… t

Degenerate Phil

Text prompt “Degenerate Phil” creates some nightmare fuel.
Nighty-night.

Generative AI is neither good nor evil. It’s up to you, the human in the loop, to decide.

AI Art is getting better

AI created mountain scene

Adobe Firefly Express (beta) whatever “Text to Image” takes the old Colab Notebooks to a new refined level.
However it’s still easy to cherry-pick “good” images for every 10 mediocre or just plain wrong images.

Don’t trust the robots. PEACE. T.AKE IT IT ELASY!

* All images above generated by Adobe “text to image” software.

[EDIT]
I’m crossing the streams. OpenAI conversation where I phrase bomb “T.AKE IT IT ELASY”. A generated text-to-image response for “Take it easy”
Would this be considered adversarial AI?

OPENAI conversation - adding phrase "T.AKE ITT ELASY" which was generated by text to image "Take it easy".
Published
Categorized as AI/ML, Art

Mammoth Mountain Logo

Ooof. Hard to believe this would have passed all the checks and balances to get appropriated approved.

It’s not a stretch to say that a California ski resort has naively combined two M’s to form a crown but to outright copy a symbol used repeatedly by one of the highest selling artists of all time seems ridiculous.

RIP King. Jean-Michel Basquiat (1960 – 1988)

The Micro One-Armed Bandit

Over the holidays I came up with an idea to create a micro slot machine coded in #CircuitPython using the Adafruit 5×5 NeoBFF Led Matrix. A micro switch, or limit switch is used to ‘pull’ the slot machine arm. A Piezo buzzer bleeps and bloops familiar tones and may signal a win. Ding-ding-ding!

I paired this add-on board with the Atmel SAMD21 QTPY microcontroller which provided some issues with limited memory. This particular microcontroller has constraints which made this a fun challenge. The ESP32 and RP2040 versions of QTPY microcontroller boards on the other hand would allow for more advanced libraries to be used out-of-the-box and thus could have a much different solution.

If you’d like to jump straight to the CircuitPython code you can find it here:
https://github.com/somenice/micro-one-armed-bandit
Otherwise I’ll walk through the build and code.

Parts required:
Adafruit 5×5 NeoPixel Grid BFF Add-On for QT Py and Xiao
Adafruit QT Py – SAMD21 Dev Board with STEMMA QT
Piezo Buzzer
Micro Switch w/Lever
Header pins and a bit of wire
Optional: Right angle USB-C cable

Pins used:
The micro switch – ‘NO’ or Normally Open pin is on A1
The Piezo is on pin A2 which requires PWM
The 5×5 matrix uses pin A3 by default
All share ground

I first clipped 2 header pins of 7 then soldered the 5×5 NeoBFF on top of the headers while fitted in a breadboard. Next I soldered the QT Py board to the bottom of the headers, back-to-back, making sure to line the boards in the correct direction which is smartly printed on the back of matrix.

There is really no case or supports. The lever arm and piezo buzzer were soldered to the back with bits of wire dead bug style. The right angle USB-C cable is perfect to have the matrix sit upright.

Almost all code is derived from some Adafruit CircuitPython tutorial.
One of the key functions of the micro switch as slot machine arm was to have the action happen on the release or rise of the lever.
This was made easy with Adafruit Debounce library.

from adafruit_debouncer import Debouncer
if switch.rose:

The idea of the slot machine was to have 5 “Reels” which get randomly offset as they “spin”. Most physical slot machines will have different reel sequences but this example uses just one.

I declare hex values to identify the colour then manually created the “Reel” with different colour frequencies. Note the number of RED instances vs PURPLE.

RED = 0x100000
REEL = [RED,GREEN,YELLOW,BLUE,PURPLE,YELLOW,RED,GREEN,BLUE,RED,YELLOW,RED,RED]

On release of the lever the first step is animate the existing columns down until coming slowly to rest with a random offset on the reel.

Yup, this whole thing relies on random.randint(0,len(REEL)) So not a hardened gambling system.

I played with piezo tones, simulated physical mechanisms and settled on some familiar notes that some 8-bit fans may remember while collecting coins in another world. The final slot gets a slightly higher note, adding that audio and visual stimulation.

One of the most fun and satisfying puzzles was working with only the Adafruit CircuitPython Neopixel library to animate the 5×5 RGB matrix using a nested loop of columns and rows.

for i in range(5): #COLUMNS
    for j in range(5): #ROWS

Using various math equations, very simple but new-to-me discoveries via trial and error to produce very satisfying results.

pixels[20-(5*i-j)] = #TOP LEFT ACROSS
pixels[20-(5*j-i)] = #TOP LEFT DOWN
pixels[5*i+j] = #BOTTOM LEFT ACROSS
pixels[5*j+i] = #BOTTOM LEFT UP
pixels[24-(5*i+j)] = #TOP RIGHT ACROSS
pixels[24-(5*j+i)] = #TOP RIGHT DOWN

Once again, you can see the code and fork here: https://github.com/somenice/micro-one-armed-bandit

As earlier mentioned, the memory constraints were a fun challenge as well as using minimal parts on a basic microcontroller.
Being a hobbyist with almost endless access to sensors, radios, and actuators can often lead to scope creep. Nothing stopping me from endlessly adding functionality until I get bored and quit. This one was fun to get at least to V 0.1