Commit 3948fd6f authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

initial commit

parent f9a26a9f
This diff is collapsed.
/*
FILE NAME : axii_and_scales.js
DESCRIPTION: optical design
REVISION: 1.00
AUTHOR: Oleg Dzhimiev <oleg@elphel.com>
LICENSE: AGPL, see http://www.gnu.org/licenses/agpl.txt
Copyright (C) 2014 Elphel, Inc.
*/
function draw_axii(){
//x-axis
$("#cnv1").drawLine({
layer: true,
name: "axis_x",
strokeStyle: "rgba(50,50,50,0.5)",
strokeWidth: 0.5,
x1: x0, y1: $("#cnv1").height()/2,
x2: $("#cnv1").width()-x0, y2: $("#cnv1").height()/2
});
$("#cnv1").drawLine({
layer: true,
name: "axis_x_arrow",
strokeStyle: "rgba(50,50,50,0.5)",
fillStyle: "rgba(50,50,50,0.5)",
strokeWidth: 0.5,
x1: $("#cnv1").width()-x0, y1: $("#cnv1").height()/2,
x2: $("#cnv1").width()-x0-x0, y2: $("#cnv1").height()/2+2,
x3: $("#cnv1").width()-x0-x0, y3: $("#cnv1").height()/2-2,
});
$("#cnv1").drawText({
layer: true,
name: "axis_x_label",
fillStyle: "rgba(0,0,0,0.5)",
x: $("#cnv1").width()-x0, y: $("#cnv1").height()/2+y0,
font: "8px Arial, sans-serif",
align:"left",
text: "z"
});
//y-axis
$("#cnv1").drawLine({
layer: true,
name: "axis_y",
strokeStyle: "rgba(50,50,50,0.5)",
strokeWidth: 0.5,
x1: xO, y1: $("#cnv1").height()-3*y0+5,
x2: xO, y2: y0
});
$("#cnv1").drawLine({
layer: true,
name: "axis_y_arrow",
strokeStyle: "rgba(50,50,50,0.5)",
fillStyle: "rgba(50,50,50,0.5)",
strokeWidth: 0.5,
x1: xO, y1: y0,
x2: xO+2, y2: y0+y0,
x3: xO-2, y3: y0+y0,
});
$("#cnv1").drawText({
layer: true,
name: "axis_y_label",
fillStyle: "rgba(0,0,0,0.5)",
x: xO-x0, y: y0,
font: "8px Arial, sans-serif",
align:"left",
text: "y"
});
}
//draw mm scale
function draw_reference_scale(){
var sx0=xO;
var sy0=$("#cnv1").height()-y0-5;
//lines
$("#cnv1").drawLine({
layer: true,
strokeStyle: "rgba(0,0,0,1)",
strokeWidth: 0.5,
x1: sx0, y1: sy0-5,
x2: sx0, y2: sy0+5,
x3: sx0, y3: sy0,
x4: sx0+canvas_reference_scale, y4: sy0,
x5: sx0+canvas_reference_scale, y5: sy0-5,
x6: sx0+canvas_reference_scale, y6: sy0+5,
cornerRadius: 0,
});
//1m label
$("#cnv1").drawText({
layer: true,
fillStyle: "rgba(0,0,0,1)",
x: sx0+canvas_reference_scale-30, y: sy0-10,
font: "8pt Verdana, sans-serif",
align:"left",
text: (canvas_reference_scale/canvas_scale)+"mm"
});
}
function draw_scale(){
canvas_length = $("#cnv1").width() - 3*x0;
//mm scale
canvas_scale_steps = canvas_length/canvas_reference_scale;
for (var i=1;i<canvas_scale_steps;i++){
$("#cnv1").drawLine({
layer: true,
strokeStyle: "rgba(0,0,0,0.5)",
strokeWidth: 0.5,
x1: xO+(canvas_reference_scale*i), y1: $("#cnv1").height()/2-3,
x2: xO+(canvas_reference_scale*i), y2: $("#cnv1").height()/2+3
});
if (i%5==0) {
if ((xO+(canvas_reference_scale*i)+12)<($("#cnv1").width() - xO))
$("#cnv1").drawText({
layer: true,
fillStyle: "rgba(0,0,0,0.5)",
x: xO+(canvas_reference_scale*i)+3, y: $("#cnv1").height()/2-14,
font: "8pt Verdana, sans-serif",
align:"left",
text: i*(canvas_reference_scale/canvas_scale)+"mm"
});
}
}
canvas_height = $("#cnv1").height()/2 - 3*y0/2;
canvas_scale_steps = canvas_height/canvas_reference_scale;
for (var i=1;i<canvas_scale_steps;i++){
$("#cnv1").drawLine({
layer: true,
strokeStyle: "rgba(0,0,0,0.5)",
strokeWidth: 0.5,
x1: xO-3, y1: $("#cnv1").height()/2-(canvas_reference_scale*i),
x2: xO+3, y2: $("#cnv1").height()/2-(canvas_reference_scale*i)
});
$("#cnv1").drawLine({
layer: true,
strokeStyle: "rgba(0,0,0,0.5)",
strokeWidth: 0.5,
x1: xO-3, y1: $("#cnv1").height()/2+(canvas_reference_scale*i),
x2: xO+3, y2: $("#cnv1").height()/2+(canvas_reference_scale*i)
});
}
}
\ No newline at end of file
button {
/* font-family:"Times New Roman", Times, serif;*/
border: 0px solid black;
font-size: 16px;
/*line-height: 24px;*/
padding: 3px 10px 0px 10px;
margin: 3px 3px 3px 3px;
/*border radius*/
border-radius: 2px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
/*shadow*/
-moz-box-shadow: 1px 1px 1px black;
-webkit-box-shadow: 1px 1px 1px black;
box-shadow: 1px 1px 1px black;
/*text-shadow: 1px 1px 1px gray;*/
color: rgba(260,260,260,1);
text-align:center;
/*remove text selection*/
/* -webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;*/
}
button::-moz-focus-inner {
border: 0;
}
button:active, button:disabled {
text-shadow: 0px 0px 0px gray;
color: rgba(150,100,100,1);
/*shadow*/
-moz-box-shadow: 1px 1px 1px gray;
-webkit-box-shadow: 1px 1px 1px gray;
box-shadow: 1px 1px 1px gray;
/*margin: 3px 1px 3px 5px;*/
/* margin-left: 2px;
margin-top: 2px;*/
}
button:hover{
/* -moz-box-shadow: 0px 0px 10px black;
-webkit-box-shadow: 0px 0px 10px black;
box-shadow: 0px 0px 10px black; */
}
/*background gradients*/
button {
background: -webkit-gradient(linear, left top, left bottom, from(rgba(200,100,100,0.7)), to(rgba(200,100,100,0.7))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(200,100,100,0.7), rgba(200,100,100,0.7)); /* for firefox 3.6+ */
}
button:hover {
background: -webkit-gradient(linear, left top, left bottom, from(rgba(256,170,170,1)), to(rgba(230,130,130,1))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(256,170,170,1), rgba(230,130,130,1)); /* for firefox 3.6+ */
}
button:active, button:disabled {
background: -webkit-gradient(linear, left top, left bottom, from(rgba(230,130,130,1)), to(rgba(256,170,170,1))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(230,130,130,1), rgba(256,170,170,1)); /* for firefox 3.6+ */
}
input {
border: 0px solid black;
/*line-height: 22px;*/
width: 110px;
height: 15px;
-moz-line-height: 18px;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
padding: 2px 5px 2px 5px;
}
\ No newline at end of file
/*
FILE NAME : files.js
DESCRIPTION: optical design
REVISION: 1.00
AUTHOR: Oleg Dzhimiev <oleg@elphel.com>
LICENSE: AGPL, see http://www.gnu.org/licenses/agpl.txt
Copyright (C) 2014 Elphel, Inc.
*/
function save_design(){
console.log("save_design(): "+$("#file_to_save").val());
var xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Document>\n";
$(".elements").each(function(i){
//console.log($(this).find("#distance").val()+" ")
xml += "\t<element>\n";
xml += "\t\t<distance>"+e[i].d+"</distance>\n";
xml += "\t\t<thickness>"+e[i].t+"</thickness>\n";
xml += "\t\t<material>"+e[i].m+"</material>\n";
xml += "\t\t<name>"+e[i].name+"</name>\n";
xml += "\t\t<front>\n";
xml += "\t\t\t<height>"+e[i].front.h+"</height>\n";
xml += "\t\t\t<rcurve>"+e[i].front.c+"</rcurve>\n";
xml += "\t\t\t<k>"+e[i].front.k+"</k>\n";
xml += "\t\t\t<a1>"+e[i].front.a[0]+"</a1>\n";
xml += "\t\t\t<a2>"+e[i].front.a[1]+"</a2>\n";
xml += "\t\t\t<a3>"+e[i].front.a[2]+"</a3>\n";
xml += "\t\t\t<a4>"+e[i].front.a[3]+"</a4>\n";
xml += "\t\t</front>\n";
xml += "\t\t<back>\n";
xml += "\t\t\t<height>"+e[i].back.h+"</height>\n";
xml += "\t\t\t<rcurve>"+e[i].back.c+"</rcurve>\n";
xml += "\t\t\t<k>"+e[i].back.k+"</k>\n";
xml += "\t\t\t<a1>"+e[i].back.a[0]+"</a1>\n";
xml += "\t\t\t<a2>"+e[i].back.a[1]+"</a2>\n";
xml += "\t\t\t<a3>"+e[i].back.a[2]+"</a3>\n";
xml += "\t\t\t<a4>"+e[i].back.a[3]+"</a4>\n";
xml += "\t\t</back>\n";
xml += "\t</element>\n";
});
xml += "</Document>"
postSettings($("#file_to_save").val(), "save", xml);
}
function postSettings(file, cmd, xml) {
$.ajax({
url: "files.php?file="+file+"&cmd="+cmd,
type: "POST",
dataType: "xml",
data: xml,
async:false,
complete: function(response){parse_save_response(response.responseText);},
contentType: "text/xml; charset=\"utf-8\""
});
}
function parse_save_response(text) {
//$("#test").html(text);
//reload list
get_designs_list("load_designs_list");
jquery_list("load_designs_list","Load",load_design);
}
function getDesign(file) {
$.ajax({
url: "files.php?file="+file+"&cmd=read",
type: "GET",
async: false,
complete: function(response){
restore_design(response.responseXML);
},
contentType: "text/xml; charset=\"utf-8\""
});
}
function restore_design(text){
console.log("restore_design()");
//erase old
$(".elements").each(function(){
console.log("removing "+$(this).attr("value"));
array_remove_element($(this).attr("value"));
// $("#element_"+i).remove();
// $("#cnv1").removeLayer("element_"+i).drawLayers();
});
selected_elements = Array();
//draw new
var data = $(text).find("Document");
data.find("element").each(function(){
array_add_element(
$(this).find("distance").text(),
$(this).find("thickness").text(),
$(this).find("material").text(),
$(this).find("name").text(),
$(this).find("front").find("height").text(),
$(this).find("front").find("rcurve").text(),
$(this).find("front").find("k").text(),
$(this).find("front").find("a1").text(),
$(this).find("front").find("a2").text(),
$(this).find("front").find("a3").text(),
$(this).find("front").find("a4").text(),
$(this).find("back").find("height").text(),
$(this).find("back").find("rcurve").text(),
$(this).find("back").find("k").text(),
$(this).find("back").find("a1").text(),
$(this).find("back").find("a2").text(),
$(this).find("back").find("a3").text(),
$(this).find("back").find("a4").text()
);
});
}
\ No newline at end of file
<?php
/*
FILE NAME : files.php
DESCRIPTION: optical design
REVISION: 1.00
AUTHOR: Oleg Dzhimiev <oleg@elphel.com>
LICENSE: AGPL, see http://www.gnu.org/licenses/agpl.txt
Copyright (C) 2014 Elphel, Inc.
*/
if (isset($_GET['file'])) $file = $_GET['file'];
else die("-1");
if (isset($_GET['cmd'])) $cmd = $_GET['cmd'];
else die("-2");
$default_path = "local";
if ($cmd=="save") {
file_put_contents("$default_path/$file",file_get_contents("php://input"));
}elseif ($cmd=="read") {
$content = file_get_contents("$default_path/$file");
header("Content-Type: text/xml\n");
header("Content-Length: ".strlen($content)."\n");
header("Pragma: no-cache\n");
echo $content;
}
?>
\ No newline at end of file
<?php
/*
FILE NAME : get_designs_list.php
DESCRIPTION: optical design
REVISION: 1.00
AUTHOR: Oleg Dzhimiev <oleg@elphel.com>
LICENSE: AGPL, see http://www.gnu.org/licenses/agpl.txt
Copyright (C) 2014 Elphel, Inc.
*/
//$res_xml = file_get_contents("sensors/sensors.xml");
$path = "local";
$res_xml = "<?xml version='1.0'?>\n";
$res_xml .= "<Document>\n";
$files = scandir($path);
foreach($files as $file){
if (is_file("$path/$file")) {
$res_xml .= "\t<file>$file</file>\n";
}
}
$res_xml .= "</Document>";
header("Content-Type: text/xml");
header("Content-Length: ".strlen($res_xml)."\n");
header("Pragma: no-cache\n");
printf("%s", $res_xml);
flush();
?>
#cnv1{
position: absolute;
left:5px;
top:5px;
width: 1000px;
height: 500px;
box-shadow: 0px 0px 5px rgba(100,100,100,0.7);
border-radius:3px;
}
#elements_table_header{
position: absolute;
left:5px;
top:510px;
}
#elements_table{
position: absolute;
left:5px;
top:544px;
}
#controls_div{
position: absolute;
left: 1010px;
top:5px;
}
table {
border: 1px solid rgba(200,200,200,1);
border-collapse:collapse;
}
#elements_table_header, #controls_table, #ray_draw_table{
background: rgba(200,200,200,0.6);
}
td{
padding: 2px 5px 2px 5px;
text-align: center;
border: 0px solid red;
}
#controls_table tr td input{
padding: 10px;
}
input{
width: 100px;
text-align:right;
}
#file_to_save{
width: 200px;
}
#load_designs_list{
position:absolute;
left:1010px;
top:44px;
}
#number{
margin: 0px;
padding:2px 3px 2px 3px;
font-size:0.7em
}
#ray_draw_div{
position: absolute;
left:1010px;
top:74px;
}
.remove_button{
font-size: 16px;
margin: 0px;
padding: 1px 6px 1px 6px;
border-radius: 10px;
}
.plus_button{
font-size: 16px;
padding: 2px 6px 0px 6px;
border-radius: 10px;
}
.elements{
margin: 0px;
}
#elements_table{
padding: 0px 0px 0px 0px;
background: rgba(200,200,200,0.6);
}
<html>
<!--
FILE NAME : index.html
DESCRIPTION: optical design
REVISION: 1.00
AUTHOR: Oleg Dzhimiev <oleg@elphel.com>
LICENSE: AGPL, see http://www.gnu.org/licenses/agpl.txt
Copyright (C) 2014 Elphel, Inc.
-->
<head>
<title>Lens Design Tool</title>
<script src="jquery-2.1.0.min.js" type="text/javascript"></script>
<script src="jcanvas.min.js" type="text/javascript"></script>
<script src="lens_design.js" type="text/javascript"></script>
<script src="axii_and_scales.js" type="text/javascript"></script>
<script src="list.js" type="text/javascript"></script>
<script src="jquery_list.js" type="text/javascript"></script>
<script src="files.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="button.css" />
<link rel="stylesheet" type="text/css" href="index.css" />
<link rel="stylesheet" type="text/css" href="list.css" />
</head>
<body>
<div id=load_designs_list class=list></div>
<div id="cnv1_div">
<canvas id="cnv1" width="1000" height="500"></canvas>
</div>
<div id="controls_div">
<table id="controls_table">
<tr>
<td><button onclick="save_design()">Save</button></td>
<td><input type="text" id="file_to_save" value="tmp_design.xml" /></td>
</tr>
<td></td>
<td></td>
</table>
</div>
<div id="elements_table_header_div">
<table id="elements_table_header">
<tr id="header">
<td><div style="width:16px;">#</div></td>
<td width=100 >Distance, <span style="font-size:0.8em">mm</span></td>
<td width=100 >Thickness, <span style="font-size:0.8em">mm</span></td>
<td width=100 >Material</td>
<td width=100 >Comment</td>
<td width=24></td>
<td>Aperture<span style="font-size:0.8em"> (Dia)</span>, <span style="font-size:0.8em">mm</span></td>
<td width=100 >R<span style="font-size:0.8em">(curve)</span>, <span style="font-size:0.8em">mm</span></td>
<td width=100 >&kappa;</td>
<td width=100 >&alpha;<span style="font-size:0.6em">1</span></td>
<td width=100 >&alpha;<span style="font-size:0.6em">2</span></td>
<td width=100 >&alpha;<span style="font-size:0.6em">3</span></td>
<td width=95 >&alpha;<span style="font-size:0.6em">4</span></td>
<td><button class='plus_button' onclick="element_add_button()"><b>+</b></button></td>
</tr>
</table>
</div>
<div id="elements_table">
</div>
<div id="ray_draw_div">
<table id="ray_draw_table">
<tr>
<td>Image height/2, <span style="font-size:0.6em">mm</span></td>
<td><input type="text" id="rays_imhh" value="3" /></td>
</tr>
<tr>
<td>N</td>
<td><input type="text" id="rays_n" value="3" /></td>
</tr>
<tr>
<td>color</td>
<td><input type="text" id="rays_color" value="rgb(20,150,20)" /></td>
</tr>
<tr>
<td><button onclick="rays_draw()">Draw rays</button></td>
</tr>
</table>
</div>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
function jquery_list(list, msg, callback) {
var selectBoxContainer = $("#"+list);
//add the header box <div> to the list
selectBoxContainer.append("<div class='list_head'></div>");
//assign the default message to the list header
var selectBox = selectBoxContainer.find('.list_head');
selectBox.html(msg);
selectBoxContainer.attr('value',msg);
//process the list
var dropDown = selectBoxContainer.find('.list_view');
//console.log(dropDown);
//selectBoxContainer.append(dropDown.hide());
dropDown.hide();
dropDown.bind('show',function(){
selectBox.addClass('expanded');
dropDown.fadeIn();
}).bind('hide',function(){
selectBox.removeClass('expanded');
dropDown.fadeOut();
}).bind('toggle',function(){
if (selectBox.hasClass('expanded')) dropDown.trigger('hide');
else dropDown.trigger('show');
});
selectBox.click(function(){
dropDown.trigger('toggle');
return false;
});
$(document).click(function(){
dropDown.trigger('hide');
});
//process all the list elements
dropDown.find('li').each(function(i) {
var li = $(this);
li.click(function(){
selectBox.html(li.html());
selectBoxContainer.attr('value',li.html());
//selectBoxContainer.attr('value',i);
dropDown.trigger('hide');
//my function
callback("list",i);
return false;
});
});
}
\ No newline at end of file
This diff is collapsed.
.list
{
background:red;
}
.list_view ul{
position: relative;
top: -12px;
left: -40px;
width:280px;
}
.list_view li
{
list-style-type: none;
display: block;
border: 1px dotted rgba(220,220,220,1);
background: rgba(250,250,250,1);
z-index: 100;
padding-left: 5px;
color: black;
}
.list_view li:hover
{
background: rgba(200,128,128,1);
}
.list_head
{
/* font-family:"Times New Roman", Times, serif;*/
font-family:Arial;
position:absolute;
width: 285px;
height: 25px;
z-index: 50;
line-height: 25px; /*should be the same as height*/
font-size: 1em;
text-align:center;
color: rgba(256,256,256,1);
background: -webkit-gradient(linear, left top, left bottom, from(rgba(200,100,100,0.7)), to(rgba(200,100,100,0.7))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(200,100,100,0.7), rgba(200,100,100,0.7)); /* for firefox 3.6+ */
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
}
.list_head:hover
{
background: -webkit-gradient(linear, left top, left bottom, from(rgba(256,170,170,1)), to(rgba(230,130,130,1))); /* for webkit browsers */
background: -moz-linear-gradient(top, rgba(256,170,170,1), rgba(230,130,130,1)); /* for firefox 3.6+ */
cursor: default;
}
.list_view{
position: absolute;
top: 25px;
left: 3px;
/*background:black;*/
padding:0px;
line-height: 25px; /*should be the same as height*/
font-size: 14px;
width: 285px;
height: 200px;
overflow:hidden;
z-index:100;
}
\ No newline at end of file
$(function(){
get_designs_list("load_designs_list");
jquery_list("load_designs_list","Load",load_design);
//jquery_list("input_sensor_list",list_initial_value,update_sensor_fields);
//var list_div = document.getElementById('load_designs_list');
//if (list_div.addEventListener) list_div.addEventListener('DOMMouseScroll', wheelEvent_list, false);
//list_div.onmousewheel = wheelEvent_list;
});
function load_design(src,i){
console.log("Loading lens design: "+designs[i]);
getDesign(designs[i]);
}
function get_designs_list_sync(some_folder,type) {
$.ajax({
url: "./get_designs_list.php",
async: false,
dataType: "xml",
success: function(data){fill_designs_list(data.getElementsByTagName("file"));}
});
}
var designs = Array();
function fill_designs_list(designs_list){
designs = Array();
for (var i=0;i<designs_list.length;i++){
var tmp = designs_list[i];
if (tmp.length != 0) {
if (typeof(tmp.childNodes[0])!='undefined') designs[i] = tmp.childNodes[0].nodeValue;
else designs[i] = "";
}
}
}
function get_designs_list(element_id) {
var some_folder = "";
var folder_list = "";
if (some_folder!="Load") {
get_designs_list_sync();
var list = "<div class='list_view'><ul>";
for(var i=0; i<designs.length; i++) {
list = list + "<li>"+designs[i]+"</li>";
}
list = list + "</ul></div>";
}else{
list = "<div class='list_view'><ul></ul></div>";
}
$("#"+element_id).html(list);
}
function wheelEvent_list(event){
var delta = 0;
if (!event) event = window.event; // IE
if (event.wheelDelta) { //IE+Opera
delta = event.wheelDelta/120;
if (window.opera) delta = -delta;
} else if (event.detail) { // Mozilla
delta = -event.detail;
}
if (delta)
handleWheel_list(event,delta);
if (event.preventDefault)
event.preventDefault();
event.returnValue = false;
}
function handleWheel_list(event,delta) {
var tmp = $(".list_view ul").position().top;
console.log($(".list_view ul").position().top+" "+$(".list_view ul").offset().top);
var tmp2 = +tmp+20*delta;
if (tmp2 > -12) tmp2=-12;
if (tmp2 < (-$(".list_view ul").height()+$(".list_view").height()-12) ) tmp2=-$(".list_view ul").height()+$(".list_view").height()-12;
$(".list_view ul").css({top:tmp2+'px'});
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
FILE NAME : 0353-70-64.xml
DESCRIPTION: potential design for Eyesis series
REVISION: 1.00
LICENSE: CERN OHL v.1.1 or later, see http://ohwr.org/cernohl
Copyright (C) 2014 Elphel, Inc.
-->
<Document>
<element>
<distance>0</distance>
<thickness>2</thickness>
<material>LASF14A</material>
<name></name>
<front>
<height>19</height>
<rcurve>44.1995256672</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</front>
<back>
<height>19</height>
<rcurve>246.6876684899</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</back>
</element>
<element>
<distance>2.5000001103</distance>
<thickness>0.9798916508</thickness>
<material>SK16</material>
<name></name>
<front>
<height>13.2</height>
<rcurve>28.7407314472</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</front>
<back>
<height>8.4</height>
<rcurve>4.6429368608</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</back>
</element>
<element>
<distance>5.523528887</distance>
<thickness>2.5000747341</thickness>
<material>BAF51</material>
<name></name>
<front>
<height>9.2</height>
<rcurve>10.1726461944</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</front>
<back>
<height>6.4</height>
<rcurve>4.6194936713</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</back>
</element>
<element>
<distance>10.0236036211</distance>
<thickness>2.5344684091</thickness>
<material>SF57</material>
<name></name>
<front>
<height>9</height>
<rcurve>14.5286371088</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</front>
<back>
<height>9</height>
<rcurve>-20.3628934583</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</back>
</element>
<element>
<distance>12.9906694879</distance>
<thickness></thickness>
<material></material>
<name>aperture stop</name>
<front>
<height>-2.0802795223</height>
<rcurve></rcurve>
<k>NaN</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</front>
<back>
<height>NaN</height>
<rcurve></rcurve>
<k>NaN</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</back>
</element>
<element>
<distance>14.2945748147</distance>
<thickness>1.5</thickness>
<material>SF58</material>
<name></name>
<front>
<height>7.4</height>
<rcurve>-30.5356011642</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</front>
<back>
<height>7.4</height>
<rcurve>8.9309914413</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</back>
</element>
<element>
<distance>15.7945748147</distance>
<thickness>1.9557993329</thickness>
<material>N-SK15</material>
<name></name>
<front>
<height>7.4</height>
<rcurve>8.9309914413</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</front>
<back>
<height>7.4</height>
<rcurve>-7.4851654525</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</back>
</element>
<element>
<distance>18.2605400091</distance>
<thickness>1.5</thickness>
<material>N-FK51A</material>
<name></name>
<front>
<height>9</height>
<rcurve>24.7891335236</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</front>
<back>
<height>9</height>
<rcurve>-12.6157169321</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</back>
</element>
<element>
<distance>20.4723519148</distance>
<thickness>2.0521328555</thickness>
<material>N-FK51</material>
<name></name>
<front>
<height>9</height>
<rcurve>11.3993328019</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</front>
<back>
<height>9</height>
<rcurve>-31.8291341955</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</back>
</element>
<element>
<distance>28.2244847702</distance>
<thickness>0.5</thickness>
<material>N-BK7</material>
<name>field flattener</name>
<front>
<height>8</height>
<rcurve>-8</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</front>
<back>
<height>9</height>
<rcurve>-10000</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</back>
</element>
<element>
<distance>28.7244847702</distance>
<thickness>0.4</thickness>
<material>N-BK7</material>
<name>sensor glass</name>
<front>
<height>8</height>
<rcurve>10000</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</front>
<back>
<height>8</height>
<rcurve>-10000</rcurve>
<k>0</k>
<a1>0</a1>
<a2>0</a2>
<a3>0</a3>
<a4>0</a4>
</back>
</element>
</Document>
\ No newline at end of file
<html>
<head>
<link rel="stylesheet" type="text/css" media="all" href="css/reset.css" /> <!-- reset css -->
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<style>
body{ background-color: ivory; }
#canvas{border:1px solid red;}
</style>
<script>
$(function(){
var canvas=document.getElementById("canvas");
var ctx=canvas.getContext("2d");
ctx.beginPath();
ctx.moveTo(66,21);
ctx.lineTo(79,35);
ctx.lineTo(79,53);
ctx.quadraticCurveTo(79-55,53+(185-53)/2,79,167);
ctx.lineTo(79,185);
ctx.lineTo(66,199);
ctx.quadraticCurveTo(66-60,21+(199-21)/2,66,21);
ctx.closePath();
ctx.fillStyle="skyblue";
ctx.fill();
ctx.lineWidth=2;
ctx.strokeStyle="black";
ctx.stroke();
}); // end $(function(){});
</script>
</head>
<body>
<canvas id="canvas" width=300 height=300></canvas>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment