nklein.com Open in urlscan Pro
65.254.227.240  Public Scan

URL: https://nklein.com/
Submission: On May 20 via api from US — Scanned from DE

Form analysis 1 forms found in the DOM

GET https://nklein.com/

<form role="search" method="get" id="searchform" class="searchform" action="https://nklein.com/">
  <div>
    <label class="screen-reader-text" for="s">Search for:</label>
    <input type="text" value="" name="s" id="s">
    <input type="submit" id="searchsubmit" value="Search">
  </div>
</form>

Text Content

NKLEIN SOFTWARE


SOFTWARE DEVELOPMENT AND CONSULTING

 * ‡ Home
 * ‡ About
 * ‡ Math
 * ‡ Reviews
 * ‡ Software
 * ‡ Services




DRAW OR MCCLIM MAY 7TH, 2022
PATRICK STEIN

Someone helpfully pointed out that the functionality that I was looking for when
I made my Draw Library already exists in McClim. I feel like someone else
reminded me of this a year or two ago. I forgot to look into it then. But, I
will definitely look into it now.

I had a block thinking of McClim as windowing/GUI and overlooking its screenshot
and print functionality.


SHARE THIS:

 * Click to share on Reddit (Opens in new window)
 * Click to share on Facebook (Opens in new window)
 * Click to share on Twitter (Opens in new window)
 * Click to print (Opens in new window)
 * 

 * ‡ cl-pdf, draw, mcclim, vecto
 * ‡ Link
 * ‡ No Comments ⇒


MAKING SUDOKU DIAGRAMS IN LISP MAY 1ST, 2022
PATRICK STEIN

A few weeks ago, I was analyzing a Sudoku variant if the board were a flat torus
instead of a square. I wrote a little paper about this analysis.

For that paper, I created the diagrams by taking screenshots of the f-puzzles
Sudoku editor, pulling them into the GIMP image editor, cropping them all to the
same dimensions, and pulling them into my document. I discovered a mistake that
I had made throughout all of the images after I had already collected all of the
screenshots. Rather than fixing the mistake by doing a new screenshot, I fixed
things in the image editor instead of in the Sudoku editor.

It was painful.

So, I decided to make a way to declare a diagram and then render it so that it
can be modified/corrected rather painlessly.

My initial cut at this was in CL-PDF. I realized, when I had finished, that I
had only used a small subset of CL-PDF and that almost all of that functionality
was available in Vecto (with a tiny bit of help from ZPB-TTF which Vecto uses
already).

This was all the motivation that I needed to finally start on a project that
I’ve been hoping to do for years now. I wrote a compatibility library that takes
something very, very close to the subset of CL-PDF that I used in the diagram
and renders it either using CL-PDF or Vecto so that I can have the output as
either a vector image or a raster image.



I’d like to extend this sometime to also output to CL-SVG, but the way that
fonts are handled in SVGs might make that impossible for most things one would
want to do with text in a diagram.

You can find the library here: https://github.com/nklein/sudoku-diagrams


SHARE THIS:

 * Click to share on Reddit (Opens in new window)
 * Click to share on Facebook (Opens in new window)
 * Click to share on Twitter (Opens in new window)
 * Click to print (Opens in new window)
 * 

 * ‡ cl-pdf, draw, lisp, sudoku, sudoku-diagrams, topology, vecto
 * ‡ Link
 * ‡ No Comments ⇒


DRAW V0.2.20220430 MAY 1ST, 2022
PATRICK STEIN

I have released a new Lisp library. This library provides compatibility between
CL-PDF and Vecto so that I can render the same drawing either as a vector
drawing or a raster drawing.

This library forms an almost drop-in replacement for a small subset of CL-PDF
and implements that subset with both CL-PDF and Vecto.

The functionality at the moment is somewhat limited. But, it is enough to make
the Sudoku diagrams that I was working on. I had originally created the diagrams
using CL-PDF. Then, I went through and wrapped them in one line of code and
changed all of the PDF: package delimiters to DRAW: and ta-da. Diagrams.



This is the current test image. It demonstrates all of the capabilities
available at the moment.

You can find the library here: https://github.com/nklein/draw


SHARE THIS:

 * Click to share on Reddit (Opens in new window)
 * Click to share on Facebook (Opens in new window)
 * Click to share on Twitter (Opens in new window)
 * Click to print (Opens in new window)
 * 

 * ‡ cl-pdf, draw, lisp, vecto
 * ‡ Link
 * ‡ No Comments ⇒


ANAMORPHIC FUN JANUARY 2ND, 2020
PATRICK STEIN

I want to make some bookshelf dioramas like these ones by Monde. I also want to
make some that take more liberties with the limited space available. So, I am
thinking about using forced perspective to create extra depth. I’m also thinking
of some designs that could use right-angled mirrors to snake height into depth.

I also want to create extra width (and height) though. Not just depth. How can I
do that? I can use anamorphic illusions to make things appear to stretch beyond
the edges of the box. And, I can force the viewer to only view it from the
illusory angle and enhance the illusion of space if I make the diorama viewable
through a peephole.

So, I started experimenting yesterday with anamorphic projection onto the inside
of a narrow box for viewing through a peephole.

I used the cl-svg to create grids like this that look flat when viewed (from the
correct distance) through the peephole linked above.



Then, I used cl-jpeg to create images that when printed and folded into the
interior of a diorama look as if the image extends beyond the sides of the
diorama.

If you print this as 72dpi and then fold on the white lines, it will look like a
flat, square image with the letters AB on it when you look down into it.

Then, I combined the two.

If you print this as 72dpi and then fold on the white lines, it will look like a
flat, square image with the letters AB on it when you look down into it through
a 200-degree peephole.

Here is the full source code (peephole.lisp) used to generate the grid and the
anamorphic images.


SHARE THIS:

 * Click to share on Reddit (Opens in new window)
 * Click to share on Facebook (Opens in new window)
 * Click to share on Twitter (Opens in new window)
 * Click to print (Opens in new window)
 * 

 * ‡ anamorphic projection, lisp, non-linear geometry
 * ‡ Link
 * ‡ No Comments ⇒


DIY CAMERA OBSCURA FOR THE ECLIPSE JULY 9TH, 2017
PATRICK STEIN

I am excited about the solar eclipse this August that will be visible across the
continental U.S. I am also keen in still having retinas when it’s over. So, I
ordered some solar-rated sunglasses and decided to build a solar projector.

I brushed off my familiarity with the relevant lens equations, ordered some
big-aperature lenses, and put the TC Maker laser cutter to good use.



The solar projector on a railing, propped up by books, catching the sun.




MATERIALS

 * 7″ x 10.3″ PREMIUM GRADE Fresnel Lens (6 pk)
   (only need one)
 * Three Delta 90 Projection TV Lenses (only need one)
 * Handheld Mirror
 * Two 1/4″-20 knobs
 * Two 1/4″-20 Tee Nuts
 * Several sheets of 2’x4′ 1/8″ Hardboard
 * Wood glue
 * 4 bolts, nuts, and washers to hold the lens


DETERMINING THE LENS FOCAL LENGTHS

I bought Fresnel lenses sold as page magnifiers and glass lenses that were sold
to match particular TV models. I had no real information about their focal
lengths. So, I took two different steps to come up with approximate focal
lengths. The first thing that I did was set up a small lamp in my bedroom at
night. I then positioned the light and a white backdrop at the distance that I
needed them to be so that when the image of the light was in focus, the lens was
half way between the light and the backdrop.

Then, I used the equation: to calculate the focal length. Here is the distance
from the lens to the object and is the distance from the lens to the image.
Since I made those both equal here, then the focal length is half the distance
from the lens to the backdrop.

I determined that the focal length of my Fresnel lens was about 300mm and that
the focal length of my glass lens was about 90mm.

Later, I verified these numbers by taking taking the lenses outside. I placed
them to focus the sun on the sidewalk. Be very careful in this step.
Concentrating the sun with a lens is a great way to start a fire. That’s why I
did this on the sidewalk. I verified that when the lens was at the calculated
focal length, the sidewalk started to smoke.


PREPARING THE TELESCOPE

So, my brushing up on my lens equations and some common sense made me think that
to project the sun, I wanted there to be about 390mm between my two lenses. I
still wanted to verify this before really committing. So, I cut up a cardboard
box so that I could put a Fresnel lens in one end and a glass lens in the other.





This worked out well enough and I had experimental verification of how far I
wanted from the Fresnel lens and the glass lens.





So, then I started sketching out plans for the actual projector.





I decided that I wanted a 90-degree bend in the light path. With the bend, I can
point the objective lens up toward the sun and have the projection screen set up
any distance off to the side rather than having to set it up between the
projector and the ground.

Once that was done, I put together plans to cut out a real box using a laser
cutter.

In my first attempt, I had apparently gotten one of the pieces of my drawing
misaligned. It was together enough though to do some initial experimentation. In
the initial experimentation, it was really obvious that I needed to add a
viewfinder.


THE VIEWFINDER

After manually attempting to point the camera at the moon and other dim objects,
I decided that I needed a viewfinder of some sort. I decided that I needed a
viewfinder where you could either look through it at a dim object or line things
up based on shadows from the sun. I was about to just go with a cross-hairs type
pattern when I thought, now would be a very nice time to pretty it up. I
searched around a bit for sun icons and stumbled upon this gorgeous eclipse
icon.



I made the front viewfinder with both the sun and the moon cut out. I made the
rear viewfinder with the moon cut out and the sun just engraved. This is
supposed to be a reminder that you shouldn’t be trying to line up the sun by
looking through the viewfinder. You can use the viewfinder to line up the moon
and you can use the shadow of the front viewfinder on the rear viewfinder to
line up the sun.




FINAL PLANS

Here are the sun-projector plans. The red lines are to be cut through. The blue
lines are to be cut through if you want to build a straight-through projector.
The green lines are to be cut through if you want to build the projector with a
bend as I did. The yellow lines are only to be etched. Note: the entire
dimensions depend on your lenses having a light path in the neighborhood of
mine….. something between 300mm and 400mm. If you don’t have lenses in that
range, you probably have to design your own.





Here is an image of the sun. The projected image of the sun is 100mm in
diameter. You can’t tell too much in the picture, but in real life you can see
two shadow images of the sun because I am using a $5 rear-reflecting mirror
instead of $85 front-reflecting mirror. Meh.






NEXT STEPS

Next, I am planning to try to make a base in which to sit the projector to make
it easier to point it at the desired spot in the sky.


SHARE THIS:

 * Click to share on Reddit (Opens in new window)
 * Click to share on Facebook (Opens in new window)
 * Click to share on Twitter (Opens in new window)
 * Click to print (Opens in new window)
 * 

 * ‡ eclipse, solar projector
 * ‡ Link
 * ‡ No Comments ⇒

⇐ Older Entries


Search for:


RSS FEEDS

 * All Posts
 * All Comments
 * Announcements
 * Math
 * Lisp
 * Reviews


LINKS

 * Automatous Monk
 * God Plays Dice
 * iPhone and Kids
 * MathFactor
 * Patrick’s Livejournal
 * Planet Lisp
 * Reasonable Deviations
 * Sketches of Topology


CATEGORIES

 * Announcements (2)
 * Articles (165)
   * Math (45)
     * Clifford Algebras (12)
   * Programming (106)
     * NeHe Tutorials (6)
   * Reviews (5)
 * Development (9)
 * Releases (32)
   * Bug Fixes (4)
   * Initial Releases (13)
   * New Versions (16)
 * TC Lisp (12)


RECENT POSTS

 * Draw or McClim
 * Making Sudoku Diagrams in Lisp
 * DRAW v0.2.20220430
 * Anamorphic Fun
 * DIY Camera Obscura for the Eclipse
 * Fog of Light – Starting to Add Star-Fields
 * Fog of Light – Getting Underway
 * The Metaphor Soup Blender Train


TAGS

algebra alternatives bad math c++ cl-fft cl-growl cl-pdf Clean Architecture code
design code kata CSS debugging domain-specific languages draw ebooks fluid
design game design geoma geometry iphone iphone app iphone apps javascript lisp
literate programming macros nehe objective c opengl optimization polynomials
preview quicklisp rt scheme spell-it TC Lisp track-best ubuntu unet userial user
interface toolkits vecto vmware woolly


ARCHIVES

 * May 2022
 * January 2020
 * July 2017
 * May 2017
 * March 2017
 * February 2016
 * January 2016
 * October 2015
 * September 2015
 * June 2015
 * May 2015
 * April 2015
 * March 2015
 * February 2015
 * January 2015
 * November 2014
 * April 2014
 * November 2013
 * October 2013
 * September 2013
 * August 2013
 * July 2013
 * May 2013
 * April 2013
 * March 2013
 * January 2013
 * December 2012
 * October 2012
 * September 2012
 * August 2012
 * May 2012
 * March 2012
 * February 2012
 * December 2011
 * September 2011
 * June 2011
 * May 2011
 * April 2011
 * March 2011
 * February 2011
 * December 2010
 * November 2010
 * October 2010
 * September 2010
 * July 2010
 * June 2010
 * May 2010
 * April 2010
 * March 2010
 * February 2010
 * January 2010
 * December 2009
 * November 2009
 * October 2009
 * September 2009
 * August 2009
 * July 2009
 * June 2009
 * May 2009
 * April 2009
 * February 2009
 * January 2009
 * October 2008
 * September 2008
 * August 2007
 * May 2007
 * May 2000

l

 
 * ‡ Home
 * ‡ About
 * ‡ Math
 * ‡ Reviews
 * ‡ Software
 * ‡ Services
 * ‡ Contact
 * ‡ Technorati Profile