Commits

Jason McKesson committed f714b2a

No longer necessary.

Comments (0)

Files changed (4)

Documents/Illumination/FacetedCircle.svg

Removed
Old image
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" height="301px" width="301px" >
-	<style type="text/css" ><![CDATA[.facets
-{
-	fill: none;
-	stroke: black;
-	stroke-width: 1px;
-	stroke-linejoin: round;
-}
-
-.circle
-{
-	fill: none;
-	stroke: black;
-}]]></style>
-	<defs >
-		<g id="g_faceted_circle" >
-			<circle r="120" cy="150" cx="150" class="circle" />
-			<path d="M 150 30 L 65.147186257614 65.147186257614 L 30 150 L 65.147186257614 234.85281374239 L 150 270 L 234.85281374239 234.85281374239 L 270 150 L 234.85281374239 65.147186257614 Z" class="facets" />
-		</g>
-	</defs>
-	<use xlink:href="#g_faceted_circle" y="0" x="0" height="300" width="300" />
-</svg>

Documents/Illumination/FacetedNearVsFar.svg

Removed
Old image
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" height="300px" width="400px" >
-	<style type="text/css" ><![CDATA[.__grid1
-{
-	stroke: #CCC;
-	stroke-width: 1px;
-	fill: none;
-}
-
-.ray
-{
-	marker-end: url(#arrow);
-	stroke: darkblue;
-	stroke-dasharray: 3,3;
-	stroke-width: 1px;
-}
-
-.__axis_arrow_end1
-{
-	marker-end: url(#__axis_arrow1);
-}
-
-.__axis1
-{
-	stroke: black;
-	stroke-width: 2px;
-	fill: none;
-}
-
-.light
-{
-	fill: yellow;
-	stroke: none;
-}
-
-.facets
-{
-	fill: lightblue;
-	stroke: black;
-	stroke-width: 1px;
-	stroke-linejoin: round;
-}
-
-.circle
-{
-	stroke: black;
-	stroke-width: 2px;
-	fill: none;
-}
-
-.show_clip
-{
-	fill: none;
-	stroke: black;
-}
-
-.surface
-{
-	fill: lightblue;
-	stroke: none;
-}
-
-.arrowhead
-{
-	fill: darkblue;
-	stroke: darkblue;
-}
-
-.clip_to_area
-{
-	clip-path: url(#area_clip);
-}]]></style>
-	<defs >
-		<marker markerWidth="10" markerHeight="8" refX="10" refY="4" markerUnits="userSpaceOnUse" orient="auto" id="arrow" >
-			<path d="M 10 4 L 0 0 L 0 8 Z" class="arrowhead" />
-		</marker>
-		<g id="g_surface" >
-			<rect y="0" x="325" height="150" width="75" class="surface" />
-		</g>
-		<g id="g_faceted_circle" >
-			<circle r="200" cy="250" cx="375" class="circle" />
-			<path d="M 375 50 L 218.63370350639 125.30203962825 L 180.01441756364 294.50418679126 L 288.22325217649 430.19377358048 L 461.77674782351 430.19377358048 L 569.98558243636 294.50418679126 L 531.36629649361 125.30203962825 Z" class="facets" />
-		</g>
-		<clipPath id="area_clip" >
-			<rect y="0" x="0" height="150" width="400" class="show_clip" />
-		</clipPath>
-	</defs>
-	<circle r="10" cy="75" cx="50" class="light" />
-	<circle r="10" cy="225" cx="225" class="light" />
-	<use xlink:href="#g_faceted_circle" y="0" x="0" height="150" width="400" class="clip_to_area" />
-	<use xlink:href="#g_faceted_circle" y="150" x="0" height="150" width="400" class="clip_to_area" />
-	<line x2="213.2410708021" y2="71.440997454968" y1="69.806226419516" x1="288.22325217649" class="ray" />
-	<line x2="221.91517993333" y2="83.811806536858" y1="87.651019814127" x1="296.8168517532" class="ray" />
-	<line x2="250.84915116786" y2="222.87649901276" y1="219.80622641952" x1="288.22325217649" class="ray" />
-	<line x2="259.88548610599" y2="231.14531220986" y1="237.65101981413" x1="296.8168517532" class="ray" />
-</svg>

Documents/Illumination/GenFacetedCircle.lua

-require "SvgWriter"
-require "vmath"
-require "Viewport"
-require "SubImage"
-require "_utils"
-
-local subImageSize = 300;
-
-local subImages = SubImage.SubImage(1, 1, subImageSize, subImageSize, 50, 0);
-
-local coordSize = 2;
-
-local vp = Viewport.Viewport(subImages:SubSize(), {0, 0}, coordSize)
-local trans2 = Viewport.Transform2D()
-vp:SetTransform(trans2);
-
--- Styles
-local styleLib = SvgWriter.StyleLibrary();
-local pointSize = 9;
-local textSize = 25;
-
-styleLib:AddStyle(nil, "facets",
-	SvgWriter.Style():stroke("black"):stroke_width("1px"):stroke_linejoin("round"):fill("none"));
-
-styleLib:AddStyle(nil, "circle",
-	SvgWriter.Style():stroke("black"):fill("none"));
-	
-
---Vertices
-local circleRadius = 0.8;
-
-local vpCircleRadius = vp:Transform(vmath.vector(circleRadius, circleRadius, 0.0));
-vpCircleRadius = math.abs(vpCircleRadius.x);
-
-local circleCenterPt = vmath.vec2(0, 0);
-
---Facets
-local numFacets = 8;
-
-local facetPath = SvgWriter:Path();
-
-for i=1, numFacets do
-	local angle = ((i - 1) / numFacets) * math.pi * 2 + (math.pi / 2);
-	local point = vmath.vec2(math.cos(angle), math.sin(angle));
-	point = (point * circleRadius) + circleCenterPt;
-	
-	point = vp:Transform(point);
-
-	if(i == 1) then
-		facetPath:M(point);
-	else
-		facetPath:L(point);
-	end
-end
-
-facetPath:Z();
-
-local writer = SvgWriter.SvgWriter(ConstructSVGName(arg[0]), {(subImages:Size().x + 1) .."px", (subImages:Size().y + 1) .. "px"});
-	writer:StyleLibrary(styleLib);
-	writer:BeginDefinitions();
-		writer:BeginGroup(nil, "g_faceted_circle");
-			writer:Circle(vp:Transform(circleCenterPt), vpCircleRadius, {"circle"});
-			writer:Path(facetPath, {"facets"});
-		writer:EndGroup();
-	writer:EndDefinitions();
-	
-	writer:Use("g_faceted_circle", subImages:Offset(1, 1), subImages:SubSize());
-
-writer:Close();

Documents/Illumination/GenFacetedNearVsFar.lua

-require "SvgWriter"
-require "vmath"
-require "Viewport"
-require "SubImage"
-require "GridAxis"
-require "_utils"
-
-local imageSize = vmath.vec2(400, 150);
-
-local subImages = SubImage.SubImage(1, 2, imageSize.x, imageSize.y, 0, 0);
-
-local coordSize = 6;
-local coordWidth = coordSize * (imageSize.x / imageSize.y);
-
-local vp = Viewport.Viewport(imageSize, {-5, 0}, {coordWidth, coordSize})
-local trans2 = Viewport.Transform2D()
-vp:SetTransform(trans2);
-
-local styleLib = SvgWriter.StyleLibrary();
-
-local lightSourceColor = "yellow";
-local surfaceColor = "lightblue";
-local rayColor = "darkblue";
-
-styleLib:AddStyle(nil, "surface", SvgWriter.Style():stroke("none"):fill(surfaceColor));
-styleLib:AddStyle(nil, "light", SvgWriter.Style():stroke("none"):fill(lightSourceColor));
-styleLib:AddStyle(nil, "arrowhead",
-	SvgWriter.Style():stroke(rayColor):fill(rayColor));
-	
-styleLib:AddStyle(nil, "ray",
-	SvgWriter.Style():stroke(rayColor):stroke_width("1px"):stroke_dasharray({3, 3}):marker_end(SvgWriter.uriLocalElement("arrow")));
-	
-styleLib:AddStyle(nil, "facets",
-	SvgWriter.Style():stroke("black"):stroke_width("1px"):stroke_linejoin("round"):fill(surfaceColor));
-
-styleLib:AddStyle(nil, "circle",
-	SvgWriter.Style():stroke("black"):stroke_width("2px"):fill("none"));
-	
-styleLib:AddStyle(nil, "show_clip",
-	SvgWriter.Style():stroke("black"):fill("none"));
-	
-styleLib:AddStyle(nil, "clip_to_area",
-	SvgWriter.Style():clip_path(SvgWriter.uriLocalElement("area_clip")));
-
-	
-local axisData = GridAxis.GridAxis2D(vp, nil, styleLib, true, nil);
-
---Surface and light.
-local surfaceDim =
-{
-	vmath.vec2(0, coordSize / 2),
-	vmath.vec2(3, -coordSize / 2),
-};
-
-local lightSourcePos = 
-{
-	vmath.vec2(-11, 0),
-	vmath.vec2(-4, 0);
-}
-
-local lightSourceRadius = 0.4;
-
-lightSourceRadius = vp:Transform(vmath.vector(lightSourceRadius, lightSourceRadius, 0.0));
-lightSourceRadius = math.abs(lightSourceRadius.x);
-
-
---Vertices
-local circleRadius = 8;
-
-local vpCircleRadius = vp:Transform(vmath.vector(circleRadius, circleRadius, 0.0));
-vpCircleRadius = math.abs(vpCircleRadius.x);
-
-local circleCenterPt = vmath.vec2(2, -7);
-
---Facets
-local numFacets = 7;
-
-local facetPath = SvgWriter:Path();
-
-for i=1, numFacets do
-	local angle = ((i - 1) / numFacets) * math.pi * 2 + (math.pi / 2);
-	local point = vmath.vec2(math.cos(angle), math.sin(angle));
-	point = (point * circleRadius) + circleCenterPt;
-	
-	point = vp:Transform(point);
-
-	if(i == 1) then
-		facetPath:M(point);
-	else
-		facetPath:L(point);
-	end
-end
-
-facetPath:Z();
-
---Diffuse Rays
-local function CalcRays(lightPos, rayLen)
-	rayLen = rayLen or 3;
-	
-	local rayLines = {};
-
-	local startAngle = (0 / numFacets) * math.pi * 2 + (math.pi / 2);
-	local endAngle = (1 / numFacets) * math.pi * 2 + (math.pi / 2);
-	local facetAngle = startAngle + (2 * math.pi / numFacets / 2);
-	
-	local startLoc = vmath.vec2(math.cos(facetAngle), math.sin(facetAngle));
-	startLoc = (startLoc * circleRadius) + circleCenterPt;
-	rayLines[#rayLines + 1] = startLoc;
-	
-	local dir = vmath.norm(lightPos - startLoc);
-	rayLines[#rayLines + 1] = startLoc + (dir * rayLen);
-
-	local startPt = vmath.vec2(math.cos(startAngle), math.sin(startAngle));
-	local endPt = vmath.vec2(math.cos(endAngle), math.sin(endAngle));
-	startPt = (startPt * circleRadius) + circleCenterPt;
-	endPt = (endPt * circleRadius) + circleCenterPt;
-	
-	local midPt = (startPt + endPt) / 2;
-	rayLines[#rayLines + 1] = midPt;
-
-	dir = vmath.norm(lightPos - midPt);
-	rayLines[#rayLines + 1] = midPt + (dir * rayLen);
-	
-	return rayLines;
-end
-
-local rays =
-{
-	CalcRays(lightSourcePos[1]),
-	CalcRays(lightSourcePos[2], 1.5),
-}
-
-surfaceDim = vp:Transform(surfaceDim);
-lightSourcePos = vp:Transform(lightSourcePos);
-rays[1] = subImages:Transform({1, 1}, vp:Transform(rays[1]));
-rays[2] = subImages:Transform({1, 2}, vp:Transform(rays[2]));
-
-
-local writer = SvgWriter.SvgWriter(ConstructSVGName(arg[0]), {subImages:Size().x .."px", subImages:Size().y .. "px"});
-	writer:StyleLibrary(styleLib);
-	writer:BeginDefinitions();
-		WriteStandardArrowhead(writer, "arrow", {"arrowhead"});
-		
-		writer:BeginGroup(nil, "g_surface");
-			--Draw surface and light.
-			writer:Rect2Pt(surfaceDim[1], surfaceDim[2], nil, {"surface"});
-		writer:EndGroup();
-		
-		writer:BeginGroup(nil, "g_faceted_circle");
-			writer:Circle(vp:Transform(circleCenterPt), vpCircleRadius, {"circle"});
-			writer:Path(facetPath, {"facets"});
-		writer:EndGroup();
-		
-		writer:BeginClipPath(nil, "area_clip");
-			writer:Rect(subImages:Offset(1, 1), subImages:SubSize(), nil, {"show_clip"});
-		writer:EndClipPath();
-		
-	writer:EndDefinitions();
-
---	axisData:AddDefinitions(writer, "g_axes");
---	writer:Use("g_axes", subImages:Offset(1, 1), subImages:SubSize());
---	writer:Use("g_axes", subImages:Offset(1, 2), subImages:SubSize());
-
-
-	lightSourcePos[1] = subImages:Transform({1, 1}, lightSourcePos[1]);
-	lightSourcePos[2] = subImages:Transform({1, 2}, lightSourcePos[2]);
-
-	writer:Circle(lightSourcePos[1], lightSourceRadius, {"light"});
-	writer:Circle(lightSourcePos[2], lightSourceRadius, {"light"});
-	
-	writer:Use("g_faceted_circle", subImages:Offset(1, 1), subImages:SubSize(), {"clip_to_area"});
-	writer:Use("g_faceted_circle", subImages:Offset(1, 2), subImages:SubSize(), {"clip_to_area"});
-
-	for i=1, #rays[1], 2 do
-		writer:Line(rays[1][i], rays[1][i + 1], {"ray"});
-	end
-	for i=1, #rays[2], 2 do
-		writer:Line(rays[2][i], rays[2][i + 1], {"ray"});
-	end
-	
-
-
-
-writer:Close();