Live data from Hacker News

Code CAD – Use code to create CAD models

cadhub.xyz

71–80 of 97 posts

Re: Code CAD – Use code to create CAD models

#71
Complete newb to the space, but I’ve been playing with SketchUp lately for some hobbyist projects, and the inability to just TELL IT what to do instead of having to drag and drop constantly has been shocking to me. Like “attach this object to this other object at this offset” or “make a rectangle of these dimensions at these starting coordinates.” So this seems very exciting.

Re: Code CAD – Use code to create CAD models

#72
Shout out to JSCAD -- Javascript solid object CAD software. I really like it. Some things I've been able to do with JSCAD that would be hard to imagine with any other CAD software:

- From the same source files, I can generate either an "assembled" model or a "print version" arranged for 3D printing.

- Integrated into github CI/CD so that I know immediately if I broke my designs. Easy to write tests for things like bounding box size.

- Use eslint to enforce style rules. Mocha for tests. Typescript if you want.

- Browserify to bundle the design into a website. Directly from the source CAD files, without rendering to a huge mesh file format.

It's cool because you get access to the whole javascript ecosystem, and it's native to the browser.

https://openjscad.xyz/

Re: Code CAD – Use code to create CAD models

#73
I am an engineer. I do Arduino programming on the side. In my experience every attempt at a code-based CAD system has been totally useless. At every step of designing something, it feels like the scripting language is actively working against anything and everything I try to do with it. Everything feels as though it takes about ten times as long as it should. So far I've tried OpenSCAD and JSCAD.

I pirated SolidWorks last week and it is an absolute joy to use. It is like night and day compared to any scripting based CAD system out there.

CAD and code absolutely do not, and should not mix.

Re: Code CAD – Use code to create CAD models

#74

Complete newb to the space, but I’ve been playing with SketchUp lately for some hobbyist projects, and the inability to just TELL IT what to do instead of having to drag and drop constantly has been shocking to me. Like “attach this object to this other object at this offset” or “make a rectangle of these dimensions at these starting coordinates.” So this seems very exciting.

IME, positioning in SketchUp requires fiddly d'n'd. Sizing, however, can be done by typing in numbers as soon as you start drawing a line or rectangle, start pulling a face into a volume, or any action that involves one or more offsets.

Re: Code CAD – Use code to create CAD models

#75

I am an engineer. I do Arduino programming on the side. In my experience every attempt at a code-based CAD system has been totally useless. At every step of designing something, it feels like the scripting language is actively working against anything and everything I try to do with it. Everything feels as though it takes about ten times as long as it should. So far I've tried OpenSCAD and JSCAD. I pirated SolidWorks…

CAD and code absolutely do not, and should not mix.

I tend to agree, having done both programming and mechanical design. Drawing by writing code is pounding a screw.

The major CAD systems have some scripting capability, for when you need to generate a gear or a geodesic dome or something that needs procedural generation. They also have constraint solvers, so you can specify constraints and let the system find a solution that satisfies them. Try the demo version of Fusion 360 for that.

Re: Code CAD – Use code to create CAD models

#76
post #35

Hey, I created CadHub. I'm really bullish on software driven CAD, myself and other CadHub volunteers talk regularly about a future in which Mechanical Engineering and design is very similar to software engineering. I'll be the first person it admit that some of the current CodeCAD tools aren't production ready, OpenSCAD for example I can't imagine being used by mechanical engineers. So the idea is mostly about unifyi…

Howdy! Well we absolutely need more open source CAD tools. That said as a mechanical engineer for going on two decades now, I really get no value from this kind of mechanical design. I grew up on Solidworks and now use OnShape. That kind of physical modeling is very important. Being able to click on a face and sketch some geometry and then extrude it really feels like the right modality for me. I’d really love to see…

  > Howdy! Well we absolutely need more open source CAD tools.
Please, no. We need one (or two for competition) really good open source solid modeling CAD tools with parametric and other interfaces. We do not need a dozen competing tools with varying feature overlap that need to be meticulously vetted before committing to one. Not to mention wasted dev time as each tool implements similar features in different ways, wasting very limited open source dev time.

Often I feel like FreeCAD is "getting there" but it's nowhere near "there" yet.

Re: Code CAD – Use code to create CAD models

#77
post #68
post #48

Earlier quoted context omitted.

My background is software, I do (mechanical) CAD just for hobby stuff, but I agree about the GUI being a convenient way of working on it. What I desparately want though is an on-disk format that's plaintext, makes sense, and results in reasonable diffs so that I can use git for version control. I just don't understand, being familiar with git, how people can work with 'save and mark new version' style 'version contro…

STEP exchange files are plaintext but there isn't any guarantee that the position of stuff is preserved after making a change.

Can STEP files be parsed to order via e.g. (I know nothing about them) sorting some tree? Are there any e.g. hashes that change as content is modified?

In software we solved this with code style guides and later code formatting tools. I would be surprised if e.g. a Python script could not format the STEP files to a "canonical" representation before committing the file to version control.

Re: Code CAD – Use code to create CAD models

#78
post #75

I am an engineer. I do Arduino programming on the side. In my experience every attempt at a code-based CAD system has been totally useless. At every step of designing something, it feels like the scripting language is actively working against anything and everything I try to do with it. Everything feels as though it takes about ten times as long as it should. So far I've tried OpenSCAD and JSCAD. I pirated SolidWorks…

CAD and code absolutely do not, and should not mix. I tend to agree, having done both programming and mechanical design. Drawing by writing code is pounding a screw. The major CAD systems have some scripting capability, for when you need to generate a gear or a geodesic dome or something that needs procedural generation. They also have constraint solvers, so you can specify constraints and let the system find a solut…

I'm an embedded software engineer and into 3D printing useful/functional things. I've made a lot of cool complicated stuff with OpenSCAD. There's a lot of problems that are solved nicely in code. For example, I made a two stage 80:1 gear box for a force feedback steering wheel project, and I fully parameterized the gearbox geometry based on the tooth count, gear metric, and extrinsic mounting constraints. As a result, I could very easily try out different ratios and metrics across the whole assembly.

It's sometimes more painful to use code for quick "all I need is a funny shaped..." projects. Some projects really benefit from having a for loop, though.

Re: Code CAD – Use code to create CAD models

#79

Complete newb to the space, but I’ve been playing with SketchUp lately for some hobbyist projects, and the inability to just TELL IT what to do instead of having to drag and drop constantly has been shocking to me. Like “attach this object to this other object at this offset” or “make a rectangle of these dimensions at these starting coordinates.” So this seems very exciting.

Sketchup has a Ruby API. This book is good if you can find a copy:

https://www.amazon.com/Automatic-SketchUp-Creating-Models-Ru...

Re: Code CAD – Use code to create CAD models

#80

Complete newb to the space, but I’ve been playing with SketchUp lately for some hobbyist projects, and the inability to just TELL IT what to do instead of having to drag and drop constantly has been shocking to me. Like “attach this object to this other object at this offset” or “make a rectangle of these dimensions at these starting coordinates.” So this seems very exciting.

It's worth noting that SketchUp is a simple, non-parametric CAD package. What you want is available in most other, more advanced CAD software.
Post reply on HN