LegraJS

Creative

canvas drawing library

SHOW HN2019

140points
27comments
#320of 2,195 in 2019
Top 15%of 2019 by points

How HN took it

CuriousMostly questions and neutral comments

3 positive, 9 neutral or asking, 0 mixed, 0 critical, out of 12 comments about the project. Thread score +0.12.

Idea: 2 for, 0 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Cool and neat project

    From 3 comments
    • Love these types of projects! Very neat. Does the API use actual LEGO pieces? If so, could you render something and output a count of the pieces necessary so as to actually build…
      sweetheart on HN
    • Niiice!
      esimov on HN
    • Cool! For the image rendering, could you have a setting to constrain the colours used to currently-available Lego bricks? You might also offer dithering for better image matching.
      mft_ on HN
  • Idea of combining with physical Lego output

    From 2 comments
    • Love these types of projects! Very neat. Does the API use actual LEGO pieces? If so, could you render something and output a count of the pieces necessary so as to actually build…
      sweetheart on HN
    • +1 for this feature! It would be pretty neat to combine this with a service that prints a 2D image using physical lego bricks. This is nerdy and silly, but I could imagine…
      ed312 on HN

Objections

  • Similar to existing legofy tools

    From 2 comments
    • Looks very similar to legofy https://github.com/JuanPotato/Legofy
      LiamPa on HN
    • I've done something like this in Go: https://github.com/esimov/legoizer
      esimov on HN

Requests

  • Constrain colours to real Lego bricks

    From 2 comments
    • Not just count the pieces but to limit the colours of the pieces would be great too! http://ryanhowerter.net/colors
      ullarah on HN
    • Cool! For the image rendering, could you have a setting to constrain the colours used to currently-available Lego bricks? You might also offer dithering for better image matching.
      mft_ on HN
  • Count pieces needed to build a render

    From 1 comment
    • Love these types of projects! Very neat. Does the API use actual LEGO pieces? If so, could you render something and output a count of the pieces necessary so as to actually build…
      sweetheart on HN
  • Select brick type for a rectangle fill

    From 1 comment
    • Great stuff. It would be awesome if you could select a brick type for a rectangle. You could make a 6x6 square and choose to fill it with 2x6 or 1x6 bricks.
      simlevesque on HN
  • Implement the Canvas 2D path API

    From 2 comments
    • For paths and polygons you should just implement the 2d Path API https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D#Paths ``` context.moveTo(x,y);…
      tantalor on HN
    • I wonder why no one, who implements some kind of JavaScript graphics library like this one, just mimics the Canvas 2D context API, so you could just drop this into your current…
      WillYouFinish on HN

Questions

  • How to create a graphics library like this

    From 2 comments
    • How do you create something like this? I.e. what are the keywords I’d look for if I wanted to create my own graphics library from scratch like this? Very cool btw
      blzrdnofreespch on HN
    • Rasterization + whichever shape you want to draw. E.g. "rasterization line" leads you to https://en.m.wikipedia.org/wiki/Bresenham%27s_line_algorithm
      kaoD on HN
  • Performance on larger canvases and redraws

    From 2 comments
    • What would the optimizations be for a larger canvas? Does it redraw the whole canvas when an update is made* to a single line when there are several other lines on the canvas?…
      marclave on HN
    • It doesn't redraw the whole canvas. The optimizations are really needed when 'filling' a shape. If you draw a large polygon, it may take a little longer to fill it with bricks.…
      shihn on HN

Alternatives named

  • legofy (JuanPotato)

    From 1 comment
    • Looks very similar to legofy https://github.com/JuanPotato/Legofy
      LiamPa on HN
  • legoizer (Go)

    From 1 comment
    • I've done something like this in Go: https://github.com/esimov/legoizer
      esimov on HN
  • kirkegaard legofy (JS with video)

    From 1 comment
    • I also did something like this in JS with video support https://github.com/kirkegaard/legofy
      ranza on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/21622217)