General > General Technical Chat

Angle Gradient for DIY Encoder

(1/2) > >>

eTobey:
Hi,

i would like to build an encoder, but i cant generate an useful printing pattern for it.

I tried Photoshop, but it limits steps to only 1%. Also i tried using CSS (HTML), but this yields not exact gradients.

I can not use an encoder, that uses a disc and puts light through it, i need to use reflection. On that one picture with the thin green lines, you can see the ring, where the print should go.

See also:
https://botscene.net/2012/10/18/make-a-low-cost-absolute-encoder/

eTobey:
Figured it out by myself:

One lucky google find,  a few hours and some tweaking: The solution is gnuplot...


--- Code: ---set pm3d map
unset key

# plot the heatmap
set parametric
set isosamples 5000

unset border
unset xtics
unset ytics
unset colorbox

set angles degree
r = 6
set urange[0:r] # radius
set vrange[0:360] # angle
set xrange[-r:r]
set yrange[-r:r]
set size ratio 1
set palette gray
set terminal gif size 3000,3000
set output 'output9.gif'

splot u*cos(v), u*sin(v), sin(v*21)
--- End code ---

eliocor:
maybe you can use HTML...
Here is an example (15 degrees/step):
Open file with a browser (remove '.txt' extension)


--- Code: ---<!DOCTYPE html>
<html>
<head>
<style>
#grad1 {
  height: 1000px;
  width: 1000px;
  background-color: red; /* For browsers that do not support gradients */
  background-image: conic-gradient(
  black   0deg, white  15deg, black  30deg, white  45deg, black  60deg, white  75deg,
  black  90deg, white 105deg, black 120deg, white 135deg, black 150deg, white 165deg,
  black 180deg, white 195deg, black 210deg, white 225deg, black 240deg, white 255deg,
  black 270deg, white 285deg, black 300deg, white 315deg, black 330deg, white 345deg,
  black 360deg
  );
}
</style>
</head>
<body>

<h1>Conic Gradient - 15 degrees for each color</h1>

<div id="grad1"></div>

</body>
</html>

--- End code ---

eTobey:
I already wrote, that i used CSS. It is not relialable.

eliocor:
just by curiosity:
what kind of printer technology do you use to appreciate the difference?

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod