Hacker News new | ask | show | jobs
by exmadscientist 774 days ago
For anyone wondering how a "professional" would do this, you might use a 3D CAD program like SolidWorks, Inventor, or FreeCAD. You'd make a single 2D sketch, draw some lines in box shapes, and put some constraints on those boxes. Free/unbound dimensions would read out the distances that you needed to know. The whole thing would take less than five minutes for someone with beginner-level skills (i.e., me), and maybe an hour or two to learn from scratch. It's not as cool as doing this with CSS's constraint solver, but it might add a new tool to your toolbox, and the value of that is difficult to overestimate.
3 comments

Having used AutoCAD, Draftsight, and PTC ProEngineer in the past, and FreeCAD (for actual CAD, generally 2D, as input to a Shopbot) and Sketchup (for design renderings for clients) regularly currently, I would suggest that the learning curve on constraint-based drafting is fairy steep for most folks.

I'd also submit that it's of limited value if you aren't using the same package as your shop. The browser-based method is at least all but guaranteed to be available to the people building the cabinets.

Since they'll have to do shop drawings anyways, you aren't gaining much even if you can interchange drawings with their CAD software.

I would recommend SolveSpace for this - it has a wonderfully simple UI, good taste in key shortcuts, runs quickly with few resources, and is easy to quickly define the kind of 2D constraints you would to use in the types of drawings we're talking about.

It can export to SVG, DXF, PDF, GCODE, and more

I mean, we're talking about making the napkin sketch that you hand to the real draftsman. The format really doesn't matter; they want a PDF (or whatever). They are not going to open your HTML/CSS/JS tool even if it would be trivial to them. They have better things to do with their lives. So what tool you choose is up to you and should be whatever is best for you. It doesn't matter what the shop is using.

Proper constraint-based drafting is indeed quite hard! But I think the whole "lay out this 2D grid-like structure with a few rectangles" problem is probably one of the first things anyone would learn to do with it, and I'd submit that it is indeed probably about a couple of hours' work, for someone already reasonably technical. The moment there's more than a single sketch involved, or complex geometry in that single sketch, I agree with you that it's asking too much.

The real benefit is that you are starting to learn something new. CSS is not going to help you (insane contortions aside? I really don't want to find out) when things like circles appear. And yet, if you know how to do 2D sketches, you can find yourself using them to solve other problems, just because you already know how to do it. And that's pretty cool! (For example, I've had living rooms that were just awful to lay out. It was a real nightmare to figure out how to get a TV into that place. So I sketched it up and messed around until I got something viable. My original plan was just to print out some pieces of paper to scale, then mess around with those, but it was soon clear I could do it all onscreen, so I did.)

Mid-way through development, once I still had to solve the problems of sharing and printing, I almost gave up on continuing the work because I thought: "it surely must be easier to just learn a CAD application".

But as another commenter highlighted: that meant a learning curve not only for me, but for my wife as well. And then there was the challenge of sharing it with everyone else via email, IM, etc. Having it open in the browser means it's easy to share, and fast and easy to load and show to people anywhere (which is handy during construction).

I've actually used FreeCAD Python scripts that simply define a lot of defaults for my usual cabinet style (eg. toe kick height, panel thickness, a couple of drawer styles [inset or not]...), and then simply declare cabinets I want to be building.

I get a 3D rendering, a cutting list exported as CSV that I can pass on to a shop, and it's trivial to adjust and play with dimensions.