Live data from Hacker News

GenCAD

gencad.github.io

91–100 of 135 posts

Re: GenCAD

#91

This has been easy with OpenSCAD for a long time. I have made lots of cool, complex models this way. I built a repo of the prompts I use to show the llm how to do this and it includes many of the models I've created this way... https://github.com/cjtrowbridge/vibe-modeling

OpenSCAD has almost zero crossover with B-rep modelling ('true' CAD, what this apparently is), though.

This isn't B-rep based modelling. Far from it. It builds up the feature tree and then uses geometry kernel to generate B-rep based representation. The final generator output script could probably be adjusted to generate openscad. It only supports 2d drawings containing lines, arcs and circles and extrude operation for making them 3d. Operations like fillets and chamfers which depend on intermediate B-rep model state are not supported.

I would even argue that for basic modelling majority of tools/features in CAD operate at the abstraction closer to CSG for describing what and B-rep is only treated as how. Just like good chunk of code based CAD use combination of CSG for what and triangle mesh based geometry engine for how. That's assuming you consider standard 2d->3d operations (extrude, revolve, sweep along arbitrary 2d profile) as valid primitives for CSG.

User comes into direct contact of B-rep in very specific situations: 1 doing operations like fillets/chamfers/draft/thickness based on intermediate geometry, 2 attaching sketches or other features to generated geometry or using generated edges (instead of new sketches) for guiding operations like complex sweeps, 3 surface based modelling workflows where you build up the the solid from individual faces typically including complex curved surfaces.

In case of 1 and 2 the the dependency on b-rep based representation is only marginal, in theory you could select edges in triangle mesh based underlying representation but the final result but quality of result wouldn't be as nice and TNP issues for parametric model editing would likely be even bigger than it is for existing CAD. That's not really CSG territory anymore but isn't exclusive to B-rep either, and involves a bunch of work that's outside the scope of B-rep. In non parametric mesh modellers with more destructive editing workflows like blender chamfers and fillets work fine. And if anything for reliable parametric models you often want to limit dependencies on intermediate geometry as that depends on CAD keeping track of where each edge/face originated from outside the b-rep and increases the chance of TNP issues.

3 is critical for industrial design containing large amount of complex curved surfaces like cars and other consumer products, but there are also many more technical parts where it can be completely ignored. Cad tutorials for beginner tutorials almost completely ignore this category of cad modelling. The part about not being exclusive to b-rep also applies for surface modelling part.

Re: GenCAD

#92
post #74

I'm stumped by things like this. The drawing & modelling are not the difficult bit - the CAM programming is. That seems difficult enough that I have not found an open source program to load a 3D model and allow me to set the toolpaths in a UI, never mind have an LLM generate them from the model.

That's a completely different difficult problem, and totally dependent on the manufacturing process. CNC? Sure. FDM from the same .step? Almost entirely irrelevant, that's the slicer's job. SLA? Doesn't make sense to ask the question.

Re: GenCAD

#93
post #22

Readers may also enjoy my open source Rust BRep CAD kernel https://github.com/ecto/vcad or the hosted version at https://vcad.io . I also wrote a bit about what goes into CAD apps! https://campedersen.com/tessellation

Seeing as I'm attempting to build my own CAD program in Rust I checked out the hosted website. I'm not really sure what is supposed to be working and what isn't. I can't help but to be skeptical of one person writing ~115k LOC in 4 months which is just the Rust crates, nevermind the frontend (which is another 100k LOC!!!). I'm curious why you decided to go with "eager" tessellation. Creating a circle immediately resu…

> I'm curious why you decided to go with "eager" tessellation. Creating a circle immediately results in a bunch of lines which resemble a circle but would fail under tangency constraints quickly. Is this a current limitation or part of the strategy for the kernel?

I’ve seen several vibe coded attempts at a geometric kernel (including several of my own) and this happens every time.

Vibe coding a geometric kernel is practically impossible because sooner or later* the LLM inevitably takes the tessellation shortcut and if you don’t catch it, the codebase is completely compromised. At the end of the day, there isn’t enough training data in architecture or algorithms (opencascade solvespace and truck being the only real examples, all significantly worse than commercial kernels like Parasolid or ACIS).

* usually as soon as you ask it to do anything non-trivial. If you’re lucky you’ll get a naive Newton marching algorithm on analytical bodies, which is slightly better but has the same problem with degenerate and pathological cases (coincidence, tangents, parallels)

Re: GenCAD

#94

I spent a few hours trying to get this to work, and I couldn’t get it to produce usable results on anything except the training data, even with very simple drawings. I noticed in the GitHub that they mention it is only around 60% reliable even on their own training data, but the image shown on the front page feels pretty misleading. I made 10 images that were very similar in complexity to the examples shown, and even…

I’m also confused by their examples. All of them seem to be perfect renders/exports from 3D models — this is not the use case where I see it the most useful. Making a parametrized CAD model out of a hand-drawn sketch — yes, please

I have tried getting claude to generate openscad for sketches it does poorly. But that would be great

Re: GenCAD

#96
post #74

I'm stumped by things like this. The drawing & modelling are not the difficult bit - the CAM programming is. That seems difficult enough that I have not found an open source program to load a 3D model and allow me to set the toolpaths in a UI, never mind have an LLM generate them from the model.

> The drawing & modelling are not the difficult bit - the CAM programming is.

Actually the drawing and modeling are very much the hard part, so much so that the open source geometric kernels are decades behind the commercial ones. The computational geometry is genuinely a hard problem due to floating point errors and degenerate cases like parallel surfaces and tangent lines.

Once you have the geometric kernels, CAM is little more than a physically aware pathfinding optimization problem. Computationally expensive but otherwise straight forward. The kernel, on the other hand, has to be built up experimentally, tracking down every place where the math breaks down or there’s a pathological case, until you’ve got the thousands of special cases worked out.

Re: GenCAD

#97
post #37

Neat, but I don't really see the utility. The time consuming part of CAD drawing comes from figuring out the correct dimensions of each feature, spacing, sizing, tolerances, etc., and constraining the drawing in a way so that it's easy to tweak later on- which this doesn't do at all. Maybe you could draw a 2d sketch of what you want then generate it, but you'd still have to do the hard part.

I think this is true under assumption that you know the CAD tool well. From my recent experience (I have a 3D printer), I regularly find myself in a situation where I know what I want to do, I can do measurements and I can make a sketch on a paper. Yet, making it a proper 3D model in something like FreeCAD is super tedious. I know OpenSCAD relatively well, but when it comes to something more complex I struggle a lot.…

Your comment on how you feel trying to execute a model is similar to the inverse of how many Mechanical Engineers (used to) talk about coding - they know what they want, they can write down what they want a program to do, they just don't know what to type out in a programming language or how to compile the code or use the IDE, etc etc.

There are mechanical engineers out there who can literally model objects nearly as fast and they can 'think' about the layout of said object. If you look at the complexity of, say, a CAD model from a real, highly complex aluminum casting section of an automotive subframe, or the living-room-sized cross-fuselage spar forging of a fighter aircraft, with hundreds of ribs and fillets and features- and compare that to the simple model you are trying to make in OpenSCAD, you should quickly realize the parallels in difficulty you are trying to express (similar to the person without knowledge of C++ or Python watching someone be able to build applications by typing code from their fingertips as if they already knew what to type...)

You are struggling for a few reasons- 1., it is a knowledge hurdle of an entire field you are trying to surmount- again, go watch someone actually model a real, complex part and watch the speed, they can do so in a tool like Solidworks, CATIA, NX, etc... at a rate that is far different because they have experience that it can honestly take even good people years to accumulate - and 2. they are using professional tools - you mention OpenSCAD, like it is CAD, but it isn't. It is programmatic mesh generation, and it turns out that programmatically typing out how to generate complex things is much more difficult than a combination of a graphical GUI and graph-based generator that all big CAD programs figured out starting in the 1980s. If those tools you use were really the best way to make complex models 'paramaterized', then why do we design our fighter jets, Formula 1 cars, or Space X rockets in Dassault's CATIA or Siemen's NX ?

You want a LLM to take a sketch to your CAD, but what I'm saying is, there are people out there that can skip the sketch and build the CAD as fast as you can likely hand draw the first sketch, and these are skills you can actually learn, but you may just be using the wrong tools and have not had the practice necessary.

Re: GenCAD

#98

I spent a few hours trying to get this to work, and I couldn’t get it to produce usable results on anything except the training data, even with very simple drawings. I noticed in the GitHub that they mention it is only around 60% reliable even on their own training data, but the image shown on the front page feels pretty misleading. I made 10 images that were very similar in complexity to the examples shown, and even…

When skimming a research paper in addition to abstract don't forget to read "limitations and future work" and "conclusions".

In the limitation section they are quite direct with it: "images used .. are mostly isometric and noise-free CAD-images" and "limited CAD vocabulary used in this study needs to be extended by including more sophisticated CAD tokens such as revolve operation, edge operation (e.g., fillets/chamfers)". It currently supports only series of pads (can be subtractive). Many simple beginner exercises of seemingly similar complexity don't fit those constraints. Some of the parts shown could be more naturally created using wider set of tools, but technically can be created using only pads.

So even if you tried with clean screenshot of simple 3d model, it will likely fail if camera settings aren't right, and it will fail if model can't be represented using series of pad operations. Anything containing spheres, cones, nearly all lathe parts, fillets which can't be included in 2d sketches will fail. In theory arbitrary extrusion angles are supported, but all examples showed only axis aligned parts.

That said I wouldn't be surprised if it failed even if you considered exact limitations not just similar complexity in your attempts.

Assuming images in the googledrive are the training data, "mostly isometric and noise-free CAD images" is a bit of understatement. All of them are at very specific angles using and single style. Specific solid gray infill color for "images", and white infill with weird shading around perimeter for "sketches". Both with white background and pixelated non antialised 1px lines. No reason to expect it capable of processing anything which doesn't have exactly same visual style. For practical product that would have to be solved but that wasn't really the point of this research. All the style transference papers have show that it's more or less solvable problem, but for a paper exploring what model architecture and 3d representation could work best for AI cad it seems like unnecessary distraction that would only bloat the training costs and time. Most annoying part is that it makes hard to test the model with your own inputs.

Re: GenCAD

#99
post #23

To the author if they happen to see this. Please kill the auto playing video. If someone is listening to something else on their phone this always takes over and interrupts.

TIL: people are still browsing the internet without an ad blocker.

How do you use an actually effective ad blocker on the iPhone?

Re: GenCAD

#100
post #37

Neat, but I don't really see the utility. The time consuming part of CAD drawing comes from figuring out the correct dimensions of each feature, spacing, sizing, tolerances, etc., and constraining the drawing in a way so that it's easy to tweak later on- which this doesn't do at all. Maybe you could draw a 2d sketch of what you want then generate it, but you'd still have to do the hard part.

I think this is true under assumption that you know the CAD tool well. From my recent experience (I have a 3D printer), I regularly find myself in a situation where I know what I want to do, I can do measurements and I can make a sketch on a paper. Yet, making it a proper 3D model in something like FreeCAD is super tedious. I know OpenSCAD relatively well, but when it comes to something more complex I struggle a lot.…

I've resorted to using Rust + vcad, although I think I'll give OpenSCAD a spin.

I haven't tried telling AI to "make a thing," but I'm able to get Co-pilot to refactor code. It's just the geometry that makes my head spin.

Post reply on HN