Saturday, July 31, 2021

Sigh... Even Uglier Overlapping Triangles!

Laying out overlapping triangles, removing the area of each from total land area until we get down to zero.

Improved World Mapper

31 July 2021- Random Worlds, Also!

Laying out overlapping rectangles, removing the area of each from total land area until we get down to zero. I need to figure out how to back the overlap back out...

Should have concentrated on complex poly...

I made complex polygons last night, then I got started on world building by attributes. I left a placeholder world map, now I want to splat out some non-overlapping landmass rectangles. I also want to have a few more posts today to get my posts up to 47 for July. I'm at 45 with this post which I will need to replace. I changed the for loop to a while loop and had the total landmass area attribute to reduce to zero, while each rectangle can still overlap. I actually still want the overlap but I want to cut out the overlap from the total land area. I’m at 46 of 47 posts and I have an unhealthy drive to get to 47… 8-P

What do I want to do for the 47th post? Break down the landmass and seas differently. Same blue rectangle to start with, but fill it with some triangles and get the areas of these triangles, subtract them from the total landmass and repeat while total landmass is greater than zero. Later- which I did, right triangles and ugly! I need to find the area of the overlapping polygons, and I really just need to go ahead and build out random marching triangles. Either way, best to roll out a function for the triangle area from the cross product.


Friday, July 30, 2021

Back to Random Worlds, again...

Gonna splat out some random stats for a star and world.

Overlapping Complex Polygonal Landmass!

I want to make some overlapping complex polygons now.

Overlapping Polygons and back to NMWM again

I could have made my overlapping triangles much better drawing them inside of the rectangles from my overlapping rectangles; still would be overlapping, but I would not have so much going on in the center of my world rectangle. Tonight I need to turn the triangles into more than three-sided polygons. I can do that with the method mentioned before or I can subdivide a polygon side at a random point and push the side out or pull it in, subdividing the sides and fractalizing the coast-line of my landmass. I’ve done this before with the user picking points but either of these will be run by the page.

After that, create a world from a set of variables including how much land and sea we need to map and work out the surface conditions, temperature and pressure. This could be done with ul, but I will probably just set up a paragraph element to change. Eventually I will want to be able to click on SVG elements and add text to sea or landmass, identify settlements and the like.

  1. Triangle to polygon as more than three points around a center, effectively a triangle fan

  2. Random star and planet attributes to get a circumference, diameter and surface area, then we want to split that up into land and sea area

  3. Follow that by drawing triangles in the world rectangle, accumulating the triangle areas

  4. Use what I call random marching triangles to build up landmass with pleasing shapes

Thursday, July 29, 2021

Overlapping Poly to Random Marching Triangles

I modified my SVG overlapping rectangles to be overlapping triangles, and it is as ugly as you would imagine. I will make polygons with a random number of sides and vertices, three or more. For this I will want to go around the circle, starting at a random point and ending when we get past that point, and also to place points at some random distance from the center of my polygon. Each polygon is then a triangle fan and I can calculate the area by adding up the areas of the triangles. Now we are starting to the point of this, to fill a world map with landmass equal to or at least closely approximating the area of the worlds’ landmass.

Back to the New Model World Map; we presumably have an orbit, stellar luminosity and therefore insolation in AUs, Sols and Earths respectively, as well a planetary mass, density and derive gravity and surface area. We can just randomly set what I usually call the hydrographic ratio. We need a fraction which is land and the rest is sea, or ice if the mean surface temperatures are even vaguely Earthlike, which isn’t guaranteed. For the world and the map, we can simply splat out land polygons, detect and subtract overlap, until we have drawn a world map with more or less enough land. We would then need to worry about local surface temps, precipitation, etc. to find arable land for colony sites or native civilizations. For that I will probably want to build adjacent polygons out of a little something I am calling random marching triangles; you make a small triangle, push out a new triangle off a random side, rinse and repeat. I need it to tend to double back on itself and close off triangle fans, but also push out projecting bits.


Now with Overlapping Triangles!

I want to make some overlapping polygons now, starting with triangles.

Wednesday, July 28, 2021

Fun with SVGs and Javascript

I got up late this morning and had to grab all my diabetes meds and take them with me to take at work! Still and all, I got there okay, even got a decent parking space for a quarter after six AM… I’ve spent the last hour struggling with creating SVG elements on my webpage. I finally have a loop spitting out random overlapping opaque rectangles in a blue 520 by 260 pixel world rectangle, so, so far, I’ve reinvented a canvas! 8-P

The overlapping effect is pretty, though.

The next step will be to generate random polygons using Javascript within the world rectangle, then work out how to handle wrapping and clipping. In this case, if something in my random polygon extends off the edge, I will clip the extension. I need to take the points off the edge and work out where the extension leaves the world rect, create a few points to bridge the bits which I am clipping, then put the clipped points into a new rectangle, wrap it and add or subtract x and y as needed. If it extends off the right, subtract the width of the world rect and it will project into the left side. If it extends up or down we need to flip it around and over half the width.

(Or I can just start on building up a low poly spherical polyhedron and project it in 3D with SVG…)


Random Overlapping Opaque Rectangular SVG Landmass!

I made some blocky landmass, recreating canvas, effectively... 8-P
There are plenty of tricks I can do with SVG, though!

Tuesday, July 27, 2021

SVG 'World'

SVG

SVG shapes- A blue circle for a hemisphere and a green polygon for landmass, lines for a mountain range and a river. No interactivity, just lines and curves.

Working on SVG

I’m watching youtube videos about inline SVG. It claims to be scriptable, you ‘just’ throw a ‘class’ on it… I don’t know how that works, yet. I need to get my drabble written and experiment with SVG after that. I want to draw some landmass with polygons, probably polygons inside of an ellipse or circle. Just for tonight I just want to throw something on the webpage. I can draw landmass, seas and lines for mountains and rivers. I need to figure out how to draw them on top of each other, so that will come, I hope.

Monday, July 26, 2021

Daughters...

Div experiments with child divs. I found and monkey copied some code for making lists procedurally with javascript, so these are ul, not divs. I added some style attribures to the mamma div, including green, but I need to figure out what the page is calling each daughter so I can change things in a particular daughter. 8-(

Daughter Div Experiments, Oh My!

I need to see if I can dynamically create and manipulate multiple daughter divs, color them, shape them and move them around.I’m going to need to use toString to convert numbers and strings into strings for CSS to understand, like I did last night when I moved the red jelly bean around the page, following my mouse cursor. I need to change that from mouse move to mouse click because that is better for my android screen, I don’t have a separate mouse or pointing device.

  1. Create child divs with javascript

  2. Move them around with a mouse click (create at an empty spot, select and then designate a destination, which gives me the start of a game or something)

  3. Make triangles. I want to make a single triangle base, select a point within to subdivide into three upper triangle faces of a tetrahedron and then open it like a flower; in fact, I could make a procedural rose, possibly. I won’t get there tonight!

Sunday, July 25, 2021

Moving Div!

Moving Div!

I got the div moving around with requestAnimationFrame.

Oval Div(ision)

Oval Div(ision)

For a world map, but not in a canvas...
I don't know much about divs, but I'd like to draw landmass in the blue oval world. These will be objects I will manipulate with javascript, but the oval is CSS in HTML, then I changed three attributes of the div's blue oval!

Text input and stuff

Almost a year ago I did a word builder where the page prompts the user with a text input box for some letters with which to build a word. The code parses the letters into vowels and ‘consonants’ by stripping out five vowels, so it’s not perfect, but it does a decent job. I will copy and steal what I need to code a text input box for planet name and use a variation to get a random planet diameter. Also, I need to eat… Of course this code is not what I want the text input box to actually do, I want the page to generate a random word, offer it and accept whatever the user might input instead.

https://vincesalienzoo.blogspot.com/2020/08/wednesdays-project.html


Even Better Worlds...

Create and eventually destroy the world! 8-P
(link here)

between 10,000 and 15,000 km across

Saturday, July 24, 2021

Essential work for essential pay...

Nobody wants to work (be exploited) anymore! Pay them like they are essential to a thriving business, because they are! It’s no surprise that the coddled captains of industry need this explained to them, they’ve been running businesses into the ground this way for decades. Extract every penny from the business and put nothing back into it…

I’m going to work on ‘Create and Destroy The World!’ again, but this time I’m going to ruthlessly prune old code back to PR#G, input boxes and buttons; I got what I wanted to do to sort of work last night but I want code which I can copy into blogger. With PR#s I will be able to procedurally generate worlds at a later date. For now I can generate PR planet names and diameters or get input from the user, then create some sloppy world maps and destroy them at the click of a button! 8-P

  1. Prune code

  2. Add input boxes for planet names and diameters (but offer PR) 

  3. Size canvas based on diameter (in hundreds of kilometers?)

  4. Draw some sloppy worldmaps

  5. Destroy the worlds in a suitably rude fashion at the button click

Better Worlds...

Create and eventually destroy the world! 8-P

Friday, July 23, 2021

Creating Worlds! 8-P

A little dynamic JS in my HTML

I have to work tomorrow morning so I won’t get any real coding done tonight. I have been looking at doing more with HTML, which I basically ignore while doing javascript things with numbers and the canvas. The canvas element is just another object and I can call it and manipulate it from javascript. I’m going to create a page and pretty much do all the stuff from javascript. The idea is that the page will ask the user to ‘create a new world’, which to start with is a square canvas of some random (or pseudo-random, actually) width and the same height. So I will copy over my variables and functions for PR# and I will generate the canvas when the user clicks on ‘create a new world’, and remove it when the user clicks on another button, ‘destroy the world!’ For that I will want to do something dramatic with the canvas before it’s gone.

  1. Open new page ‘Create And Destroy The World!’

  2. Copy over my variables and functions for PR#

  3. Button to create a new canvas for which I will need a PR width and (the same) height

  4. Draw a blue or green circle in a clear rectangle, then draw some smaller circles for land or sea. I’m just doing some sloppy world mapping here

  5. Remove it and get ready to draw a new canvas and world, but blow it up first!

The important bit is to create a canvas dynamically, remove it and create a new one. Use para in the body as well to tell the user stuff without annoying pop-up dialog boxes. Doing something with canvas is the bare minimum, then I need to get to bed!


Thursday, July 22, 2021

Peeps jitter-bugging around!

Top down view of Moms' Peeps! I got my peeps moving around and avoiding the wall of their 'chicken condo'. Now I want to make a button to make it rain on them, where they will walk away from the raindrops. For now a lightblue circle appears for a little bit.

Functions 'To Do' List

 This would be progress-

  1. drawRun() to clear and draw run and chicken condo every iteration of the animation loop

  2. avoidWd() to make sure each peep doesn’t walk through the wall by looking at the dx of peepx and amd destx vs. the wooden wall at that height in my canvas; if peepy is <h/2, and px >w*2/3 but <w*⅚, so about one in twelve unless they’re concentrate over there. Check dx between peepx and and the wall and destx and the wall for positive or negative, </> 0, and if they disagree, change destx dx to -dx and adding back to destx

  3. Check for vorCllz() with a flood fill from the spot the user last checked; as the user confuses the issue, this will move about but will mean that the user isn’t waiting for the page to do the entire grid. Instead, we are checking a new pixel, or several, every iteration of the flood fill

  4. Make it rain in the chicken run; animate raindrops, bit opaque blue circles and have the peeps avoid them by having the raindrop particle find peeps within n distance and alter their destinations to away from the raindrop particle. If this forces the peep to seek a destination beyond an edge or through the wooden wall, then change destination dx to -dx. Raindrops only happen in the run, not the chicken condo.

Wednesday, July 21, 2021

Functions and Spaceborne

I need to clear and redraw between moving peeps… drawRun(). The peeps are going right through that wall! 8-P I’ll have to fix that as well, but the trail-leaving peeps was a good place to leave things off. I need to make some progress on the new model world map, too! Check vorCllz() each time we add a new feature point, but figure out how to make all this happen fast? 8-P

I had a few words very early this morning, but not my drabble. I need to write the two functions, drawRun() in peeps and to check for vorCllz() in the NMWM, as well as some way of keeping peeps from going through the wooden wall, avoidWd()? If peepx and destx are on different sides of the wall, change destx and desty. That’s three functions and less than twenty minutes, so I’ll be getting them done after midnight…

I was thinking about my spaceborne workers and approximations. We start with about one percent of $⅓ Trillion or $3.33 Billion worth of early spaceborne production done by ‘millionaire’ spaceworkers doing work worth more than $100 million and needing millions in support and wages. We use my go-to 8% growth rate and get ten-fold growth or $33.5 Billion after thirty years in the 2050s and employ about two hundred spaceborne rockstars earning a few million. Wages goes up as the quarter power and workers go up as the ¾ power of production; even if this is not actually the case, we can actually expect these ‘rockstars’ to start their own businesses with venture capital and their own sweat equity, if and when their businesses fail to pay them properly or merely fail; it’s time to railroad and there’s gonna be a lot of trial and error until things shake out but old money with see the (potential) returns and throw money at it… A hundred years after that in the mid 22nd Century and that explosive growth and the spaceborne manufacturing would be $73.7 and more than the current GWP (meanwhile GWP has had over a century of slow growth, but the spaceborne economic sector is a large part of overall growth), about 60,000 spaceborne paid about $12 million, so at least some of these spaceborne workers will be able to live in habitats, perhaps retire to the Moon?


Tuesday, July 20, 2021

Peeps leaving a trail...

Top down view of Moms' Peeps! I got my peeps moving around but not clearing and drawing the run, condo and peeps in between iterations of my animation loop. It gets very messy...
(the little red rings are destinations)

Little piggies and peeps...

I zonked out, predictably. My foot was not a happy foot and the little piggy was weepy, but altogether we may be getting somewhere. I was pulling on the damn stitch thinking it was a sticky fiber from the bandaids, but I managed to not pull it out. Got a shower without having the bagged foot get soaked, actually did a good job bagging, taping and saran-wrapping it, then peeled the old mess (but not too disgusting) and got the little piggy's new bandaid on and wrapped in the sticky tape. A bandaid under the stitch, then over the ugly wound at the end of the toe, then around that and then the sticky tan gauze stuff. The place where Dr. Hopkins cut the tendon isn’t bleeding, which is good except I’d rather have a little blood flow to prove good circulation… Enough gabbing about my diabetes related ills.

I need to at least get my peeps moving about and do something about destinations which are on the other side of the wooden wall. I’ll worry about that after I get the peeps moving towards the destination. What to do once it gets there… to confuse the issue, dx is peep x - destination x, which we will reduce to one pixel by dividing dx by math.abs(dx), unless dx is zero, then we need to head off that little divide by zero headache. Same thing for dy. Now, if abs(dx) is less than 1, just make peep x equal to dest. x and when dx and dy both equal zero, we create a new destination.

Monday, July 19, 2021

Infected Toe Blues and Space Condos

I stayed home again and used another vacation day after calling out sick Friday. My swollen foot is much better than it was on Friday. Doctor Tam (yes, Dr. Tam) prescribed a third antibiotic and the infected toe is almost clear now, I think. I need to get my ass moving and go to my appointment with Dr. Hopkins, who wasn’t available Friday. I don’t think it will be okay for him to cut the tendon today, I probably will have to see him again next week… 8-(

(Dr. Hopkins did cut the tendon and I'm going back to work tomorrow morning)

I need a few more words and I was trying to estimate our future spaceborne population again. Assuming they’re doing work based on the value of a seat to orbit vs. their orbital production. The problem is, this changes over time, based on space flight costs and where. Farther out, and the cost to get a worker there and support them will go up, while costs to get to LEO and beyond will go down over time. For now this is still tens of millions, so the value of production will have to be more than that or no production, no job and no ride; ‘No bucks, no Buck Rogers!’

LEO will do for now, but LEO won’t really get going without lunar Oxygen and then metals; oxidizer is the lion’s share of propellant, 78% of Methalox at the preferred ratio. We might just export hydrogen peroxide to get enough oxygen with a little hydrogen in LEO, and bring up carbon from Earth to LEO. This comes to 16.5% Carbon, 5.5% H2 and 78% O2 by mass. Eighty-five percent H2O2 would be 6.67% H2 and 93.33% O2 by mass and 5.5 tonnes of H2 to 77 tonnes of O2, so we can make this work just by tweaking the concentration. This points out, again, that things change and we can improve over time; O2, then water or H2O2, then make methane and refined materials and finally manufactured goods. O2 is a vast improvement, we will always want water as well, etc.

What I expect is that the cost of production will go down over time, in materials, labor and maintenance. Labor costs will be based on what it costs to support because that will affect what an enterprise can afford to spend on everything, including labor and labor will be a reasonably static proportion of on orbit production costs. We don’t know what the ‘efficiency’ growth rate might be, but wages will be based on that and the cost of living, which will be very high to begin with.

John Barnes used power production as his baseline, that a solar powersat provides employment for so many people and the powersats increase in number while decreasing the number of workers needed over time. The population also diversifies into other economic niches, and all this provided a pull for emigration to space. If we assume that very soon cheap access to space provides a way to cut setup and production costs to $10 million per space worker and LEO production is 1% of the $⅓ trillion space economy, that’s $3.3 billion or 333 people working in space. We can grow the spaceborne economy very fast, at 8% per year while finding ways to decrease the number of people we need on orbit at half that rate, so that the number still increases over time while the value of that labor and therefore pay increases until eventually a space worker can actually afford to own a habitat, or a space condo. Assuming this sort of growth for three quarters of a century is a little depressing, about six thousand working in orbit for a trillion dollar industry, but those space workers will be making millions even if they get less than 1% of the value of that. Actually, they will be splitting with dirtside support workers, but the high end would be a million dollars (“One. Million. Dollars!”). A little depressing, a lot slower than I’d like, but a trillion dollar spaceborne industry and billions to spend on habitats is something we might see by the 22nd Century. A stern chase is a long ass chase but at some point the spaceborne will eventually eclipse the rest of the human enterprise. There are stories to be written in there...


Sunday, July 18, 2021

Peeps Run and 'Chicken Condo'

Top down view of Moms' Peeps! Peeps have positional color borrowed from my new model world mapper and will be pushed away from the edges and walls. Next I need to get my peeps moving around, clearing and drawing the run, condo and peeps in between iterations of my animation loop.
(the little red rings are destinations)