Live data from Hacker News

Code-GUI bidirectional editing via LSP

jamesbvaughan.com

31–40 of 71 posts

Re: Code-GUI bidirectional editing via LSP

#31
post #16
post #4

Isn’t the python based build123d the current best CAD in code solution? The problem with OpenSCAD is that it cannot export solid geometry, just a final mesh. More broadly, I was genuinely shocked to realize, when I was playing with it, that there is no cross CAD file format that captures even simple design concepts like “this hole is aligned to the center of this plate” or even “this is a 2mm fillet”. STEP (the file…

STEP is capable of capturing what you describe, it is down to the "user group" of customers of the CAD vendors to ask for it to be implemented by each CAD system in terms of what they import and export. We put in for some funding for the next edition of STEP AP242 for me to be able to work more closely with the user group to improve this area.

That's awesome! Yeah it seems strange to me that we don't have a standard way of tracking how a model is built up and parameterized (basically Fusion 360's history mode). I'd naively assumed that this was a solved problem in the CAD world - given the whole point of parametric CAD is to be able to easily tweak the distance between two points and have the whole model update.

Re: Code-GUI bidirectional editing via LSP

#32
post #29

Whoa … you can use various unicode characters in titles on HN?

I was surprised by this too! I actually did a search for that character in order to check before posting this: https://hn.algolia.com/?q=%E2%87%84

I was a bit concerned that HN's algorithm might down-weight posts with non-ASCII characters in titles to discourage people from trying to attract attention with them, but it seems like it's fine?

Re: Code-GUI bidirectional editing via LSP

#33
post #4

Isn’t the python based build123d the current best CAD in code solution? The problem with OpenSCAD is that it cannot export solid geometry, just a final mesh. More broadly, I was genuinely shocked to realize, when I was playing with it, that there is no cross CAD file format that captures even simple design concepts like “this hole is aligned to the center of this plate” or even “this is a 2mm fillet”. STEP (the file…

The interoperability problem stems from CAD kernels using proprietary B-rep representations and constraint solvers, with STEP's AP242 standard attempting to address this by including Product Manufacturing Information (PMI) and semantic annotations, though adoption remains fragmented.

Re: Code-GUI bidirectional editing via LSP

#34
We do quite a lot of this using webviews in vscode over at Darwinium. Similar process that involves postMessages between the UI container and the host containing the LSP. Biggest challenge I had with this was figuring out how to map a diagnostic from the language server (which is inherently range-based) to a UI component that would display it - it involves a fairly intricate pubsub system and mapping UI components explicitly to parts of a tree. Would love to share it eventually.

Re: Code-GUI bidirectional editing via LSP

#36
post #4

Isn’t the python based build123d the current best CAD in code solution? The problem with OpenSCAD is that it cannot export solid geometry, just a final mesh. More broadly, I was genuinely shocked to realize, when I was playing with it, that there is no cross CAD file format that captures even simple design concepts like “this hole is aligned to the center of this plate” or even “this is a 2mm fillet”. STEP (the file…

It's really hard to explain if you don't know how CAD kernels produce final BREP shapes via their process trees, but, try give an example- something like "this is a 2mm fillet" requires a 'fillet solver' that is deeply ingrained in the kernel. It isn't something that would ever be portable, say, from Fusion360 to CATIA natively because those are completely different kernels with different ways of 'solving' the model…

This is helpful but surely we can save a consistent description of the process step and the input parameters alongside the final geometry in the same file format?

Re: Code-GUI bidirectional editing via LSP

#37
post #11
post #4

Isn’t the python based build123d the current best CAD in code solution? The problem with OpenSCAD is that it cannot export solid geometry, just a final mesh. More broadly, I was genuinely shocked to realize, when I was playing with it, that there is no cross CAD file format that captures even simple design concepts like “this hole is aligned to the center of this plate” or even “this is a 2mm fillet”. STEP (the file…

I don't think they change programs very often, and only very rarely in the middle of a project.

I think this maybe why!

Of course it’s great for vendor lock-in.

But given how many companies need to work with diverse suppliers, there must be a whole bunch of re-creating models happening. There is no chance that everybody is using the same CAD tool

Re: Code-GUI bidirectional editing via LSP

#38
post #4

Isn’t the python based build123d the current best CAD in code solution? The problem with OpenSCAD is that it cannot export solid geometry, just a final mesh. More broadly, I was genuinely shocked to realize, when I was playing with it, that there is no cross CAD file format that captures even simple design concepts like “this hole is aligned to the center of this plate” or even “this is a 2mm fillet”. STEP (the file…

The interoperability problem stems from CAD kernels using proprietary B-rep representations and constraint solvers, with STEP's AP242 standard attempting to address this by including Product Manufacturing Information (PMI) and semantic annotations, though adoption remains fragmented.

I’d have assumed that somebody had a format for just the basic operations … but it looks like even that is just being considered

Re: Code-GUI bidirectional editing via LSP

#39
post #30
post #3

This is a great idea: I'd never think of using LSP for this! As a software developer, I always get frustrated when I am doing some graphical work and struggle to neatly parametrize whatever I am drawing (wooden cabinets and furniture, room layouts, installation plans...) and switch between coding where that makes most sense and GUI where it doesn't. The best I've gotten was FreeCAD with Python bindings (I've got a co…

I think we’re a lot of developers who are frustrated by constantly needing to choose between code or GUI… both have their use case, but I feel like there must be a system that combines both.

How about a visual programming language? Plenty of 3D and CAD software uses a VPL for procedural design, which helps a ton to bring out the benefits of both

Re: Code-GUI bidirectional editing via LSP

#40
It's concerning to me that the LSP idea is .. a thing. Casey Muratori observed years ago that it's just a way worse way of doing libraries. Like, you're introducing HTTP where there could just be a function call into a DLL/SO. What's the benefit there? Just make vim/emacs/$editor speak some native protocol and be done with it. Then you GUI is just welded directly into the running editor process.. right??

There's no security risk there that wasn't present before as far as I can tell because you were already planning on running the LSP on your local machine..

Post reply on HN