< 182022-05-19⋎20 >

Topic for #farmOS is: farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Forum: farmOS.discourse.groupSet by mstenta on 2021-06-15 at 12:52
05:58AnasHaddad[m]<mstenta[m]> "If you want to start a forum..." <- we can use this discussion farmos.discourse.group/t/migrating-from-
15:50mstenta[m]Hey all - I've got a sore throat/cough. I may join the dev call today, but I probably won't talk much. Or at least I will try not to. :-)
15:51mstenta[m]@room dev call in 10 minutes here: meet.jit.si/farmos-dev
15:53symbioquine[m]Bummer, hope you feel better soon!
15:53mstenta[m]Getting there... both kids had it already and are on the mend - I'm just a day or two behind them :-)
15:54mstenta[m](obligatory "not covid")
17:14mstenta[m]symbioquine: FYI here is the PHP function in v1 that was responsible for generating beds, given a bounding polygon, number of beds, and orientation: github.com/farmOS/farmOS/blob/509cfb2e92
17:15mstenta[m]I had to do some clever stuff with rotations to simplify it...
17:16*sent a code block: libera.ems.host/_matrix/media/r0/downloa
17:16symbioquine[m]This is the meat of how I'm doing it in the land drawing tool; github.com/symbioquine/farmOS_land_drawi
17:16mstenta[m]i really like the UI of yours
17:16mstenta[m]and that it can do more than 1xN
17:17mstenta[m](grids)
17:17symbioquine[m]I basically calculate two unit basis vectors given the two anchor points (origin/rotation), then iterate over the grid and use those basis vectors to calculate the corner coordinates of each of the polygons.
17:18FarmerEd[m]I was just going to say that 😂
17:19symbioquine[m]The main tricky thing I'm doing is normalizing for distance =/= map units due to distortion of the projection.
17:19mstenta[m]oh wow, so it corrects for projection distortion?
17:20symbioquine[m]yeah, in a rudimentary way...
17:20symbioquine[m]github.com/symbioquine/farmOS_land_drawi
17:21mstenta[m]wowza
17:22symbioquine[m]The spherical distance of going one map unit South or West isn't always 1 meter depending where on the map you are. In some places it can make a pretty big difference.
17:23symbioquine[m]I originally had to figure that out to make the snapping grid produce accurate area values...
17:23mstenta[m]oh man this reminds me of something similar i needed to learn when i was coding the "calculate area of a polygon" in v1 (in PHP)
17:23mstenta[m]github.com/farmOS/farmOS/blob/509cfb2e92
17:24symbioquine[m]Hah, I'm glad OpenLayers takes care of that bit :)
17:24mstenta[m]yes! me too. glad we haven't had to port that code to v2 :-)
17:24mstenta[m]although maybe we will... if we need areas in PHP eventually
17:25mstenta[m]that was always a bit odd in v1, though... the slight difference between OL and PHP calculations
17:26symbioquine[m]Could be different rounding of the coefficients/constants or different floating point handling even
17:26mstenta[m]perhaps we can avoid it in PHP though and just provide a way to store a value (eg: www.drupal.org/project/farm/issues/30519)
17:26mstenta[m]yeaa
17:27mstenta[m](that value could be calculated client side, or wherever... just not in PHP, if we can avoid it)
17:31mstenta[m]makes me wonder if anyone's made a JS parser in PHP 😆
17:32symbioquine[m]I was just thinking that
17:32mstenta[m]ha! www.php.net/manual/en/book.v8js.php
17:32mstenta[m]... because of course
17:32mstenta[m]> This extension embeds the V8 Javascript Engine into PHP.
19:46symbioquine[m]A bit off-topic, but one can certainly go off the deep-end with embedding JS runtimes; github.com/emscripten-core/emscripten/is
19:48symbioquine[m]... and also www.figma.com/blog/how-we-built-the-figm

< 182022-05-19⋏20 >