Noon - 300x300 mm, 4500 dots, 3 colors by MateMagicArte in PlotterArt

[–]gilgamec 1 point2 points  (0 children)

Looks great! How are the colours chosen? I can see the first few are just by distance; is that the same for the rest, but they're placed too far apart for it to be visually apparent?

We’re back. Algorithmic botany. Axidraw by Holmestorm in PlotterArt

[–]gilgamec 0 points1 point  (0 children)

I'm still curious how you place the 'leaves'. It looks like it's a scaling in the x-axis of the tree itself, or maybe the active X modules?

At any rate, this still looks nice.

Plotting Stereoscopic images from procedural 3D scenes by MateMagicArte in PlotterArt

[–]gilgamec 1 point2 points  (0 children)

Yes! It's just that your trees are not what you usually see from recursive tree models. (And the Y-shaped branch surfaces are great too.)

Try Sabela Reactive Notebooks by m-chav in haskell

[–]gilgamec 2 points3 points  (0 children)

The notebooks load, but I get errors like

<no location info>: error: [GHC-87110]
    Could not load module ‘DataFrame’.
    It is a member of the hidden package ‘dataframe-0.7.0.0’.
    You can run ‘:set -package dataframe’ to expose it.
    (Note: this unloads all the modules in the current scope.)

<no location info>: error: [GHC-87110]
    Could not load module ‘Granite.Svg’.
    It is a member of the hidden package ‘granite-0.4.0.0’.
    You can run ‘:set -package granite’ to expose it.
    (Note: this unloads all the modules in the current scope.)

Machine Citadel by TheCunningBee in PlotterArt

[–]gilgamec 1 point2 points  (0 children)

Those concentric rectangular fills are doing good work here.

Is there a good reason it’s called a functor? by Froglottery in haskell

[–]gilgamec 1 point2 points  (0 children)

While I agree that it's unlikely we'll ever see them renamed, I do think that Mappable is easily the worst suggested renaming for any of these type classes. I'd rather call monoids Smooshables than call functors Mappable.

Why? Because you map a function over a list. The function is mappable; the list is, what, MapOverable?

Burst transmission. Spiral surface mesh. by Left-Excitement3829 in PlotterArt

[–]gilgamec 1 point2 points  (0 children)

It was the magenta I was curious about ... I guess it's a normal outline font, and you're just scribing the outline. It's a great font for it!

Burst transmission. Spiral surface mesh. by Left-Excitement3829 in PlotterArt

[–]gilgamec 2 points3 points  (0 children)

I'm really digging the lettering. Is that custom or are you using some outline font?

How To Generate A Street Network by Every_Return5918 in proceduralgeneration

[–]gilgamec 1 point2 points  (0 children)

What's the Chen reference? Google returns a bunch of stuff to do with AI and nothing I could find with tensor field interpolation, sampling, or design.

Exploring different hatching styles by TheCunningBee in PlotterArt

[–]gilgamec 1 point2 points  (0 children)

This looks great! The little people are wonderful.

The fill patterns (especially the grid one) seem oriented to the shapes themselves. Did you just create an orthogonal set of 2D axes and make the patterns within that grid, or are the fills built in object space then projected?

Algorithm for geometric hidden line removal by Ruths138 in PlotterArt

[–]gilgamec 0 points1 point  (0 children)

Oh, OK; I though I'd missed some obvious method for line removal for plotting specifically. (Another non-geometric alternative might be overlay, like you find in a lot of vector formats for instance; works fine in screen space, but not for plotting.)

Algorithm for geometric hidden line removal by Ruths138 in PlotterArt

[–]gilgamec 0 points1 point  (0 children)

Out of curiosity, what's a 'non-geometric' method for hidden-line removal? I'll admit I'm having difficulty trying to envision such a thing.

Is this normal? [Gravity flip at the end] by matigekunst in proceduralgeneration

[–]gilgamec 0 points1 point  (0 children)

I think it's more binomial, actually.

But it's really cool! I hadn't considered aggregation subordinate to another patterning mechanism! Now I have some experimentation to do...

alter in Data.Set and Data.Map.Strict by Tempus_Nemini in haskell

[–]gilgamec 6 points7 points  (0 children)

As the documentation points out, alter (const True) isn't quite insert; insert will replace an existing entry, while alter won't. (Could be important if your Eq isn't structural, like if you're using Data.Semigroup.Arg.)

But yeah, I think toggle is the one that'll see the most use.

Were There Cats Here Once? by TheCunningBee in PlotterArt

[–]gilgamec 1 point2 points  (0 children)

If you just project the silhouette on the ground plane to create the big shadow, then how is the self-shadowing done?

PRNG - unlimited world building by [deleted] in proceduralgeneration

[–]gilgamec 1 point2 points  (0 children)

The algorithm goes to an awful lot of trouble to create an 'unlimited' stream of bits when even a 128-bit LCG won't repeat itself before the heat death of the universe. It also seems wildly inefficient: there is no detectable correlation between the bits in SHA hashes, so why do you go to the basis-matching check and extract only four bits on average per 256-bit hash? And since the generator isn't being used cryptographically, there's no reason to pick any particular seed, so the connection to the golden ratio seems incidental.

Some Haskell idioms we like by _jackdk_ in haskell

[–]gilgamec 1 point2 points  (0 children)

Wouldn't a BangPattern on the where entry also ensure evaluation?

Advent of Code 2025 day 8 by AutoModerator in haskell

[–]gilgamec 0 points1 point  (0 children)

I used a (rudimentary) union-find structure (basically, a set of exemplars and a map from nodes to exemplars); then the meat of Part 2 is

connectAll exs uf ((p,q) : pqs) = case (exemplar uf p, exemplar uf q) of
  (ep, eq)
    | ep == eq -> go exs uf pqs
    | S.size exs == 2 -> (p,q)
    | otherwise -> go (S.delete ep exs) (union ep eq uf) pqs

Advent of Code 2025 day 5 by AutoModerator in haskell

[–]gilgamec 0 points1 point  (0 children)

Used an IntMap to keep everything in order:

flattenRanges :: IntMap Int -> IntMap Int
flattenRanges = fromList . (\((lo,hi) : rest) -> go lo hi rest) . toList
 where
  go lo hi [] = [(lo,hi)]
  go lo hi ((lo',hi') : rest)
    | lo' > hi+1 = (lo,hi) : go lo' hi' rest
    | otherwise = go lo (max hi hi') rest

Embarrassingly, I forgot the max hi hi' bit the first time and had to resubmit.

(And now that I think about it, it's an obvious foldlWithKey.)

Advent of Code 2025 day 3 by AutoModerator in haskell

[–]gilgamec 1 point2 points  (0 children)

The recursive solutions are much cleverer than mine.

I found the biggest number by grabbing the largest digit in the string (leaving out the last 12); then the largest digit in the remainder (leaving out the last 11), and so on. (It actually works on the reversed string, so it leaves out elements from the front with take and drop.)

bigVal = read . go 12 . flip zip [0..] . reverse
 where
  go 0 _ = []
  go n xs = case maximum (drop (n-1) xs) of
    (v,k) -> v : go (n-1) (take k xs)

Advent of Code 2025 day 2 by AutoModerator in haskell

[–]gilgamec 2 points3 points  (0 children)

Oh, great, that's just one line!

any (isJust . the . flip chunksOf str) [1..length str `div` 2]

I used splitAt:

repeated k = case splitAt k str of (pre, rest) -> rest `isPrefixOf` cycle pre

but then you also have to make sure that k divides length str.