SVG Projection from Prism

See bottom of page for description of this program.

INPUT

OUTPUT

black/colour cut lines:
parameters:

Description and Instructions

The purpose of this program is to project from a grid to the sides of a triangular based prism, with a point of projection on top of the prism. The idea is that the svg can be cut with a laser cutter, so you can create a kind of lantern that projects to a grid of squares on the plane. The yellow region, determined by the two blue dots, determines which grid squares we project to. The yellow region on the screen is actually multipled by 3 to get the projected grid region; I've done this since otherwise the ratio of triangle to yellow square is too big.
The scale slider shows the scale of the units on the canvas. If this is changed, the units change, so the integer grid changes. But the controlling dots are not changed, so this means that if the scale value increases, the sides of the triangle will increase in length (if you want, the metric used to measure the screen changes. The value of the scale is the with in integer units, i.e., how many integer units the canvas width is; units is adjusted accordingly.
Note, I have rounded down coordinates, so the map is not highly accurate, and might not give best results if scaled up too much.
Note, the prism is upsidown; I wanted the top edge to be fixed on the svg, so when the height is increased, the picture extends downwards.
Note, there will be an overlap gluing together tab down the side, which is not ideal; I may create a future version without this; one could wrap round 4 sides, or have no overlap.
May not work properly for lines across regions.
The sides of the squares are epsilon away from integer spaced grid lines; that is what epsilon is.
Note, the lid is slightly over the level of where the light should be, by a fixed 10 units, which I should probably make variable. This is so you can put the light in, and it hangs down a little, to be in the right place; I am imagining a small LED.
Radius is for the radius of the hole for the light on the lid
The point of the coloured vs only red black is just to see how the dots on the top canvas relate to the ones on the svg picture. These are not needed for printing out, so for that the black/red version can be used
Originally, I was not going to make a base - I imagined just stand alone with no base, but added this later, so it's a separate triangle, two versions, with or without the grid holes
The hold for the light is supposed to be in the lid, but I have not prevented the program from projecting from outside the lid area; then the svg indivates where the light should be, but it's not in the lid area any more, so you would just have to hold the light in the appropriate place by other means.