hns - 日記自動生成システム - Version 2.19.9

先月 2024年02月 来月
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29
Namazu for hns による簡易全文検索
詳しくは 詳細指定/ヘルプを参照して下さい
検索式:

2024年02月08日(木) 旧暦 [n年日記] [更新:"2024/02/08 04:41:37"]

#1 [openscad] upper version non - invert, negative resist

upper-nega-resist.stl
// upper version  non - invert, negative resist

module slope (L, H, W, D) {

  translate([ -W/2, -D * 2, 0])   cube([ W, D, H]);
  translate([ -W/2,  D + L, 0])   cube([ W, D, H]);

  polyhedron(
      points = [
             [ -W/2,  0 , H],
             [  W/2,  0 , H],
             [  W/2,  L , 0], 
             [ -W/2,  L , 0], 
                       
             [ -W/2,  L , H], 
             [  W/2,  L , H], 
             ],
      faces  = [
             [ 0, 1, 2, 3],
             [ 3, 2, 5, 4],
             [ 4, 5, 1, 0],
             [ 0, 3, 4],
             [ 1, 5, 2]
             ]
             );
}

module slopex2(L, H, W, D, GAP) {

//                   x       y  z
translate([  W/2 + GAP,  - L/2, 50 ]) rotate([0, 180,   0]) slope (L,  H, W, D); 
translate([ -W/2 - GAP,    L/2, 50 ]) rotate([0, 180, 180]) slope (L,  H, W, D); 

}
//       Length, Height, Width, shift, gap

slopex2 (300,        50,   100, 50, 10);%


2024年02月09日(金) 旧暦 [n年日記] [更新:"2024/02/09 07:53:08"]

#1 [DWL66+][377nm] bit map format for contrast curve

Download (for Save Link As)

#!/usr/pkg/bin/perl
use strict;
my($VERSION);
$VERSION = "2024-02-10 08:32" ; # written by emacs time-stamp
## $VERSION .= ' UTC';
$VERSION =~ s/ /-/g;
$VERSION =~ s/:/./g;

sub box  {
    my ($arg_ptr) = @_;
    my $width    = $arg_ptr -> { -width};
    my $length   = $arg_ptr -> { -length};
    my $value    = $arg_ptr -> { -value};
    my $gap      = $arg_ptr -> { -gap};
   foreach my $i (0..$length - 1) {
       foreach my $j (0..$width - 1) { print PGM  $value . ' ' ; }
       foreach my $g (0..$gap-1    ) { print PGM  '00 ' ;        }
       foreach my $j (0..$width - 1) { print PGM  $value . ' ' ; }
       print PGM  "\n";
   }
}
    
sub main()  {
    my $base_name  =  $0;
       $base_name .=  '-'. $VERSION;  
    my $pgm_name .=  $base_name . '.pgm';
    my $bmp_name .=  $base_name . '.bmp';
    open(PGM, "> $pgm_name") || die "problem opening file to write: $!\n";
    print $pgm_name,"\n";  # See below after __END__ line
    my $max     = 127;
    my $width   = 100;
    my $length  = 50;
    my $gap     = 25;

    my $totalW  = $width * 2 + $gap;
    my $totalH  = $length * 4 + $max * 2;

    print PGM  "P2\n";
    printf( PGM " # %2d x %d bitmap PGM format\n", $totalW, $totalH);
    print PGM  $totalW, ' ' . $totalH . "\n";
    print PGM  $max . "\n";

    box ({ -length => $length, -width => $width, -value => $max, -gap=> $gap});
    box ({ -length => $length, -width => $width, -value => 0   , -gap=> $gap});

    foreach my $value (0..$max - 1) {
	foreach my $repeat (0,1)  {
	    foreach my $j (0..$width - 1) { print PGM  $value        . ' ' ; }
	    foreach my $g (0..$gap   - 1) { print PGM                '00 ' ; }
	    foreach my $j (0..$width - 1) { print PGM  $max - $value . ' ' ; }
	}
	print PGM  "\n";
    }
    box ({ -length => $length, -width => $width, -value => 0   , -gap=> $gap});
    box ({ -length => $length, -width => $width, -value => $max, -gap=> $gap});

    system ("convert $pgm_name $bmp_name") && die "conversion problem: $!\n";
}
main();
__END__

 feh `perl 225x456`


; please note I have copy in ~/.emacs-sub/time-stamp-setup.el
(require 'time-stamp)
(add-hook 'write-file-hooks 'time-stamp)
(setq time-stamp-active t)
;; (setq time-stamp-time-zone "UTC")
(setq time-stamp-time-zone nil)
(setq time-stamp-format "%04y-%02m-%02d %02H:%02M");
(setq time-stamp-start "$VERSION = \"") ;
(setq time-stamp-end "\"") ;
(setq time-stamp-line-limit 20) ; ; default is 8



2024年02月13日(火) 旧暦 [n年日記] [更新:"2024/02/13 09:51:52"]

#1 [openscad] paraboloid with base plane

STL model For Save As
//////////////////////////////////////////////////////////////////////////////////////////////
// Paraboloid module for OpenScad
//
// Copyright (C) 2013  Lochner, Juergen
// http://www.thingiverse.com/Ablapo/designs
//
// This program is free software. It is 
// licensed under the Attribution - Creative Commons license.
// http://creativecommons.org/licenses/by/3.0/
//////////////////////////////////////////////////////////////////////////////////////////////

module paraboloid (y=10, f=5, rfa=0, fc=1, detail=44){
	// y = height of paraboloid
	// f = focus distance 
	// fc : 1 = center paraboloid in focus point(x=0, y=f); 0 = center paraboloid on top (x=0, y=0)
	// rfa = radius of the focus area : 0 = point focus
	// detail = $fn of cone

	hi = (y+2*f)/sqrt(2);					// height and radius of the cone -> alpha = 45° -> sin(45°)=1/sqrt(2)
	x =2*f*sqrt(y/f);					// x  = half size of parabola
	
   translate([0,0,-f*fc])					// center on focus 
	rotate_extrude(convexity = 10,$fn=detail )		// extrude paraboild
	translate([rfa,0,0])					// translate for fokus area	 
	difference(){
		union(){					// adding square for focal area
		projection(cut = true)				// reduce from 3D cone to 2D parabola
				translate([0,0,f*2]) rotate([45,0,0])			// rotate cone 45° and translate for cutting
				translate([0,0,-hi/2])cylinder(h= hi, r1=hi, r2=0, center=true, $fn=detail);   	// center cone on tip
			translate([-(rfa+x ),0]) square ([rfa+x , y ]);		// focal area square
		}
		translate([-(2*rfa+x ), -1/2]) square ([rfa+x ,y +1] ); 	// cut of half at rotation center 
	}
}
rotate([180,0,0])

paraboloid (y=25,f=100,rfa= 0,fc=0,detail=120);
translate([0,0,-25.5])
cube([1000,1000,1],center = true);


2024年02月15日(木) 旧暦 [n年日記] [更新:"2024/02/15 03:30:25"]

#1 [openscad] curved star cone

Download STL format, for Save Link as
 module base (R, X, theta, z) {

polyhedron(
	points = [
      [ 0,	0,	0],         // 0
      [   cos (theta) * X * R,
          sin (theta) * X * R, -z],  // 1
      [ R,      0,      -z],            // 2
      [   cos (theta) * X * R,
        - sin (theta) * X * R, -z],  // 3

      [ 0,	0,	        0],        // 4
      [   cos (theta) * X * R,		
        - sin (theta) * X * R,  z],         // 5
      [ R,      0,              z],         // 6
      [   cos (theta) * X * R,
          sin (theta) * X * R,  z],  // 7
      ],
      faces = [
      [0, 1, 2, 3, 0],
      [4, 5, 6, 7, 4],
      [0, 1, 7, 4],
      [1, 2, 6, 7],
      [3, 2, 6, 5],
      [0, 3, 5, 4],
       ]
);
}

delta_y =  5;   // step of vertical angle 
end     = 90;   // 

    R = 100 ;  // Radius
    X =  0.5;  // ratio outer:inner
theta = 40.0;  // center angle of 1/8 unit
    z = 0.1 ;  //  hull hackgin thickness

// base shape
module rotate_base( R, X, theta, i) {
    rotate([0, - i , 0]) base (R, X, theta * (1 - i/90), z);
}


module rough_shape (  delta_y, R, X ) {
// ----------------------------------
// repeat 8 times over horizontal plane
// ----------------------------------

   for ( angle = [0:45:315] ) {

       rotate([0, 0, angle]) 
        for ( i = [0:delta_y:end]) {
         hull(){
	    rotate_base( R, X, theta, i-5);
	    rotate_base( R, X, theta, i+5);
        }
    }
  }
}

outer_boundary = 1000;

intersection() {
   rough_shape ( delta_y, R, X );
     // to cut the small part below zero-height plane, prepare large box
   translate([0,0, outer_boundary/2])
   cube (size = outer_boundary, center=true);
}


basement_size = 500; // 500 um
thickness     = 1;   
  cube([ basement_size,   basement_size, thickness], center = true);



2024年02月19日(月) 旧暦 [n年日記] [更新:"2004/08/09 23:43:33"]

#1 [DWL66+][bitmap] another (large, 0.55 x 1.0 m/m) version for contrast curve


For save link as



















#!/usr/pkg/bin/perl
use strict;
my($VERSION);
$VERSION = "2024-02-17 23:28" ; # written by emacs time-stamp
## $VERSION .= ' UTC';
$VERSION =~ s/ /-/g;
$VERSION =~ s/:/./g;

sub box  {
    my ($arg_ptr) = @_;
    my $width    = $arg_ptr -> { -width};
    my $length   = $arg_ptr -> { -length};
    my $value    = $arg_ptr -> { -value};
    my $gap      = $arg_ptr -> { -gap};
   foreach my $i (0..$length - 1) {
       foreach my $j (0..$width - 1) { print PGM  $value . ' ' ; }
       foreach my $g (0..$gap-1    ) { print PGM  '00 ' ;        }
       foreach my $j (0..$width - 1) { print PGM  $value . ' ' ; }
       print PGM  "\n";
   }
}
    
sub main()  {

    my $max     = 127;  # bmp light value
    my $width   = 250;
    my $length_posi  = 100;
    my $length_nega  = 100;
    my $slant_length = 600;
    my $gap     = 50;


    my $totalW  = $width * 2 + $gap;
    my $ref_length = $length_posi + $length_nega;

    my $totalH  = $ref_length * 2 + $slant_length;

    my $base_name  =  'cross_x2';
    $base_name = sprintf("cross_x2-%d-%d", $totalW, $totalH);

    $base_name .=  '-'. $VERSION;  
    my $pgm_name .=  $base_name . '.pgm';
    my $bmp_name .=  $base_name . '.bmp';

        open(PGM, "> $pgm_name") || die "problem opening file to write: $!\n";
    print $bmp_name,"\n";  # See below after __END__ line


    print PGM  "P2\n";
    printf( PGM " # %2d x %d bitmap PGM format\n", $totalW, $totalH);
    print PGM  $totalW, ' ' . $totalH . "\n";
    print PGM  $max . "\n";

    box ({ -length => $length_posi, -width => $width, -value => $max, -gap=> $gap});
    box ({ -length => $length_nega, -width => $width, -value => 0   , -gap=> $gap});


    foreach my $value (0..$slant_length - 1) {
	my $light_value = int ($value/$slant_length * 128);
##	foreach my $repeat (0,1)  {
	    foreach my $j (0..$width - 1) { print PGM  $light_value        . ' ' ; }
	    foreach my $g (0..$gap   - 1) { print PGM                '00 ' ; }
	    foreach my $j (0..$width - 1) { print PGM  $max - $light_value . ' ' ; }
##	}
	print PGM  "\n";
    }
    box ({ -length => $length_nega, -width => $width, -value => 0   , -gap=> $gap});
    box ({ -length => $length_posi, -width => $width, -value => $max, -gap=> $gap});

    system ("convert $pgm_name $bmp_name") && die "conversion problem: $!\n";
}
main();
__END__

 feh `perl 225x456`


; please note I have copy in ~/.emacs-sub/time-stamp-setup.el
(require 'time-stamp)
(add-hook 'write-file-hooks 'time-stamp)
(setq time-stamp-active t)
;; (setq time-stamp-time-zone "UTC")
(setq time-stamp-time-zone nil)
(setq time-stamp-format "%04y-%02m-%02d %02H:%02M");
(setq time-stamp-start "$VERSION = \"") ;
(setq time-stamp-end "\"") ;
(setq time-stamp-line-limit 20) ; ; default is 8



最近の日記
2024年11月14日
DWL66+ 2018 405 nm
2024年02月19日
another (large, 0.55 x 1.0 m/m) version for contrast curve
2024年02月15日
curved star cone
2024年02月13日
paraboloid with base plane
2024年02月09日
bit map format for contrast curve
以上、5 日分です。
タイトル一覧
カテゴリ分類
Powered by hns-2.19.9, HyperNikkiSystem Project