|
Post by tenochtitlanuk on Apr 12, 2022 6:53:49 GMT -5
Interesting one. Here are two versions of the function.. r =size *( sin( t) *( abs( cos( t )))^0.5 /( sin( t) +7/5 ) -2 *sin( t) +2) and r =size *( ( sinRad( theta) *( abs( cosRad( theta)))^0.5) /( sinRad( theta) +3.5 ) -2 *sinRad( theta) +2) See my misplaced bracketting?? Whoops!
|
|
|
Post by tenochtitlanuk on Apr 12, 2022 3:56:30 GMT -5
In an online advert for iDroo I saw this -
... and tried coding it in LB with the shape colour-filled. Either I coded the formula wrong, or it is a less-convincing shape than as shown in the ad. Anyone improve it??? Ideally before the next St Valentine's Day??
|
|
|
Post by tenochtitlanuk on Apr 11, 2022 11:41:57 GMT -5
Thie following code retrieves a file from my site; saves it; and displays it. Something similar should work for you- but no idea if it works from cloud storage- Onedrive is not directly available to me as I work in Linux/Wine/LB.
remote$ = httpget$( "https://www.diga.me.uk/isWordInSowpods.bas") open "localSOWPODS.bas" for output as #fOut #fOut, remote$; close #fOut run "Notepad localSOWPODS.bas", MINIMIZE
EDIT Similarly, downloading and displaying an html page...
URLFile$ ="https://www.diga.me.uk/index.html" lpOperation$ = "open" lpParameters$ = "" lpDirectory$ = DefaultDir$ nShowCmd = _SW_SHOWNORMAL
calldll #shell32, "ShellExecuteA", _ hWindow as ulong, _ 'parent window lpOperation$ as ptr, _ 'open or print URLFile$ as ptr, _ 'file name lpParameters$ as ptr, _ 'null lpDirectory$ as ptr, _ 'default directory nShowCmd as long, _ 'show window flag result as long
if result <= 32 then print "Error, Address Failure!": print "Done"
remote$ = httpget$( "https://www.diga.me.uk/index.html") open "localIndex.html" for output as #fOut #fOut, remote$; close #fOut
|
|
|
Post by tenochtitlanuk on Apr 8, 2022 15:49:18 GMT -5
It's my birthday on the 9th. Coding off and on since the Sixties. Didn't find LB until v1.4. It's a comfort as old age ( 3/4 century plus) creeps up on me- here's this afternoonn's LB play result.
|
|
|
Post by tenochtitlanuk on Apr 8, 2022 3:45:45 GMT -5
Of course any decent 'painting' type of program will convert between file types. In the Linux world the standard is GIMP. But for LB computer-generated art the slow stage is the on-screen drawing pixel by pixef- hence the point that it is much quicker to write directly to a ppm file and convert it separately afterwards.
|
|
|
Post by tenochtitlanuk on Apr 7, 2022 6:09:29 GMT -5
This sort of thing?? It saves a csv file you can read back in LB or as text or into a spreadsheet..
nomainwin
WindowWidth =860 WindowHeight =600
open "Save mouse-click positions" for graphics_nsb_nf as #wg
#wg "trapclose quit"
#wg "down ; size 5" #wg "when leftButtonDown saveMousePosn"
open "Positions.csv" for output as #fOut
wait
sub saveMousePosn h$, x, y #wg "set "; x; " "; y #fOut x; ","; y end sub
sub quit h$ close #fOut close #h$ end end sub
|
|
|
Post by tenochtitlanuk on Apr 4, 2022 13:51:00 GMT -5
Was going to suggest image323. The ImageMagick method is easy and works fast, and has many more possibilities, but does require you and users to install I.M. Example below resized an image to fit 400x400; inverted the original colours amd loaded unscaled; and unscaled, as B&W Only snag for me is I can't get it reliably working on LB/Wine/Linux, so have to go to a Windoze machine... PS the dog looks lovely whatever I do. My son, also...
|
|
|
Post by tenochtitlanuk on Apr 4, 2022 5:23:54 GMT -5
I call the .exe file, not the dll.
|
|
|
Post by tenochtitlanuk on Apr 4, 2022 4:18:19 GMT -5
I've used ImageMagick calls to do all sorts of image-processing. It can do alnost any processing you might need and has more functions than most 'art packages'. Search my site for 'Magick'.
|
|
|
Post by tenochtitlanuk on Mar 31, 2022 5:28:31 GMT -5
The current 'scientific' egg-equation is.. However you'll not see much difference if you omit all but the first part! I'm now playing with Magic Eye use of egg images. If you are used to viewing these, the image below should show each row at a different depth, with the light blue row 'out of sequence'.
|
|
|
Post by tenochtitlanuk on Mar 29, 2022 10:58:02 GMT -5
... and meanwhile I seem to have produced a micrograph of the scales of a butterfly wing....
|
|
|
Post by tenochtitlanuk on Mar 28, 2022 17:47:04 GMT -5
Yup- my eggs can now be positioned, sized and egg-proportioned and colour-filled. I look forward to working out how the ray-tracing stuff works when I've time. Meanwhile ( I know I've published flowers before -see my site) here is a spiral of eggs using my egg code. I call it a 'clutch'...
|
|
|
Post by tenochtitlanuk on Mar 26, 2022 3:43:33 GMT -5
With the egg-citing approach of Easter and its association with eggs- decorated ones ( pretty!)- and chocolate ones ( yes please!) you may have missed news that mathematicians have cracked ( !) the problem of describing all egg shapes with a single equation. Previously they could only do so for circles, ovals, or ovals with the long axis distorted to bias the fattest point towards one end. This unfortunately does not cover the more pear-shaped eggs. We won't beat Anatoly's ( tsh) Faberge eggs, but still fun to have. Do a Google search and work from there. Some ideas.. A single outline? Eggs in arrays or circles? Eggs in a basket? Varying sizes? Colour schemes- single colour or gradient fill? 3D eggs as rotatable 2d line projections?
|
|
|
Post by tenochtitlanuk on Mar 25, 2022 9:46:06 GMT -5
The code is very much a beginning, or work-in-progress. I am looking in this version at what happens if the birds are simply attracted to the centre of mass of their neighbours, and tire slowly. Hence earlier use of velocity terms is remmed out. Do they end in systematic or chaotic orbits? Plenty of other rules to consider. I've looked at some possibilities, and each uses the same kind of code. It is of course much slower when you have to know which are your nearest neighbours... and I've yet to digest what you and the others have achieved. I just like putting pretty graphics on the Forum! As with most coding, I've got far enough so far only to have got good ideas on how to rewrite it better!
However I've just been in Northumbria for a week, then in Cornwall for a week, and at present have ten days with my son from the US who we've not seen in the flesh for three years plus. Priorities .... J
|
|
|
Post by tenochtitlanuk on Mar 24, 2022 16:56:58 GMT -5
Have posted a page about sorting irises and penguins using AI and the k-means method. See penguins
|
|