Proposal: GUI-first, text-based mechanical CAD inspired by software engineering

28 points by thinkmachyx 5 days ago

Most mechanical CAD tools (SolidWorks, Fusion, FreeCAD) still lock all modeling into opaque binary files. That makes it hard to track changes, collaborate with Git, or automate builds.

I’ve written a proposal for an alternative paradigm:

- GUI-first, like KiCad - visual modeling is the default

- Text-based source files (YAML/JSON) — readable, diffable, Git-friendly

- Separation of source and result - .step, .stl and previews are built artifacts

- Parametric logic is explicit - slot width = tab width + clearance

Works with Git, CI, or scripting — no more PDM lock-in The proposal is called SplitCAD, and it's just a concept for now — not a working tool. But I’d love to hear from anyone frustrated by the limitations of current mechanical CAD.

GitHub: https://github.com/yuanxun-yx/SplitCAD

bluGill a day ago

That won't help. I've worked with graphical programming languages before. They work well enough, but in every case I've seen the files saved are not merge-able. Even code generation tools a trivial change will sometimes result in saved files that are almost entirely. Even with text based coding, sometimes you have to make major changes to a file and you tell everyone else on the project don't touch that file since their changes will not merge - the difference is because you are working with the text you know this will happen.

What you want is something that allows more than one person to work on a project. Programming started with file locks - you can divide a large project into pieces (parts, sub assemblies...) and then lock those pieces. I think that is done by the better CADs already, if not it is easy and you should apply that.

Eventually we figured out how to create merge tools - break the program up into lines, and if a line is changed by only one person apply the change, otherwise make sometime redo that line manually. Until you figure out how to merge graphical drawings you are stuck. Making the file next based isn't going to fix anything because the tools will sometimes need to restructure the file based on what seems like a trivial change.

  • marcosdumay a day ago

    IMO, graphical languages should have graphical merge tools. You can't expect the text to be mergeable, but it's not enough reason to refuse file diffing as a concept.

    The problem is that graphical tools are usually large, proprietary software made with the explicit purpose of locking people into an entire ecosystem. Diffing is a small specialized operation that enables portability and interoperability between ecosystems, so tool creators actively avoid those.

  • rjsw a day ago

    There is current work in STEP AP242 to annotate parts of a design with UUIDs to make it easier to work out if elements of a saved file are new or modifications of a pre-existing one.

    • bluGill a day ago

      UUIDs don't tell you that because when does changing a part make it a new part and thus a new UUID? Unless the users is naming all parts - but that isn't what UUIDs normally are and opens a different set of problems.

      The problem is hard. I wish those working on it luck, but I don't have high confidence that it is solvable.

      • rjsw a day ago

        There will be an algorithm defined for CAD systems to follow on when to keep or replace a UUID.

X-Ryl669 a day ago

FreeCAD files are zip file containing XML documents. There's nothing binary in them, you can modify them by hand if you want. The main issue being that the format itself isn't standardized, so it's continuously evolving, it can't be used as an inter-exchange format. Notice that the last standard revision for STEP files does contains some tools for saving the parametric functions in the file (so the STEP boundary surface description isn't static anymore but can be parametric too). It's not made to save all the possibilities of a huge CAD toolkit, but if such a toolkit wanted to, it could map the functions in the file to its own parametric function and allow skipping a lot of work for recreating the part.

IshKebab a day ago

I don't think this will ever really work well. CAD is just too visual. You're never going to be able to meaningfully diff/merge anything but the most trivial changes.

Code-based CAD is fine for things that are highly regular like fasteners, springs, etc. You're never going to design a motorbike or a chainsaw using OpenSCAD though (at least not if you aren't masochistic).

willrshansen a day ago

I got into FreeCAD's python interface, and then Cadquery for 3d printing a few years back, and I think you've got about 70% of the solution.

Things you've got right:

   - Human-readable text file is source of truth
   - GUI editing is first-class, because it's easier to work on (most of the time)
Features your proposed solution is missing that I want:

   - Full power of an established programming language.  Yaml or json won't cut it.
   - Code and GUI on equal footing.  Edit in GUI -> see generated code.  Edit in code -> see result on model.
The main problem with Cadquery is that it's entirely code-first, and you lose out on the intuitiveness of GUI editing

One of the less obvious things I really like about dealing with code cad is that feature selection can be based on intent. Like "upper-rightmost feature" rather than "feature closest to this coordinate I just clicked". There's got to be a good way to incorporate this aspect into the "edit in GUI -> code is generated" step (without just requiring manual code editing), but I'm not good enough at UX immediately see it.

loloquwowndueo a day ago

Sounds like a gui editor for openscad would be just the thing for this, right?

  • bluGill a day ago

    Unlikely - a GUI editor is likely to restructure a file on what looks like a trivial change and thus the result cannot be merged.

    • WillAdams a day ago

      Why not a GUI editor which instantiates dimensions/coordinates, allowing the user to name/identify them (and then change their values either by changing the associated value or dragging the associated graphical element)?

      • bluGill a day ago

        Where does it put each dimension/coordinate? So long as there is anything that could go in more than one place the GUI can rearrange a file. If the place is specified exactly then a minor change will change the sorting.

        • WillAdams a day ago

          I suggested a list/pane at one corner for the actual list --- agree the UI is difficult and that there needs to be a way to set/adjust the association (see discussion on the PythonSCAD Google Group).

  • aDyslecticCrow a day ago

    A gui with tools for openscad that map to real functions would do the trick.

WillAdams a day ago

In what way does LibreCAD writing out .dxfs, or Solvespace or BRL-CAD having a human-readable file format option developed not suit your needs?

That said, I believe this would be helped immensely by an overview of CAD --- fortunately, one was published a while back, and dragged back from 404-ness by one CAD vendor:

https://www.shapr3d.com/history-of-cad/introduction

a reading of that to understand the overall context would probably provide a solid foundation for your efforts.

There has been some recent discussion of making OpenSCAD and derivatives thereof more interactive:

https://groups.google.com/g/pythonscad/c/a-FVSiRnzhw

and various efforts/research:

https://www.reddit.com/r/openscad/comments/18wpaoz/investiga...

https://old.reddit.com/r/openscad/comments/1eswe2w/i_made_a_...

Try that latter at:

https://scriptcad.com/paulftw/2.0-demo

Agree w/ @jpm_sd that Dune 3D is well worth looking at (it's the only interactive 3D CAD where I was actually able to make it through the tutorial).

severak_cz a day ago

I am already working on something similar yet much smaller - simple, easy to use 2D CAD for hobbyists, maps and geometric art. I have working prototype implemented in lua (Love2D) [0] and barebones text based file format[1].

Curently I am experimenting with drawing things in DeltaCAD (another easy to use CAD - unfortunately abandonware now), converting it to my format (via DXF export) and displaying it with javascript. I want to reimplement second version in javascript to be able to run it in browser and use better GUI components than those which I tried to implement myself.

[0] - https://github.com/severak/graph-paper

[1] - https://github.com/severak/graph-paper/blob/main/doc/file-fo...

  • WillAdams a day ago

    An existing project in this space is perhaps:

    https://www.godsvg.com/

    • severak_cz 8 hours ago

      It looks interesting and I see use cases for this but my tool is (and will be something little different) - it's more visual drawing tool (with exact dimensions) and human readable file format is more byproduct than not.

zxspectrum1982 a day ago

Other than git-friendly, this is how I remember AutoCAD 10 from ancient times.

  • WillAdams a day ago

    Wouldn't it have been git-friendly if .dxf was used as the file format?

  • stergios a day ago

    Me too. I had a secondary monochrome monitor just for the text commands.

ddingus 5 days ago

I live seeing efforts like this.

But I am just going to put this here so the general thoughts incorporate a fundamental problem before significant labor investments go too far:

What is a probable, viable, possible answer to the geometry kernel problem?

Parasolid, arguably the leader and generally most capable geometry kernel we have today, is or at least I can't see past...

...is just not something easily duplicated.

There are a bazillion man months of time in that body of code. And those are hard hours!

For those unfamiliar, the geometry kernel is the piece that resolves geometry cases to make operations possible. Imagine a cylinder and rectangle. Now imagine they have some common volume. They intersect, in other words.

Put a fillet on one edge to blend the edge.

How many literal edge and corner cases can you come up with?

There are way more than you think!

Now multiply that tiny problem space with all the geometry used every day.

And then multiple that time again by what it takes to make it robust.

And the whole thing, as it stand today is not even multi-threaded!

Any CAD that we expect to see even moderate general use in a professional sense, needs this piece.

How do we, meaning anyone interested in CAD this way, get past this?

I wish there were some OSS type license for Parasolid. It could be treated like the Linux kernel.

Whatever replaces Parasolid and friends, should be treated like the Linux kernel.

The closest we have is Open Cascade.

Sorry. I do not want to piss on a good vision. But this has to be said.

Peace and good luck!

I used voice input on this. Pleqse forgive typos.

  • blobfish01 3 days ago

    Great comment! I think the size and scope of BRep modeling kernels is lost on 99% CAD users. IMHO: I have reached the point where I think there should be a generation of library development before a CAD application is even considered. This is coming from a person who has spent 10 years on an open source cad application, so I am not naive. The modeling kernel, of course, is lacking but also 3d visualization needs some love. More options in that space, but still lacking.

    • ddingus 3 days ago

      I agree! Viz needs love for sure.

      Sidebar: My home plasma TV is a 3D capable one. Back in the 90's I used to use 3D to visualize models on SGI machines.

      Fast forward to the mid 10's and I can hook up a laptop with nVidia GPU and run NX and the whole interface and model works in 3D!

      Amazing. I love it, especially with a space controller.

      There are maybe a handful who do that on even a very low basis.

      That has always bothered me. Part of me knows some people have trouble and that another part knows the development gets even more expensive, but still your point is a solid one.

      • blobfish01 2 days ago

        I am jealous. I ran UG(sorry will always be UG to me) for 15 years and didn't ever experience it in 3D. I did immediately fall in love with the spaceballs/3d controllers. I added the initial 3d controller support in FreeCAD years ago. If you are spaceball curious: https://spacemice.org/index.php?title=Gallery

        • ddingus 2 days ago

          Nice addition!

          Don't be sorry. Tons of users call it UG. Yeah, I had an airplane model to play with and built a fair number of surfaces.

          It works well. Space X has a nice 3D setup.

  • tda a day ago

    > I wish there were some OSS type license for Parasolid. It could be treated like the Linux kernel.

    > Whatever replaces Parasolid and friends, should be treated like the Linux kernel.

    So much this! But the undertaking is so daunting, how do we get there? A capable, OSS CAD kernel would provide so much value to the world. I whish e.g. the EU could just "nationalise" such important, crucial software and redistribute it openly. Or that through some Chinese effort a newer and better kernel just lands out of nowhere and disrupt the field, like with DeepSeek.

    The world has benefitted so immensely from Linux being freely available, has anyone even tried to put a price on the benefit to humanity? Imagine being stuck in a world where on big corporations can have proper OS-es, and everyone else is stuck with some anaemic locked down kernel...

    • cyanydeez a day ago

      Im not sure we are annywhere near Software as Public Infrastructure.

      Will need to clear put billionaire parasites, and that wont happen till American fascism hita its nadir.

  • rjsw a day ago

    > I wish there were some OSS type license for Parasolid. It could be treated like the Linux kernel.

    I did propose that licencing it as dual AGPL + commercial could be a way around the objections to the attempts to make JT into an ISO standard, didn't get anywhere.

  • thinkmachyx 5 days ago

    Thanks a lot for the thoughtful and respectful reply! I really appreciate that you raising the engine issue without dismissing the whole idea.

    Although building such engine requires tons of work, but the engine we’re having is indeed a bit of old. Except for the problems I mentioned, you also mentioned they’re still single threaded. That’s why I think it’s still worth building a new one, especially when there’s no good open sourced one currently.

    I’m a big supporter of open source. If we have something like that in the future, we should of course make it open source like Linux kernel and allow everyone to enjoy the benefit of it.

    • ddingus 4 days ago

      Me too, and you are quite welcome!

      CAD is close to my heart. I jumped in during the 80's as a high schooler running on an Apple 2! Even back then, limited 8 bit CAD could do a lot. And it was one application that helped me see the future! Product design was gonna change as manufacturing already was and the people who knew CAD were gonna be there.

      Now here we are, and the CAD companies own design and manufacturing.

      I had a flash of an idea this morning reading your comment:

      Perhaps we could license Parasolid for a year, or maybe we try what tomfoolery I am about to put here with Open Cascade.

      Maybe an AI model of some kind can get us a leg up?

      Going back to the fillet example I put here earlier, I want to share a bit of backstory...

      I was at SDRC, who had built out a fantastic concurrent engineering and analysis system called I-DEAS. I loved that CAD software and was an applications engineer and trainer on it. Taught many groups of engineers how CAD works, and I got to do that on a system that had collaboration built in from the beginning! Fully revision controlled concurrent engineering and analysis. Fun stuff.

      But it died.

      My years of skills gone. Kernel could not keep up. So I moved all that onto what is NX today and many of the best parts of the software I loved ended up being implemented because some mergers resulted in the same smart people being product managers! I am particularly redeemed!

      And therein lies the lesson of the geometry kernel. You build your true skill on Parasolid systems or risk seeing them lying dormant, cast aside.

      The kernel upon which I-DEAS was built was written in Fortran 90. Beautiful software too. It offered capabilities well ahead of Parasolid in some ways, but consistently failed on some common geometry cases that come up rather frequently. Things tangent to things, touching a a point was a big one.

      One thing I taught was overbuild or underbuild. Rather than draw a rectangle tangent to a circle to prepare for an extrude, place that end of the rectangle inside the circle and let a boolean operator sort out the two resulting solids.

      So yeah, build it kind of wrong so the kernel can build solids. Messy. :)

      I was in a room talking to the people who do fillers. Edge blend to some of us.

      We talked about my fillet gauntlet. It was a collection of geometry cases that fillet operations failed to complete.

      Parasolid could always resolve more of them, and it did that with fairly sloppy tolerances. The SDRC kernel was catching up each rev, but the trend line looked like a decade of analysis of the successful resolutions, and coding for those, wash, rinse repeat a lot.

      I wonder if it might be possible to generate geometry cases using parameters such that whole problem spaces could or can be created. Have good kernels solve and train an AI on all that to see what it may then solve differently?

      Maybe man years boils down to compute/watt hours?

      • thinkmachyx 3 days ago

        I really appreciate your reply — it's an honor to hear from someone with such deep experience in the field. Your insights from decades of working with CAD and kernels are incredibly valuable, and it means a lot that you'd take the time to share them here.

        The idea of parameterizing geometric problem spaces and learning from how different kernels handle them is strikingly similar to what compiler researchers have done in CS: generating corner cases, analyzing compile errors, and training AI to self-correct. AI coding is used widely in the industry currently, with tools like cursor gaining huge popularity.

        And the move to a text-based representation is what makes this all tractable — binary formats never gave us that level of observability or editability. With source-level CAD, it becomes much more realistic to analyze failures, share test cases, and eventually integrate AI tools that can reason about geometry the same way they reason about code.

        • ddingus 3 days ago

          Re: honor

          Humor mode = 1 (you will see why)

          LOL, Thanks for that! Really. CAD is kind of obscure meaning it is rare to have this chat. Was nice.

          I find it an equal honor to talk with others very highly skilled.

          Bromance Curious Mode = 0

          Cheers!

          • thinkmachyx 2 days ago

            lol, got it! Sorry I got too excited. Got a bunch of Reddit "experts" earlier, so your reply honestly made my day. Thanks!

            • kingkongjaffa 2 days ago

              Are you an LLM? You write like an LLM on a 3 day old account.

              • loloquwowndueo a day ago

                How about a non-native speaker using an LLM to more easily render their thoughts in English? Would that be okay? :)

        • ddingus 3 days ago

          Perhaps text answers are possible?

          Today, a solid consists of the following entities that follow the golden rule; namely, each edge is shared by two and only two surfaces: [0]

          Solid Cubish

          6 faces bounded by 4 edges each, having endpoints, etc...

          Each edge is a curve [1] that lies on the surface so as to bound it to a precision small enough that there are no gaps between the curves and the surface edges they define.

          Various bindings and or other data elements:

          Centroid

          Vertices, each attached to three edge endpoints considered equal given a system tolerance.

          ...etc.

          [0] Where an edge is alone, the resulting non manifold has a hole in it somewhere, and or is a surface body where a large number of edges stand alone.

          Where an edge is shared by more than two others, that is a self-intersecting body.

          Neither case is actually manufacturable. One can understand a lot just from edge checks too.

          All edges alone, or unique = face.

          No edges present = closed surface must be sphere, torus or elliptical solid body

          ...etc.

          Also, in wireframe NURBS curve land, the most useful thing about the decision to represent all the analytic entities (line, arc, conic, hyp, parabola, circle, elipse...) as NURBS was to be able to reason programmatically with far fewer pain in the ass cases!

          Eg: a trim function can be written to process any NURBS arguments. One that has to face lines, circles and friends ends up either converting to NURBS or handling trim line to circle, arc to conic, NURBS to ... you get the idea. Too messy.

          Generating that data won't be cheap, but it can be distributed! If we had a few thousand users run scripts on their systems, we could get a large problem-solution data corpus.

          [1] In modern CAD, everything is a curve. Lines are NURBS curves having only two control points. Earlier CAD actually used all the entity types directly, not just deriving them on the fly from the NURBS.

          Arcs are curves with 3 specifically placed control points.

          Hyperbola, Conic, Parabola, are the next order up, 4 control points, and above that is the Bspine. 5th degree, and above curves.

          Why can't we tokenize those things and train some LLM like thing? I am going to ask my data science friends about this. Has me thinking!

          At the core, it is all NURBS curves and surfaces. Those two can represent all that we need.

          The relations are all just text, names of entities and how they are related.

          Even the NURBS surfaces have text forms. At one point, some systems would let a person just define one by typing the U, V points / matrix values in.

          Eg:

          Plane [point 1, 2, 3...]

          That data is where both the problems and answers are, in this training sense anyway.

          How can it not?

          What I put before was basically the idea of generating a case, say conic section and cube/rectangle.

          Generate common volume case 1 in modern kernel and output text representation of it. That exists today.

          Then generate ideal edge blend solution 1, and minimum radius case 1, maximum radius case 1.

          Output those and we have in text:

          Problem case 1 of problem space 1.txt

          Ideal, or common edge blend solution.txt

          Max radii case 1.txt

          Minimum radii case1.txt

          Then proceed to generate a bazillion of these, until the problem space of a conic section intersecting a rectangular body is represented fully enough for AI models to operate and even potentially demonstrate emergent behavior like they do on text and code today.

          Edit: basically an LLM like thing becomes the kernel and the CAD system is how one talks to it. Not sure that came through before. Writing it out just in case.

          And to be fair, I am still learning in this area. If what I put here is a no way, it would be most helpful to tell me or link me to why not. Thanks in advance.

          Edit: Ahh, I see. Lol, read in the cad code and have an AI rewrite it? Maybe, but doubtful.

          A bounty on... um yeah. 'Nuff said.

          • ddingus 2 days ago

            Edit: I got the number of control points discussion above wrong. The Arts and conics should be marked three control points each, with the difference being the constraint on the middle control point. Whoops!

          • kingkongjaffa 2 days ago

            Man you have been incredibly generous with what I suspect is an LLM chat. The OP types really strangely with some tell tale LLM writing structures and styles on a 3 day old account.

            Their link is just AI slop there’s nothing insightful here: https://github.com/yuanxun-yx/SplitCAD

            Be wary/careful if they reach out to you some way.

            • ddingus 2 days ago

              Which writing structures would you identify specifically?

              • kingkongjaffa 2 days ago

                Llm’s are notoriously overly agreeable and polite in a weird way.

                Like a human might say “cheers for the thoughtful response” and an LLM would say something more like this “Thanks a lot for the thoughtful and respectful reply! I really appreciate that you raising the engine issue without dismissing the whole idea. ” The tell here is that it’s maintaining a polite engaging conversation while mirroring the semantic meaning of your reply without any conceptual depth.

                You could have written anything and it would have agreed with you.

                Anyone who has spent a few minutes genuinely thinking about how to build CAD can easily see that the geometry kernal is the crux of the problem and why open source attempts lag behind commercial CAD.

                But the LLM user response here is overtly neutral essentially saying “thanks for raising this super obvious thing”

                Its being overly polite. In another comment they say they are “honoured to have your reply” which again is just overly polite.

                On a 3 day old account it just stinks.

                OP is either a low effort poster farming for something or an english as second language user relying on an LLM to write for them way too much.

                Or they are a naive user who wrote a low effort LLM generated proposal without looking at any of the prior art of the topic.

      • layerdynamicsai a day ago

        “Parasolid could always resolve more of them, and it did that with fairly sloppy tolerances”

        Doesn’t that come down to the precision, 1.e-7?

        • ddingus a day ago

          Yes and no.

          Parasolid is happy to work to whatever precision it is asked to use. The system driving it is where the choices are.

          Sloppy tolerances really equal dynamic tolerance based on model geometry size.

          Really, there have been a few different ways to approach this:

          Some systems use a well defined tolerance and that results in a bounded model space.

          Others do not put a boundary on the model space, but then the tolerance varies by size.

          And the third way is to just set a loose tolerance on difficult blends and expect the troubles to come along for the ride. User does that when a blend fails.

          With fillets specifically, a relaxed tolerance allows many of them to complete, but there can be downstream problems.

          Gaps and slivers can appear in models output to STEP, STL and so forth.

  • api a day ago

    Outsider here but — is it conceivable that instead of writing a geometry kernel one could be trained? Use the existing geometry kernels and all the open CAD documents you can find to generate gigantic amounts of training data and train a geometry model.

    Of course the catch here is going to be the precision required for real world use. A ton of impressive AI demos are just that — demos. They are good enough to wow as a demo. Still, if the data set is big enough, and you’d probably want to run the model itself in at least fp32 precision, maybe you could get something.

    There is a body of machine learning work that’s been done on precision annealing of models. Basically you train to min loss and then go into a finer grained domain using something like simulated annealing to fine tune parameters.

    • ddingus a day ago

      That is what I was writing about above.

      Use current CAD and a script to output a LOT of cases to be used for training data.

    • zihotki a day ago

      Sure, as soon as we could get predictable and repeatable results from a model in reasonable time

      • ddingus a day ago

        That is circular.

therouwboat a day ago

Code review seem unnecessary, since nobody cares how you made something as long as it is correct. (Measure model, measure finished part) I sometimes modify models in mastercam when designer is away.

Technical drawing comes with list of changes and more important projects have approval processes.