Live data from Hacker News

Code CAD – Use code to create CAD models

cadhub.xyz

61–70 of 97 posts

Re: Code CAD – Use code to create CAD models

#61

Honestly openSCAD is pretty cool but you quickly run into limitations because of it's DSL. One major reason I don't like it is that it uses mesh-based modeling and not boundary representation. With the former you can never get a "perfectly" smooth sphere for example. Most CNC shops require the latter. So a few years back I moved to CadQuery[1]. CadQuery uses boundary representation and uses Python as it's host langua…

I really would like to know how programs like CadQuery maintain a robust geometric representation given the inevitable rounding errors that will occur in floating point. For example, how can CadQuery guarantee that a surface will never self-intersect after a number of operations have been performed on it?

Wikipedia has a page on it [1], but quickly skims over some techniques without much details.

[1] https://en.wikipedia.org/wiki/Robust_geometric_computation

Re: Code CAD – Use code to create CAD models

#62
post #61

Honestly openSCAD is pretty cool but you quickly run into limitations because of it's DSL. One major reason I don't like it is that it uses mesh-based modeling and not boundary representation. With the former you can never get a "perfectly" smooth sphere for example. Most CNC shops require the latter. So a few years back I moved to CadQuery[1]. CadQuery uses boundary representation and uses Python as it's host langua…

I really would like to know how programs like CadQuery maintain a robust geometric representation given the inevitable rounding errors that will occur in floating point. For example, how can CadQuery guarantee that a surface will never self-intersect after a number of operations have been performed on it? Wikipedia has a page on it [1], but quickly skims over some techniques without much details. [1] https://en.wikip…

[deleted]

Re: Code CAD – Use code to create CAD models

#63

Earlier quoted context omitted.

Doesn't https://github.com/CadQuery/CQ-editor work on MacOS? I don't really see how development has fizzed out. There have been quite a few commits the last couple of months.

I wanted to kick the tires on CadQuery, but I had to install and understand Anaconda first. Any tool that requires me to understand a build system or a language package manager to correctly and safely build the software before I can use it is not ready for prime time. If this was important for my life, I might put in the effort. If it is for passing curiosity, I probably won't. Especially when it impacts not just thi…

Which is ironic given that Anaconda was made to simplify package management and deployment.

Re: Code CAD – Use code to create CAD models

#64
post #12

The tool looks very nice, but the syntax, which looks pretty close to OpenSCAD, is pretty ungainly. It makes me wish lisp-style syntax were more widely accepted. difference() { hull() { ... } translate([1, 0]) circle(r) } I mean, those are just s-expressions in disguise. (difference (hull ...) (translate (circle r) [1, 0])) The distinction between modules and functions also seems unnecessary.

Language-wise, OpenSCAD is very functional-ish indeed. Try writing code to distribute a vector of length multipliers evenly along some arbitrary length, e.g. [1,2,1] times 20 over 100 coordinate units. It is only possible by recursively calculating a vector of coordinate positions, in our example [0,5,25,30,70,75,95,100]. Not the easiest task for the uninitiated.

Re: Code CAD – Use code to create CAD models

#65

Earlier quoted context omitted.

Onshape is a good combination of visual + you can set exact values for things. I’m always happy to try new tools, but I tend to fallback to Blender for artsy stuff and Onshape for more precise parts. I suck at 3d modeling, so I evaluate tools from a “how much value can a noob get” point of view.

That is definitely an important user perspective. My angle is that I am a professional robotics engineer as well as an open source evangelist. I design a lot of open source CAD and I’d really like it if the CAD package itself was open source as it is important to me to have a community of users who fork my designs. So far open source CAD does not feel adequate as a design tool for me. FreeCAD is conceptually the clos…

Some really interesting thoughts in funding, thankyou. The gotdot and blender examples useful.

Re: Code CAD – Use code to create CAD models

#66
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…

the link for this post takes you to a OpenSCAD model, worth noting there are integrations it CadQuery and JSCAD too.

https://cadhub.xyz/

Re: Code CAD – Use code to create CAD models

#67
post #61

Honestly openSCAD is pretty cool but you quickly run into limitations because of it's DSL. One major reason I don't like it is that it uses mesh-based modeling and not boundary representation. With the former you can never get a "perfectly" smooth sphere for example. Most CNC shops require the latter. So a few years back I moved to CadQuery[1]. CadQuery uses boundary representation and uses Python as it's host langua…

I really would like to know how programs like CadQuery maintain a robust geometric representation given the inevitable rounding errors that will occur in floating point. For example, how can CadQuery guarantee that a surface will never self-intersect after a number of operations have been performed on it? Wikipedia has a page on it [1], but quickly skims over some techniques without much details. [1] https://en.wikip…

Cadquery uses opencascade under the hood. I think your best bet is to open an issue and ask: https://github.com/tpaviot/oce

Re: Code CAD – Use code to create CAD models

#68
post #48

Earlier quoted context omitted.

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…

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.

Re: Code CAD – Use code to create CAD models

#69

Earlier quoted context omitted.

Doesn't https://github.com/CadQuery/CQ-editor work on MacOS? I don't really see how development has fizzed out. There have been quite a few commits the last couple of months.

I wanted to kick the tires on CadQuery, but I had to install and understand Anaconda first. Any tool that requires me to understand a build system or a language package manager to correctly and safely build the software before I can use it is not ready for prime time. If this was important for my life, I might put in the effort. If it is for passing curiosity, I probably won't. Especially when it impacts not just thi…

Yes I agree. Anaconda is one of the worst pieces of software on earth. In fact I have never gotten it to work with anaconda. I use this nix-flake: https://github.com/marcus7070/cq-flake which is faaaaar easier to use and setup and includes the editor. But the README says it probably won't work on non-nixos systems so your mileage may vary.

Re: Code CAD – Use code to create CAD models

#70
post #12

The tool looks very nice, but the syntax, which looks pretty close to OpenSCAD, is pretty ungainly. It makes me wish lisp-style syntax were more widely accepted. difference() { hull() { ... } translate([1, 0]) circle(r) } I mean, those are just s-expressions in disguise. (difference (hull ...) (translate (circle r) [1, 0])) The distinction between modules and functions also seems unnecessary.

https://libfive.com/studio/

This looks incredible! Scheme syntax, ability to manipulate graphically, Scheme code updates dynamically? Very cool. I’ll have to try this for my next woodworking project.
Post reply on HN