Recent submissions

Comment · 4 years ago
I wrote this (in golang) to satisfy my need to generate STLs for 3d printing.

https://github.com/deadsy/sdfx

In general I like to write code to define objects, but there are some situations where a graphical editing UI would be nice. ie- Curve and polygon design.

You can sort of imagine a hybrid approach where you could crack open a mini editor to design a curve and then use it to generate code (table of numbers) which you could then extrude/sweep/loft or whatever.

Comment · 6 years ago
3d = stl, 2d = svg or dxf
Comment · 6 years ago
Comment · 6 years ago
Comment · 6 years ago
I wrote a CAD package in Go that has a function for it.

https://github.com/deadsy/sdfx

  func InvoluteGear(
   numberTeeth int, // number of gear teeth
   gearModule float64, // pitch circle diameter / number of gear teeth
   pressureAngle float64, // gear pressure angle (radians)
   backlash float64, // backlash expressed as per-tooth distance at pitch circumference
   clearance float64, // additional root clearance
   ringWidth float64, // width of ring wall (from root circle)
   facets int, // number of facets for involute flank
  )
Comment · 8 years ago
You sequence the motor, get a pick up from the light sensor and then turn it into a note trigger. It'd be simpler to sequence an array rather than a motor and generate a trigger based on array content.

But sure. Art. It's a piece of kinetic sculpture....

Comment · 9 years ago
Right - they statically link which means that you typically don't have to worry about shared object dependencies when moving the binary around. You just have big binaries. If you use cgo (integration with C-code and C based libraries) then you are back to *.so versioning problems.
Comment · 9 years ago
Premise: It's more important to be productive than to have fast code. Conclusion: Use Python. Is the premise true? For many cases- yes, but it depends. If you are running an application on the cloud and your metric is $/user/year and you have many users then saving some compute resources for each user gets attractive and you don't want to just throw another VM at it.

Is the conclusion true? Garbage collection gives big productivity gains. Other languages have GC. It's not nice to see your Python code die after a few days because you messed up the type passed to a function. Other languages fix that at compile time. Multicore is now. Other languages are built with better multicore awareness.

Comment · 9 years ago
As an engineer hiring engineers, if a candidate gives me a guthub url then I'm going to take a look. There are too many people coming through the door who are marginal coders, so if I can get a sense of what they do for something other than a white board problem then that's a good thing.
Comment · 9 years ago
Comment · 11 years ago
There are other tooth forms that also satisfy the fundamental law of gearing (constant ratio of angular velocity). E.g. cycloid gearing used typically in mechanical clocks. The involute is popular because its easy to manufacture. It can be auto-generated on a gear hobbing machine- probably less important now with CNC machines, but very important in a pre-digital machine era. The involute is also less sensitive to gear center to center spacing.
Comment · 11 years ago
When I was in Stuttgart I made a point of visiting the one they have in the Rathaus. It's an interesting mechanical design, but definitely assumes some personal responsibility on the part of the user. Keep your hands to yourself as you go around the top and bottom...
Comment · 12 years ago
I'd been curious about this one since it was released in the early 80's. I wrote an emulation in python to satisfy my curiosity. (https://github.com/deadsy/py_z80) My general conclusion was that the hardware wasn't good enough (monochrome competing with the ZX Spectrum's color) and that Forth didn't offer enough advantages over BASIC to warrant significant usage. It's an interesting design though, and it's good to see how they built their Forth system in an 8K ROM.
Comment · 13 years ago
The Tensilica guys took this thing an extra step. ie- profile real code to find out what constants are most typically used, enumerate the top n constants, encode the constant with 0..n-1 in the immediate instruction - the immediate value is a hardware based lookup. You can still do arbitrary immediates with longer instructions but you can apparently get some nice code size reductions using this technique.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton