[{"data":1,"prerenderedAt":276},["ShallowReactive",2],{"project-37619100":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":35,"aspects":36,"strip":44,"post_text":46,"what":47,"said":68,"maker_in_thread":140,"shape":149,"grid":153,"attempts":239,"same_week":240,"maker_shows":31,"maker_hidden":269,"reader_version":270,"card":271},"37619100","TG","Fast geometry library for C","title","Show HN: TG – Fast geometry library for C","https:\u002F\u002Fgithub.com\u002Ftidwall\u002Ftg","github.com","tidwall",1695425268,2023,201,32,277,3109,9,"notable","languages","geometry library","library",[24,25,26,27],"geometry library c","point in polygon","polygon intersection","spatial index","loved",0.2,{"positive":31,"neutral":32,"mixed":33,"critical":34},7,12,1,0,20,{"execution":37,"docs":38,"design":40,"idea":41,"performance":43},{"positive":34,"critical":34},{"positive":39,"critical":34},3,{"positive":34,"critical":34},{"positive":42,"critical":34},4,{"positive":34,"critical":34},[39,34,34,45,39,34,34,39,34,39,45,45,45,39,45,39,45,34,45,39,34,34,34,39,39,39,34,34,39,34,39,39],5,null,{"problem":48,"audience":46,"pricing":46,"motivation":46,"time_to_build":46,"stack":55,"openness":67,"stage":67,"team_size":67},{"value":49,"source":50,"evidence":51},"fast point-in-polygon, intersections and low memory geometry operations","maker",[52],{"id":53,"by":11,"text":54},"37626046","TG isn't spherical and wasn't designed to be. It's 2D and projection agnostic. Crossing the antimeridian is a user problem to solve. I recommend following the GeoJSON rule of…",[56,61],{"value":57,"source":50,"evidence":58},"C",[59],{"id":60},"post",{"value":62,"source":50,"evidence":63},"WebAssembly target",[64],{"id":65,"by":11,"text":66},"37620617","Yes, I used wasm as one of the targets during development.","unknown",{"praise":69,"objections":92,"requests":104,"questions":117,"alternatives":127},[70,82],{"value":71,"source":72,"evidence":73},"Excellent README and visualizations","commenter",[74,78],{"id":75,"by":76,"text":77},"37620524","simonw","This is a really great README - clearly explained the benefits of the library and anticipated all of my questions about it.",{"id":79,"by":80,"text":81},"37619888","hgs3","Nice library. +1 for the excellent visualizations [1]. Will you keep it focused on intersections or might you dabble with triangulation? [1]…",{"value":83,"source":72,"evidence":84},"Useful for SQLite extension and WASM use",[85,88],{"id":86,"by":76,"text":87},"37620565","This looks really interesting. It implements pretty much the exact subset of geospatial stuff that I care about, in a single C file (an amalgamation that includes its…",{"id":89,"by":90,"text":91},"37620133","Waterluvian","Very nice! I wonder if I can compile this to wasm. I’ve been badly needing spatial predicates in a web environment that are faster and less clunky than JSTS. Does it assume a…",[93],{"value":94,"source":72,"evidence":95},"Floating point robustness lacks exact predicates",[96,100],{"id":97,"by":98,"text":99},"37624471","s2mcallis","Howdy, I work on S2 [1] so I have questions! How do you deal with polygons that cross the antimeridian? The indexing structure you've come up with seems very interesting. In…",{"id":101,"by":102,"text":103},"37622808","fastneutron","You might consider Shewchuk’s methods for robust geometric computations: https:\u002F\u002Fwww.cs.cmu.edu\u002F~quake\u002Frobust.html There are more modern implementations available on GitHub, but…",[105,110],{"value":106,"source":72,"evidence":107},"Use Shewchuk robust predicates",[108,109],{"id":101,"by":102,"text":103},{"id":97,"by":98,"text":99},{"value":111,"source":72,"evidence":112},"Add comments and algorithm references to code",[113],{"id":114,"by":115,"text":116},"37621082","aquarin","Also, \"length\" may have better be implemented using: https:\u002F\u002Fen.cppreference.com\u002Fw\u002Fc\u002Fnumeric\u002Fmath\u002Fhypot It will be helpful, if you add comments discussing why certain functions…",[118,122],{"value":119,"source":72,"evidence":120},"How are antimeridian-crossing polygons handled",[121],{"id":97,"by":98,"text":99},{"value":123,"source":72,"evidence":124},"Is the library flat Cartesian or does it handle projections",[125,126],{"id":89,"by":90,"text":91},{"id":53,"by":11,"text":54},[128,132,136],{"value":129,"source":72,"evidence":130},"S2 geometry",[131],{"id":97,"by":98,"text":99},{"value":133,"source":72,"evidence":134},"SpatiaLite",[135],{"id":86,"by":76,"text":87},{"value":137,"source":72,"evidence":138},"JSTS",[139],{"id":89,"by":90,"text":91},{"comments":45,"answered":42,"key":141},[142,143,146],{"id":53,"text":54},{"id":144,"text":145},"37622187","I have strict safety rules for this project, one of which requires that all geometries are thread-safe pointers. So in the example you show, it would not be safe to share the…",{"id":147,"text":148},"37622546","I can't stop precision loss in all cases, but I do my darnedest to avoid loss when it causes false positives, especially for stuff like intersect detection code. For example the…",{"commenters":150,"max_depth":45,"maker_replies":45,"first_comment_mins":151,"lifespan_hours":152},19,131,72,[154,156,158,161,163,168,172,174,178,180,181,182,184,186,191,194,197,199,200,203,206,210,213,215,218,220,222,225,227,229,232,235],[97,34,39,155,98,34],"project\u002Fmixed\u002Fexecution",[53,34,34,157,11,33],"maker\u002Fneutral\u002Fnone",[159,34,34,160,98,34],"37626457","commenter\u002Fneutral\u002Fnone",[79,33,45,162,80,34],"project\u002Fpositive\u002Fdocs",[164,165,39,166,167,34],"37622035",2,"project\u002Fneutral\u002Fdesign","ginko",[169,165,34,170,171,34],"37622114","commenter\u002Fneutral\u002Fdesign","matthews2",[144,165,34,173,11,33],"maker\u002Fneutral\u002Fdesign",[175,39,39,176,177,34],"37621741","project\u002Fneutral\u002Fexecution","pasabagi",[147,39,34,179,11,33],"maker\u002Fneutral\u002Fexecution",[101,39,39,176,102,34],[75,42,45,162,76,34],[86,45,45,183,76,34],"project\u002Fpositive\u002Fidea",[185,45,45,183,76,34],"37625077",[187,188,39,189,190,34],"37620615",6,"project\u002Fneutral\u002Fperformance","unnah",[192,31,45,183,193,34],"37622929","MoSarwatSpatial",[89,195,39,196,90,34],8,"project\u002Fneutral\u002Fidea",[198,195,45,183,76,34],"37620574",[65,195,34,157,11,33],[201,195,45,202,76,34],"37620628","maker\u002Fpositive\u002Fdocs",[204,195,39,196,205,34],"37620599","o11c",[207,195,34,208,209,34],"37621213","other\u002Fneutral\u002Fnone","crabmusket",[211,195,34,208,212,34],"37625642","kylebarron",[214,195,34,160,209,34],"37651920",[216,195,39,196,217,34],"37621987","Tanjreeve",[219,18,39,176,115,34],"37621033",[114,18,39,221,115,34],"project\u002Fneutral\u002Fdocs",[223,18,34,160,224,34],"37621106","WithinReason",[226,18,34,160,115,34],"37621323",[228,18,39,196,115,34],"37621702",[230,18,34,231,11,33],"37621922","maker\u002Fneutral\u002Fdocs",[233,18,39,176,234,34],"37626073","MobiusHorizons",[236,237,39,189,238,34],"37621779",10,"sylware",[],[241,246,251,256,260,264],{"id":242,"name":243,"points":244,"category":245},"37613054","Paisa",662,"productivity",{"id":247,"name":248,"points":249,"category":250},"37663270","Raverie",644,"games",{"id":252,"name":253,"points":254,"category":255},"37600019","automatic_log_collector_and_analyzer",313,"infrastructure",{"id":257,"name":258,"points":259,"category":245},"37636701","chatgpt-history-export-to-md",295,{"id":261,"name":262,"points":263,"category":245},"37642671","E-Ink Day Schedule",294,{"id":265,"name":266,"points":267,"category":268},"37661767","Magentic",283,"dev_tools",false,"v2",{"id":272,"name":5,"line":6,"ai":269,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":29,"top":18,"kw":273,"maker":11,"domain":10,"tier":19,"attempts":34,"strip":274,"url":9,"mix":275,"praise":71,"objection":94,"sub":21},37619100,[24,25,26,27],"30053003035553535053000333003033",[31,32,33,34],1794036642218]