logoalt Hacker News

Show HN: FluidCAD – Parametric CAD with JavaScript

92 pointsby maouidatoday at 6:39 PM20 commentsview on HN

Hello HN users,

This is a CAD by code project I have been working on on my free time for more than year now.

I built it with 3 goals in mind:

- It should be familiar to CAD designers who have used other programs. Same workflow, same terminology.

- Reduce the mental effort required to create models as much as possible. This is achieved by:

    - Provide live rendering and visual guidance as you type.
    - Allow the user to reference existing edges/faces on the scene instead of having to calculate everything.
    - Provide interactive mouse helpers for features that are hard to write by code: Only 3 interactive modes for now: Edge trimming, Sketch region extrude, Bezier curve drawing.
    - Implicit coding whenever possible: e.g: There are sensible defaults for most parameters. The program will automatically fuse intersecting objects together so you do not have to worry about what object needs to be fused with what.
- It should be reasonably fast: The scene objects are cached and only the updated objects are re-computed.

I think I have achieved these goals to a good extent. The program is still in early stages and there are many features I want to add, rewrite but I think it is already usable for simple models.

Update to add more details: This is based on Opencascade.js WASM binding. So you get all the good things that come with any brep kernel. Fillets, chamfers, step import and export...

The scene is webview but the editing is in your local file. You use your own editor and the environment you are familiar with.

One important feature that I think make this stand out among other code based cad software is the ability to transform features not just shapes. More here: https://fluidcad.io/docs/guides/patterns You can see it in action in the lantern example: https://fluidcad.io/docs/tutorials/lantern


Comments

ramses0today at 8:38 PM

I'll throw my hat in on the feedback... looks great!

https://github.com/openscad/openscad/pull/4478#issuecomment-...

My pet use case is: "My naive approach as a programmer would be: `pen := new Pen(q,r,s,t); box := new Box( pen.L, pen.W, pen.H )`" along with being able to sometimes work with the whole pen, and sometimes touch the pen vs. the cap separately.

Since it's all javascript, it seems like there's a chance that this use case would work (ie: `p = Pen(...).render().getWidth()`)? Additionally, your intermediate step screenshots really makes it seem like a SketchUp-ish GUI would be perfect! Obviously a ton of work, but SketchUp's "grab face + extrude / push", but if it were "sticky" to the underlying parametric components seems like it'd be an awesome combo... something like group/components, but backed by code instead of GUI-only (or GUI-centric) editing.

bsimpsontoday at 8:30 PM

The thing that made Flash magical was that it had the approachability of a design tool (and it really did have some of the best design tools ever), with the extensibility of a scripting language. You could start by drawing on a canvas and grow into programmatically generating designs.

This looks like it could do the same thing for constraint modeling. That's awesome!

upcoming-sesametoday at 9:58 PM

I don't know much about CAD but it is surprising to me this hasn't existed before seems so natural. great work

show 1 reply
isaacphitoday at 10:03 PM

This looks incredible, great job!

I've been revisiting OpenSCAD recently but find it very frustrating. I just got started with build123d which is great but I'll definitely be trying this. The workflow is exactly what I'm looking for.

I'll drop an issue if I have feedback. Are you open to PRs?

kabir_dakitoday at 10:12 PM

Impressive to see parametric CAD running in the browser. Curious how you handle precision with floating point — that's usually the first wall you hit with geometry in JS. Does it support STEP or DXF export?

gitgudtoday at 9:57 PM

Really interesting! Is there a list of all supported CAD operations? Can I “revolve” 2D sketches? Can I make assemblies?

unforbiddenYettoday at 8:31 PM

Nice work and kudos for programming it by hand! Starred the project and plan to try it out soonish.

intersticetoday at 8:46 PM

I've been working on this exact idea! But it's late, will remember to come back and check this out to compare notes.

WillAdamstoday at 7:07 PM

Why use this rather than Maker.js?

https://www.microsoft.com/en-us/garage/profiles/maker-js/

show 1 reply
CWIZOtoday at 7:19 PM

This looks great. I just started trying to generate some models using golang and the ecosystem doesn't seem great. Will check this out, might work out better.

shockstoday at 7:34 PM

This looks awesome.

alteromtoday at 7:04 PM

What geometry kernel is it using?

Which operations are supported? (Booleans? ...)

Where's the API link?

...finally, was this vibe-coded?

Inquiring minds want to know!

show 3 replies